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

#library("boolified_operator_test.dart");
#import("compiler_helper.dart");

final String TEST_EQUAL = @"""
foo(param0, param1) {
  if (param0 == param1) return 0;
  return 1;
}
""";

final String TEST_EQUAL_NULL = @"""
foo(param0) {
  if (param0 == null) return 0;
  return 1;
}
""";

final String TEST_LESS = @"""
foo(param0, param1) {
  if (param0 < param1) return 0;
  return 1;
}
""";

final String TEST_LESS_EQUAL = @"""
foo(param0, param1) {
  if (param0 <= param1) return 0;
  return 1;
}
""";
final String TEST_GREATER = @"""
foo(param0, param1) {
  if (param0 > param1) return 0;
  return 1;
}
""";

final String TEST_GREATER_EQUAL = @"""
foo(param0, param1) {
  if (param0 >= param1) return 0;
  return 1;
}
""";

main() {
  RegExp regexp = const RegExp('=== true');

  String generated = compile(TEST_EQUAL, 'foo');
  Expect.isFalse(generated.contains('=== true'));
  Expect.isTrue(generated.contains('eqB'));

  generated = compile(TEST_EQUAL_NULL, 'foo');
  Expect.isFalse(generated.contains('=== true'));
  Expect.isTrue(generated.contains('eqNullB'));

  generated = compile(TEST_LESS, 'foo');
  Expect.isFalse(generated.contains('=== true'));
  Expect.isTrue(generated.contains('ltB'));

  generated = compile(TEST_LESS_EQUAL, 'foo');
  Expect.isFalse(generated.contains('=== true'));
  Expect.isTrue(generated.contains('leB'));
  
  generated = compile(TEST_GREATER, 'foo');
  Expect.isFalse(generated.contains('=== true'));
  Expect.isTrue(generated.contains('gtB'));
  
  generated = compile(TEST_GREATER_EQUAL, 'foo');
  Expect.isFalse(generated.contains('=== true'));
  Expect.isTrue(generated.contains('geB'));
}
<commit_msg>Fix another test case after reemoval of eqNullB<commit_after>// Copyright (c) 2012, 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.

#library("boolified_operator_test.dart");
#import("compiler_helper.dart");

final String TEST_EQUAL = @"""
foo(param0, param1) {
  if (param0 == param1) return 0;
  return 1;
}
""";

final String TEST_EQUAL_NULL = @"""
foo(param0) {
  if (param0 == null) return 0;
  return 1;
}
""";

final String TEST_LESS = @"""
foo(param0, param1) {
  if (param0 < param1) return 0;
  return 1;
}
""";

final String TEST_LESS_EQUAL = @"""
foo(param0, param1) {
  if (param0 <= param1) return 0;
  return 1;
}
""";
final String TEST_GREATER = @"""
foo(param0, param1) {
  if (param0 > param1) return 0;
  return 1;
}
""";

final String TEST_GREATER_EQUAL = @"""
foo(param0, param1) {
  if (param0 >= param1) return 0;
  return 1;
}
""";

main() {
  RegExp regexp = const RegExp('=== true');

  String generated = compile(TEST_EQUAL, 'foo');
  Expect.isFalse(generated.contains('=== true'));
  Expect.isTrue(generated.contains('eqB'));

  generated = compile(TEST_EQUAL_NULL, 'foo');
  Expect.isFalse(generated.contains('=== true'));
  Expect.isTrue(generated.contains('== null'));

  generated = compile(TEST_LESS, 'foo');
  Expect.isFalse(generated.contains('=== true'));
  Expect.isTrue(generated.contains('ltB'));

  generated = compile(TEST_LESS_EQUAL, 'foo');
  Expect.isFalse(generated.contains('=== true'));
  Expect.isTrue(generated.contains('leB'));
  
  generated = compile(TEST_GREATER, 'foo');
  Expect.isFalse(generated.contains('=== true'));
  Expect.isTrue(generated.contains('gtB'));
  
  generated = compile(TEST_GREATER_EQUAL, 'foo');
  Expect.isFalse(generated.contains('=== true'));
  Expect.isTrue(generated.contains('geB'));
}

{'fraction_non_alphanumeric': 0.17405063291139242, 'fraction_numerical': 0.020042194092827006, 'mean_word_length': 4.898911353032659, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4887075', 'n_tokens_mistral': 1335, 'n_tokens_neox': 1276, 'n_words': 314}