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

Valid file with no tests raises a SyntaxError exception immediately after "Starting elm-doctest ..." #9

Closed
sdaves opened this issue Nov 16, 2016 · 4 comments
Labels

Comments

@sdaves
Copy link

sdaves commented Nov 16, 2016

Using:

http://elm-lang.org/examples/random

$ elm-doctest Random.elm
Starting elm-doctest ...

processing: /tmp/Random.elm
undefined:1
> > > > | | > 
^

SyntaxError: Unexpected token > in JSON at position 0
    at Object.parse (native)
    at Array.app.ports.evaluate.subscribe.resource (/home/user/projects/trustedexpert/projects/brokedown-web/node_modules/elm-doctest/src/bridge.js:103:40)
    at Function.onEffects [as func] (/home/user/projects/trustedexpert/projects/brokedown-web/node_modules/elm-doctest/distribution/index.js:3456:12)
    at A3 (/home/user/projects/trustedexpert/projects/brokedown-web/node_modules/elm-doctest/distribution/index.js:98:11)
    at onMessage (/home/user/projects/trustedexpert/projects/brokedown-web/node_modules/elm-doctest/distribution/index.js:3241:12)
    at Object.callback (/home/user/projects/trustedexpert/projects/brokedown-web/node_modules/elm-doctest/distribution/index.js:3283:11)
    at step (/home/user/projects/trustedexpert/projects/brokedown-web/node_modules/elm-doctest/distribution/index.js:2921:32)
    at Timeout.work [as _onTimeout] (/home/user/projects/trustedexpert/projects/brokedown-web/node_modules/elm-doctest/distribution/index.js:2963:15)
    at tryOnTimeout (timers.js:232:11)
    at Timer.listOnTimeout (timers.js:202:5)

Looks like its having an issue parsing the JSON at bridge.js line 103.

@tshm
Copy link
Owner

tshm commented Nov 16, 2016

right now, elm-doctest requires module declaration.
I'll try to address the issue by just adding the dummy line.

@tshm tshm added the bug label Nov 16, 2016
@tshm tshm closed this as completed in 59e64c5 Nov 16, 2016
tshm added a commit that referenced this issue Nov 16, 2016
@sdaves
Copy link
Author

sdaves commented Nov 18, 2016

Nice fix!

However, this example throws the same error:

module DoctestParamError exposing (Msg(Example))
type Msg = Example

I think it is failing on the open parentheses after Msg.

@tshm
Copy link
Owner

tshm commented Nov 18, 2016

parser for module declaration fails for the case. Reopening it.

@tshm tshm reopened this Nov 18, 2016
@tshm tshm closed this as completed in 2d56122 Nov 18, 2016
@sdaves
Copy link
Author

sdaves commented Nov 18, 2016

Thanks!

On November 18, 2016 11:35:29 AM EST, tosh shimayama notifications@github.com wrote:

Closed #9 via 2d56122.

You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#9 (comment)

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

No branches or pull requests

2 participants