Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add checker error/warning test
  • Loading branch information
spytheman committed May 9, 2022
commit 3f3733f064418405ad3b6d99ab13981d9bd97ee3
14 changes: 14 additions & 0 deletions vlib/v/checker/tests/compile_error.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
vlib/v/checker/tests/compile_error.vv:4:5: error: Only Serenity is supported
2 |
3 | $if !serenity {
4 | $compile_error('Only Serenity is supported')
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 | }
6 |
vlib/v/checker/tests/compile_error.vv:8:5: error: On non Vinix this warning should be shown
6 |
7 | $if !vinix {
8 | $compile_warn('On non Vinix this warning should be shown')
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9 | }
10 |
15 changes: 15 additions & 0 deletions vlib/v/checker/tests/compile_error.vv
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module main

$if !serenity {
$compile_error('Only Serenity is supported')
}

$if !vinix {
$compile_warn('On non Vinix this warning should be shown')
}

fn main() {
println('Hello from Serenity')
}