2013-10-31 05:46:57 +00:00
|
|
|
// 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.
|
|
|
|
|
2014-03-06 09:16:41 +00:00
|
|
|
import "dart:isolate";
|
|
|
|
|
2013-10-31 05:46:57 +00:00
|
|
|
import "package:expect/expect.dart";
|
|
|
|
|
2014-03-06 09:16:41 +00:00
|
|
|
void test(port) {
|
2013-10-31 05:46:57 +00:00
|
|
|
Expect.isNull(const int.fromEnvironment('NOT_FOUND'));
|
2013-10-31 13:45:39 +00:00
|
|
|
Expect.equals(12345, const int.fromEnvironment('NOT_FOUND',
|
|
|
|
defaultValue: 12345));
|
2014-03-06 09:16:41 +00:00
|
|
|
if (port != null) port.send(null);
|
|
|
|
}
|
|
|
|
|
|
|
|
main() {
|
|
|
|
test(null);
|
|
|
|
var port = new ReceivePort();
|
|
|
|
Isolate.spawn(test, port.sendPort);
|
|
|
|
port.listen((_) => port.close());
|
2013-10-31 05:46:57 +00:00
|
|
|
}
|