Skip to content

Commit

Permalink
Refactor lexer tests (#498)
Browse files Browse the repository at this point in the history
- Refactor the lexer tests to be more readable, abandoning the
  previous string-based summary DSL in favor of a more obvious
  sequence of `TokenKinds` with optional lexemes. The new tests
  also test that token lexemes are correct.

- Move duplicated `unindent` function into a shared crate,
  `test-utilities`. This new versionless dev-dependency will
  prevent publishing to crates.io, at least until rust-lang/cargo/pull/7333
  makes it into stable. If we publish a new version before then,
  test-utilities will need to be published to crates.io, so we can depend
  on it by version.
  • Loading branch information
casey authored Oct 18, 2019
1 parent 750ba6e commit 49ab423
Show file tree
Hide file tree
Showing 11 changed files with 946 additions and 358 deletions.
10 changes: 6 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/target
/.vagrant
/README.html
/tmp
/fuzz/target
/fuzz/corpus
/fuzz/artifacts
/fuzz/corpus
/fuzz/target
/target
/test-utilities/Cargo.lock
/test-utilities/target
/tmp
8 changes: 8 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,9 @@ features = ["termination"]
[dev-dependencies]
executable-path = "1"
pretty_assertions = "0.6"

# Until github.com/rust-lang/cargo/pull/7333 makes it into stable,
# this version-less dev-dependency will interfere with publishing
# to crates.io.
[dev-dependencies.test-utilities]
path = "test-utilities"
Loading

0 comments on commit 49ab423

Please sign in to comment.