TEST: convertion unit tests into run tests
This commit is contained in:
committed by
vvlevchenko
parent
7fd4b4fe34
commit
3fe59cc46c
@@ -1,11 +0,0 @@
|
||||
extern void *resolve_symbol(const char*);
|
||||
|
||||
int
|
||||
run_test() {
|
||||
int (*cycle)(int) = resolve_symbol("kfun:cycle(Int)");
|
||||
|
||||
if (cycle(1) != 2) return 1;
|
||||
if (cycle(0) != 1) return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -5,3 +5,8 @@ fun cycle(cnt: Int): Int {
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
if (cycle(1) != 2) throw Error()
|
||||
if (cycle(0) != 1) throw Error()
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
extern void *resolve_symbol(const char*);
|
||||
|
||||
int
|
||||
run_test() {
|
||||
int (*cycle_do)(int) = resolve_symbol("kfun:cycle_do(Int)");
|
||||
|
||||
if (cycle_do(3) != 5) return 1;
|
||||
if (cycle_do(0) != 3) return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -5,3 +5,8 @@ fun cycle_do(cnt: Int): Int {
|
||||
} while (sum == cnt)
|
||||
return sum
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
if (cycle_do(3) != 5) throw Error()
|
||||
if (cycle_do(0) != 3) throw Error()
|
||||
}
|
||||
Reference in New Issue
Block a user