backend: add tests for ===
This commit is contained in:
committed by
SvyatoslavScherbina
parent
5db25a3985
commit
69ee5a619a
@@ -13,6 +13,8 @@ run_test() {
|
||||
void *(*goodbyeString)() = resolve_symbol("kfun:goodbyeString()");
|
||||
int (*eqeqStr)(void *, void *) = resolve_symbol("kfun:eqeqStr(String;String)");
|
||||
|
||||
int (*eqeqeq)(void *, void *) = resolve_symbol("kfun:eqeqeq(Any?;Any?)");
|
||||
|
||||
int (*gtI )(int , int ) = resolve_symbol("kfun:gtI(Int;Int)");
|
||||
int (*ltI )(int , int ) = resolve_symbol("kfun:ltI(Int;Int)");
|
||||
int (*geI )(int , int ) = resolve_symbol("kfun:geI(Int;Int)");
|
||||
@@ -34,6 +36,9 @@ run_test() {
|
||||
|
||||
if (!eqeqStr(helloString(), helloString())) return 1;
|
||||
|
||||
if (!eqeqeq(helloString(), helloString())) return 1;
|
||||
if (eqeqeq(helloString(), goodbyeString())) return 1;
|
||||
|
||||
if (gtI (2 , 3 )) return 1;
|
||||
if (ltI (3 , 2 )) return 1;
|
||||
if (geI (2 , 3 )) return 1;
|
||||
|
||||
@@ -6,6 +6,8 @@ fun eqeqF (a:Float, b:Float ) = a == b
|
||||
fun eqeqD (a:Double, b:Double) = a == b
|
||||
fun eqeqStr(a:String, b:String) = a == b
|
||||
|
||||
fun eqeqeq (a: Any?, b: Any?) = a === b
|
||||
|
||||
fun gtI (a:Int, b:Int ) = a > b
|
||||
fun ltI (a:Int, b:Int ) = a > b
|
||||
fun geI (a:Int, b:Int ) = a >= b
|
||||
|
||||
Reference in New Issue
Block a user