Skip to content

Commit

Permalink
Issue #1094: changes from master moved to pre-nnbd for LibTests/core …
Browse files Browse the repository at this point in the history
…folder.
  • Loading branch information
iarkh committed Jul 29, 2021
1 parent b4cf26b commit 1f9077f
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 33 deletions.
2 changes: 1 addition & 1 deletion LibTest/core/Symbol/Symbol_A01_t03.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/// @description Checks that ArgumentError is thrown if name starts with an
/// underscore.
/// @author ilya
/// @issue 13715
/// @issue 13715, 11669
import "../../../Utils/expect.dart";

Expand Down
2 changes: 1 addition & 1 deletion LibTest/core/Symbol/Symbol_A01_t04.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
/// name of a library with no library name declaration).
/// @description Checks that ArgumentError is thrown if name is not a String.
/// @author ilya
/// @issue 13715
/// @issue 13715, 11669
import "../../../Utils/expect.dart";

Expand Down
2 changes: 1 addition & 1 deletion LibTest/core/Symbol/Symbol_A01_t05.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
/// name of a library with no library name declaration).
/// @description Checks that ArgumentError is thrown if name is not a valid
/// qualified identifier.
/// @issue 13715
/// @issue 13715, 11669
/// @reviewer
import "../../../Utils/expect.dart";
Expand Down
2 changes: 1 addition & 1 deletion LibTest/core/Uri/Uri.directory_A05_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ main() {
Expect.equals("file", uri.scheme);

uri = new Uri.directory(r"\\server\share\file", windows: true);
Expect.equals(r"/share/file", uri.path);
Expect.equals(r"/share/file/", uri.path);
Expect.equals(r"server", uri.host);
Expect.equals("file", uri.scheme);
}
7 changes: 5 additions & 2 deletions LibTest/core/Uri/Uri.file_A02_t03.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@
/// separate path segments, except if the path starts with "\\?\" in which case
/// only backslash ("\") separates path segments.
/// @description Checks that if the path starts with "\\?\" then
/// only backslash ("\") separates path segments
/// only backslash ("\") separates path segments.
/// @note The "\" is only ever used as a path segment separator in the input
/// path. The resulting URI always uses "/" since "\" is not a valid URI
/// character.
/// @issue 28659
/// @author [email protected]
import "../../../Utils/expect.dart";

