Skip to content

Add test cases from sqlite/test/blob.test #2

Open
@fractaledmind

Description

@fractaledmind

I have extracted test cases from the SQLite test suite for the lexer. I originally wrote them using a basic helper method while I was building the lever. Now, they need to be converted into the MiniTest suite. Add a new describe block to the test/feather/test_lexer.rb file and file the code style already present. Here are the test cases:

# adapted from sqlite/test/blob.test
assert_tokenized_as("X'01020304'", [[:TK_BLOB, "X'01020304'"]])
assert_tokenized_as("x'ABCDEF'", [[:TK_BLOB, "x'ABCDEF'"]])
assert_tokenized_as("x''", [[:TK_BLOB, "x''"]])
assert_tokenized_as("x'abcdEF12'", [[:TK_BLOB, "x'abcdEF12'"]])
assert_tokenized_as("x'0123456789abcdefABCDEF'", [[:TK_BLOB, "x'0123456789abcdefABCDEF'"]])
assert_tokenized_as("X'01020k304'", [[:TK_ILLEGAL, "X'01020k304'"]])
assert_tokenized_as("X'01020, 100", [[:TK_ILLEGAL, "X'01020, 100"]])
assert_tokenized_as("X'01020 100'", [[:TK_ILLEGAL, "X'01020 100'"]])
assert_tokenized_as("X'01001'", [[:TK_ILLEGAL, "X'01001'"]])
assert_tokenized_as("x'012/45'", [[:TK_ILLEGAL, "x'012/45'"]])
assert_tokenized_as("x'012:45'", [[:TK_ILLEGAL, "x'012:45'"]])
assert_tokenized_as("x'012@45'", [[:TK_ILLEGAL, "x'012@45'"]])
assert_tokenized_as("x'012G45'", [[:TK_ILLEGAL, "x'012G45'"]])
assert_tokenized_as("x'012`45'", [[:TK_ILLEGAL, "x'012`45'"]])
assert_tokenized_as("x'012g45'", [[:TK_ILLEGAL, "x'012g45'"]])

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions