<commit_before>describe 'window.collectionDifference', ->
  type = Backbone.Collection
  collection1 = null
  collections = null
  result = null
  models = [0..10].map (i) -> new Backbone.Model(someField: i)

  beforeEach ->
    collection1 = new type(models[1..4])
    collections = [new type(models[2..3]), new type(models[5..6])]
    result = collectionDifference(type, 'someField', collection1, collections...)

  it 'deletes the elements from "collections" that match "someField"', ->
    expect(result.pluck('someField')).toEqual([1, 4])

  it 'should work when adding elements to "collection1"', ->
    collection1.add(models[6])
    collection1.add(models[7])
    expect(result.pluck('someField')).toEqual([1, 4, 7])

  it 'should work when removing elements from "collection1"', ->
    collection1.remove(models[3])
    collection1.remove(models[4])
    expect(result.pluck('someField')).toEqual([1])

  it 'should work when resetting "collection1"', ->
    collection1.reset(models[1..7])
    expect(result.pluck('someField')).toEqual([1, 4, 7])

  it 'should work when adding elements to "collections"', ->
    collections[0].add(models[1])
    collections[1].add(models[1])
    collections[1].add(models[4])
    expect(result.pluck('someField')).toEqual([])

  it 'should work when removing elements from "collections"', ->
    collections[0].remove(models[2])
    collections[1].remove(models[6])
    expect(result.pluck('someField')).toEqual([1, 2, 4])

  it 'should work when resetting "collections"', ->
    collections[0].reset(models[1..2])
    collections[1].reset(models[2..3])
    expect(result.pluck('someField')).toEqual([4])

  it 'should work when using different models with the same fields', ->
    collections[0].reset([new Backbone.Model(someField: 2), new Backbone.Model(someField: 3)])
    expect(result.pluck('someField')).toEqual([1, 4])

  it 'should ignore other fields', ->
    collection1.reset([new Backbone.Model(someField: 1, otherField: 10), new Backbone.Model(someField: 2, otherField: 3)])
    collections[0].reset([new Backbone.Model(someField: 2, otherField: 10), new Backbone.Model(someField: 3, otherField: 2)])
    expect(result.pluck('otherField')).toEqual([10])

  it 'should work with arrays and objects instead of collections and models', ->
    result = collectionDifference(type, 'someField', collection1, [{someField: 2}, {someField: 3}], collections[1])
    expect(result.pluck('someField')).toEqual([1, 4])

  it 'should work with subsequent add, removes, and resets', ->
    collection1.add(models[6])
    collection1.add(models[7])
    collection1.reset(models[1..7])
    collection1.remove(models[7])
    collection1.remove(models[6])
    collections[0].add(models[1])
    collections[1].add(models[1])
    collections[1].add(models[4])
    collections[0].add(models[1])
    collections[0].reset(models[2..4])
    collections[0].remove(models[4])
    collections[1].remove(models[1])
    collections[1].remove(models[4])
    expect(result.pluck('someField')).toEqual([1, 4])
<commit_msg>Intentionally breaking spec to test CI.<commit_after>describe 'window.collectionDifference', ->
  type = Backbone.Collection
  collection1 = null
  collections = null
  result = null
  models = [0..10].map (i) -> new Backbone.Model(someField: i)

  beforeEach ->
    collection1 = new type(models[1..4])
    collections = [new type(models[2..3]), new type(models[5..6])]
    result = collectionDifference(type, 'someField', collection1, collections...)

  it 'deletes the elements from "collections" that match "someField"', ->
    expect(result.pluck('someField')).toEqual([1, 4])

  it 'should work when adding elements to "collection1"', ->
    collection1.add(models[6])
    collection1.add(models[7])
    expect(result.pluck('someField')).toEqual([1, 4, 7])

  it 'should work when removing elements from "collection1"', ->
    collection1.remove(models[3])
    collection1.remove(models[4])
    expect(result.pluck('someField')).toEqual([1])

  it 'should work when resetting "collection1"', ->
    collection1.reset(models[1..7])
    expect(result.pluck('someField')).toEqual([1, 4, 7])

  it 'should work when adding elements to "collections"', ->
    collections[0].add(models[1])
    collections[1].add(models[1])
    collections[1].add(models[4])
    expect(result.pluck('someField')).toEqual([])

  it 'should work when removing elements from "collections"', ->
    collections[0].remove(models[2])
    collections[1].remove(models[6])
    expect(result.pluck('someField')).toEqual([1, 2, 4])

  it 'should work when resetting "collections"', ->
    collections[0].reset(models[1..2])
    collections[1].reset(models[2..3])
    expect(result.pluck('someField')).toEqual([4])

  it 'should work when using different models with the same fields', ->
    collections[0].reset([new Backbone.Model(someField: 2), new Backbone.Model(someField: 3)])
    expect(result.pluck('someField')).toEqual([1, 4])

  it 'should ignore other fields', ->
    collection1.reset([new Backbone.Model(someField: 1, otherField: 10), new Backbone.Model(someField: 2, otherField: 3)])
    collections[0].reset([new Backbone.Model(someField: 2, otherField: 10), new Backbone.Model(someField: 3, otherField: 2)])
    expect(result.pluck('otherField')).toEqual([10])

  it 'should work with arrays and objects instead of collections and models', ->
    result = collectionDifference(type, 'someField', collection1, [{someField: 2}, {someField: 3}], collections[1])
    expect(result.pluck('someField')).toEqual([1, 4])

  it 'should work with subsequent add, removes, and resets', ->
    collection1.add(models[6])
    collection1.add(models[7])
    collection1.reset(models[1..7])
    collection1.remove(models[7])
    collection1.remove(models[6])
    collections[0].add(models[1])
    collections[1].add(models[1])
    collections[1].add(models[4])
    collections[0].add(models[1])
    collections[0].reset(models[2..4])
    collections[0].remove(models[4])
    collections[1].remove(models[1])
    # collections[1].remove(models[4])
    expect(result.pluck('someField')).toEqual([1, 4])

{'fraction_non_alphanumeric': 0.16955243384514865, 'fraction_numerical': 0.0359359686377001, 'mean_word_length': 4.6589648798521255, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 31, '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': '3022346', 'n_tokens_mistral': 1982, 'n_tokens_neox': 1979, 'n_words': 407}