diff options
| author | Daniel Bovensiepen <[email protected]> | 2012-05-16 16:07:55 +0800 |
|---|---|---|
| committer | Daniel Bovensiepen <[email protected]> | 2012-05-16 16:07:55 +0800 |
| commit | 26c6031a53867011eb33b624ed245d5603b778cf (patch) | |
| tree | d9ebdce9f246607409efc65f414704c96fb677d3 /test/t/_assert.rb | |
| parent | dd6af6d2ec17c88c87844e75cd973fb4569c4c88 (diff) | |
| download | mruby-26c6031a53867011eb33b624ed245d5603b778cf.tar.gz mruby-26c6031a53867011eb33b624ed245d5603b778cf.zip | |
Move assert lib for tests one directory up and add it always in the beginning
Diffstat (limited to 'test/t/_assert.rb')
| -rw-r--r-- | test/t/_assert.rb | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/test/t/_assert.rb b/test/t/_assert.rb deleted file mode 100644 index b2ce616e0..000000000 --- a/test/t/_assert.rb +++ /dev/null @@ -1,67 +0,0 @@ -$ok_test = 0 -$ko_test = 0 -$kill_test = 0 -$asserts = [] - -## -# Print the assertion in a readable way -def print_assertion_string(str, iso) - print(str) - if(iso != '') - print(' [') - print(iso) - print(']') - end -end - -## -# Verify a code block. -# -# str : A remark which will be printed in case -# this assertion fails -# iso : The ISO reference code of the feature -# which will be tested by this -# assertion -def assert(str = 'Assertion failed', iso = '') - begin - if(!yield) - $asserts.push([str, iso]) - $ko_test += 1 - print('F') - else - $ok_test += 1 - print('.') - end - rescue - $kill_test += 1 - print('X') - end -end - -## -# Report the test result and print all assertions -# which were reported broken. -def report() - print "\n" - $asserts.each do |str, iso| - print('Fail: '); - print_assertion_string(str, iso) - print("\n") - end - - $total_test = $ok_test.+($ko_test) - print('Total: ') - print($total_test) - print("\n") - - print(' OK: ') - print($ok_test) - print("\n") - print(' KO: ') - print($ko_test) - print("\n") - print(' Crash: ') - print($kill_test) - print("\n") -end - |
