Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable asserts in dart2wasm tests #2241

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions integration_tests/wasm/test/hello_world_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,12 @@ void main() {
test('1 == 1', () {
expect(1, equals(1));
});

test('asserts are enabled', () {
expect(shouldFail, throwsA(isA<AssertionError>()));
});
}

void shouldFail() {
assert(1 == 2);
}
4 changes: 4 additions & 0 deletions pkgs/test/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.25.7

* Enable asserts for `dart2wasm` tests.

## 1.25.6

* Point API doc links to `package:test` canonical libraries.
Expand Down
4 changes: 2 additions & 2 deletions pkgs/test/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: test
version: 1.25.6
version: 1.25.7
description: >-
A full featured library for writing and running Dart tests across platforms.
repository: https://github.com/dart-lang/test/tree/master/pkgs/test
Expand Down Expand Up @@ -35,7 +35,7 @@ dependencies:

# Use an exact version until the test_api and test_core package are stable.
test_api: 0.7.2
test_core: 0.6.3
test_core: 0.6.4

typed_data: ^1.3.0
web_socket_channel: '>=2.0.0 <4.0.0'
Expand Down
4 changes: 4 additions & 0 deletions pkgs/test_core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.6.4

* Enable asserts for `dart2wasm` tests.

## 0.6.3

* Update min SDK constraint to 3.2.0.
Expand Down
1 change: 1 addition & 0 deletions pkgs/test_core/lib/src/runner/wasm_compiler_pool.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class WasmCompilerPool extends CompilerPool {
final process = await Process.start(Platform.resolvedExecutable, [
'compile',
'wasm',
'--enable-asserts',
'--packages=${(await packageConfigUri).path}',
for (var experiment in enabledExperiments)
'--enable-experiment=$experiment',
Expand Down
2 changes: 1 addition & 1 deletion pkgs/test_core/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: test_core
version: 0.6.3
version: 0.6.4
description: A basic library for writing tests and running them on the VM.
repository: https://github.com/dart-lang/test/tree/master/pkgs/test_core

Expand Down
Loading