// Copyright (c) 2018, 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.

import 'package:expect/expect.dart';

void main() {
  print(const Symbol(null));                                //# 01: compile-time error
  print(const Symbol(r''));                                 //# 02: ok
  Expect.isTrue(identical(const Symbol(r'foo'), #foo));     //# 03: ok
  Expect.isTrue(identical(const Symbol(r'$foo'), #$foo));   //# 03: ok
  Expect.isTrue(identical(const Symbol(r'$_'), #$_));       //# 03: ok
  Expect.isTrue(identical(const Symbol(r'+'), #+));         //# 03: ok
  Expect.isTrue(identical(const Symbol(r'[]='), #[]=));     //# 03: ok
  Expect.isTrue(identical(const Symbol(r'_foo'), #_foo));   //# 03: compile-time error
  Expect.isTrue(identical(const Symbol(r'_$'), #_$));       //# 03: compile-time error
  Expect.isTrue(identical(const Symbol(r'_foo$'), #_foo$)); //# 03: compile-time error
  print(const Symbol(r'_+'));                               //# 03: compile-time error
}

// Copyright (c) 2018, 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.

import 'package:expect/expect.dart';

void main() {
  print(const Symbol(null)); //# 01: compile-time error
  print(const Symbol(r''));
  Expect.isTrue(identical(const Symbol(r'foo'), #foo));
  Expect.isTrue(identical(const Symbol(r'$foo'), #$foo));
  Expect.isTrue(identical(const Symbol(r'$_'), #$_));
  Expect.isTrue(identical(const Symbol(r'+'), #+));
  Expect.isTrue(identical(const Symbol(r'[]='), #[]=));
  Expect.isFalse(identical(const Symbol(r'_foo'), #_foo));
  Expect.isFalse(identical(const Symbol(r'_$'), #_$));
  Expect.isFalse(identical(const Symbol(r'_foo$'), #_foo$));
  print(const Symbol(r'_+'));
}

Adjust vm test about the Symbol constructor
Adjust vm test about the Symbol constructor

The `Symbol` constructor has been changed to accept any string as the
actual argument (it used to require strings similar to the ones that we
can use with `#` to create a symbol literal). This CL change a vm test
such that it has the updated expectations.

Cf. https://github.com/dart-lang/sdk/issues/46207.

Change-Id: I25fa5a145b7d476372b4c2f8502eabb36ec82fec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205781
Commit-Queue: Erik Ernst <251bb01623bfda2cd9151e339a6e783ca432874c@google.com>
Reviewed-by: Martin Kustermann <a35dd5b79fac84b2bb3b026a16b8becc55af5961@google.com>
