Fixes #1121. Update Symbol tests according to the changed specification
diff --git a/LibTest/core/Symbol/Symbol_A01_t01.dart b/LibTest/core/Symbol/Symbol_A01_t01.dart
index 54ea111..04b9d1c 100644
--- a/LibTest/core/Symbol/Symbol_A01_t01.dart
+++ b/LibTest/core/Symbol/Symbol_A01_t01.dart
@@ -1,38 +1,69 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/// @assertion const Symbol(String name)
-/// Constructs a new Symbol.
+/// Constructs a new Symbol representing the provided name.
///
-/// The name must be a valid public Dart member name, public constructor name, or
-/// library name, optionally qualified.
+/// Symbols created from equal name strings are themselves equal. If the symbols
+/// are created using const, symbols with the same name strings are
+/// canonicalized and identical.
///
-/// A qualified name is a valid name preceded by a public identifier name and
-/// a '.', e.g., foo.bar.baz= is a qualified version of baz=. That means that the
-/// content of the name String must be either
+/// Some name strings create symbols which can also be created using a symbol
+/// literal, or be implicitly created while running Dart programs, for example
+/// through Object.noSuchMethod.
///
-/// - a valid public Dart identifier (that is, an identifier not starting with "
-/// _"), such an identifier followed by "=" (a setter name),
-/// - the name of a declarable operator (one of "+", "-", "*", "/", "%", "~/",
-/// "&", "|", "^", "~", "<<", ">>", "<", "<=", ">", ">=", "==", "[]", "[]=", or
-/// "unary-"),
-/// - any of the above preceded by any number of qualifiers, where a qualifier
-/// is a non-private identifier followed by '.', or the empty string (the default
-/// name of a library with no library name declaration).
-/// @description Checks that there are errors if correct arguments are used and
-/// created objects equal to corresponding symbol literals.
-/// @author ilya
+/// If name is a single Dart identifier that does not start with an underscore,
+/// or it is a qualified identifier (multiple identifiers separated by .s), or
+/// it is the name of a user definable operator different from unary- (one of
+/// "+", "-", "*", "/", "%", "~/", "&", "|", "^", "~", "<<", ">>", ">>>", "<",
+/// "<=", ">", ">=", "==", "[]", or "[]="), then the result of Symbol(name) is
+/// equal to the symbol literal created by prefixing # to the contents of name,
+/// and const Symbol(name) is identical to that symbol literal.
+/// That is #foo == Symbol("foo") and identical(#foo, const Symbol("foo")).
+///
+/// If name is a single identifier that does not start with an underscore
+/// followed by a =, then the symbol is a setter name, and can be equal to the
+/// Invocation.memberName in an Object.noSuchMethod invocation.
+///
+/// Private symbol literals, like #_foo, cannot be created using the symbol
+/// constructor. A symbol like const Symbol("_foo") is not equal to any symbol
+/// literal, or to any source name symbol introduced by noSuchMethod.
+///
+/// assert(Symbol("foo") == Symbol("foo"));
+/// assert(Symbol("foo") == #foo);
+/// assert(identical(const Symbol("foo"), const Symbol("foo")));
+/// assert(identical(const Symbol("foo"), #foo));
+/// assert(Symbol("[]=") == #[]=]);
+/// assert(identical(const Symbol("[]="), #[]=));
+/// assert(Symbol("foo.bar") == #foo.bar);
+/// assert(identical(const Symbol("foo.bar"), #foo.bar));
+/// The created instance overrides Object.==.
+///
+/// @description Checks that Symbols created from equal name strings are
+/// themselves equal.
+/// @author sgrekhov@unipro.ru
import "../../../Utils/expect.dart";
main() {
- Expect.equals(#foo, new Symbol('foo'));
- Expect.equals(#foo.bar$, new Symbol(r'foo.bar$'));
- new Symbol(r'foo.bar$.baz_=');
-
- Expect.equals(#foo, const Symbol('foo'));
- Expect.equals(#foo.bar$, const Symbol(r'foo.bar$'));
- const Symbol(r'foo.bar$.baz_=');
-}
+ var s1 = new Symbol('foo');
+ var s2 = new Symbol('foo');
+ Expect.equals(s1, s2);
+ Expect.isFalse(identical(s1, s2));
+ var s3 = new Symbol(r'foo.bar$');
+ var s4 = new Symbol(r'foo.bar$');
+ Expect.equals(s3, s4);
+ Expect.isFalse(identical(s3, s4));
+
+ var s5 = new Symbol(r'foo.bar$.baz_=');
+ var s6 = new Symbol(r'foo.bar$.baz_=');
+ Expect.equals(s5, s6);
+ Expect.isFalse(identical(s5, s6));
+
+ var s7 = new Symbol('foo.b_a_r');
+ var s8 = new Symbol('foo.b_a_r');
+ Expect.equals(s7, s8);
+ Expect.isFalse(identical(s7, s8));
+}
diff --git a/LibTest/core/Symbol/Symbol_A01_t02.dart b/LibTest/core/Symbol/Symbol_A01_t02.dart
index c5a5be5..5e383fa 100644
--- a/LibTest/core/Symbol/Symbol_A01_t02.dart
+++ b/LibTest/core/Symbol/Symbol_A01_t02.dart
@@ -1,54 +1,65 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/// @assertion const Symbol(String name)
-/// Constructs a new Symbol.
+/// Constructs a new Symbol representing the provided name.
///
-/// The name must be a valid public Dart member name, public constructor name, or
-/// library name, optionally qualified.
+/// Symbols created from equal name strings are themselves equal. If the symbols
+/// are created using const, symbols with the same name strings are
+/// canonicalized and identical.
///
-/// A qualified name is a valid name preceded by a public identifier name and
-/// a '.', e.g., foo.bar.baz= is a qualified version of baz=. That means that the
-/// content of the name String must be either
+/// Some name strings create symbols which can also be created using a symbol
+/// literal, or be implicitly created while running Dart programs, for example
+/// through Object.noSuchMethod.
///
-/// - a valid public Dart identifier (that is, an identifier not starting with "
-/// _"), such an identifier followed by "=" (a setter name),
-/// - the name of a declarable operator (one of "+", "-", "*", "/", "%", "~/",
-/// "&", "|", "^", "~", "<<", ">>", "<", "<=", ">", ">=", "==", "[]", "[]=", or
-/// "unary-"),
-/// - any of the above preceded by any number of qualifiers, where a qualifier
-/// is a non-private identifier followed by '.', or the empty string (the default
-/// name of a library with no library name declaration).
-/// @description Checks that symbols for operators can be created.
-/// @author ilya
+/// If name is a single Dart identifier that does not start with an underscore,
+/// or it is a qualified identifier (multiple identifiers separated by .s), or
+/// it is the name of a user definable operator different from unary- (one of
+/// "+", "-", "*", "/", "%", "~/", "&", "|", "^", "~", "<<", ">>", ">>>", "<",
+/// "<=", ">", ">=", "==", "[]", or "[]="), then the result of Symbol(name) is
+/// equal to the symbol literal created by prefixing # to the contents of name,
+/// and const Symbol(name) is identical to that symbol literal.
+/// That is #foo == Symbol("foo") and identical(#foo, const Symbol("foo")).
+///
+/// If name is a single identifier that does not start with an underscore
+/// followed by a =, then the symbol is a setter name, and can be equal to the
+/// Invocation.memberName in an Object.noSuchMethod invocation.
+///
+/// Private symbol literals, like #_foo, cannot be created using the symbol
+/// constructor. A symbol like const Symbol("_foo") is not equal to any symbol
+/// literal, or to any source name symbol introduced by noSuchMethod.
+///
+/// assert(Symbol("foo") == Symbol("foo"));
+/// assert(Symbol("foo") == #foo);
+/// assert(identical(const Symbol("foo"), const Symbol("foo")));
+/// assert(identical(const Symbol("foo"), #foo));
+/// assert(Symbol("[]=") == #[]=]);
+/// assert(identical(const Symbol("[]="), #[]=));
+/// assert(Symbol("foo.bar") == #foo.bar);
+/// assert(identical(const Symbol("foo.bar"), #foo.bar));
+/// The created instance overrides Object.==.
+///
+/// @description Checks that if the symbols are created using const, symbols
+/// with the same name strings are canonicalized and identical.
+/// @author sgrekhov@unipro.ru
import "../../../Utils/expect.dart";
main() {
- Expect.equals(#~, const Symbol('~'));
- Expect.equals(#==, const Symbol('=='));
- Expect.equals(#[], const Symbol('[]'));
- Expect.equals(#[]=, const Symbol('[]='));
+ const s1 = const Symbol('foo');
+ var s2 = const Symbol('foo');
+ Expect.identical(s1, s2);
- Expect.equals(#*, const Symbol('*'));
- Expect.equals(#/, const Symbol('/'));
- Expect.equals(#%, const Symbol('%'));
- Expect.equals(#~/, const Symbol('~/'));
+ const s3 = const Symbol(r'foo.bar$');
+ const s4 = const Symbol(r'foo.bar$');
+ Expect.identical(s3, s4);
- Expect.equals(#+, const Symbol('+'));
- Expect.equals(#-, const Symbol('-'));
+ var s5 = const Symbol(r'foo.bar$.baz_=');
+ var s6 = const Symbol(r'foo.bar$.baz_=');
+ Expect.identical(s5, s6);
- Expect.equals(#<<, const Symbol('<<'));
- Expect.equals(#>>, const Symbol('>>'));
-
- Expect.equals(#<, const Symbol('<'));
- Expect.equals(#<=, const Symbol('<='));
- Expect.equals(#>, const Symbol('>'));
- Expect.equals(#>=, const Symbol('>='));
-
- Expect.equals(#&, const Symbol('&'));
- Expect.equals(#^, const Symbol('^'));
- Expect.equals(#|, const Symbol('|'));
+ var s7 = const Symbol('foo.b_a_r');
+ var s8 = const Symbol('foo.b_a_r');
+ Expect.identical(s7, s8);
}
-
diff --git a/LibTest/core/Symbol/Symbol_A01_t03.dart b/LibTest/core/Symbol/Symbol_A01_t03.dart
deleted file mode 100644
index b91bd64..0000000
--- a/LibTest/core/Symbol/Symbol_A01_t03.dart
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-/// @assertion const Symbol(String name)
-/// Constructs a new Symbol.
-///
-/// The name must be a valid public Dart member name, public constructor name, or
-/// library name, optionally qualified.
-///
-/// A qualified name is a valid name preceded by a public identifier name and
-/// a '.', e.g., foo.bar.baz= is a qualified version of baz=. That means that the
-/// content of the name String must be either
-///
-/// - a valid public Dart identifier (that is, an identifier not starting with "
-/// _"), such an identifier followed by "=" (a setter name),
-/// - the name of a declarable operator (one of "+", "-", "*", "/", "%", "~/",
-/// "&", "|", "^", "~", "<<", ">>", "<", "<=", ">", ">=", "==", "[]", "[]=", or
-/// "unary-"),
-/// - any of the above preceded by any number of qualifiers, where a qualifier
-/// is a non-private identifier followed by '.', or the empty string (the default
-/// name of a library with no library name declaration).
-/// @description Checks that ArgumentError is thrown if name starts with an
-/// underscore.
-/// @author ilya
-/// @issue 13715
-/// @issue 11669
-
-import "../../../Utils/expect.dart";
-
-main() {
- Expect.throws(() {new Symbol('_foo');}, (e) => e is ArgumentError);
-}
diff --git a/LibTest/core/Symbol/Symbol_A01_t05.dart b/LibTest/core/Symbol/Symbol_A01_t05.dart
deleted file mode 100644
index 82ccdf5..0000000
--- a/LibTest/core/Symbol/Symbol_A01_t05.dart
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-/// @assertion const Symbol(String name)
-/// Constructs a new Symbol.
-///
-/// The name must be a valid public Dart member name, public constructor name, or
-/// library name, optionally qualified.
-///
-/// A qualified name is a valid name preceded by a public identifier name and
-/// a '.', e.g., foo.bar.baz= is a qualified version of baz=. That means that the
-/// content of the name String must be either
-///
-/// - a valid public Dart identifier (that is, an identifier not starting with "
-/// _"), such an identifier followed by "=" (a setter name),
-/// - the name of a declarable operator (one of "+", "-", "*", "/", "%", "~/",
-/// "&", "|", "^", "~", "<<", ">>", "<", "<=", ">", ">=", "==", "[]", "[]=", or
-/// "unary-"),
-/// - any of the above preceded by any number of qualifiers, where a qualifier
-/// is a non-private identifier followed by '.', or the empty string (the default
-/// 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 11669
-
-import "../../../Utils/expect.dart";
-
-main() {
- new Symbol(''); // ok
-
- Expect.throws(() {new Symbol('+++');}, (e) => e is ArgumentError);
-
- Expect.throws(() {new Symbol('2013year');}, (e) => e is ArgumentError);
-}
-
diff --git a/LibTest/core/Symbol/Symbol_A02_t01.dart b/LibTest/core/Symbol/Symbol_A02_t01.dart
new file mode 100644
index 0000000..ffc679a
--- /dev/null
+++ b/LibTest/core/Symbol/Symbol_A02_t01.dart
@@ -0,0 +1,63 @@
+// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// @assertion const Symbol(String name)
+/// Constructs a new Symbol representing the provided name.
+///
+/// Symbols created from equal name strings are themselves equal. If the symbols
+/// are created using const, symbols with the same name strings are
+/// canonicalized and identical.
+///
+/// Some name strings create symbols which can also be created using a symbol
+/// literal, or be implicitly created while running Dart programs, for example
+/// through Object.noSuchMethod.
+///
+/// If name is a single Dart identifier that does not start with an underscore,
+/// or it is a qualified identifier (multiple identifiers separated by .s), or
+/// it is the name of a user definable operator different from unary- (one of
+/// "+", "-", "*", "/", "%", "~/", "&", "|", "^", "~", "<<", ">>", ">>>", "<",
+/// "<=", ">", ">=", "==", "[]", or "[]="), then the result of Symbol(name) is
+/// equal to the symbol literal created by prefixing # to the contents of name,
+/// and const Symbol(name) is identical to that symbol literal.
+/// That is #foo == Symbol("foo") and identical(#foo, const Symbol("foo")).
+///
+/// If name is a single identifier that does not start with an underscore
+/// followed by a =, then the symbol is a setter name, and can be equal to the
+/// Invocation.memberName in an Object.noSuchMethod invocation.
+///
+/// Private symbol literals, like #_foo, cannot be created using the symbol
+/// constructor. A symbol like const Symbol("_foo") is not equal to any symbol
+/// literal, or to any source name symbol introduced by noSuchMethod.
+///
+/// assert(Symbol("foo") == Symbol("foo"));
+/// assert(Symbol("foo") == #foo);
+/// assert(identical(const Symbol("foo"), const Symbol("foo")));
+/// assert(identical(const Symbol("foo"), #foo));
+/// assert(Symbol("[]=") == #[]=]);
+/// assert(identical(const Symbol("[]="), #[]=));
+/// assert(Symbol("foo.bar") == #foo.bar);
+/// assert(identical(const Symbol("foo.bar"), #foo.bar));
+/// The created instance overrides Object.==.
+///
+/// @description Checks that if name is a single Dart identifier that does not
+/// start with an underscore then the result of Symbol(name) is equal to the
+/// symbol literal created by prefixing # to the contents of name, and
+/// const Symbol(name) is identical to that symbol literal.
+/// That is #foo == Symbol("foo") and identical(#foo, const Symbol("foo")).
+/// @author ilya, sgrekhov@unipro.ru
+
+import "../../../Utils/expect.dart";
+
+main() {
+ Expect.equals(#foo, new Symbol('foo'));
+ Expect.isFalse(identical(#foo, new Symbol('foo')));
+ Expect.equals(#foo.bar$, new Symbol(r'foo.bar$'));
+ Expect.isFalse(identical(#foo.bar$, new Symbol(r'foo.bar$')));
+ Expect.equals(#foo.bar$.baz_, new Symbol(r'foo.bar$.baz_'));
+ Expect.isFalse(identical(#foo.bar$.baz_, new Symbol(r'foo.bar$.baz_')));
+
+ Expect.identical(#foo, const Symbol('foo'));
+ Expect.identical(#foo.bar$, const Symbol(r'foo.bar$'));
+ Expect.identical(#foo.bar$.baz_, const Symbol(r'foo.bar$.baz_'));
+}
diff --git a/LibTest/core/Symbol/Symbol_A02_t02.dart b/LibTest/core/Symbol/Symbol_A02_t02.dart
new file mode 100644
index 0000000..2ca1cf5
--- /dev/null
+++ b/LibTest/core/Symbol/Symbol_A02_t02.dart
@@ -0,0 +1,74 @@
+// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// @assertion const Symbol(String name)
+/// Constructs a new Symbol representing the provided name.
+///
+/// Symbols created from equal name strings are themselves equal. If the symbols
+/// are created using const, symbols with the same name strings are
+/// canonicalized and identical.
+///
+/// Some name strings create symbols which can also be created using a symbol
+/// literal, or be implicitly created while running Dart programs, for example
+/// through Object.noSuchMethod.
+///
+/// If name is a single Dart identifier that does not start with an underscore,
+/// or it is a qualified identifier (multiple identifiers separated by .s), or
+/// it is the name of a user definable operator different from unary- (one of
+/// "+", "-", "*", "/", "%", "~/", "&", "|", "^", "~", "<<", ">>", ">>>", "<",
+/// "<=", ">", ">=", "==", "[]", or "[]="), then the result of Symbol(name) is
+/// equal to the symbol literal created by prefixing # to the contents of name,
+/// and const Symbol(name) is identical to that symbol literal.
+/// That is #foo == Symbol("foo") and identical(#foo, const Symbol("foo")).
+///
+/// If name is a single identifier that does not start with an underscore
+/// followed by a =, then the symbol is a setter name, and can be equal to the
+/// Invocation.memberName in an Object.noSuchMethod invocation.
+///
+/// Private symbol literals, like #_foo, cannot be created using the symbol
+/// constructor. A symbol like const Symbol("_foo") is not equal to any symbol
+/// literal, or to any source name symbol introduced by noSuchMethod.
+///
+/// assert(Symbol("foo") == Symbol("foo"));
+/// assert(Symbol("foo") == #foo);
+/// assert(identical(const Symbol("foo"), const Symbol("foo")));
+/// assert(identical(const Symbol("foo"), #foo));
+/// assert(Symbol("[]=") == #[]=]);
+/// assert(identical(const Symbol("[]="), #[]=));
+/// assert(Symbol("foo.bar") == #foo.bar);
+/// assert(identical(const Symbol("foo.bar"), #foo.bar));
+/// The created instance overrides Object.==.
+///
+/// @description Checks that symbols for operators can be created.
+/// @author ilya, sgrekhov@unipro.ru
+
+import "../../../Utils/expect.dart";
+
+main() {
+ Expect.identical(#~, const Symbol('~'));
+ Expect.identical(#==, const Symbol('=='));
+ Expect.identical(#[], const Symbol('[]'));
+ Expect.identical(#[]=, const Symbol('[]='));
+
+ Expect.identical(#*, const Symbol('*'));
+ Expect.identical(#/, const Symbol('/'));
+ Expect.identical(#%, const Symbol('%'));
+ Expect.identical(#~/, const Symbol('~/'));
+
+ Expect.identical(#+, const Symbol('+'));
+ Expect.identical(#-, const Symbol('-'));
+
+ Expect.identical(#<<, const Symbol('<<'));
+ Expect.identical(#>>, const Symbol('>>'));
+ Expect.identical(#>>>, const Symbol('>>>'));
+
+ Expect.identical(#<, const Symbol('<'));
+ Expect.identical(#<=, const Symbol('<='));
+ Expect.identical(#>, const Symbol('>'));
+ Expect.identical(#>=, const Symbol('>='));
+
+ Expect.identical(#&, const Symbol('&'));
+ Expect.identical(#^, const Symbol('^'));
+ Expect.identical(#|, const Symbol('|'));
+}
diff --git a/LibTest/core/Symbol/Symbol_A02_t03.dart b/LibTest/core/Symbol/Symbol_A02_t03.dart
new file mode 100644
index 0000000..25fb0d5
--- /dev/null
+++ b/LibTest/core/Symbol/Symbol_A02_t03.dart
@@ -0,0 +1,94 @@
+// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// @assertion const Symbol(String name)
+/// Constructs a new Symbol representing the provided name.
+///
+/// Symbols created from equal name strings are themselves equal. If the symbols
+/// are created using const, symbols with the same name strings are
+/// canonicalized and identical.
+///
+/// Some name strings create symbols which can also be created using a symbol
+/// literal, or be implicitly created while running Dart programs, for example
+/// through Object.noSuchMethod.
+///
+/// If name is a single Dart identifier that does not start with an underscore,
+/// or it is a qualified identifier (multiple identifiers separated by .s), or
+/// it is the name of a user definable operator different from unary- (one of
+/// "+", "-", "*", "/", "%", "~/", "&", "|", "^", "~", "<<", ">>", ">>>", "<",
+/// "<=", ">", ">=", "==", "[]", or "[]="), then the result of Symbol(name) is
+/// equal to the symbol literal created by prefixing # to the contents of name,
+/// and const Symbol(name) is identical to that symbol literal.
+/// That is #foo == Symbol("foo") and identical(#foo, const Symbol("foo")).
+///
+/// If name is a single identifier that does not start with an underscore
+/// followed by a =, then the symbol is a setter name, and can be equal to the
+/// Invocation.memberName in an Object.noSuchMethod invocation.
+///
+/// Private symbol literals, like #_foo, cannot be created using the symbol
+/// constructor. A symbol like const Symbol("_foo") is not equal to any symbol
+/// literal, or to any source name symbol introduced by noSuchMethod.
+///
+/// assert(Symbol("foo") == Symbol("foo"));
+/// assert(Symbol("foo") == #foo);
+/// assert(identical(const Symbol("foo"), const Symbol("foo")));
+/// assert(identical(const Symbol("foo"), #foo));
+/// assert(Symbol("[]=") == #[]=]);
+/// assert(identical(const Symbol("[]="), #[]=));
+/// assert(Symbol("foo.bar") == #foo.bar);
+/// assert(identical(const Symbol("foo.bar"), #foo.bar));
+/// The created instance overrides Object.==.
+///
+/// @description Checks that symbols for operators can be created.
+/// @author ilya, sgrekhov@unipro.ru
+
+import "../../../Utils/expect.dart";
+
+main() {
+ Expect.equals(#~, new Symbol('~'));
+ Expect.isFalse(identical(#~, new Symbol('~')));
+ Expect.equals(#==, new Symbol('=='));
+ Expect.isFalse(identical(#==, new Symbol('==')));
+ Expect.equals(#[], new Symbol('[]'));
+ Expect.isFalse(identical(#[], new Symbol('[]')));
+ Expect.equals(#[]=, new Symbol('[]='));
+ Expect.isFalse(identical(#[]=, new Symbol('[]=')));
+
+ Expect.equals(#*, new Symbol('*'));
+ Expect.isFalse(identical(#*, new Symbol('*')));
+ Expect.equals(#/, new Symbol('/'));
+ Expect.isFalse(identical(#/, new Symbol('/')));
+ Expect.equals(#%, new Symbol('%'));
+ Expect.isFalse(identical(#%, new Symbol('%')));
+ Expect.equals(#~/, new Symbol('~/'));
+ Expect.isFalse(identical(#~/, new Symbol('~/')));
+
+ Expect.equals(#+, new Symbol('+'));
+ Expect.isFalse(identical(#+, new Symbol('+')));
+ Expect.equals(#-, new Symbol('-'));
+ Expect.isFalse(identical(#-, new Symbol('-')));
+
+ Expect.equals(#<<, new Symbol('<<'));
+ Expect.isFalse(identical(#<<, new Symbol('<<')));
+ Expect.equals(#>>, new Symbol('>>'));
+ Expect.isFalse(identical(#>>, new Symbol('>>')));
+ Expect.equals(#>>>, new Symbol('>>>'));
+ Expect.isFalse(identical(#>>>, new Symbol('>>>')));
+
+ Expect.equals(#<, new Symbol('<'));
+ Expect.isFalse(identical(#<, new Symbol('<')));
+ Expect.equals(#<=, new Symbol('<='));
+ Expect.isFalse(identical(#<=, new Symbol('<=')));
+ Expect.equals(#>, new Symbol('>'));
+ Expect.isFalse(identical(#>, new Symbol('>')));
+ Expect.equals(#>=, new Symbol('>='));
+ Expect.isFalse(identical(#>=, new Symbol('>=')));
+
+ Expect.equals(#&, new Symbol('&'));
+ Expect.isFalse(identical(#&, new Symbol('&')));
+ Expect.equals(#^, new Symbol('^'));
+ Expect.isFalse(identical(#^, new Symbol('^')));
+ Expect.equals(#|, new Symbol('|'));
+ Expect.isFalse(identical(#|, new Symbol('|')));
+}
diff --git a/LibTest/core/Symbol/Symbol_A03_t01.dart b/LibTest/core/Symbol/Symbol_A03_t01.dart
new file mode 100644
index 0000000..c573c5f
--- /dev/null
+++ b/LibTest/core/Symbol/Symbol_A03_t01.dart
@@ -0,0 +1,59 @@
+// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// @assertion const Symbol(String name)
+/// Constructs a new Symbol representing the provided name.
+///
+/// Symbols created from equal name strings are themselves equal. If the symbols
+/// are created using const, symbols with the same name strings are
+/// canonicalized and identical.
+///
+/// Some name strings create symbols which can also be created using a symbol
+/// literal, or be implicitly created while running Dart programs, for example
+/// through Object.noSuchMethod.
+///
+/// If name is a single Dart identifier that does not start with an underscore,
+/// or it is a qualified identifier (multiple identifiers separated by .s), or
+/// it is the name of a user definable operator different from unary- (one of
+/// "+", "-", "*", "/", "%", "~/", "&", "|", "^", "~", "<<", ">>", ">>>", "<",
+/// "<=", ">", ">=", "==", "[]", or "[]="), then the result of Symbol(name) is
+/// equal to the symbol literal created by prefixing # to the contents of name,
+/// and const Symbol(name) is identical to that symbol literal.
+/// That is #foo == Symbol("foo") and identical(#foo, const Symbol("foo")).
+///
+/// If name is a single identifier that does not start with an underscore
+/// followed by a =, then the symbol is a setter name, and can be equal to the
+/// Invocation.memberName in an Object.noSuchMethod invocation.
+///
+/// Private symbol literals, like #_foo, cannot be created using the symbol
+/// constructor. A symbol like const Symbol("_foo") is not equal to any symbol
+/// literal, or to any source name symbol introduced by noSuchMethod.
+///
+/// assert(Symbol("foo") == Symbol("foo"));
+/// assert(Symbol("foo") == #foo);
+/// assert(identical(const Symbol("foo"), const Symbol("foo")));
+/// assert(identical(const Symbol("foo"), #foo));
+/// assert(Symbol("[]=") == #[]=]);
+/// assert(identical(const Symbol("[]="), #[]=));
+/// assert(Symbol("foo.bar") == #foo.bar);
+/// assert(identical(const Symbol("foo.bar"), #foo.bar));
+/// The created instance overrides Object.==.
+///
+/// @description Checks that a symbol like const Symbol("_foo") is not equal to
+/// any symbol literal
+/// @author ilya, sgrekhov@unipro.ru
+/// @issue 13715
+/// @issue 11669
+
+import "../../../Utils/expect.dart";
+
+main() {
+ Expect.notEquals(#_foo, new Symbol('_foo'));
+ Expect.notEquals(#_foo, const Symbol('_foo'));
+
+ Expect.equals(new Symbol('_foo'), new Symbol('_foo'));
+ Expect.isFalse(identical(new Symbol('_foo'), new Symbol('_foo')));
+
+ Expect.identical(const Symbol('_foo'), const Symbol('_foo'));
+}
diff --git a/LibTest/core/Symbol/Symbol_A03_t02.dart b/LibTest/core/Symbol/Symbol_A03_t02.dart
new file mode 100644
index 0000000..3944e21
--- /dev/null
+++ b/LibTest/core/Symbol/Symbol_A03_t02.dart
@@ -0,0 +1,72 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// @assertion const Symbol(String name)
+/// Constructs a new Symbol representing the provided name.
+///
+/// Symbols created from equal name strings are themselves equal. If the symbols
+/// are created using const, symbols with the same name strings are
+/// canonicalized and identical.
+///
+/// Some name strings create symbols which can also be created using a symbol
+/// literal, or be implicitly created while running Dart programs, for example
+/// through Object.noSuchMethod.
+///
+/// If name is a single Dart identifier that does not start with an underscore,
+/// or it is a qualified identifier (multiple identifiers separated by .s), or
+/// it is the name of a user definable operator different from unary- (one of
+/// "+", "-", "*", "/", "%", "~/", "&", "|", "^", "~", "<<", ">>", ">>>", "<",
+/// "<=", ">", ">=", "==", "[]", or "[]="), then the result of Symbol(name) is
+/// equal to the symbol literal created by prefixing # to the contents of name,
+/// and const Symbol(name) is identical to that symbol literal.
+/// That is #foo == Symbol("foo") and identical(#foo, const Symbol("foo")).
+///
+/// If name is a single identifier that does not start with an underscore
+/// followed by a =, then the symbol is a setter name, and can be equal to the
+/// Invocation.memberName in an Object.noSuchMethod invocation.
+///
+/// Private symbol literals, like #_foo, cannot be created using the symbol
+/// constructor. A symbol like const Symbol("_foo") is not equal to any symbol
+/// literal, or to any source name symbol introduced by noSuchMethod.
+///
+/// assert(Symbol("foo") == Symbol("foo"));
+/// assert(Symbol("foo") == #foo);
+/// assert(identical(const Symbol("foo"), const Symbol("foo")));
+/// assert(identical(const Symbol("foo"), #foo));
+/// assert(Symbol("[]=") == #[]=]);
+/// assert(identical(const Symbol("[]="), #[]=));
+/// assert(Symbol("foo.bar") == #foo.bar);
+/// assert(identical(const Symbol("foo.bar"), #foo.bar));
+/// The created instance overrides Object.==.
+///
+/// @description Checks that a symbol like const Symbol("_foo") is not equal to
+/// any source name symbol introduced by noSuchMethod
+/// @author sgrekhov@unipro.ru
+
+import "../../../Utils/expect.dart";
+
+class C {
+ bool called = false;
+
+ @override
+ noSuchMethod(Invocation invocation) {
+ called = true;
+ Expect.notEquals(invocation.memberName, new Symbol("_foo"));
+ Expect.notEquals(invocation.memberName, const Symbol("_foo"));
+ }
+}
+
+main() {
+ dynamic c = new C();
+ c._foo();
+ Expect.isTrue(c.called);
+ c.called = false;
+
+ c._foo;
+ Expect.isTrue(c.called);
+ c.called = false;
+
+ c._foo = 42;
+ Expect.isTrue(c.called);
+}
diff --git a/LibTest/core/Symbol/Symbol_A04_t01.dart b/LibTest/core/Symbol/Symbol_A04_t01.dart
new file mode 100644
index 0000000..b526afe
--- /dev/null
+++ b/LibTest/core/Symbol/Symbol_A04_t01.dart
@@ -0,0 +1,66 @@
+// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// @assertion const Symbol(String name)
+/// Constructs a new Symbol representing the provided name.
+///
+/// Symbols created from equal name strings are themselves equal. If the symbols
+/// are created using const, symbols with the same name strings are
+/// canonicalized and identical.
+///
+/// Some name strings create symbols which can also be created using a symbol
+/// literal, or be implicitly created while running Dart programs, for example
+/// through Object.noSuchMethod.
+///
+/// If name is a single Dart identifier that does not start with an underscore,
+/// or it is a qualified identifier (multiple identifiers separated by .s), or
+/// it is the name of a user definable operator different from unary- (one of
+/// "+", "-", "*", "/", "%", "~/", "&", "|", "^", "~", "<<", ">>", ">>>", "<",
+/// "<=", ">", ">=", "==", "[]", or "[]="), then the result of Symbol(name) is
+/// equal to the symbol literal created by prefixing # to the contents of name,
+/// and const Symbol(name) is identical to that symbol literal.
+/// That is #foo == Symbol("foo") and identical(#foo, const Symbol("foo")).
+///
+/// If name is a single identifier that does not start with an underscore
+/// followed by a =, then the symbol is a setter name, and can be equal to the
+/// Invocation.memberName in an Object.noSuchMethod invocation.
+///
+/// Private symbol literals, like #_foo, cannot be created using the symbol
+/// constructor. A symbol like const Symbol("_foo") is not equal to any symbol
+/// literal, or to any source name symbol introduced by noSuchMethod.
+///
+/// assert(Symbol("foo") == Symbol("foo"));
+/// assert(Symbol("foo") == #foo);
+/// assert(identical(const Symbol("foo"), const Symbol("foo")));
+/// assert(identical(const Symbol("foo"), #foo));
+/// assert(Symbol("[]=") == #[]=]);
+/// assert(identical(const Symbol("[]="), #[]=));
+/// assert(Symbol("foo.bar") == #foo.bar);
+/// assert(identical(const Symbol("foo.bar"), #foo.bar));
+/// The created instance overrides Object.==.
+///
+/// @description Check the case when 'name' is not Dart identifier.
+/// @author ilya, sgrekhov@unipro.ru
+/// @issue 13715
+/// @issue 11669
+
+import "../../../Utils/expect.dart";
+
+main() {
+ Expect.equals(Symbol.empty, new Symbol(''));
+ Expect.identical(Symbol.empty, const Symbol(''));
+
+ Expect.equals(Symbol.unaryMinus, new Symbol('unary-'));
+ Expect.identical(Symbol.unaryMinus, const Symbol('unary-'));
+
+ Expect.equals(new Symbol('+++'), new Symbol('+++'));
+ Expect.identical(const Symbol('+++'), const Symbol('+++'));
+
+ Expect.equals(new Symbol('42isananswer'), new Symbol('42isananswer'));
+ Expect.identical(const Symbol('42isananswer'), const Symbol('42isananswer'));
+
+ Expect.equals(new Symbol('42'), new Symbol('42'));
+ Expect.identical(const Symbol('42'), const Symbol('42'));
+}
+
diff --git a/LibTest/core/Symbol/Symbol_A05_t01.dart b/LibTest/core/Symbol/Symbol_A05_t01.dart
new file mode 100644
index 0000000..77708c0
--- /dev/null
+++ b/LibTest/core/Symbol/Symbol_A05_t01.dart
@@ -0,0 +1,66 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// @assertion const Symbol(String name)
+/// Constructs a new Symbol representing the provided name.
+///
+/// Symbols created from equal name strings are themselves equal. If the symbols
+/// are created using const, symbols with the same name strings are
+/// canonicalized and identical.
+///
+/// Some name strings create symbols which can also be created using a symbol
+/// literal, or be implicitly created while running Dart programs, for example
+/// through Object.noSuchMethod.
+///
+/// If name is a single Dart identifier that does not start with an underscore,
+/// or it is a qualified identifier (multiple identifiers separated by .s), or
+/// it is the name of a user definable operator different from unary- (one of
+/// "+", "-", "*", "/", "%", "~/", "&", "|", "^", "~", "<<", ">>", ">>>", "<",
+/// "<=", ">", ">=", "==", "[]", or "[]="), then the result of Symbol(name) is
+/// equal to the symbol literal created by prefixing # to the contents of name,
+/// and const Symbol(name) is identical to that symbol literal.
+/// That is #foo == Symbol("foo") and identical(#foo, const Symbol("foo")).
+///
+/// If name is a single identifier that does not start with an underscore
+/// followed by a =, then the symbol is a setter name, and can be equal to the
+/// Invocation.memberName in an Object.noSuchMethod invocation.
+///
+/// Private symbol literals, like #_foo, cannot be created using the symbol
+/// constructor. A symbol like const Symbol("_foo") is not equal to any symbol
+/// literal, or to any source name symbol introduced by noSuchMethod.
+///
+/// assert(Symbol("foo") == Symbol("foo"));
+/// assert(Symbol("foo") == #foo);
+/// assert(identical(const Symbol("foo"), const Symbol("foo")));
+/// assert(identical(const Symbol("foo"), #foo));
+/// assert(Symbol("[]=") == #[]=]);
+/// assert(identical(const Symbol("[]="), #[]=));
+/// assert(Symbol("foo.bar") == #foo.bar);
+/// assert(identical(const Symbol("foo.bar"), #foo.bar));
+/// The created instance overrides Object.==.
+///
+/// @description Checks that if name is a single identifier that does not start
+/// with an underscore followed by a =, then the symbol is a setter name, and
+/// can be equal to the Invocation.memberName in an Object.noSuchMethod
+/// invocation.
+/// @author sgrekhov@unipro.ru
+
+import "../../../Utils/expect.dart";
+
+class C {
+ bool called = false;
+
+ @override
+ noSuchMethod(Invocation invocation) {
+ called = true;
+ Expect.equals(invocation.memberName, new Symbol("foo="));
+ Expect.isFalse(identical(invocation.memberName, const Symbol("foo=")));
+ }
+}
+
+main() {
+ dynamic c = new C();
+ c.foo = 42;
+ Expect.isTrue(c.called);
+}
diff --git a/LibTest/core/Symbol/Symbol_A06_t01.dart b/LibTest/core/Symbol/Symbol_A06_t01.dart
new file mode 100644
index 0000000..cf1df7c
--- /dev/null
+++ b/LibTest/core/Symbol/Symbol_A06_t01.dart
@@ -0,0 +1,69 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// @assertion const Symbol(String name)
+/// Constructs a new Symbol representing the provided name.
+///
+/// Symbols created from equal name strings are themselves equal. If the symbols
+/// are created using const, symbols with the same name strings are
+/// canonicalized and identical.
+///
+/// Some name strings create symbols which can also be created using a symbol
+/// literal, or be implicitly created while running Dart programs, for example
+/// through Object.noSuchMethod.
+///
+/// If name is a single Dart identifier that does not start with an underscore,
+/// or it is a qualified identifier (multiple identifiers separated by .s), or
+/// it is the name of a user definable operator different from unary- (one of
+/// "+", "-", "*", "/", "%", "~/", "&", "|", "^", "~", "<<", ">>", ">>>", "<",
+/// "<=", ">", ">=", "==", "[]", or "[]="), then the result of Symbol(name) is
+/// equal to the symbol literal created by prefixing # to the contents of name,
+/// and const Symbol(name) is identical to that symbol literal.
+/// That is #foo == Symbol("foo") and identical(#foo, const Symbol("foo")).
+///
+/// If name is a single identifier that does not start with an underscore
+/// followed by a =, then the symbol is a setter name, and can be equal to the
+/// Invocation.memberName in an Object.noSuchMethod invocation.
+///
+/// Private symbol literals, like #_foo, cannot be created using the symbol
+/// constructor. A symbol like const Symbol("_foo") is not equal to any symbol
+/// literal, or to any source name symbol introduced by noSuchMethod.
+///
+/// assert(Symbol("foo") == Symbol("foo"));
+/// assert(Symbol("foo") == #foo);
+/// assert(identical(const Symbol("foo"), const Symbol("foo")));
+/// assert(identical(const Symbol("foo"), #foo));
+/// assert(Symbol("[]=") == #[]=]);
+/// assert(identical(const Symbol("[]="), #[]=));
+/// assert(Symbol("foo.bar") == #foo.bar);
+/// assert(identical(const Symbol("foo.bar"), #foo.bar));
+/// The created instance overrides Object.==.
+///
+/// @description Checks that a symbol can be implicitly created while running
+/// Dart programs through Object.noSuchMethod
+/// @author sgrekhov@unipro.ru
+
+import "../../../Utils/expect.dart";
+
+class C {
+ bool called = false;
+
+ @override
+ noSuchMethod(Invocation invocation) {
+ called = true;
+ Expect.equals(invocation.memberName, new Symbol("foo"));
+ Expect.isFalse(identical(invocation.memberName, const Symbol("foo")));
+ }
+}
+
+main() {
+ dynamic c = new C();
+ c.foo();
+ Expect.isTrue(c.called);
+ c.called = false;
+
+ c.foo;
+ Expect.isTrue(c.called);
+ c.called = false;
+}