<commit_before>;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;;
;;;; This file is part of Sheeple

;;;; utils.lisp
;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(in-package :sheeple)

(def-suite utils :in sheeple)
(in-suite sheeple)

(test flatten)
(test proper-list-of-length-p)

(test topological-sort)
(test once-only)
(test memq)
(test collect-normal-expander)<commit_msg>Added unit test for #'flatten<commit_after>;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;;
;;;; This file is part of Sheeple

;;;; utils.lisp
;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(in-package :sheeple)

(def-suite utils :in sheeple)
(in-suite sheeple)

(test flatten
  (is (null (flatten ())))
  (is (null (flatten '(() (()) ((()))))))
  (is (equal '(a b c) (flatten '(a b c))))
  (is (equal '(a b c) (flatten '((a b c)))))
  (is (equal '(a b c) (flatten '((a) (b) (c)))))
  (is (equal '(a b c) (flatten '((a . b) . c)))))

(test proper-list-of-length-p)
(test topological-sort)
(test once-only)
(test memq)
(test collect-normal-expander)
{'fraction_non_alphanumeric': 0.3681462140992167, 'fraction_numerical': 0.0, 'mean_word_length': 5.149732620320855, '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': '1951837', 'n_tokens_mistral': 492, 'n_tokens_neox': 433, 'n_words': 109}