<commit_before>USING: math math.ranges sequences sets tools.test arrays ;
IN: math.ranges.tests

[ { } ] [ 1 1 (a,b) >array ] unit-test
[ { } ] [ 1 1 (a,b] >array ] unit-test
[ { } ] [ 1 1 [a,b) >array ] unit-test
[ { 1 } ] [ 1 1 [a,b] >array ] unit-test

[ { }  ] [ 1 2 (a,b) >array ] unit-test
[ { 2 } ] [ 1 2 (a,b] >array ] unit-test
[ { 1 } ] [ 1 2 [a,b) >array ] unit-test
[ { 1 2 } ] [ 1 2 [a,b] >array ] unit-test

[ { } ] [ 2 1 (a,b) >array ] unit-test
[ { 1 } ] [ 2 1 (a,b] >array ] unit-test
[ { 2 } ] [ 2 1 [a,b) >array ] unit-test
[ { 2 1 } ] [ 2 1 [a,b] >array ] unit-test

[ { 1 2 3 4 5 } ] [ 1 5 1 <range> >array ] unit-test
[ { 5 4 3 2 1 } ] [ 5 1 -1 <range> >array ] unit-test

[ { 0 1/3 2/3 1 } ] [ 0 1 1/3 <range> >array ] unit-test
[ { 0 1/3 2/3 1 } ] [ 1 0 -1/3 <range> >array reverse ] unit-test

[ 100 ] [
    1 100 [a,b] [ 2^ [1,b] ] map members length
] unit-test<commit_msg>math.ranges: Add a bunch more tests for empty ranges.<commit_after>USING: math math.ranges sequences sets tools.test arrays ;
IN: math.ranges.tests

[ { } ] [ 1 1 (a,b) >array ] unit-test
[ { } ] [ 1 1 (a,b] >array ] unit-test
[ { } ] [ 1 1 [a,b) >array ] unit-test
[ { 1 } ] [ 1 1 [a,b] >array ] unit-test

[ { }  ] [ 1 2 (a,b) >array ] unit-test
[ { 2 } ] [ 1 2 (a,b] >array ] unit-test
[ { 1 } ] [ 1 2 [a,b) >array ] unit-test
[ { 1 2 } ] [ 1 2 [a,b] >array ] unit-test

[ { } ] [ 2 1 (a,b) >array ] unit-test
[ { 1 } ] [ 2 1 (a,b] >array ] unit-test
[ { 2 } ] [ 2 1 [a,b) >array ] unit-test
[ { 2 1 } ] [ 2 1 [a,b] >array ] unit-test

[ { 1 2 3 4 5 } ] [ 1 5 1 <range> >array ] unit-test
[ { 5 4 3 2 1 } ] [ 5 1 -1 <range> >array ] unit-test

[ { 0 1/3 2/3 1 } ] [ 0 1 1/3 <range> >array ] unit-test
[ { 0 1/3 2/3 1 } ] [ 1 0 -1/3 <range> >array reverse ] unit-test

{ 0 } [ 0 -1 .0001 <range> length ] unit-test
{ 0 } [ 0 -1 .5 <range> length ] unit-test
{ 0 } [ 0 -1 1 <range> length ] unit-test
{ 0 } [ 0 -1 2 <range> length ] unit-test
{ 0 } [ 0 -1 3 <range> length ] unit-test
{ 0 } [ 0 -1 4 <range> length ] unit-test

{ 0 } [ 0 -2 .0001 <range> length ] unit-test
{ 0 } [ 0 -2 1 <range> length ] unit-test
{ 0 } [ 0 -2 2 <range> length ] unit-test
{ 0 } [ 0 -2 3 <range> length ] unit-test
{ 0 } [ 0 -2 4 <range> length ] unit-test

{ 0 } [ -1 0 -.0001 <range> length ] unit-test
{ 0 } [ -1 0 -.5 <range> length ] unit-test
{ 0 } [ -1 0 -1 <range> length ] unit-test
{ 0 } [ -1 0 -2 <range> length ] unit-test
{ 0 } [ -1 0 -3 <range> length ] unit-test
{ 0 } [ -1 0 -4 <range> length ] unit-test

{ 0 } [ -2 0 -.0001 <range> length ] unit-test
{ 0 } [ -2 0 -1 <range> length ] unit-test
{ 0 } [ -2 0 -2 <range> length ] unit-test
{ 0 } [ -2 0 -3 <range> length ] unit-test
{ 0 } [ -2 0 -4 <range> length ] unit-test

[ 100 ] [
    1 100 [a,b] [ 2^ [1,b] ] map members length
] unit-test
{'fraction_non_alphanumeric': 0.21594565606006436, 'fraction_numerical': 0.09152663568108688, 'mean_word_length': 2.238425925925926, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 65, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3295614', 'n_tokens_mistral': 1432, 'n_tokens_neox': 1228, 'n_words': 423}