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

Doctests error output is strange (and doesn't match to regex) #1681

Open
TorkelE opened this issue Aug 20, 2021 · 1 comment
Open

Doctests error output is strange (and doesn't match to regex) #1681

TorkelE opened this issue Aug 20, 2021 · 1 comment

Comments

@TorkelE
Copy link

TorkelE commented Aug 20, 2021

Slight continuation from: #1679, but I think the issue is different, so opened a new issue.

Basically, I want to test this code, which yields an error message:

'''jldoctest; filter = r".*"s
[1,2,asf]

# output
'''

by using doctest(MyPackage)
(essentially I am trying to build a regex to catch whenever the code error, or not, and this is some of the early stages with trying to figure out regexes for the doctests)

My hope is that this regex will just accept anything. However, it doesn't seem to be able to match an error. This yields a crash:

┌ Error: doctest failure in ~/.julia/dev/Catalyst/docs/src/tutorials/using_catalyst.md:23-27
│ 
│ ```jldoctest; filter = r".*"s
│ [1,2,asf]
│ 
│ # output
│ 
│ ```
│ 
│ Subexpression:
│ 
│ [1,2,asf]
│ 
│ Evaluated output:
│ 
│ 
│ 
│ Expected output:
│ 
│ 
│ 
│   diff = 
└ @ Documenter.DocTests ~/.julia/packages/Documenter/R2HVS/src/DocTests.jl:385

Basically, the evaluated output of the error seem to be nothing at all. Which doesn't match to the regex? I get similar problem (but with different expected output) if I try some non-empty expected output:

'''jldoctest; filter = r".*"s
[1,2,asf]

# output
3
'''

(just something random, which is not correct)

'''jldoctest; filter = r".*"s
[1,2,asf]

# output
ERROR: UndefVarError: asf not defined
Stacktrace:
 [1] top-level scope
   @ REPL[1]:1
'''

(the error message which the code produces)

@mortenpi
Copy link
Member

I wonder if it is related to #1676?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants