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

Fix test fixture for the multi range example #352

Merged
merged 1 commit into from
Oct 1, 2019

Conversation

honzajavorek
Copy link
Contributor

Context is explained in #348. The example used for testing multiple-ranged souce maps for annotation stopped to produce multiple ranges after Drafter 4.0.1 has been released and propagated through vaguely pinned transitive dependencies.

I've used a trick from this API Blueprint suggested by @kylef, which serves for producing multiple ranges in the Drafter's test suite.

The test verifies that code normalizes the range to boundary positions:

assert.deepPropertyVal(annotation, 'location', [[7, 5], [13, 19]]);

The ones I hardcoded to the test are verified manually through VS Code. On the screenshots below you can see how my cursor position translates to line and column numbers in VS Code's blue bottom bar:

Screenshot 2019-10-01 at 15 19 29

Screenshot 2019-10-01 at 15 18 38

Copy link
Member

@kylef kylef left a comment

Choose a reason for hiding this comment

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

Makes sense, although I wonder if/when this will break in the future. Not sure what other cases can cause multi-line source maps (under cases where there is indentation).

@honzajavorek
Copy link
Contributor Author

I guess this is all we have if we want to test against fixtures. I didn't check, but I believe there are also unit tests. If you wipe all real cases out of the parse results, we can rely at least on those.

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