This commit is contained in:
Timo Westkämper 2010-10-06 20:31:23 +00:00
parent 4adad8aae9
commit 3592b658b0
2 changed files with 16 additions and 4 deletions

View File

@ -89,8 +89,7 @@ class AliasTest {
@Test
def Number_Comparison {
val predicate: Predicate = person.scalaInt lt 5;
assertEquals("person.scalaInt < 5", predicate);
assertEquals("person.scalaInt < 5", person.scalaInt lt 5);
assertEquals("person.javaInt < 5", person.javaInt lt 5);
assertEquals("person.javaInt > 5", person.javaInt gt 5);
assertEquals("person.javaInt <= 5", person.javaInt loe 5);

View File

@ -8,9 +8,17 @@ class ImplicitsTest {
implicit def toStringWrapper(str: String) = new StringWrapper(str);
implicit def toIntWrapper(num: Integer) = new IntegerWrapper(num);
@Test
def test(){
val res1: Predicate = "str" startsWith "other";
def stringValue(){
val res: Predicate = "str" startsWith "other";
}
@Test
def intValue(){
val num: Integer = 1;
val res: Predicate = num < 3;
}
}
@ -21,4 +29,9 @@ class StringWrapper(str: String){
}
class IntegerWrapper(num: Integer){
def <(other: Integer): Predicate = null;
}
trait Predicate