[gardening] Move language_2/conditional_rewrite_test

Change-Id: I878230e5ed311d5d51b15c48c9fb5dca447e0ef0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108905
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
This commit is contained in:
Stephen Adams
2019-07-15 22:04:16 +00:00
committed by commit-bot@chromium.org
parent 700195642a
commit fab9b9f71f
3 changed files with 13 additions and 8 deletions
@@ -13,9 +13,6 @@ posNull(x, y) => x != null ? y : null;
negNull(x, y) => x != null ? !y : null;
main() {
bool isCheckedMode = false;
assert((isCheckedMode = true));
Expect.equals(false, posFalse(null, false));
Expect.equals(false, negFalse(null, false));
Expect.equals(null, posNull(null, false));
@@ -36,7 +33,7 @@ main() {
Expect.equals(true, posNull([], true));
Expect.equals(false, negNull([], true));
if (!isCheckedMode) {
if (isConditionCheckDisabled) {
Expect.equals(null, posFalse([], null));
Expect.equals(true, negFalse([], null));
Expect.equals(null, posNull([], null));
@@ -49,3 +46,15 @@ main() {
Expect.equals(true, negNull([], y));
}
}
bool get isConditionCheckDisabled {
bool b = null;
for (int i = 0; i < 3; i++) {
try {
b = !b;
} catch (e) {
return false;
}
}
return true;
}
@@ -29,7 +29,6 @@ compile_time_constant_static5_test/11: CompileTimeError
compile_time_constant_static5_test/16: CompileTimeError
compile_time_constant_static5_test/21: CompileTimeError
compile_time_constant_static5_test/23: CompileTimeError
conditional_rewrite_test: RuntimeError
config_import_corelib_test: CompileTimeError # we need a special platform.dill file for categories=all. Once we fix that, all dart:* are supported when using '--categories=all' so this will become a RuntimeError, OK.
config_import_test: RuntimeError # Test flag is not passed to the compiler.
const_constructor3_test/04: MissingCompileTimeError # OK - Subtype check uses JS number semantics.
@@ -28,7 +28,6 @@ compile_time_constant_static5_test/21: CompileTimeError
compile_time_constant_static5_test/23: CompileTimeError
conditional_import_string_test: CompileTimeError
conditional_import_test: CompileTimeError
conditional_rewrite_test: RuntimeError
config_import_corelib_test: CompileTimeError
config_import_test: RuntimeError
const_list_test: RuntimeError
@@ -808,7 +807,6 @@ regress_22728_test: RuntimeError
[ $compiler == dartkp && $runtime == dart_precompiled && !$checked ]
assertion_initializer_const_error_test/01: MissingCompileTimeError
assertion_initializer_const_function_error_test/01: MissingCompileTimeError
conditional_rewrite_test: RuntimeError # Issue 31402 (Not)
implicit_downcast_during_combiner_test: RuntimeError
implicit_downcast_during_compound_assignment_test: RuntimeError
implicit_downcast_during_conditional_expression_test: RuntimeError
@@ -879,7 +877,6 @@ malbounded_type_test_test/04: Fail
regress_30339_test: RuntimeError
[ $runtime == vm && !$checked && ($compiler == dartk || $compiler == dartkb) ]
conditional_rewrite_test: RuntimeError # Issue 31402 (Not)
type_error_test: RuntimeError # Issue 31402 (Variable declaration)
# ===== dartk + vm status lines =====