]> gitweb.factorcode.org Git - factor.git/blobdiff - core/generic/single/single-tests.factor
Delete empty unit tests files, remove 1- and 1+, reorder IN: lines in a lot of places...
[factor.git] / core / generic / single / single-tests.factor
index 8245cbe22fad2985147c2609bd10beb275c2ef67..f59268b770312caa7566d8bfe88a4d5adf969753 100644 (file)
@@ -1,10 +1,10 @@
-IN: generic.single.tests
 USING: tools.test math math.functions math.constants generic.standard
 generic.single strings sequences arrays kernel accessors words
 specialized-arrays.double byte-arrays bit-arrays parser namespaces
 make quotations stack-checker vectors growable hashtables sbufs
 prettyprint byte-vectors bit-vectors specialized-vectors.double
-definitions generic sets graphs assocs grouping see ;
+definitions generic sets graphs assocs grouping see eval ;
+IN: generic.single.tests
 
 GENERIC: lo-tag-test ( obj -- obj' )
 
@@ -269,3 +269,14 @@ M: growable call-next-hooker call-next-method "growable " prepend ;
 [ t ] [
     \ + \ nth effective-method nip dup \ nth "default-method" word-prop eq? and
 ] unit-test
+
+[ ] [ "IN: generic.single.tests GENERIC: xyz ( a -- b )" eval( -- ) ] unit-test
+[ ] [ "IN: generic.single.tests MATH: xyz ( a b -- c )" eval( -- ) ] unit-test
+
+[ f ] [ "xyz" "generic.single.tests" lookup pic-def>> ] unit-test
+[ f ] [ "xyz" "generic.single.tests" lookup "decision-tree" word-prop ] unit-test
+
+! Corner case
+[ "IN: generic.single.tests GENERIC# broken-generic# -1 ( a -- b )" eval( -- ) ]
+[ error>> bad-dispatch-position? ]
+must-fail-with