-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix #16693: testament spec nimout
too lax
#16698
Changes from 20 commits
de7bef3
89958ad
b9bc7a1
5631705
35f83d4
41b097d
1783ccc
cedfd9f
dc58147
debabf2
0993b55
3cc2311
19761b1
5722b67
3155d9b
6d514bf
9137f92
f69e9e8
ec9c257
b474044
e11cb31
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
discard """ | ||
ccodecheck: "baz" | ||
targets: "c" | ||
ccodecheck: "baz" | ||
""" | ||
|
||
proc foo(): void {.exportc: "bar".}= | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
discard """ | ||
exitcode: 1 | ||
targets: "c" | ||
exitcode: 1 | ||
""" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
discard """ | ||
errormsg: "undeclared identifier: 'undefined'" | ||
file: "notthisfile.nim" | ||
targets: "c" | ||
errormsg: "undeclared identifier: 'undefined'" | ||
file: "notthisfile.nim" | ||
""" | ||
|
||
echo undefined |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
discard """ | ||
maxcodesize: 1 | ||
targets: "c" | ||
maxcodesize: 1 | ||
""" | ||
|
||
echo "Hello World" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
discard """ | ||
output: ''' | ||
done | ||
''' | ||
targets: "c" | ||
output: ''' | ||
done | ||
''' | ||
""" | ||
|
||
echo "broken" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
discard """ | ||
outputsub: "something else" | ||
outputsub: "something else" | ||
targets: "c" | ||
""" | ||
|
||
echo "Hello World!" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
discard """ | ||
timeout: "0.1" | ||
targets: "c" | ||
""" | ||
|
||
import os | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
discard """ | ||
nimout: "Warning: cannot prove that field 'x.s' is accessible [ProveField]" | ||
nimout: "tcheckedfield1.nim(40, 6) Warning: cannot prove that field 'x.s' is accessible [ProveField]" | ||
line:51 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. another bug: if i change this to EDIT: filed #17636 can be fixed in future work There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. where is the logic? Related to my patch? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pre-existing, it's unrelated to your PR, just that i noticed it while reviewing your PR |
||
action: run | ||
output: "abc abc" | ||
|
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,17 @@ | ||||||||
discard """ | ||||||||
matrix: "--hint:processing" | ||||||||
ringabout marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
nimout: ''' | ||||||||
compile start | ||||||||
.. | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shoot, this fails on windows:
(known bug IIRC) given that we already have a similar test in trunner.nim, maybe add refs:
|
||||||||
warn_module.nim(6, 6) Hint: 'test' is declared but not used [XDeclaredButNotUsed] | ||||||||
compile end | ||||||||
''' | ||||||||
""" | ||||||||
|
||||||||
static: | ||||||||
echo "compile start" | ||||||||
|
||||||||
import warn_module | ||||||||
|
||||||||
static: | ||||||||
echo "compile end" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
discard """ | ||
errormsg: "type mismatch: got <int>" | ||
line: 17 | ||
Comment on lines
2
to
3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need those 2 lines, given that we already capture
I'd prefer simplicity here and in other tests; specifying separately line, col, errormsg is more work and nimout already captures what we want to test. Ditto in other examples above, eg, replacing:
by:
and similar examples There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. then I need to change line number which is a huge work can be left in the future PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes can be deferred
no, you could just add empty newlines |
||
nimout: '''type mismatch: got <int> | ||
nimout: '''tprevent_forloopvar_mutations.nim(17, 7) Error: type mismatch: got <int> | ||
but expected one of: | ||
proc inc[T: Ordinal](x: var T; y = 1) | ||
first type mismatch at position: 1 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just use a seq for rhs, it'll be clearer than with rhs.finished + rhsIter() (which complicates readability because of iterator semantics which requires calling iter before finished)