Skip to content

Commit

Permalink
chore: add test data
Browse files Browse the repository at this point in the history
  • Loading branch information
xxrjun committed Dec 28, 2023
1 parent 4c4a609 commit 5e51e20
Show file tree
Hide file tree
Showing 24 changed files with 175 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/hidden_test_data_2021/01_1_hidden.lsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
(-)

2 changes: 2 additions & 0 deletions tests/hidden_test_data_2021/01_2_hidden.lsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
(- (/ 8 4) +)

5 changes: 5 additions & 0 deletions tests/hidden_test_data_2021/02_1_hidden.lsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(print-num 4)
(print-num 3)
(print-num 2)
(print-num 1)

4 changes: 4 additions & 0 deletions tests/hidden_test_data_2021/02_2_hidden.lsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(print-num 654)
(print-num 0)
(print-num -321)

11 changes: 11 additions & 0 deletions tests/hidden_test_data_2021/03_1_hidden.lsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
(* 9 3 1)
(+ 3 2 1)

(print-num (+ 6 (+ 5 1 2) (* 9 1 5) (/ 9 2) (mod 15 11)))

(print-num (mod 13 10))

(print-num (- (+ 6 1) 7))

(print-num -520)

8 changes: 8 additions & 0 deletions tests/hidden_test_data_2021/03_2_hidden.lsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(print-num (mod 23 (+ 15 5)))

(print-num (* (/ 2 3) 7))

(print-num (- (+ 3 5 2 (- 1 6) 3 (/ 1 2) (mod 3 5))
5))


12 changes: 12 additions & 0 deletions tests/hidden_test_data_2021/04_1_hidden.lsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
(print-bool #f)
(print-bool #t)

(print-bool (or #f #f))
(print-bool (or #t #f))

(print-bool (not #f))
(print-bool (not #t))

(print-bool (and #t #t))
(print-bool (and #t #f))

4 changes: 4 additions & 0 deletions tests/hidden_test_data_2021/04_2_hidden.lsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(print-bool (or #t (and #t #f) (not #t)))
(print-bool (and #t (not #t) (or #t #f) (and #f (not #f))))
(print-bool (or #f #f #t))

4 changes: 4 additions & 0 deletions tests/hidden_test_data_2021/05_1_hidden.lsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(print-num (if #t 2 1))

(print-num (if #f 2 1))

6 changes: 6 additions & 0 deletions tests/hidden_test_data_2021/05_2_hidden.lsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(print-num (if (> 1 2) (+ 5 6 7) (* 6 7 8 9 10)))

(print-num (if (= 6 (* 3 2))
(if #f 1 2)
0))

8 changes: 8 additions & 0 deletions tests/hidden_test_data_2021/06_1_hidden.lsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(define x 8)

(print-num x)

(define y (- 3 2))

(print-num y)

6 changes: 6 additions & 0 deletions tests/hidden_test_data_2021/06_2_hidden.lsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(define x (+ 20 -6 -1 -3))

(define y (/ 8 2))

(print-num (- x y))

6 changes: 6 additions & 0 deletions tests/hidden_test_data_2021/07_1_hidden.lsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(print-num
((fun (num) (- num 1)) 3))

(print-num
((fun (x y) (- x y)) 3 2))

8 changes: 8 additions & 0 deletions tests/hidden_test_data_2021/07_2_hidden.lsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(define a 10)

(print-num
((fun (a b c) (- a (/ b c))) 2 20 10))


(print-num a)

5 changes: 5 additions & 0 deletions tests/hidden_test_data_2021/08_1_hidden.lsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(define bar
(fun (x y z) (+ x y (/ y z))))

(print-num (bar 10 9 8))

6 changes: 6 additions & 0 deletions tests/hidden_test_data_2021/08_2_hidden.lsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(define foo (fun (y) (+ y 1)))

(define foo-z (fun () 5))

(print-num (foo (foo-z)))

20 changes: 20 additions & 0 deletions tests/hidden_test_data_2021/b1_1_hidden.lsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
(define fact
(fun (n) (if (< n 3) n
(* n (fact (- n 1))))))

(print-num (fact 11))
(print-num (fact 12))
(print-num (fact 13))
(print-num (fact 14))

(define fib (fun (x)
(if (< x 2) x (+
(fib (- x 1))
(fib (- x 2))))))

(print-num (fib 2))
(print-num (fib 4))
(print-num (fib 6))
(print-num (fib 11))
(print-num (fib 21))

20 changes: 20 additions & 0 deletions tests/hidden_test_data_2021/b1_2_hidden.lsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
(define min
(fun (a b)
(if (< a b) a b)))

(define max
(fun (a b)
(if (> a b) a b)))

(define gcd
(fun (a b)
(if (= 0 (mod (max a b) (min a b)))
(min a b)
(gcd (min a b) (mod (max a b) (min a b))))))

(print-num (gcd 15 35))

(print-num (gcd 448 189))

(print-num (gcd 330 715))

2 changes: 2 additions & 0 deletions tests/hidden_test_data_2021/b2_1_hidden.lsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
(+ 3 2 1 (or #f #t))

6 changes: 6 additions & 0 deletions tests/hidden_test_data_2021/b2_2_hidden.lsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(define foo
(fun (num)
(if (> num 1) 1 (= num 1))))

(print-num (* 8 (foo 1)))

7 changes: 7 additions & 0 deletions tests/hidden_test_data_2021/no_answer_yet/b3_1_hidden.lsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(define dist-square
(fun (x y)
(define square (fun (x) (* x x)))
(+ (square x) (square y))))

(print-num (dist-square 6 10))

10 changes: 10 additions & 0 deletions tests/hidden_test_data_2021/no_answer_yet/b3_2_hidden.lsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
(define diff
(fun (a b)
(define abs
(fun (a)
(if (< a 0) (- 0 a) a)))
(abs (- a b))))

(print-num (diff 0 5))
(print-num (diff 5 0))

7 changes: 7 additions & 0 deletions tests/hidden_test_data_2021/no_answer_yet/b4_1_hidden.lsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(define add-x
(fun (x) (fun (y) (+ x y))))

(define z (add-x 10))

(print-num (z 5))

6 changes: 6 additions & 0 deletions tests/hidden_test_data_2021/no_answer_yet/b4_2_hidden.lsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(define foo
(fun (f x) (f x)))

(print-num
(foo (fun (x) (- x 1)) 11))

0 comments on commit 5e51e20

Please sign in to comment.