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

Unit test for verifying complexity of basic transformer #88

Merged
merged 1 commit into from
Feb 21, 2016

Conversation

ashawley
Copy link
Member

@ashawley ashawley commented Nov 4, 2015

A new unit test -- taken from code example in SI-4528 -- to verify changes in #58 for maintaining linear complexity of scala.xml.transform.BasicTransformer.transform.

Adding this test is motivated on refactoring of #58 to remove a compiler warning -- see #83.

Here is how I verified the unit test of this PR. I cherry-picked it on to the revision before the fix in #58 (b2eef1f), and then after (master). As you can see, it fails for before, but succeeds on the current master.

$ git checkout -b complexity-before b2eef1f^
Switched to a new branch 'complexity-before'
$ git cherry-pick SI-4528-transformer-complexity
[complexity-before bd4dd2b] Unit test for verifying complexity of basic transformer
 Date: Tue Oct 13 11:34:42 2015 -0400
 1 file changed, 22 insertions(+), 1 deletion(-)
$ sbt "testOnly scala.xml.Transformers"
[error] Test scala.xml.Transformers.preserveReferentialComplexityInLinearComplexity failed: expected:<1> but was:<32>
[error] Failed: Total 4, Failed 1, Errors 0, Passed 3
[error] Failed tests:
[error]     scala.xml.Transformers
[error] (test:testOnly) sbt.TestsFailedException: Tests unsuccessful
[error] Total time: 4 s, completed Nov 3, 2015 10:32:30 PM
$ git checkout -b complexity-after master
Switched to a new branch 'complexity-after'
$ git cherry-pick SI-4528-transformer-complexity
[complexity-after cb5dd60] Unit test for verifying complexity of basic transformer
 Date: Tue Oct 13 11:34:42 2015 -0400
 1 file changed, 22 insertions(+), 1 deletion(-)
$ sbt "testOnly scala.xml.Transformers"
[info] Passed: Total 4, Failed 0, Errors 0, Passed 4
[success] Total time: 4 s, completed Nov 3, 2015 9:39:50 PM
$ git checkout master
Switched to branch 'master'
$ git branch -D complexity-before
Deleted branch complexity-before (was bd4dd2b).
$ git branch -D complexity-after
Deleted branch complexity-after (was cb5dd60).

@biswanaths biswanaths merged commit 5fb415a into scala:master Feb 21, 2016
@biswanaths
Copy link
Contributor

Pull the PR local, verified and pushed to the master.

@ashawley ashawley deleted the SI-4528-transformer-complexity branch February 29, 2016 05:45
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