-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix parser * Add test for REPL `?<command>` help syntax
- Loading branch information
1 parent
484deaf
commit f4d0411
Showing
2 changed files
with
21 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,6 +72,10 @@ temp_pkg_dir() do project_path | |
end | ||
|
||
@testset "tokens" begin | ||
statement = Pkg.REPLMode.parse("?dev")[1] | ||
@test statement.command.kind == Pkg.REPLMode.CMD_HELP | ||
@test length(statement.arguments) == 1 | ||
@test statement.arguments[1] == "dev" | ||
statement = Pkg.REPLMode.parse("add [email protected]:JuliaLang/Example.jl.git")[1] | ||
@test "add" in statement.command.names | ||
@test statement.arguments[1] == "[email protected]:JuliaLang/Example.jl.git" | ||
|
@@ -844,11 +848,9 @@ end | |
@test qwords[1].isquoted | ||
@test qwords[1].word == "Don't" | ||
@test !qwords[2].isquoted | ||
@test qwords[2].word == "forget" | ||
@test !qwords[3].isquoted | ||
@test qwords[3].word == "to" | ||
@test qwords[4].isquoted | ||
@test qwords[4].word == "\"test\"" | ||
@test qwords[2].word == " forget to " | ||
@test qwords[3].isquoted | ||
@test qwords[3].word == "\"test\"" | ||
@test_throws CommandError Pkg.REPLMode.parse_quotes("Don't") | ||
@test_throws CommandError Pkg.REPLMode.parse_quotes("Unterminated \"quot") | ||
end | ||
|