<commit_before>;;;; t.lisp

;;; Testing Part
(in-package #:unset-macro-character.test)

(define-test #:unset-macro-character.current
  (let ((*readtable* #1=(copy-readtable nil)))
    (set-macro-character #\[ (get-macro-character #\( ))
    (unset-macro-character #\[)

    (multiple-value-bind (f nt) (get-macro-character #\[)
      (assert-eql (values nil nil) (values f nt)))))


(define-test unset-macro-character.saved-readtable
  (let ((rt #1=(copy-readtable nil))
        (*readtable* #1#))
    (set-macro-character #\[ (get-macro-character #\( ) nil rt)
    (unset-macro-character #\[ rt)

    (multiple-value-bind (f nt) (get-macro-character #\[ rt)
      (assert-eql (values nil nil) (values f nt)))))


(define-test unset-dispatch-macro-character.current
  (let ((*readtable* #1=(copy-readtable nil)))
    (set-dispatch-macro-character #\# #\%
                                  (get-dispatch-macro-character #\# #\' *readtable*))

    (unset-dispatch-macro-character #\# #\%)

    (assert-eql (get-dispatch-macro-character #\# #\%)
                (get-dispatch-macro-character #\# #\NEWLINE #1#))))


(define-test unset-dispatch-macro-character.saved-readtable
  (let ((*readtable* #1=(copy-readtable nil))
        (rt #1#))
    (set-dispatch-macro-character #\# #\%
                                  (get-dispatch-macro-character #\# #\')
                                  rt)

    (unset-dispatch-macro-character #\# #\% rt)

    (assert-eql (get-dispatch-macro-character #\# #\% rt)
                (get-dispatch-macro-character #\# #\NEWLINE #1#))))


(define-test remove-dispatch-macro-character.current
  (let ((*readtable* #1=(copy-readtable nil)))

    (make-dispatch-macro-character #\$ nil)
    (multiple-value-bind (f nt) (get-macro-character #\$)
      #-clisp (assert-eql (values (get-macro-character #\# #1#) nil)
                          (values f nt))
      #+clisp (assert-eql (values t nil) (values (functionp f) nt))
      )

    (make-dispatch-macro-character #\% t)
    (multiple-value-bind (f nt) (get-macro-character #\%)
      #-clisp (assert-eql (values (get-macro-character #\# #1#) t)
                          (values f nt))
      #+clisp (assert-eql (values t t) (values (functionp f) nt))
      )

    (remove-dispatch-macro-character #\$)
    (remove-dispatch-macro-character #\%)

    (multiple-value-bind (f nt) (get-macro-character #\$)
      (assert-eql (values nil nil) (values f nt)))

    (multiple-value-bind (f nt) (get-macro-character #\%)
      (assert-eql (values nil nil) (values f nt)))))

(define-test remove-dispatch-macro-character.saved-readtable
  (let ((rt #1=(copy-readtable nil)))

    (make-dispatch-macro-character #\$ nil rt)

    (multiple-value-bind (f nt) (get-macro-character #\$ rt)
      #-clisp (assert-eql (values (get-macro-character #\# #1#) nil)
                          (values f nt))
      #+clisp (assert-eql (values t nil) (values (functionp f) nt))
      )


    (make-dispatch-macro-character #\% t rt)

    (multiple-value-bind (f nt) (get-macro-character #\% rt)
      #-clisp (assert-eql (values (get-macro-character #\# #1#) t)
                          (values f nt))
      #+clisp (assert-eql (values t t) (values (functionp f) nt))
      )5

    (remove-dispatch-macro-character #\$ rt)
    (remove-dispatch-macro-character #\% rt)

    (multiple-value-bind (f nt)  (get-macro-character #\$ rt)
      (assert-eql (values nil nil) (values f nt)))

    (multiple-value-bind (f nt)  (get-macro-character #\% rt)
      (assert-eql (values nil nil) (values f nt)))))
<commit_msg>a few change.<commit_after>;;;; t.lisp

;;; Testing Part
(in-package #:unset-macro-character.test)

(define-test #:unset-macro-character.current
  (let ((*readtable* #1=(copy-readtable nil)))
    (set-macro-character #\[ (get-macro-character #\( ))
    (unset-macro-character #\[)

    (multiple-value-bind (f nt) (get-macro-character #\[)
      (assert-eql (values nil nil) (values f nt)))))


(define-test #:unset-macro-character.saved-readtable
  (let ((rt #1=(copy-readtable nil))
        (*readtable* #1#))
    (set-macro-character #\[ (get-macro-character #\( ) nil rt)
    (unset-macro-character #\[ rt)

    (multiple-value-bind (f nt) (get-macro-character #\[ rt)
      (assert-eql (values nil nil) (values f nt)))))


(define-test #:unset-dispatch-macro-character.current
  (let ((*readtable* #1=(copy-readtable nil)))
    (set-dispatch-macro-character #\# #\%
                                  (get-dispatch-macro-character #\# #\' *readtable*))

    (unset-dispatch-macro-character #\# #\%)

    (assert-eql (get-dispatch-macro-character #\# #\%)
                (get-dispatch-macro-character #\# #\NEWLINE #1#))))


(define-test #:unset-dispatch-macro-character.saved-readtable
  (let ((*readtable* #1=(copy-readtable nil))
        (rt #1#))
    (set-dispatch-macro-character #\# #\%
                                  (get-dispatch-macro-character #\# #\')
                                  rt)

    (unset-dispatch-macro-character #\# #\% rt)

    (assert-eql (get-dispatch-macro-character #\# #\% rt)
                (get-dispatch-macro-character #\# #\NEWLINE #1#))))


(define-test #:remove-dispatch-macro-character.current
  (let ((*readtable* #1=(copy-readtable nil)))

    (make-dispatch-macro-character #\$ nil)
    (multiple-value-bind (f nt) (get-macro-character #\$)
      #+(or sbcl cmu ccl)
      (assert-eql (values (get-macro-character #\# #1#) nil)
                  (values f nt))
      #+clisp
      (assert-eql (values t nil) (values (functionp f) nt))
      )

    (make-dispatch-macro-character #\% t)
    (multiple-value-bind (f nt) (get-macro-character #\%)
      #+(or sbcl cmu ccl)
      (assert-eql (values (get-macro-character #\# #1#) t)
                  (values f nt))
      #+clisp
      (assert-eql (values t t) (values (functionp f) nt))
      )

    (remove-dispatch-macro-character #\$)
    (remove-dispatch-macro-character #\%)

    (multiple-value-bind (f nt) (get-macro-character #\$)
      (assert-eql (values nil nil) (values f nt)))

    (multiple-value-bind (f nt) (get-macro-character #\%)
      (assert-eql (values nil nil) (values f nt)))))

(define-test #:remove-dispatch-macro-character.saved-readtable
  (let ((rt #1=(copy-readtable nil)))

    (make-dispatch-macro-character #\$ nil rt)

    (multiple-value-bind (f nt) (get-macro-character #\$ rt)
      #+(or sbcl cmu ccl)
      (assert-eql (values (get-macro-character #\# #1#) nil)
                  (values f nt))
      #+clisp
      (assert-eql (values t nil) (values (functionp f) nt))
      )


    (make-dispatch-macro-character #\% t rt)

    (multiple-value-bind (f nt) (get-macro-character #\% rt)
      #+(or sbcl cmu ccl)
      (assert-eql (values (get-macro-character #\# #1#) t)
                  (values f nt))
      #+clisp (assert-eql (values t t) (values (functionp f) nt))
      )

    (remove-dispatch-macro-character #\$ rt)
    (remove-dispatch-macro-character #\% rt)

    (multiple-value-bind (f nt)  (get-macro-character #\$ rt)
      (assert-eql (values nil nil) (values f nt)))

    (multiple-value-bind (f nt)  (get-macro-character #\% rt)
      (assert-eql (values nil nil) (values f nt)))))

{'fraction_non_alphanumeric': 0.1864500902401777, 'fraction_numerical': 0.004026100236012772, 'mean_word_length': 2.4109848484848486, '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': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2902400', 'n_tokens_mistral': 2675, 'n_tokens_neox': 2433, 'n_words': 515}