<commit_before>desc: Test the arity of every function
tests:

    # TODO: add test for slice (should require one or two arguments)

    # Set up some data
    - def: db = r.db('test')
    - def: obj = r.expr({'a':1})
    - def: array = r.expr([1])
    - cd: db.table_create('test1')
      ot: ({'created':1})
      def: tbl = db.table('test1')

    - ot: err("RqlCompileError", "Expected 0 argument(s) but found 1.", [])
      cd:
      - r.db_list(1)

    - ot: err("RqlCompileError", "Expected 1 argument(s) but found 2.", [])
      cd:
      - tbl.zip(1)
      - tbl.distinct(1)
      - tbl.is_empty(1)
      - obj.keys(1)

    - ot:
        js: err("RqlDriverError", "Expected 0 argument(s) but found 1.", [])
        rb: err("RqlCompileError", "Expected 1 argument(s) but found 2.", [])
        py: err("RqlCompileError", "Expected 1 argument(s) but found 2.", [])
      cd:
      - tbl.delete(1)

    - rb: db.table_list(1)
      ot: err("RqlCompileError", "Expected between 0 and 1 arguments but found 2.", [])


    - ot: err("RqlCompileError", "Expected 1 argument(s) but found 0.", [])
      cd:
      - r.db_create()
      - r.db_drop()
      - r.db()

    - cd: r.error()
      ot: err("RqlRuntimeError", "Empty ERROR term outside a default block.", [])

    - cd: r.js()
      ot:
        js: err("RqlDriverError", "Expected 1 argument(s) but found 0.", [])
        rb: err("RqlCompileError", "Expected 1 argument(s) but found 0.", [])
        py: err("RqlCompileError", "Expected 1 argument(s) but found 0.", [])

    - cd: r.expr()
      ot:
        py: err_regex('TypeError', ".*takes at least 1 argument \(0 given\)", [])
        js: err("RqlDriverError", "Expected between 1 and 2 argument(s) but found 0.", [])
        rb: err_regex("ArgumentError", '.*wrong number of arguments \(0 for 1.*\)', [])

    - ot: err("RqlCompileError", "Expected 2 argument(s) but found 1.", [])
      cd:
      - tbl.map()
      - tbl.concat_map()
      - tbl.skip()
      - tbl.limit()
      - array.append()
      - array.prepend()
      - array.difference()
      - array.set_insert()
      - array.set_union()
      - array.set_intersection()
      - array.set_difference()
      - tbl.nth()
      - tbl.for_each()
      - tbl.get()
      - r.expr([]).sample()
      - tbl.indexes_of()
    - ot: err("RqlCompileError", "Expected 1 argument(s) but found 2.", [])
      cd:
      - r.db_create(1,2)
      - r.db_drop(1,2)
      - r.db(1,2)

    - ot:
        js: err("RqlDriverError", "Expected 1 argument(s) but found 0.", [])
        rb: err("RqlCompileError", "Expected 2 argument(s) but found 1.", [])
        py: err("RqlCompileError", "Expected 2 argument(s) but found 1.", [])
      cd:
      - tbl.filter()

    - cd: r.error(1, 2)
      ot: err("RqlCompileError", "Expected between 0 and 1 arguments but found 2.", [])

    - cd:
      - db.table_drop()
      ot:
        rb: err("RqlRuntimeError", "Expected type DATUM but found DATABASE.", [])
        py: err("RqlRuntimeError", "Expected type DATUM but found DATABASE.", [])
        js: err("RqlRuntimeError", "Expected type DATUM but found DATABASE.", [])


    - cd: db.table_create()
      ot:
        rb: err("RqlRuntimeError", "Expected type DATUM but found DATABASE.", [])
        py: err("RqlRuntimeError", "Expected type DATUM but found DATABASE.", [])
        js: err("RqlDriverError", "Expected 1 argument(s) but found 0.", [])

    - cd: r.js(1,2)
      ot:
        py: err("RqlCompileError", "Expected 1 argument(s) but found 2.", [])
        rb: err("RqlCompileError", "Expected 1 argument(s) but found 2.", [])
        js: err("RqlDriverError", "Expected 1 argument(s) but found 2.", [])

    - ot: err("RqlCompileError", "Expected 2 argument(s) but found 3.", [])
      cd:
      - tbl.map(1,2)
      - tbl.concat_map(1,2)
      - tbl.skip(1,2)
      - tbl.limit(1,2)
      - array.append(1,2)
      - array.prepend(1,2)
      - array.difference([], [])
      - array.set_insert(1,2)
      - array.set_union([1],[2])
      - array.set_intersection([1],[2])
      - array.set_difference([1],[2])<commit_msg>Collapse similar errors<commit_after>desc: Test the arity of every function
