Added tests for different orders of types in the union for traversal.hl.rkt
This commit is contained in:
parent
3eecf3796e
commit
dd21c82c85
|
@ -14,11 +14,11 @@
|
||||||
(define-fold f₃ t₃ (U (tagged tg [a String] [b Boolean])
|
(define-fold f₃ t₃ (U (tagged tg [a String] [b Boolean])
|
||||||
(tagged tg [a Boolean] [c String]))
|
(tagged tg [a Boolean] [c String]))
|
||||||
String)
|
String)
|
||||||
#;(define-fold f₄ t₄ (U (tagged tg [a String] [b Boolean])
|
(define-fold f₄ t₄ (U (tagged tg [a String] [b Boolean])
|
||||||
String
|
String
|
||||||
(tagged tg [a Boolean] [c String]))
|
(tagged tg [a Boolean] [c String]))
|
||||||
String)
|
String)
|
||||||
#;(define-fold f₄ t₄ (U (tagged t0)
|
(define-fold f₅ t₅ (U (tagged t0)
|
||||||
String
|
String
|
||||||
(tagged tg [a Boolean] [c String]))
|
(tagged tg [a Boolean] [c String]))
|
||||||
String)
|
String)
|
||||||
|
@ -53,7 +53,23 @@
|
||||||
Integer)
|
Integer)
|
||||||
(tagged tg [a #t] [c 'def]) 1)
|
(tagged tg [a #t] [c 'def]) 1)
|
||||||
|
|
||||||
#;(check-equal?-values:
|
(check-equal?-values:
|
||||||
|
((f₄ string? string->symbol+acc) (tagged tg [a "abc"] [b #f]) 0)
|
||||||
|
: (Values (U (tagged tg [a Symbol] [b Boolean])
|
||||||
|
Symbol
|
||||||
|
(tagged tg [a Boolean] [c Symbol]))
|
||||||
|
Integer)
|
||||||
|
(tagged tg [a 'abc] [b #f]) 1)
|
||||||
|
|
||||||
|
(check-equal?-values:
|
||||||
|
((f₄ string? string->symbol+acc) "ghi" 0)
|
||||||
|
: (Values (U (tagged tg [a Symbol] [b Boolean])
|
||||||
|
Symbol
|
||||||
|
(tagged tg [a Boolean] [c Symbol]))
|
||||||
|
Integer)
|
||||||
|
'ghi 1)
|
||||||
|
|
||||||
|
(check-equal?-values:
|
||||||
((f₄ string? string->symbol+acc) (tagged tg [a #t] [c "def"]) 0)
|
((f₄ string? string->symbol+acc) (tagged tg [a #t] [c "def"]) 0)
|
||||||
: (Values (U (tagged tg [a Symbol] [b Boolean])
|
: (Values (U (tagged tg [a Symbol] [b Boolean])
|
||||||
Symbol
|
Symbol
|
||||||
|
@ -61,14 +77,30 @@
|
||||||
Integer)
|
Integer)
|
||||||
(tagged tg [a #t] [c 'def]) 1)
|
(tagged tg [a #t] [c 'def]) 1)
|
||||||
|
|
||||||
#;(check-equal?-values:
|
(check-equal?-values:
|
||||||
((f₄ string? string->symbol+acc) "ghi" 0)
|
((f₅ string? string->symbol+acc) (tagged t0 #:instance) 0)
|
||||||
: (Values (U (tagged tg [a Symbol] [b Boolean])
|
: (Values (U (tagged t0)
|
||||||
|
Symbol
|
||||||
|
(tagged tg [a Boolean] [c Symbol]))
|
||||||
|
Integer)
|
||||||
|
(tagged t0 #:instance) 0)
|
||||||
|
|
||||||
|
(check-equal?-values:
|
||||||
|
((f₅ string? string->symbol+acc) "ghi" 0)
|
||||||
|
: (Values (U (tagged t0)
|
||||||
Symbol
|
Symbol
|
||||||
(tagged tg [a Boolean] [c Symbol]))
|
(tagged tg [a Boolean] [c Symbol]))
|
||||||
Integer)
|
Integer)
|
||||||
'ghi 1)
|
'ghi 1)
|
||||||
|
|
||||||
|
(check-equal?-values:
|
||||||
|
((f₅ string? string->symbol+acc) (tagged tg [a #t] [c "def"]) 0)
|
||||||
|
: (Values (U (tagged t0)
|
||||||
|
Symbol
|
||||||
|
(tagged tg [a Boolean] [c Symbol]))
|
||||||
|
Integer)
|
||||||
|
(tagged tg [a #t] [c 'def]) 1)
|
||||||
|
|
||||||
(check-equal?-values:
|
(check-equal?-values:
|
||||||
((f₆ string? string->symbol+acc) (tagged tg [a "abc"] [b #f]) 0)
|
((f₆ string? string->symbol+acc) (tagged tg [a "abc"] [b #f]) 0)
|
||||||
: (Values (U (tagged tg [a Symbol] [b Boolean])
|
: (Values (U (tagged tg [a Symbol] [b Boolean])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user