]> gitweb.factorcode.org Git - factor.git/commitdiff
Merge branch 'master' of git://factorcode.org/git/factor
authorDoug Coleman <doug.coleman@gmail.com>
Mon, 21 Sep 2009 22:59:48 +0000 (17:59 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Mon, 21 Sep 2009 22:59:48 +0000 (17:59 -0500)
1  2 
core/generic/generic-tests.factor

index ca43cd237267aeefb267fc7c86238defa265242f,e2acbb8fe67b9d6752ad82960f2314eaa3aae776..9d6721c44bbcb4acaf53155c004db281d676c47e
@@@ -2,7 -2,8 +2,7 @@@ USING: accessors alien arrays definitio
  generic.math assocs hashtables io kernel math namespaces parser
  prettyprint sequences strings tools.test vectors words
  quotations classes classes.algebra classes.tuple continuations
 -layouts classes.union sorting compiler.units eval multiline
 -io.streams.string ;
 +layouts classes.union sorting compiler.units eval io.streams.string ;
  IN: generic.tests
  
  GENERIC: foobar ( x -- y )
@@@ -139,20 -140,26 +139,20 @@@ M: f generic-forget-test 
  
  ! erg's regression
  [ ] [
 -    <"
 -    IN: compiler.tests
 +    """IN: compiler.tests
  
      GENERIC: jeah ( a -- b )
      TUPLE: boii ;
      M: boii jeah ;
      GENERIC: jeah* ( a -- b )
 -    M: boii jeah* jeah ;
 -    "> eval( -- )
 +    M: boii jeah* jeah ;""" eval( -- )
  
 -    <"
 -    IN: compiler.tests
 -    FORGET: boii
 -    "> eval( -- )
 +    """IN: compiler.tests
 +    FORGET: boii""" eval( -- )
      
 -    <"
 -    IN: compiler.tests
 +    """IN: compiler.tests
      TUPLE: boii ;
 -    M: boii jeah ;
 -    "> eval( -- )
 +    M: boii jeah ;""" eval( -- )
  ] unit-test
  
  ! call-next-method cache test
@@@ -179,3 -186,20 +179,20 @@@ GENERIC: move-method-generic ( a -- b 
  [ ] [ "IN: generic.tests.a" <string-reader> "move-method-test-1" parse-stream drop ] unit-test
  
  [ { string } ] [ \ move-method-generic order ] unit-test
+ GENERIC: foozul ( a -- b )
+ M: reversed foozul ;
+ M: integer foozul ;
+ M: slice foozul ;
+ [ t ] [
+     reversed \ foozul method-for-class
+     reversed \ foozul method
+     eq?
+ ] unit-test
+ [ t ] [
+     fixnum \ <=> method-for-class
+     real \ <=> method
+     eq?
+ ] unit-test