<commit_before>;;;
;;; Tests for define-record-type 
;;;

(include "expect.scm")

(define-record-type <point-3d>
  (point-3d x y z)
  point-3d?
  (x get-x)
  (y get-y set-y!)
  (z get-z))

(define point (point-3d 2 4 8))

(expect-true "A record should be a record"
             (lambda () (record? point)))

(expect-true "A point record should be a point"
             (lambda () (point-3d? point)))

(expect-false "A record should not be a vector"
              (lambda () (vector? point)))


(expect "A record accessor should retrieve the value of it's field"
        (lambda () (list (get-x point)
                         (get-y point)
                         (get-z point)))
        '(2 4 8))

(expect "A record setter should update the value of it's field"
        (lambda ()
          (set-y! point 64)

          (list (get-x point)
                (get-y point)
                (get-z point)))
        '(2 4 8))
<commit_msg>Fix test_define_record.<commit_after>;;;
;;; Tests for define-record-type 
;;;

(include "expect.scm")

(define-record-type <point-3d>
  (point-3d x y z)
  point-3d?
  (x get-x)
  (y get-y set-y!)
  (z get-z))

(define point (point-3d 2 4 8))

(expect-true "A record should be a record"
             (lambda () (record? point)))

(expect-true "A point record should be a point"
             (lambda () (point-3d? point)))

(expect-false "A record should not be a vector"
              (lambda () (vector? point)))


(expect "A record accessor should retrieve the value of it's field"
        (lambda () (list (get-x point)
                         (get-y point)
                         (get-z point)))
        '(2 4 8))

(expect "A record setter should update the value of it's field"
        (lambda ()
          (set-y! point 64)

          (list (get-x point)
                (get-y point)
                (get-z point)))
        '(2 64 8))

{'fraction_non_alphanumeric': 0.14316125598722726, 'fraction_numerical': 0.017562533262373604, 'mean_word_length': 1.8270676691729324, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '906871', 'n_tokens_mistral': 653, 'n_tokens_neox': 615, 'n_words': 211}