[tests, benchmarks] Reformat using new Dart formatter
Certain tests and benchmarks are reformatted using the new version of "dart format" which supports records. TEST=ci Change-Id: I6132e8000317bfcc56c8d96682dc9771c728076d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286201 Reviewed-by: Bob Nystrom <rnystrom@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com>
This commit is contained in:
committed by
Commit Queue
parent
0b8986902e
commit
8627463c23
@@ -28,7 +28,9 @@ class Utf8Encode extends BenchmarkBase {
|
||||
String name = 'Utf8Encode.$language.';
|
||||
name += size >= 1000000
|
||||
? '${size ~/ 1000000}M'
|
||||
: size >= 1000 ? '${size ~/ 1000}k' : '$size';
|
||||
: size >= 1000
|
||||
? '${size ~/ 1000}k'
|
||||
: '$size';
|
||||
return name;
|
||||
}
|
||||
|
||||
@@ -43,7 +45,8 @@ class Utf8Encode extends BenchmarkBase {
|
||||
final int nChunks = (size < nRunes) ? (nRunes / size).floor() : 1;
|
||||
for (int i = 0; i < nChunks; i++) {
|
||||
final offset = i * size;
|
||||
benchmarkTextChunks.add(String.fromCharCodes(runes.sublist(offset, offset+size)));
|
||||
benchmarkTextChunks
|
||||
.add(String.fromCharCodes(runes.sublist(offset, offset + size)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +54,7 @@ class Utf8Encode extends BenchmarkBase {
|
||||
void run() {
|
||||
for (int i = 0; i < benchmarkTextChunks.length; i++) {
|
||||
final encoded = utf8.encode(benchmarkTextChunks[i]);
|
||||
if (encoded.length < benchmarkTextChunks[i].length) {
|
||||
if (encoded.length < benchmarkTextChunks[i].length) {
|
||||
throw 'There should be at least as many encoded bytes as runes';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user