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

// Tests of operators.

library operators_tests;

import 'js_backend_cps_ir.dart';

const List<TestEntry> tests = const [
  const TestEntry("main() { return true ? 42 : 'foo'; }"),
  const TestEntry("""
foo() => foo();
main() {
  print(foo() ? "hello world" : "bad bad");
}""","""
function() {
  P.print(V.foo() ? "hello world" : "bad bad");
}"""),
  const TestEntry("""
foo() { print('foo'); }
main() {
  print(foo() ? "hello world" : "bad bad");
}""","""
function() {
  V.foo();
  P.print("bad bad");
}"""),
  const TestEntry("""
get foo => foo;
main() {
  print(foo ? "hello world" : "bad bad");
}""","""
function() {
  P.print(V.foo() ? "hello world" : "bad bad");
}"""),
  const TestEntry("""
get foo => foo;
main() { print(foo && foo); }
""", """
function() {
  P.print(V.foo() ? V.foo() === true : false);
}"""),
  const TestEntry("""
get foo => foo;
main() { print(foo || foo); }
""","""
function() {
  P.print(V.foo() ? true : V.foo() === true);
}"""),<commit_msg>dart2js cps: Fix expected output in tests.<commit_after>// Copyright (c) 2014, 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.

// Tests of operators.

library operators_tests;

import 'js_backend_cps_ir.dart';

const List<TestEntry> tests = const [
  const TestEntry("main() { return true ? 42 : 'foo'; }"),
  const TestEntry("""
foo() => foo();
main() {
  print(foo() ? "hello world" : "bad bad");
}""","""
function() {
  P.print(V.foo() ? "hello world" : "bad bad");
}"""),
  const TestEntry("""
foo() { print('foo'); }
main() {
  print(foo() ? "hello world" : "bad bad");
}""","""
function() {
  V.foo();
  P.print("bad bad");
}"""),
  const TestEntry("""
get foo => foo;
main() {
  print(foo ? "hello world" : "bad bad");
}""","""
function() {
  P.print(V.foo() ? "hello world" : "bad bad");
}"""),
  const TestEntry("""
get foo => foo;
main() { print(foo && foo); }
""", """
function() {
  P.print(V.foo() ? !!V.foo() : false);
}"""),
  const TestEntry("""
get foo => foo;
main() { print(foo || foo); }
""","""
function() {
  P.print(V.foo() ? true : !!V.foo());
}"""),
{'fraction_non_alphanumeric': 0.24329896907216494, 'fraction_numerical': 0.0053608247422680414, 'mean_word_length': 3.930894308943089, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '372651', 'n_tokens_mistral': 879, 'n_tokens_neox': 864, 'n_words': 258}