Skip to content
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

X_examples.nim generated by runnableExamples should show line number where they came from #8289

Closed
timotheecour opened this issue Jul 12, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@timotheecour
Copy link
Contributor

commented Jul 12, 2018

in some cases (eg times.nim) it can be tricky to find where a failing assert came from in original source code

EDIT
especially given that the compiler does some rewrites in the error msg compared to what was in source code, eg:

here's what I have in runnableExamples:

doAssert joinPath(mypath1, absOverrides = true) == mypath1 & mypath1

here's the error msg:

Error: unhandled exception: joinPath(["foo"], true) == "foofoo" ospaths_examples.nim(38)  [AssertionError]

(happened with:

template mypath1* : auto = "foo"
proc joinPath*(parts: varargs[string], absOverrides: bool): string = 
  runnableExamples:
    doAssert joinPath(mypath1, absOverrides = true) == mypath1 & mypath1
  ...

)

@timotheecour timotheecour referenced this issue Jul 31, 2018

Closed

[WIP] [doc] miscellaneous issues #8477

6 of 21 tasks complete

timotheecour added a commit to timotheecour/Nim that referenced this issue Nov 30, 2018

@timotheecour timotheecour referenced this issue Nov 30, 2018

Merged

fix #8289 #9828

@Araq Araq closed this in #9828 Nov 30, 2018

Araq added a commit that referenced this issue Nov 30, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.