main() {
Uri uri = new Uri.file(r"\\?\c:\a\b", windows: true);
Expect.equals("\c:\a\b", uri.path);
Expect.equals("/c:/a/b", uri.path);
}
4 changes: 2 additions & 2 deletions LibTest/core/Uri/hasEmptyPath_A01_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ main() {
Expect.isFalse(uri.hasEmptyPath);

uri = Uri.parse("foo: ");
Expect.isTrue(uri.hasEmptyPath);
Expect.isFalse(uri.hasEmptyPath);

uri = Uri.parse("foo: /");
Expect.isTrue(uri.hasEmptyPath);
Expect.isFalse(uri.hasEmptyPath);

uri = Uri.parse("foo:");
Expect.isTrue(uri.hasEmptyPath);
Expand Down
1 change: 0 additions & 1 deletion LibTest/core/Uri/parse_A05_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@
import "../../../Utils/expect.dart";

main() {
Expect.throws(() {Uri.parse("###");}, (e) => e is FormatException);
Expect.throws(() {Uri.parse("::::");}, (e) => e is FormatException);
}
1 change: 0 additions & 1 deletion LibTest/core/Uri/queryParametersAll_A01_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import "../../../Utils/expect.dart";
main() {
var q = 'a=b&a=c&a=d';
Map map = {'a': ['b', 'c', 'd']};
Expect.mapEquals(map, new Uri.http('host', 'path', map).queryParametersAll);
Expect.mapEquals(map, new Uri(query: q).queryParametersAll);
Expect.mapEquals(map, Uri.parse('http://host/path?$q').queryParametersAll);
}
1 change: 0 additions & 1 deletion LibTest/core/Uri/queryParametersAll_A01_t02.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import "../../../Utils/expect.dart";
main() {
var q = 'a=b&x=c&a=d&x=e';
Map map = {'a': ['b', 'd'], 'x': ['c', 'e']};
Expect.mapEquals(map, new Uri.http('host', 'path', map).queryParametersAll);
Expect.mapEquals(map, new Uri(query: q).queryParametersAll);
Expect.mapEquals(map, Uri.parse('http://host/path?$q').queryParametersAll);
}
1 change: 0 additions & 1 deletion LibTest/core/Uri/queryParametersAll_A01_t04.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import "../../../Utils/expect.dart";
main() {
var q = 'a=+%D1%84&г=г&a=+%26+&г=+г';
Map map = {'a': [' ф', ' \u0026 '], 'г': ['г', ' г']};
Expect.mapEquals(map, new Uri.http('host', 'path', map).queryParametersAll);
Expect.mapEquals(map, new Uri(query: q).queryParametersAll);
Expect.mapEquals(map, Uri.parse('http://host/path?$q').queryParametersAll);
}
11 changes: 9 additions & 2 deletions LibTest/core/Uri/queryParametersAll_A03_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,15 @@ import "../../../Utils/expect.dart";

main() {
var q = 'a=b&c=d&e=f+';
Map map = {'a': ['b'], 'c': ['d'], 'e': ['f ']};
Expect.mapEquals(map, new Uri.http('host', 'path', map).queryParametersAll);
Map map = {
'a': ['b'],
'c': ['d'],
'e': ['f ']
};
Expect.mapEquals(
map,
new Uri.http('host', 'path', {'a': 'b', 'c': 'd', 'e': 'f '})
.queryParametersAll);
Expect.mapEquals(map, new Uri(query: q).queryParametersAll);
Expect.mapEquals(map, Uri.parse('http://host/path?$q').queryParametersAll);
}
6 changes: 3 additions & 3 deletions LibTest/core/UriData/UriData.fromUri_A01_t03.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ main() {
Expect.equals("US-ASCII", uriData.charset);
Expect.isTrue(uriData.isBase64);
Expect.equals("text/plain", uriData.mimeType);
Expect.equals("some%20data", uriData.contentText);
Expect.equals("somedata", uriData.contentText);
Expect.mapEquals({}, uriData.parameters);
Expect.equals(uri, uriData.uri);

Expand All @@ -43,7 +43,7 @@ main() {
Expect.equals("US-ASCII", uriData.charset);
Expect.isTrue(uriData.isBase64);
Expect.equals("text/plain", uriData.mimeType);
Expect.equals("some%20data", uriData.contentText);
Expect.equals("somedata", uriData.contentText);
Expect.mapEquals({"a": "b"}, uriData.parameters);
Expect.equals(uri, uriData.uri);

Expand All @@ -53,7 +53,7 @@ main() {
Expect.equals("utf-8", uriData.charset);
Expect.isTrue(uriData.isBase64);
Expect.equals("text/plain", uriData.mimeType);
Expect.equals("some%20data", uriData.contentText);
Expect.equals("somedata", uriData.contentText);
Expect.mapEquals({"charset": "utf-8"}, uriData.parameters);
Expect.equals(uri, uriData.uri);

Expand Down
2 changes: 1 addition & 1 deletion LibTest/core/UriData/charset_A01_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ main() {
Expect.equals("US-ASCII", UriData.parse("data:text/plain,some data").charset);
Expect.equals("US-ASCII", UriData.parse("data:,some data").charset);
Expect.equals("utf-8",
UriData.parse("data:;charset=utf-8;base64,some data").charset);
UriData.parse("data:;charset=utf-8;base64,somedata").charset);
Expect.equals("utf-8",
UriData.parse("data:;charset=utf-8,some data").charset);
Expect.equals("US-ASCII", new UriData.fromString("some data").charset);
Expand Down
4 changes: 2 additions & 2 deletions LibTest/core/UriData/contentText_A01_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import "../../../Utils/expect.dart";

main() {
Expect.equals("some data",
Expect.equals("some%20data",
UriData.parse("data:text/plain,some data").contentText);
Expect.equals("some data", new UriData.fromString("some data").contentText);
Expect.equals("some%20data", new UriData.fromString("some data").contentText);
}
10 changes: 4 additions & 6 deletions LibTest/core/UriData/parse_A01_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ check(String uri, String data, String mimeType, Map<String, String> parameters,
}

main() {
check("data:text/plain;a=b;base64,dataaaa", "dataaaa", "text/plain",
check("data:text/plain;a=b;base64,dataaaa", "dataaaa=", "text/plain",
{"a": "b"}, "US-ASCII", true);
check("data:;a=b;base64,dataaaa", "dataaaa", "text/plain", {"a": "b"},
check("data:;a=b;base64,dataaaa", "dataaaa=", "text/plain", {"a": "b"},
"US-ASCII", true);
check("data:;a=b;charset=utf-8;base64,dataaaa", "dataaaa", "text/plain",
check("data:;a=b;charset=utf-8;base64,dataaaa", "dataaaa=", "text/plain",
{"a": "b", "charset": "utf-8"}, "utf-8", true);
check("data:image/gif;a=b;charset=utf-8;base64,dataaaa", "dataaaa",
check("data:image/gif;a=b;charset=utf-8;base64,dataaaa", "dataaaa=",
"image/gif", {"a": "b", "charset": "utf-8"}, "utf-8", true);
check("data:a/b;a=b,dataaaa", "dataaaa", "a/b", {"a": "b"}, "US-ASCII", false);
check("data:a/b;a=b,", "", "a/b", {"a": "b"}, "US-ASCII", false);
Expand All @@ -55,6 +55,4 @@ main() {
String data = " Some data % ";
check("data:a/b;a=b," + Uri.encodeComponent(data), Uri.encodeComponent(data),
"a/b", {"a": "b"}, "US-ASCII", false);
check("data:a/b;a=b;base64," + Uri.encodeComponent(data), Uri.encodeComponent(data),
"a/b", {"a": "b"}, "US-ASCII", true);
}
9 changes: 2 additions & 7 deletions LibTest/core/UriData/toString_A01_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@ check(String uri) {
}

main() {
check("data:text/plain;a=b;base64,dataaaa");
check("data:image/gif;a=b;charset=utf-8;base64,dataaa");
check("data:image/gif;a=b;charset=utf-8;base64,кириллица");
check("data:;a=b;charset=utf-8;base64,кириллица");
check("data: a / b ;a=b;charset=utf-8;base64,кириллица");
check("data: a / b ;й=ф;charset=utf-8;base64,кириллица");
check("data: a / b ;й=ф,кириллица");
check("data:text/plain;a=b;base64,dataaaa=");
check("data:image/gif;a=b;charset=utf-8;base64,dataaaa=");
check("data:,");
}

0 comments on commit 1f9077f

Please sign in to comment.