]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/roles/roles-tests.factor
factor: second stab at [ ] [ ] unit-test -> { } [ ] unit-test
[factor.git] / extra / roles / roles-tests.factor
index 67e7f8d991c4b8e9217214688011e5d35c9aeeac..2b6f490ee90d77b27f25f607c6ff8dc42358b033 100644 (file)
@@ -16,27 +16,27 @@ TUPLE: foon <{ utensil fork spoon } ;
 TUPLE: tuning-spork <{ utensil spoon tuning-fork } ;
 
 ! role class testing
-[ t ] [ fork role? ] unit-test
-[ f ] [ foon role? ] unit-test
+{ t } [ fork role? ] unit-test
+{ f } [ foon role? ] unit-test
 
 ! roles aren't tuple classes by themselves and can't be instantiated
-[ f ] [ fork tuple-class? ] unit-test
+{ f } [ fork tuple-class? ] unit-test
 [ fork new ] must-fail
 
 ! tuples which consume roles fall under their class
-[ t ] [ foon new fork? ] unit-test
-[ t ] [ foon new spoon? ] unit-test
-[ f ] [ foon new tuning-fork? ] unit-test
-[ f ] [ foon new instrument? ] unit-test
+{ t } [ foon new fork? ] unit-test
+{ t } [ foon new spoon? ] unit-test
+{ f } [ foon new tuning-fork? ] unit-test
+{ f } [ foon new instrument? ] unit-test
 
-[ t ] [ tuning-spork new fork? ] unit-test
-[ t ] [ tuning-spork new spoon? ] unit-test
-[ t ] [ tuning-spork new tuning-fork? ] unit-test
-[ t ] [ tuning-spork new instrument? ] unit-test
+{ t } [ tuning-spork new fork? ] unit-test
+{ t } [ tuning-spork new spoon? ] unit-test
+{ t } [ tuning-spork new tuning-fork? ] unit-test
+{ t } [ tuning-spork new instrument? ] unit-test
 
 ! consumed role slots are placed in tuples in order
-[ qw{ handle tines bowl } ] [ foon all-slots [ name>> ] map ] unit-test
-[ qw{ handle bowl tines tone volume } ] [ tuning-spork all-slots [ name>> ] map ] unit-test
+{ qw{ handle tines bowl } } [ foon all-slots [ name>> ] map ] unit-test
+{ qw{ handle bowl tines tone volume } } [ tuning-spork all-slots [ name>> ] map ] unit-test
 
 ! can't combine roles whose slots overlap
 ROLE: bong bowl ;
@@ -64,5 +64,5 @@ M: fork poke drop " got poked" append ;
 M: spoon scoop drop " got scooped" append ;
 M: instrument tune drop " got tuned" append ;
 
-[ "potato got poked" "potato got scooped" "potato got tuned" ]
+{ "potato got poked" "potato got scooped" "potato got tuned" }
 [ "potato" tuning-spork new [ poke ] [ scoop ] [ tune ] 2tri ] unit-test