<commit_before>
require 'test/unit'
require 'allens'



class AllensTest < Test::Unit::TestCase
  FUNDAMENTAL_TESTS = [
            :before?,       :meets?,    :overlaps?,
            :starts?,       :during?,   :finishes?,
            :equals?,
            :finishedBy?,   :includes?, :startedBy?,
            :overlappedBy?, :metBy?,    :after?
          ]

  HIGHER_TESTS = [ :aligns?, :occupies?, :fills?, :intersects?, :excludes? ]

  # The patterns are described in test_helper.rb
  # Each pattern pair will satisfy exactly one operator. The pairs of pairs are
  # designed to test Intervals that are both limited and have a 'forever' ends value.
  # The list of numbers shows which of the higher operators should be true for
  # this combo; this list is ignored for testing the fundamental operators.
  #
  VALS = [ [ "x..", "..x", [ 0, 0, 0, 0, 1 ] ], [ "x..", "..X", [ 0, 0, 0, 0, 1 ] ],
           [ "x..", ".xx", [ 0, 0, 0, 0, 1 ] ], [ "x..", ".XX", [ 0, 0, 0, 0, 1 ] ],
           [ "xx.", ".xx", [ 0, 0, 0, 1, 0 ] ], [ "xx.", ".XX", [ 0, 0, 0, 1, 0 ] ],
           [ "x..", "xxx", [ 1, 1, 1, 1, 0 ] ], [ "x..", "XXX", [ 1, 1, 1, 1, 0 ] ],
           [ ".x.", "xxx", [ 0, 1, 1, 1, 0 ] ], [ ".x.", "XXX", [ 0, 1, 1, 1, 0 ] ],
           [ ".xx", "xxx", [ 1, 1, 1, 1, 0 ] ], [ ".XX", "XXX", [ 1, 1, 1, 1, 0 ] ],
           [ "xxx", "xxx", [ 0, 0, 1, 1, 0 ] ], [ "XXX", "XXX", [ 0, 0, 1, 1, 0 ] ],
           [ "xxx", "..x", [ 1, 1, 1, 1, 0 ] ], [ "XXX", "..X", [ 1, 1, 1, 1, 0 ] ],
           [ "xxx", ".x.", [ 0, 1, 1, 1, 0 ] ], [ "XXX", ".x.", [ 0, 1, 1, 1, 0 ] ],
           [ "xxx", "x..", [ 1, 1, 1, 1, 0 ] ], [ "XXX", "x..", [ 1, 1, 1, 1, 0 ] ],
           [ ".xx", "xx.", [ 0, 0, 0, 1, 0 ] ], [ ".XX", "xx.", [ 0, 0, 0, 1, 0 ] ],
           [ ".xx", "x..", [ 0, 0, 0, 0, 1 ] ], [ ".XX", "x..", [ 0, 0, 0, 0, 1 ] ],
           [ "..x", "x..", [ 0, 0, 0, 0, 1 ] ], [ "..X", "x..", [ 0, 0, 0, 0, 1 ] ] ]

  # TODO: checks for class constraints triggering exceptions
  # eg not defining chronon, clocktick, forever
  # also need tests for insensible (ie out of bounds) end values throwing exceptions.

<commit_msg>Fix an anomaly in the symmetry in the table-driven tests for the basic 13 operators.<commit_after>
require 'test/unit'
require 'allens'



class AllensTest < Test::Unit::TestCase
  FUNDAMENTAL_TESTS = [
            :before?,       :meets?,    :overlaps?,
            :starts?,       :during?,   :finishes?,
            :equals?,
            :finishedBy?,   :includes?, :startedBy?,
            :overlappedBy?, :metBy?,    :after?
          ]

  HIGHER_TESTS = [ :aligns?, :occupies?, :fills?, :intersects?, :excludes? ]

  # The patterns are described in test_helper.rb
  # Each pattern pair will satisfy exactly one operator. The pairs of pairs are
  # designed to test Intervals that are both limited and have a 'forever' ends value.
  # The list of numbers shows which of the higher operators should be true for
  # this combo; these extra lists are ignored for testing the fundamental operators.
  #
  VALS = [ [ "x..", "..x", [ 0, 0, 0, 0, 1 ] ], [ "x..", "..X", [ 0, 0, 0, 0, 1 ] ],
           [ "x..", ".xx", [ 0, 0, 0, 0, 1 ] ], [ "x..", ".XX", [ 0, 0, 0, 0, 1 ] ],
           [ "xx.", ".xx", [ 0, 0, 0, 1, 0 ] ], [ "xx.", ".XX", [ 0, 0, 0, 1, 0 ] ],
           [ "x..", "xxx", [ 1, 1, 1, 1, 0 ] ], [ "x..", "XXX", [ 1, 1, 1, 1, 0 ] ],
           [ ".x.", "xxx", [ 0, 1, 1, 1, 0 ] ], [ ".x.", "XXX", [ 0, 1, 1, 1, 0 ] ],
           [ ".xx", "xxx", [ 1, 1, 1, 1, 0 ] ], [ ".XX", "XXX", [ 1, 1, 1, 1, 0 ] ],
           [ "xxx", "xxx", [ 0, 0, 1, 1, 0 ] ], [ "XXX", "XXX", [ 0, 0, 1, 1, 0 ] ],
           [ "xxx", ".xx", [ 1, 1, 1, 1, 0 ] ], [ "XXX", ".XX", [ 1, 1, 1, 1, 0 ] ],
           [ "xxx", ".x.", [ 0, 1, 1, 1, 0 ] ], [ "XXX", ".x.", [ 0, 1, 1, 1, 0 ] ],
           [ "xxx", "x..", [ 1, 1, 1, 1, 0 ] ], [ "XXX", "x..", [ 1, 1, 1, 1, 0 ] ],
           [ ".xx", "xx.", [ 0, 0, 0, 1, 0 ] ], [ ".XX", "xx.", [ 0, 0, 0, 1, 0 ] ],
           [ ".xx", "x..", [ 0, 0, 0, 0, 1 ] ], [ ".XX", "x..", [ 0, 0, 0, 0, 1 ] ],
           [ "..x", "x..", [ 0, 0, 0, 0, 1 ] ], [ "..X", "x..", [ 0, 0, 0, 0, 1 ] ] ]

  # TODO: checks for class constraints triggering exceptions
  # eg not defining chronon, clocktick, forever
  # also need tests for insensible (ie out of bounds) end values throwing exceptions.


{'fraction_non_alphanumeric': 0.2505768343331795, 'fraction_numerical': 0.06045223811721274, 'mean_word_length': 1.9093959731543624, 'pattern_counts': {'":': 0, '<': 5, '<?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': '616062', 'n_tokens_mistral': 1963, 'n_tokens_neox': 1656, 'n_words': 605}