|
1135 | 1135 | :: 9 false (check-expect {(+ 1 1)} 2) -> 9 false (check-expect {2} 2)
|
1136 | 1136 | :: 9 false true (check-expect {(+ 2 2)} 4) -> 9 false true (check-expect {4} 4))
|
1137 | 1137 |
|
| 1138 | + ;; check-satisfied is generally skipped |
| 1139 | + ;; UPDATE ME when the stepper supports check-satisfied |
| 1140 | + (t 'check-satisfied-identifier m:upto-int/lam |
| 1141 | + (check-expect 1 (+ 1 1)) (check-satisfied (* 2 2) even?) (check-expect 3 (+ 1 2)) |
| 1142 | + :: (check-expect 1 {(+ 1 1)}) -> (check-expect 1 {2}) |
| 1143 | + :: false (check-expect 3 {(+ 1 2)}) -> false (check-expect 3 {3})) |
| 1144 | + |
| 1145 | + ;; non-identifier predicate in check-satisfied |
| 1146 | + ;; UPDATE ME when the stepper supports check-satisfied |
| 1147 | + (t 'check-satisfied-lambda m:intermediate-lambda/both |
| 1148 | + (check-satisfied (+ 2 3) (lambda (n) (even? (sub1 n)))) (check-expect 3 (+ 1 2)) |
| 1149 | + :: (check-expect 3 {(+ 1 2)}) -> (check-expect 3 {3})) |
| 1150 | + |
| 1151 | + ;; defined function in check-satisfied |
| 1152 | + ;; define/lambda from user code is stepped |
| 1153 | + ;; UPDATE ME when the stepper supports check-satisfied |
| 1154 | + (let* ([defs '(;; add2minus1 is stepped |
| 1155 | + (define (add2minus1 n) (+ 2 n -1)) |
| 1156 | + ;; the (lambda (j) ...) part is also stepped since it has cms |
| 1157 | + (define (curried-mul3 i) (lambda (j) (* 3 i j))))]) |
| 1158 | + (t 'check-satisfied-defined m:intermediate-lambda/both |
| 1159 | + (define (add2minus1 n) (+ 2 n -1)) |
| 1160 | + (define (curried-mul3 i) (lambda (j) (* 3 i j))) |
| 1161 | + (check-satisfied (add2minus1 5) even?) |
| 1162 | + (check-satisfied (curried-mul3 1) procedure?) |
| 1163 | + (check-satisfied (number? ((curried-mul3 2) 3)) boolean?) |
| 1164 | + (check-satisfied (curried-mul3 4) (lambda (f) (= (f 5) 60))) |
| 1165 | + :: ,@defs {(+ 2 5 -1)} -> ,@defs {6} |
| 1166 | + :: ... -> ,@defs {(lambda (j) (* 3 1 j))} |
| 1167 | + :: ... -> ,@defs {(lambda (j) (* 3 2 j))} |
| 1168 | + :: ... -> ,@defs {(* 3 2 3)} |
| 1169 | + :: ,@defs {(* 3 2 3)} -> ,@defs {18} |
| 1170 | + :: ... -> ,@defs {(lambda (j) (* 3 4 j))} ;; (f 5) is inside user code, so it is |
| 1171 | + :: ... -> ,@defs {(* 3 4 5)} ;; stepped through by the stepper; but |
| 1172 | + :: ,@defs {(* 3 4 5)} -> ,@defs {60})) ;; but (= (f 5) 60) is not. |
| 1173 | + |
1138 | 1174 | (t 'check-random m:upto-int/lam
|
1139 | 1175 | (check-random (+ 3 4) (+ 2 5)) (+ 4 5)
|
1140 | 1176 | :: {(+ 4 5)} -> {9}
|
|
0 commit comments