-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b2bd98d
commit 0163e07
Showing
1 changed file
with
17 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,23 @@ | ||
// TODO(@ethandavidson): test `is` method | ||
// TODO(@ethandavidson): test `getKindOf` method | ||
// TODO(@ethandavidson): test `toString` method | ||
// TODO(@ethandavidson): test `value` method | ||
|
||
import { assertEquals } from "../../deps/std/testing.ts"; | ||
import { assert, assertEquals } from "../../deps/std/testing.ts"; | ||
import { Token } from "./token.ts"; | ||
import { Lexicon } from "./lexicon.ts"; | ||
|
||
Deno.test("creates a token with an empty string without crashing", () => { | ||
assertEquals(new Token("").kind, Lexicon.Unknown); | ||
}); | ||
|
||
Deno.test("tokens can be accurately classified", () => { | ||
assert(new Token("").is(Lexicon.Unknown)); | ||
}); | ||
|
||
Deno.test("raw strings can be accurately classified as a kind of token", () => { | ||
assertEquals(Token.getKindOf(""), Lexicon.Unknown); | ||
}); | ||
|
||
Deno.test("inherits the value of a token from its raw value", () => { | ||
assertEquals(new Token("type").value, "type"); | ||
}); | ||
|
||
Deno.test("tokens are stringified based on their computed value property", () => { | ||
assertEquals(new Token("type").toString(), "type"); | ||
}); |
0163e07
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failed to deploy: