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

// VMOptions=--enable-isolate-groups
// VMOptions=--no-enable-isolate-groups

import "dart:isolate";

import "package:expect/expect.dart";

void test(port) {
  Expect.isNull(const String.fromEnvironment('NOT_FOUND'));
  Expect.equals(
      'x', const String.fromEnvironment('NOT_FOUND', defaultValue: 'x'));
  if (port != null) port.send(null);
}

main() {
  test(null);
  var port = new ReceivePort();
  Isolate.spawn(test, port.sendPort);
  port.listen((_) => port.close());
}

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

// VMOptions=--enable-isolate-groups
// VMOptions=--no-enable-isolate-groups

import "dart:isolate";

import "package:expect/expect.dart";

void test(port) {
  Expect.equals('', const String.fromEnvironment('NOT_FOUND'));
  Expect.equals(
      'x', const String.fromEnvironment('NOT_FOUND', defaultValue: 'x'));
  if (port != null) port.send(null);
}

main() {
  test(null);
  var port = new ReceivePort();
  Isolate.spawn(test, port.sendPort);
  port.listen((_) => port.close());
}

Adjust test for new default values of .fromEnvironment
Adjust test for new default values of .fromEnvironment

Breaking change #40678 mandates new default values for
String.fromEnvironment, this CL adjusts the expectations of a test
accordingly.

Change-Id: Ib8a26005673d07c67f65708fc9c4ae7b17421670
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139811
Reviewed-by: Johnni Winther <0f64ef784d57ffb064b634040f9eeba0d33d0be4@google.com>
Commit-Queue: Erik Ernst <251bb01623bfda2cd9151e339a6e783ca432874c@google.com>