tests:

    # TODO: add test for slice (should require one or two arguments)

    # Set up some data
    - def: db = r.db('test')
    - def: obj = r.expr({'a':1})
    - def: array = r.expr([1])
    - cd: db.table_create('test1')
      ot: ({'created':1})
      def: tbl = db.table('test1')

    - ot: err("RqlCompileError", "Expected 0 argument(s) but found 1.", [])
      cd:
      - r.db_list(1)

    - ot: err("RqlCompileError", "Expected 1 argument(s) but found 2.", [])
      cd:
      - tbl.zip(1)
      - tbl.distinct(1)
      - tbl.is_empty(1)
      - obj.keys(1)

    - ot:
        js: err("RqlDriverError", "Expected 0 argument(s) but found 1.", [])
        rb: err("RqlCompileError", "Expected 1 argument(s) but found 2.", [])
        py: err("RqlCompileError", "Expected 1 argument(s) but found 2.", [])
      cd:
      - tbl.delete(1)

    - rb: db.table_list(1)
      ot: err("RqlCompileError", "Expected between 0 and 1 arguments but found 2.", [])


    - ot: err("RqlCompileError", "Expected 1 argument(s) but found 0.", [])
      cd:
      - r.db_create()
      - r.db_drop()
      - r.db()

    - cd: r.error()
      ot: err("RqlRuntimeError", "Empty ERROR term outside a default block.", [])

    - cd: r.js()
      ot:
        js: err("RqlDriverError", "Expected 1 argument(s) but found 0.", [])
        rb: err("RqlCompileError", "Expected 1 argument(s) but found 0.", [])
        py: err("RqlCompileError", "Expected 1 argument(s) but found 0.", [])

    - cd: r.expr()
      ot:
        py: err_regex('TypeError', ".*takes at least 1 argument \(0 given\)", [])
        js: err("RqlDriverError", "Expected between 1 and 2 argument(s) but found 0.", [])
        rb: err_regex("ArgumentError", '.*wrong number of arguments \(0 for 1.*\)', [])

    - ot: err("RqlCompileError", "Expected 2 argument(s) but found 1.", [])
      cd:
      - tbl.map()
      - tbl.concat_map()
      - tbl.skip()
      - tbl.limit()
      - array.append()
      - array.prepend()
      - array.difference()
      - array.set_insert()
      - array.set_union()
      - array.set_intersection()
      - array.set_difference()
      - tbl.nth()
      - tbl.for_each()
      - tbl.get()
      - r.expr([]).sample()
      - tbl.indexes_of()
    - ot: err("RqlCompileError", "Expected 1 argument(s) but found 2.", [])
      cd:
      - r.db_create(1,2)
      - r.db_drop(1,2)
      - r.db(1,2)

    - ot:
        js: err("RqlDriverError", "Expected 1 argument(s) but found 0.", [])
        rb: err("RqlCompileError", "Expected 2 argument(s) but found 1.", [])
        py: err("RqlCompileError", "Expected 2 argument(s) but found 1.", [])
      cd:
      - tbl.filter()

    - cd: r.error(1, 2)
      ot: err("RqlCompileError", "Expected between 0 and 1 arguments but found 2.", [])

    - cd:
      - db.table_drop()
      ot: err("RqlRuntimeError", "Expected type DATUM but found DATABASE.", [])


    - cd: db.table_create()
      ot:
        rb: err("RqlRuntimeError", "Expected type DATUM but found DATABASE.", [])
        py: err("RqlRuntimeError", "Expected type DATUM but found DATABASE.", [])
        js: err("RqlDriverError", "Expected 1 argument(s) but found 0.", [])

    - cd: r.js(1,2)
      ot:
        py: err("RqlCompileError", "Expected 1 argument(s) but found 2.", [])
        rb: err("RqlCompileError", "Expected 1 argument(s) but found 2.", [])
        js: err("RqlDriverError", "Expected 1 argument(s) but found 2.", [])

    - ot: err("RqlCompileError", "Expected 2 argument(s) but found 3.", [])
      cd:
      - tbl.map(1,2)
      - tbl.concat_map(1,2)
      - tbl.skip(1,2)
      - tbl.limit(1,2)
      - array.append(1,2)
      - array.prepend(1,2)
      - array.difference([], [])
      - array.set_insert(1,2)
      - array.set_union([1],[2])
      - array.set_intersection([1],[2])
      - array.set_difference([1],[2])
{'fraction_non_alphanumeric': 0.17978510744627685, 'fraction_numerical': 0.023238380809595203, 'mean_word_length': 2.2861247947454846, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5873443', 'n_tokens_mistral': 2990, 'n_tokens_neox': 2751, 'n_words': 710}