Skip to content

Commit

Permalink
Fixes dart-lang#1653. Typos fixed in some patterns tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrekhov committed Jan 6, 2023
1 parent 4b14012 commit 093eaec
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions LanguageFeatures/Patterns/map_A04_t02.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ main() {
var {c1: a, c2: b} = {3.14: 1, 3.14: 2, 3.14: 3};
});
var {c1: a1, c2: b1} = {c1: 1, c2: 2};
Expect.equals(2, a1);
Expect.equals(1, a1);
Expect.equals(2, b1);
final {c1: int a2, c2: int b2} = {c1: 1, c2: 2};
Expect.equals(2, a2);
Expect.equals(1, a2);
Expect.equals(2, b2);

Expect.equals("a=2, b=2", test1({c1: 1, c2: 2}));
Expand Down
2 changes: 0 additions & 2 deletions LanguageFeatures/Patterns/variable_A02_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ main() {
Expect.equals("{1: 2}", testMap1({1: 2}));
Expect.equals("{1: 3}", testMap1({1: 3, 3: 4}));
Expect.equals("{2: x}", testMap1({2: "x"}));
Expect.equals("{2: true}", testMap1({2: true}));
Expect.equals("default", testMap1({3: 3}));
Expect.equals("default", testMap1({}));

Expand All @@ -225,7 +224,6 @@ main() {
Expect.equals("{1: 2}", testMap3({1: 2}));
Expect.equals("{1: 3}", testMap3({1: 3, 3: 4}));
Expect.equals("{2: x}", testMap3({2: "x"}));
Expect.equals("{2: true}", testMap3({2: true}));
Expect.equals("default", testMap3({3: 3}));
Expect.equals("default", testMap3({}));

Expand Down
6 changes: 3 additions & 3 deletions LanguageFeatures/Patterns/variable_A02_t03.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ String test1(Record r) {
return "(<String>$e, <bool>$f)";
case (int g, final h):
g.expectStaticType<Exactly<int>>();
return "(<int>$g, final $h)";
return "(<int>$g, final $h)";
default:
return "default";
}
Expand All @@ -64,7 +64,7 @@ String test2(Record r) {
(int a, String b) => "(<int>$a, <String>$b)",
(int c, final int d) => "(<int>$c, <int>$d)",
(String e, bool f) => "(<String>$e, <bool>$f)",
(int g, final h) => "(<int>$g, final $h)",
(int g, final h) => "(<int>$g, final $h)",
_ => "default"
};
}
Expand All @@ -87,7 +87,7 @@ String test3(Record r) {
}
if (r case (int g, final h)) {
g.expectStaticType<Exactly<int>>();
return "(<int>$g, final $h)";
return "(<int>$g, final $h)";
} else {
return "default";
}
Expand Down
6 changes: 3 additions & 3 deletions LanguageFeatures/Patterns/variable_A02_t04.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ main() {
Expect.equals("[<int>1, <int>2]", test1([1, 2]));
Expect.equals("[<int>3, <int>4]", test1([3, 4]));
Expect.equals("[<String>x, <bool>true]", test1(["x", true]));
Expect.equals("(<String>y, <bool>false)", test1(["y", false]));
Expect.equals("[<String>y, <bool>false]", test1(["y", false]));
Expect.equals("[<int>0, final false]", test1([0, false]));
Expect.equals("[<int>1, final C]", test1([1, C()]));
Expect.equals("default", test1([true, false]));
Expand All @@ -114,7 +114,7 @@ main() {
Expect.equals("[<int>1, <int>2]", test2([1, 2]));
Expect.equals("[<int>3, <int>4]", test2([3, 4]));
Expect.equals("[<String>x, <bool>true]", test2(["x", true]));
Expect.equals("(<String>y, <bool>false)", test2(["y", false]));
Expect.equals("[<String>y, <bool>false]", test2(["y", false]));
Expect.equals("[<int>0, final false]", test2([0, false]));
Expect.equals("[<int>1, final C]", test2([1, C()]));
Expect.equals("default", test2([true, false]));
Expand All @@ -129,7 +129,7 @@ main() {
Expect.equals("[<int>1, <int>2]", test3([1, 2]));
Expect.equals("[<int>3, <int>4]", test3([3, 4]));
Expect.equals("[<String>x, <bool>true]", test3(["x", true]));
Expect.equals("(<String>y, <bool>false)", test3(["y", false]));
Expect.equals("[<String>y, <bool>false]", test3(["y", false]));
Expect.equals("[<int>0, final false]", test3([0, false]));
Expect.equals("[<int>1, final C]", test3([1, C()]));
Expect.equals("default", test3([true, false]));
Expand Down

0 comments on commit 093eaec

Please sign in to comment.