Skip to content

Commit

Permalink
Add some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mtzguido committed Oct 15, 2024
1 parent bd47670 commit 1fd7fea
Show file tree
Hide file tree
Showing 10 changed files with 101 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/bug-reports/Bug3232a.fst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module Bug3232a

inline_for_extraction noextract
val f (x:int) : unit

noextract inline_for_extraction
let f x = ()
8 changes: 8 additions & 0 deletions tests/error-messages/Bug3232b.fst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module Bug3232b

inline_for_extraction
val f (x:int) : unit

[@@expect_failure]
noextract inline_for_extraction
let f x = ()
16 changes: 16 additions & 0 deletions tests/error-messages/Bug3232b.fst.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
>> Got issues: [
* Error 93 at Bug3232b.fst(8,0-8,12):
- Inconsistent qualifier annotations on Bug3232b.f
- Expected '[inline_for_extraction]' got '[noextract, inline_for_extraction]'
- Only in definition: '[noextract]'

>>]
* Warning 240 at Bug3232b.fst(4,4-4,5):
- Bug3232b.f is declared but no definition was found
- Add an 'assume' if this is intentional

* Warning 240 at Bug3232b.fst(8,0-8,12):
- Missing definitions in module Bug3232b: f

Verified module: Bug3232b
All verification conditions discharged successfully
7 changes: 7 additions & 0 deletions tests/error-messages/Bug3232b.fst.json_expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
>> Got issues: [
{"msg":["Inconsistent qualifier annotations on\nBug3232b.f","Expected '[inline_for_extraction]'\ngot '[noextract, inline_for_extraction]'","","Only in definition: '[noextract]'"],"level":"Error","range":{"def":{"file_name":"Bug3232b.fst","start_pos":{"line":8,"col":0},"end_pos":{"line":8,"col":12}},"use":{"file_name":"Bug3232b.fst","start_pos":{"line":8,"col":0},"end_pos":{"line":8,"col":12}}},"number":93,"ctx":["While typechecking the top-level declaration `let f`","While typechecking the top-level declaration `[@@expect_failure] let f`"]}
>>]
{"msg":["Bug3232b.f\nis declared but no definition was found","Add an 'assume' if this is intentional"],"level":"Warning","range":{"def":{"file_name":"Bug3232b.fst","start_pos":{"line":4,"col":4},"end_pos":{"line":4,"col":5}},"use":{"file_name":"Bug3232b.fst","start_pos":{"line":4,"col":4},"end_pos":{"line":4,"col":5}}},"number":240,"ctx":["While desugaring module Bug3232b"]}
{"msg":["Missing definitions in module Bug3232b: f"],"level":"Warning","range":{"def":{"file_name":"dummy","start_pos":{"line":0,"col":0},"end_pos":{"line":0,"col":0}},"use":{"file_name":"Bug3232b.fst","start_pos":{"line":8,"col":0},"end_pos":{"line":8,"col":12}}},"number":240,"ctx":[]}
Verified module: Bug3232b
All verification conditions discharged successfully
8 changes: 8 additions & 0 deletions tests/error-messages/Bug3232c.fst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module Bug3232c

inline_for_extraction noextract
val f (x:int) : unit

[@@expect_failure]
noextract
let f x = ()
16 changes: 16 additions & 0 deletions tests/error-messages/Bug3232c.fst.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
>> Got issues: [
* Error 93 at Bug3232c.fst(8,0-8,12):
- Inconsistent qualifier annotations on Bug3232c.f
- Expected '[inline_for_extraction, noextract]' got '[noextract]'
- Only in declaration: '[inline_for_extraction]'

>>]
* Warning 240 at Bug3232c.fst(4,4-4,5):
- Bug3232c.f is declared but no definition was found
- Add an 'assume' if this is intentional

* Warning 240 at Bug3232c.fst(8,0-8,12):
- Missing definitions in module Bug3232c: f

