Skip to content

Commit 949768e

Browse files
committed
Fix output when using builtin assert functions
1 parent 13cf89a commit 949768e

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

autoload/themis/supporter/builtin_assert.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function s:receiver.end_test(report) abort
1616
endif
1717
for error in v:errors
1818
let [throwpoint, exception] = matchlist(error, '\v([^:]+):\s*(.*)')[1 : 2]
19-
call a:report.add_exception(exception, throwpoint)
19+
call a:report.add_exception('themis:report:' . exception, throwpoint)
2020
endfor
2121
let v:errors = []
2222
endfunction

test/supporter/builtin_assert.vimspec

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,20 @@ Describe supporter-builtin_assert
1313
End
1414

1515
It handles assert_true()
16+
let listener = {}
17+
function listener.fail(report) abort
18+
let self.report = a:report
19+
endfunction
20+
call runner.add_event(listener)
21+
1622
function suite.test_assert_true() abort
1723
call assert_true(0)
1824
endfunction
1925
call runner.run(bundle)
26+
2027
Assert Equals(stats.fail(), 1)
28+
let exception = get(listener.report.exceptions, 0, {})
29+
Assert NotEquals(get(exception, 'type', 'error'), 'error')
30+
Assert Match(get(exception, 'message'), '^Expected')
2131
End
2232
End

0 commit comments

Comments
 (0)