<commit_before>(##spheres-load energy: testing)

(##spheres-load algorithm/list-extra)<commit_msg>Added tests for last 3 functions in list-extra<commit_after>(%load-library '(spheres/util test))

(%load-library '(spheres/algorithm list-extra))

(test-begin "list-extra" 10)


(define letters '(a b c d e f g h i))

(test-equal "list-ref-right"
            (list-ref-right 0 letters)
            'i)

(test-equal "list-ref-right"
            (list-ref-right 1 letters)
            'h)

(test-equal "rotate-left 1"
            (rotate-left 0 letters)
            letters)

(test-equal "rotate-left 2"
            (rotate-left 2 letters)
            '(c d e f g h i a b))

(test-equal "rotate-left 3"
            (rotate-left (length letters) letters)
            letters)

(test-equal "rotate-left 4"
            (rotate-left (+ (length letters) 4) letters)
            (rotate-left 4 letters))

(test-equal "rotate-right 1"
            (rotate-right 0 letters)
            letters)

(test-equal "rotate-right 2"
            (rotate-right 2 letters)
            '(h i a b c d e f g))

(test-equal "rotate-right 3"
            (rotate-right (length letters) letters)
            letters)

(test-equal "rotate-right 4"
            (rotate-right (+ (length letters) 4) letters)
            (rotate-right 4 letters))

(test-end)
{'fraction_non_alphanumeric': 0.1308623298033283, 'fraction_numerical': 0.01588502269288956, 'mean_word_length': 2.0554272517321017, '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': '4502473', 'n_tokens_mistral': 446, 'n_tokens_neox': 412, 'n_words': 126}