JS: move expressions test to box tests
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
var log = ""
|
||||
|
||||
fun printlnLog(message: Any) {
|
||||
log += "$message\n"
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
printlnLog(true.and1(true))
|
||||
|
||||
if (log != "true\n") return "fail: $log"
|
||||
return "OK"
|
||||
}
|
||||
|
||||
fun Boolean.and1(other: Boolean): Boolean {
|
||||
if (other == true) {
|
||||
if (this == true) {
|
||||
return true ;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user