Verified module: Bug3232c
All verification conditions discharged successfully
7 changes: 7 additions & 0 deletions tests/error-messages/Bug3232c.fst.json_expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
>> Got issues: [
{"msg":["Inconsistent qualifier annotations on\nBug3232c.f","Expected '[inline_for_extraction, noextract]'\ngot '[noextract]'","Only in declaration: '[inline_for_extraction]'",""],"level":"Error","range":{"def":{"file_name":"Bug3232c.fst","start_pos":{"line":8,"col":0},"end_pos":{"line":8,"col":12}},"use":{"file_name":"Bug3232c.fst","start_pos":{"line":8,"col":0},"end_pos":{"line":8,"col":12}}},"number":93,"ctx":["While typechecking the top-level declaration `let f`","While typechecking the top-level declaration `[@@expect_failure] let f`"]}
>>]
{"msg":["Bug3232c.f\nis declared but no definition was found","Add an 'assume' if this is intentional"],"level":"Warning","range":{"def":{"file_name":"Bug3232c.fst","start_pos":{"line":4,"col":4},"end_pos":{"line":4,"col":5}},"use":{"file_name":"Bug3232c.fst","start_pos":{"line":4,"col":4},"end_pos":{"line":4,"col":5}}},"number":240,"ctx":["While desugaring module Bug3232c"]}
{"msg":["Missing definitions in module Bug3232c: f"],"level":"Warning","range":{"def":{"file_name":"dummy","start_pos":{"line":0,"col":0},"end_pos":{"line":0,"col":0}},"use":{"file_name":"Bug3232c.fst","start_pos":{"line":8,"col":0},"end_pos":{"line":8,"col":12}}},"number":240,"ctx":[]}
Verified module: Bug3232c
All verification conditions discharged successfully
8 changes: 8 additions & 0 deletions tests/error-messages/Bug3232d.fst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module Bug3232d

inline_for_extraction
val f (x:int) : unit

[@@expect_failure]
noextract
let f x = ()
17 changes: 17 additions & 0 deletions tests/error-messages/Bug3232d.fst.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
>> Got issues: [
* Error 93 at Bug3232d.fst(8,0-8,12):
- Inconsistent qualifier annotations on Bug3232d.f
- Expected '[inline_for_extraction]' got '[noextract]'
- Only in declaration: '[inline_for_extraction]'
- Only in definition: '[noextract]'

>>]
* Warning 240 at Bug3232d.fst(4,4-4,5):
- Bug3232d.f is declared but no definition was found
- Add an 'assume' if this is intentional

* Warning 240 at Bug3232d.fst(8,0-8,12):
- Missing definitions in module Bug3232d: f

Verified module: Bug3232d
All verification conditions discharged successfully
7 changes: 7 additions & 0 deletions tests/error-messages/Bug3232d.fst.json_expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
>> Got issues: [
{"msg":["Inconsistent qualifier annotations on\nBug3232d.f","Expected '[inline_for_extraction]'\ngot '[noextract]'","Only in declaration: '[inline_for_extraction]'","Only in definition: '[noextract]'"],"level":"Error","range":{"def":{"file_name":"Bug3232d.fst","start_pos":{"line":8,"col":0},"end_pos":{"line":8,"col":12}},"use":{"file_name":"Bug3232d.fst","start_pos":{"line":8,"col":0},"end_pos":{"line":8,"col":12}}},"number":93,"ctx":["While typechecking the top-level declaration `let f`","While typechecking the top-level declaration `[@@expect_failure] let f`"]}
>>]
{"msg":["Bug3232d.f\nis declared but no definition was found","Add an 'assume' if this is intentional"],"level":"Warning","range":{"def":{"file_name":"Bug3232d.fst","start_pos":{"line":4,"col":4},"end_pos":{"line":4,"col":5}},"use":{"file_name":"Bug3232d.fst","start_pos":{"line":4,"col":4},"end_pos":{"line":4,"col":5}}},"number":240,"ctx":["While desugaring module Bug3232d"]}
{"msg":["Missing definitions in module Bug3232d: f"],"level":"Warning","range":{"def":{"file_name":"dummy","start_pos":{"line":0,"col":0},"end_pos":{"line":0,"col":0}},"use":{"file_name":"Bug3232d.fst","start_pos":{"line":8,"col":0},"end_pos":{"line":8,"col":12}}},"number":240,"ctx":[]}
Verified module: Bug3232d
All verification conditions discharged successfully

0 comments on commit 1fd7fea

Please sign in to comment.