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

Add spec #142

Merged
merged 5 commits into from
Aug 20, 2017
Merged

Add spec #142

merged 5 commits into from
Aug 20, 2017

Conversation

marks1024
Copy link
Contributor

@marks1024 marks1024 commented Aug 18, 2017

Since the plan is to refactor the grammar (as discussed in #97) I thought it would be useful to have a spec/test suite. So I added one. This is a minimal working version but should be easily extensible. Spec passes on my machine.

CHANGELOG.md Outdated
@@ -6,6 +6,7 @@
- Several file extensions are interpreted as LaTeX file ([#81](https://github.com/area/language-latex/pull/81), [#82](https://github.com/area/language-latex/pull/82), and
[#126](https://github.com/area/language-latex/pull/126))
- Support for highlighting long lines ([#131](https://github.com/area/language-latex/pull/131))
- Added spec
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this line on top of the file. Your PR will be published in a future release, not in v1.1.0, which is already out. Also please use imperative mood instead of past tense.

tk = grammar.tokenizeLines(s)
expect(tk[0][14].scopes[1]).toBe 'string.other.math.tex'

it "gets the language correct (python)", ->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I'm not so familiar with how to write a spec, I'd like to keep it simple as a starting point at first. Would you please remove this listing section if you don't mind?

@yudai-nkt
Copy link
Collaborator

I really appreciate this because I wanted a spec but don't know how to start as in yudai-nkt/language-tex#7. I have some comments outside the review.

  1. I'm aware that test suites are powerful tools for software development, but I'm afraid I can't relate grammar refactoring (or Splitting grammars into 'repositories' #97) to the usefulness of a spec. Could you explain?

  2. After some investigation on Atom's official language packages, <language-name>-spec.coffee looks like a popular naming convention. So, could you rename the spec to latex-spec.coffee? (this should be a review, but it seems we can't review on file names.)

@marks1024
Copy link
Contributor Author

I made a new commit that I believe addresses all issues.

Regarding point 1. I was looking into the repository feature and it will require some rearrangement to the grammar file, which could easily introduce some bugs. I thought having a spec would give collaborators some confidence that they aren't breaking anything during the refactor. And it will be quicker than checking manually on sample latex files. Although, I'm not sure we can test everything this way, for example snippets.

@yudai-nkt
Copy link
Collaborator

Please resolve conflicts.

@yudai-nkt yudai-nkt merged commit 4419611 into area:master Aug 20, 2017
@yudai-nkt
Copy link
Collaborator

Thanks. will take care of indentation on my end.

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

Successfully merging this pull request may close these issues.

2 participants