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

Setup tests for source maps #6914

Merged
merged 3 commits into from Apr 16, 2018

Conversation

Projects
None yet
3 participants
@RealyUniqueName
Copy link
Member

RealyUniqueName commented Mar 18, 2018

I'd like to find a good approach to testing source maps.
After setting up such tests we will be able to improve source maps generation and add it to other targets.

So this is my "proposal" for testing source maps generation.
Here is how it looks in ci: https://travis-ci.org/RealyUniqueName/haxe/jobs/355092123#L1758

@RealyUniqueName RealyUniqueName requested review from nadako and ncannasse Mar 18, 2018

@ncannasse

This comment has been minimized.

Copy link
Member

ncannasse commented Mar 18, 2018

Just to be clear : you're writing down an expression, then the corresponding generated code and checking that the generated code mapping is the same as the original source source right?

One problem with sourcemaps might be with inner expressions, such as the else part of a if. Would your approach allows such test and then how?

@ncannasse

This comment has been minimized.

Copy link
Member

ncannasse commented Mar 18, 2018

PS: I entirely agree with the goal of having robust sourcemap and unit tests requirements for them btw :)

@RealyUniqueName

This comment has been minimized.

Copy link
Member

RealyUniqueName commented Mar 19, 2018

Just to be clear : you're writing down an expression, then the corresponding generated code and checking that the generated code mapping is the same as the original source source right?

Yes.

It allows to check any valid Haxe expression:

if(expect(condition, [Js => 'condition'])) ifAction();
if(condition) expect(ifAction(), [Js => 'ifAction()']);
if(condition) ifAction() else expect(elseAction(), [Js => 'elseAction()']);

It can't expect(else elseAction(), ...) because else elseAction() is not a valid Haxe expression. But that's probably not that important, because keywords are not of such interest as other expressions. E.g. debuggers won't stop on else, but will stop on elseAction().

@skial skial referenced this pull request Mar 22, 2018

Closed

Haxe Roundup 424 #490

1 of 1 task complete
@RealyUniqueName

This comment has been minimized.

Copy link
Member

RealyUniqueName commented Mar 29, 2018

@ncannasse Is it ok to merge?

@ncannasse

This comment has been minimized.

Copy link
Member

ncannasse commented Mar 29, 2018

Sure

@Simn Simn merged commit e3568be into HaxeFoundation:development Apr 16, 2018

1 of 2 checks passed

continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment