<commit_before>/*
 * Copyright (c) 2019, 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.
 */
/**
 * @assertion This enables in-place literals (which aren't very useful):
 *
 *   const list = [...["why"]];
 * @description Checks that in-place literals are enabled for sets
 * @author <EMAIL>
 */
// SharedOptions=--enable-experiment=spread-collections

import "../../Utils/expect.dart";

main() {
  const res1 = {...["why"]};
  Expect.setEquals({"why"}, res1);
  const res2 = {...?["not"]};
  Expect.setEquals({"not"}, res2);

  const res3 = {...{"why"}};
  Expect.setEquals({"why"}, res3);
  const res4 = {...?{"not"}};
  Expect.setEquals({"not"}, res4);

  const res5 = {1, 2, ...[1, 2, 3], 4, 15, 1, ...[null], ...{12345}, [1, 2, 3]};
  Expect.setEquals({1, 2, 1, 2, 3, 4, 15, 1, null, 12345, [1, 2, 3]}, res5);
  const res6 = {1, 2, 3, ...[4, 5, 6], ...?[7, 8, 9], [1, 2, 3]};
  Expect.setEquals({1, 2, 3, 4, 5, 6, 7, 8, 9, [1, 2, 3]}, res6);

  const res7 = {[1, 2, 3, ...[4, 5, 6], ...?{7, 8, 9}, {1, 2, 3}]};
  Expect.listEquals({1, 2, 3, 4, 5, 6, 7, 8, 9, {1, 2, 3}}, res7);
}<commit_msg>Fixed issue #287<commit_after>/*
 * Copyright (c) 2019, 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.
 */
/**
 * @assertion This enables in-place literals (which aren't very useful):
 *
 *   const list = [...["why"]];
 * @description Checks that in-place literals are enabled for sets
 * @author <EMAIL>
 */
// SharedOptions=--enable-experiment=spread-collections

import "../../Utils/expect.dart";

main() {
  const res1 = {...["why"]};
  Expect.setEquals({"why"}, res1);
  const res2 = {...?["not"]};
  Expect.setEquals({"not"}, res2);

  const res3 = {...{"why"}};
  Expect.setEquals({"why"}, res3);
  const res4 = {...?{"not"}};
  Expect.setEquals({"not"}, res4);

  const res5 = {2, ...[1, 2, 3], 4, 15, 1, ...[null], ...{12345}, [1, 2, 3]};
  Expect.setEquals({2, 1, 3, 4, 15, null, 12345, [1, 2, 3]}, res5);
  const res6 = {1, 2, 3, ...[4, 5, 6], ...?[7, 8, 9], [1, 2, 3]};
  Expect.setEquals({1, 2, 3, 4, 5, 6, 7, 8, 9, [1, 2, 3]}, res6);

  const res7 = {[1, 2, 3, ...[4, 5, 6], ...?{7, 8, 9}, {1, 2, 3}]};
  Expect.listEquals({1, 2, 3, 4, 5, 6, 7, 8, 9, {1, 2, 3}}, res7);
}
{'fraction_non_alphanumeric': 0.24726831242411978, 'fraction_numerical': 0.08053419668150547, 'mean_word_length': 3.099502487562189, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3631493', 'n_tokens_mistral': 1120, 'n_tokens_neox': 976, 'n_words': 332}