aa0a7e7083
Change-Id: If28f2f1404f02c5d757774188a5a006137c8734f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273284 Reviewed-by: Nicholas Shahan <nshahan@google.com> Commit-Queue: Mayank Patke <fishythefish@google.com> Reviewed-by: Sigmund Cherem <sigmund@google.com> Reviewed-by: Anna Gringauze <annagrin@google.com>
46 lines
1.3 KiB
Dart
46 lines
1.3 KiB
Dart
// Copyright (c) 2023, 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:test/test.dart';
|
|
|
|
import 'expression_compiler_e2e_suite.dart';
|
|
|
|
void main() async {
|
|
var driver = await TestDriver.init();
|
|
|
|
group('dart.web.assertions_enabled', () {
|
|
const source = r'''
|
|
void main() {
|
|
var b = const bool.fromEnvironment('dart.web.assertions_enabled');
|
|
|
|
// Breakpoint: bp
|
|
print('hello world');
|
|
}
|
|
''';
|
|
|
|
tearDown(() async {
|
|
await driver.cleanupTest();
|
|
});
|
|
|
|
tearDownAll(() async {
|
|
await driver.finish();
|
|
});
|
|
|
|
test('is automatically set', () async {
|
|
var setup = SetupCompilerOptions(enableAsserts: true);
|
|
await driver.initSource(setup, source);
|
|
// TODO(43986): Update when assertions are enabled.
|
|
await driver.check(
|
|
breakpointId: 'bp', expression: 'b', expectedResult: 'false');
|
|
});
|
|
|
|
test('is automatically unset', () async {
|
|
var setup = SetupCompilerOptions(enableAsserts: false);
|
|
await driver.initSource(setup, source);
|
|
await driver.check(
|
|
breakpointId: 'bp', expression: 'b', expectedResult: 'false');
|
|
});
|
|
});
|
|
}
|