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

Tests failing on main with Parsers.jl v2.4.1 #48

Closed
nickrobinson251 opened this issue Oct 12, 2022 · 1 comment
Closed

Tests failing on main with Parsers.jl v2.4.1 #48

nickrobinson251 opened this issue Oct 12, 2022 · 1 comment

Comments

@nickrobinson251
Copy link
Collaborator

As seen on #47 e.g. https://github.com/JuliaStrings/InlineStrings.jl/actions/runs/3237028028/jobs/5304959919

The tests which are failing are

@testset "InlineString parsing" begin
testcases = [
("", InlineString7(""), NamedTuple(), OK | EOF),
(" ", InlineString7(" "), NamedTuple(), OK | EOF),
(" \"", InlineString7(), NamedTuple(), OK | QUOTED | EOF | INVALID_QUOTED_FIELD), # invalid quoted
(" \"\" ", InlineString7(), NamedTuple(), OK | QUOTED | EOF), # quoted
(" \" ", InlineString7(" "), NamedTuple(), OK | QUOTED | INVALID_QUOTED_FIELD | EOF), # invalid quoted
(" \" \" ", InlineString7(" "), NamedTuple(), OK | QUOTED | EOF), # quoted
("NA", InlineString7(), (; sentinel=["NA"]), EOF | SENTINEL), # sentinel
("\"\"", InlineString7(), NamedTuple(), OK | QUOTED | EOF), # same e & cq
("\"\",", InlineString7(), NamedTuple(), OK | QUOTED | EOF | DELIMITED), # same e & cq
("\"\"\"\"", InlineString7("\""), NamedTuple(), OK | QUOTED | ESCAPED_STRING | EOF), # same e & cq
("\"\\", InlineString7(), (; escapechar=UInt8('\\')), OK | QUOTED | INVALID_QUOTED_FIELD | EOF), # \\ e, invalid quoted
("\"\\\"\"", InlineString7("\""), (; escapechar=UInt8('\\')), OK | QUOTED | ESCAPED_STRING | EOF), # \\ e, valid
("\"\"", InlineString7(), (; escapechar=UInt8('\\')), OK | QUOTED | EOF), # diff e & cq
("\"a", InlineString7(), NamedTuple(), OK | QUOTED | INVALID_QUOTED_FIELD | EOF), # invalid quoted
("\"a\"", InlineString7("a"), NamedTuple(), OK | QUOTED | EOF), # quoted
("\"a\" ", InlineString7("a"), NamedTuple(), OK | QUOTED | EOF), # quoted
("\"a\",", InlineString7("a"), NamedTuple(), OK | QUOTED | EOF | DELIMITED), # quoted
("a,", InlineString7("a"), NamedTuple(), OK | EOF | DELIMITED),
("a__", InlineString7("a"), (; delim="__"), OK | EOF | DELIMITED),
("a,", InlineString7("a"), (; ignorerepeated=true), OK | EOF | DELIMITED),
("a__", InlineString7("a"), (; delim="__", ignorerepeated=true), OK | EOF | DELIMITED),
("a\n", InlineString7("a"), (; ignorerepeated=true), OK | NEWLINE | EOF),
("a\r", InlineString7("a"), (; ignorerepeated=true), OK | NEWLINE | EOF),
("a\r\n", InlineString7("a"), (; ignorerepeated=true), OK | NEWLINE | EOF),
("a", InlineString7("a"), (; ignorerepeated=true), OK | EOF),
("a,,\n", InlineString7("a"), (; ignorerepeated=true), OK | DELIMITED | NEWLINE | EOF),
("a\n", InlineString7("a"), (; delim="__", ignorerepeated=true), OK | NEWLINE | EOF),
("a\r", InlineString7("a"), (; delim="__", ignorerepeated=true), OK | NEWLINE | EOF),
("a\r\n", InlineString7("a"), (; delim="__", ignorerepeated=true), OK | NEWLINE | EOF),
("a", InlineString7("a"), (; delim="__", ignorerepeated=true), OK | EOF),
("a____\n", InlineString7("a"), (; delim="__", ignorerepeated=true), OK | DELIMITED | NEWLINE | EOF),
("a\n", InlineString7("a"), NamedTuple(), OK | NEWLINE | EOF),
("a\r", InlineString7("a"), NamedTuple(), OK | NEWLINE | EOF),
("a\r\n", InlineString7("a"), NamedTuple(), OK | NEWLINE | EOF),
("abcdefg", InlineString7("abcdefg"), (; delim=nothing), OK | EOF),
("", InlineString7(), (; sentinel=missing), SENTINEL | EOF),
("{abc } xyz", InlineString7("abc "), (; openquotechar='{', closequotechar='}'), OK | QUOTED | EOF | INVALID_DELIMITER),
]
for (i, case) in enumerate(testcases)
println("testing case = $i")
buf, check, opts, checkcode = case
res = Parsers.xparse(InlineString7, buf; opts...)
@test check === res.val
@test checkcode == res.code
end
res = Parsers.xparse(InlineString1, "")
@test Parsers.overflow(res.code)
res = Parsers.xparse(InlineString1, "ab")
@test Parsers.overflow(res.code)
res = Parsers.xparse(InlineString1, "b")
@test res.val === InlineString("b")

@nickrobinson251
Copy link
Collaborator Author

fixed by #49 + JuliaData/Parsers.jl#136

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

No branches or pull requests

1 participant