diff --git a/tests/lib_knuth_morris_pratt/lib_knuth_morris_pratt.fz b/tests/lib_knuth_morris_pratt/lib_knuth_morris_pratt.fz index 554fe96a4f..f93f8cf01a 100644 --- a/tests/lib_knuth_morris_pratt/lib_knuth_morris_pratt.fz +++ b/tests/lib_knuth_morris_pratt/lib_knuth_morris_pratt.fz @@ -56,17 +56,19 @@ lib_knuth_morris_pratt => test_kmp(n i32) => ("a"*2*n).utf8.find ("a"*n+"b").utf8 + say (test_kmp 1000) len := 250 + if (envir.args.index_of "-benchmark")?? - # for len=250 and interpreter takes ~70s on my machine - brute_force := time.stopwatch (()-> _:= test_brute_force len) - # for len=250 and interpreter takes ~1s on my machine - kmp := time.stopwatch (()-> _:= test_kmp len) + # for len=250 and interpreter takes ~70s on my machine + brute_force := time.stopwatch (()-> _:= test_brute_force len) + # for len=250 and interpreter takes ~1s on my machine + kmp := time.stopwatch (()-> _:= test_kmp len) - # check that kmp is at least four times faster - check (kmp*4 < brute_force) + # check that kmp is at least four times faster + check (kmp*4 < brute_force) functionality diff --git a/tests/lib_knuth_morris_pratt/lib_knuth_morris_pratt.fz.expected_out b/tests/lib_knuth_morris_pratt/lib_knuth_morris_pratt.fz.expected_out index 33a0755763..29d6290f6e 100644 --- a/tests/lib_knuth_morris_pratt/lib_knuth_morris_pratt.fz.expected_out +++ b/tests/lib_knuth_morris_pratt/lib_knuth_morris_pratt.fz.expected_out @@ -7,3 +7,4 @@ 0 --nil-- 0 +--nil--