-
Notifications
You must be signed in to change notification settings - Fork 48
Conversation
The value and scope checks can be combined into a single line like so: For tests that involve quotes, you can switch the containing quotes so that you don't need to escape anything. For example: |
I've updated my branch to incorporate your suggestions. It's definitely more readable now. If there's any other adjustments you'd like I'd be happy to make them. |
I've rebased my branch onto the current master. |
{tokens} = grammar.tokenizeLine " \n" | ||
expect(tokens[0]).toEqual value: " \n", scopes: ["source.clojure", "invalid.trailing-whitespace"] | ||
|
||
# TODO: Test 'after' tokens? |
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.
Is this something you want to finish in this PR?
Ah, yeah. I wasn't sure if it was worth testing the trailing whitespace tokens since they didn't necessarily have the same scopes across the different meta groups (and therefore didn't fit well into my generic function). I'll leave it up to you whether I should (1) delete the todo and not worry about the after tokens, (2) add some testing of the tokens, or (3) do something else. Let me know and I can make the change. |
Sorry for the delay in replying. Some specs are better than no specs, so let's remove the TODO for now and return to it later if necessary. |
No worries! I've removed the TODO and squashed my commits. |
Thanks for this! |
Add some basic specs for the grammar
I wrote some basic specs to serve as a sanity check for any grammar tweaks. All of these specs pass against the current version of the grammar. (Note that this pull request does not include specs for #39. My intention is to add specs for #39 on top of these baseline specs.)
I've actually never written CoffeeScript before and just relied on the example specs mentioned in #38 as reference. If anything looks wrong or improper let me know and I can make the necessary changes.