<commit_before>package net.sandius.rembulan.test

object MathFragments extends FragmentBundle with FragmentExpectations with OneLiners {

  in (MathContext) {

    about ("random") {
      program ("math.random(0)") failsWith (classOf[IllegalArgumentException], "bad argument #1 to 'random' (interval is empty)")
      program ("math.random(1, 0)") failsWith (classOf[IllegalArgumentException], "bad argument #1 to 'random' (interval is empty)")

      program ("return math.random(0, 0)") succeedsWith (0)

      program ("return math.random(-10000000000000000000, 10000000000000000000)") failsWith (classOf[IllegalArgumentException], "bad argument #1 to 'random' (interval is empty)")

      program ("math.random(1 << 63, (1 << 63) - 1)") failsWith (classOf[IllegalArgumentException], "bad argument #1 to 'random' (interval too large)")
    }
<commit_msg>Correcting the expected error message.<commit_after>package net.sandius.rembulan.test

object MathFragments extends FragmentBundle with FragmentExpectations with OneLiners {

  in (MathContext) {

    about ("random") {
      program ("math.random(0)") failsWith (classOf[IllegalArgumentException], "bad argument #1 to 'random' (interval is empty)")
      program ("math.random(1, 0)") failsWith (classOf[IllegalArgumentException], "bad argument #1 to 'random' (interval is empty)")

      program ("return math.random(0, 0)") succeedsWith (0)

      program ("return math.random(-10000000000000000000, 10000000000000000000)") failsWith (classOf[IllegalArgumentException], "bad argument #1 to 'random' (number has no integer representation)")

      program ("math.random(1 << 63, (1 << 63) - 1)") failsWith (classOf[IllegalArgumentException], "bad argument #1 to 'random' (interval too large)")
    }

{'fraction_non_alphanumeric': 0.12897727272727272, 'fraction_numerical': 0.06477272727272727, 'mean_word_length': 5.200704225352113, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, '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': '7489961', 'n_tokens_mistral': 595, 'n_tokens_neox': 487, 'n_words': 156}