<commit_before>(cl:in-package #:clump-test)

(defun check-parents (tree)
  (unless (null tree)
    (let ((left (clump-binary-tree:left tree))
	  (right (clump-binary-tree:right tree)))
      (unless (null left)
	(assert (eq (clump-binary-tree:parent left) tree))
	(assert (eq (clump-binary-tree:parent right) tree))))))<commit_msg>Before checking parent of right child, check that child is a node.<commit_after>(cl:in-package #:clump-test)

(defun check-parents (tree)
  (unless (null tree)
    (let ((left (clump-binary-tree:left tree))
	  (right (clump-binary-tree:right tree)))
      (unless (null left)
	(assert (eq (clump-binary-tree:parent left) tree)))
      (unless (null right)
	(assert (eq (clump-binary-tree:parent right) tree))))))
{'fraction_non_alphanumeric': 0.16689098250336473, 'fraction_numerical': 0.0, 'mean_word_length': 4.552238805970149, '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': '4190766', 'n_tokens_mistral': 264, 'n_tokens_neox': 256, 'n_words': 69}