Skip to content

Commit

Permalink
fill in some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mflatt committed Jan 13, 2024
1 parent a6e45a8 commit 5245dd2
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 1 deletion.
Binary file modified boot/pb/petite.boot
Binary file not shown.
Binary file modified boot/pb/scheme.boot
Binary file not shown.
3 changes: 2 additions & 1 deletion build.zuo
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@

(define (record-build-success token xm m host-scheme host-workarea)
;; record success so boot files will not be rebuilt from pb
(when record-from-pb?
(when (and record-from-pb?
(not (equal? xm "pb")))
(build-boot-target token xm m host-scheme host-workarea void)))

;; used to create a target for "quickboot", or just record dependency for other modes
Expand Down
21 changes: 21 additions & 0 deletions mats/5_6.ms
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,15 @@
(equal? (vector-append '#(a b c) (vector 'p)) '#(a b c p))
(mutable-vector? (vector-append (vector 'p) '#(a b c)))
(mutable-vector? (vector-append '#(a b c) (vector 'p)))
(equal? (vector-append (vector 'p) (make-vector 3 'ok)) '#(p ok ok ok))
(mutable-vector? (vector-append (vector 'p) (make-vector 3 'ok)))
(equal? (vector-append (vector 'p) (make-vector 0 'ok)) '#(p))
(mutable-vector? (vector-append (vector 'p) (make-vector 0 'ok)))
(error? (vector-append 1))
(error? (vector-append '#(a b c) 'x))
(error? (vector-append '#(a b c) '#(d) 'x))
(error? (vector-append '#(a b c) '#(d) '#(e)'x))
(error? (vector-append (vector 'p) (make-vector -1 'ok)))

;; ensure that `vector-append` optimization doesn't misorder
;; evaluation and potential collection with respect to filling
Expand Down Expand Up @@ -277,10 +282,15 @@
(equal? (immutable-vector-append '#(a b c) (vector 'p)) '#(a b c p))
(immutable-vector? (immutable-vector-append (vector 'p) '#(a b c)))
(immutable-vector? (immutable-vector-append '#(a b c) (vector 'p)))
(equal? (immutable-vector-append (vector 'p) (make-vector 3 'ok)) '#(p ok ok ok))
(immutable-vector? (immutable-vector-append (vector 'p) (make-vector 3 'ok)))
(equal? (immutable-vector-append (vector 'p) (make-vector 0 'ok)) '#(p))
(immutable-vector? (immutable-vector-append (vector 'p) (make-vector 0 'ok)))
(error? (immutable-vector-append 1))
(error? (immutable-vector-append '#(a b c) 'x))
(error? (immutable-vector-append '#(a b c) '#(d) 'x))
(error? (immutable-vector-append '#(a b c) '#(d) '#(e)'x))
(error? (immutable-vector-append (vector 'p) (make-vector -1 'ok)))

;; same as mutable-vector test above
(with-interrupts-disabled
Expand Down Expand Up @@ -448,6 +458,17 @@
2)))))
`(lambda (x y) (#3%immutable-vector x y)))

(equivalent-expansion?
(expand/optimize `(lambda (x)
(vector-length (immutable-vector x x x))))
`(lambda (x) 3))
(equivalent-expansion?
(expand/optimize `(lambda (x)
(vector-length (immutable-vector x (#2%printf "hi\n") x))))
`(lambda (x)
(#2%printf "hi\n")
3))

)

(mat vector-fill!
Expand Down
2 changes: 2 additions & 0 deletions mats/root-experr-compile-0-f-f-f
Original file line number Diff line number Diff line change
Expand Up @@ -4303,10 +4303,12 @@ cp0.mo:Expected error in mat expand/optimize-output: "expand/optimize-output: #<
5_6.mo:Expected error in mat vector-append: "vector-append: x is not a vector".
5_6.mo:Expected error in mat vector-append: "vector-append: x is not a vector".
5_6.mo:Expected error in mat vector-append: "vector-append: x is not a vector".
5_6.mo:Expected error in mat vector-append: "make-vector: -1 is not a valid vector length".
5_6.mo:Expected error in mat immutable-vector-append: "immutable-vector-append: 1 is not a vector".
5_6.mo:Expected error in mat immutable-vector-append: "immutable-vector-append: x is not a vector".
5_6.mo:Expected error in mat immutable-vector-append: "immutable-vector-append: x is not a vector".
5_6.mo:Expected error in mat immutable-vector-append: "immutable-vector-append: x is not a vector".
5_6.mo:Expected error in mat immutable-vector-append: "make-vector: -1 is not a valid vector length".
5_6.mo:Expected error in mat vector-fill!: "vector-fill!: #vfx() is not a mutable vector".
5_6.mo:Expected error in mat list->vector: "list->vector: #(a b c) is not a proper list".
5_6.mo:Expected error in mat list->vector: "list->vector: (#\a #\b . #\c) is not a proper list".
Expand Down

0 comments on commit 5245dd2

Please sign in to comment.