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

Revise risky test attributes in tests #320

Merged
merged 178 commits into from
Jan 26, 2019

Conversation

AirQuick
Copy link
Member

This pull request derives from #319. So needs to be handled after that.


If you break generate-xspec-tests.xsl intentionally (16ae511), generate-xspec-tests.xspec must fail. But actually it doesn't fail. (Travis)

The test doesn't fail, because the expression in x:expect/@test can be an empty sequence. This is a common mistake in writing @test.

This pull request revises tests in test/ to avoid the same kind of risky expressions.

…oolean-test

# Conflicts:
#	.travis.yml
#	appveyor.yml
#	bin/xspec.bat
#	test/xspec-bat.cmd
#	test/xspec.bats
…185_cumulative

# Conflicts:
#	test/saxon-custom-options/config.xml
#	test/saxon-custom-options/test.xspec
#	test/xspec-bat.cmd
#	test/xspec.bats
…185_cumulative

# Conflicts:
#	test/xspec-bat.cmd
#	test/xspec.bats
…c-rule

# Conflicts:
#	build.xml
#	test/saxon-custom-options/config.xml
#	test/saxon-custom-options/test.xspec
#	test/xspec-bat.cmd
#	test/xspec.bats
…oolean-test

# Conflicts:
#	build.xml
#	test/saxon-custom-options/config.xml
#	test/saxon-custom-options/test.xspec
#	test/xspec-bat.cmd
#	test/xspec.bats
…k/xspec into valid-xspec-rule

# Conflicts:
#	test/xspec-bat.cmd
#	test/xspec.bats
…c-rule

# Conflicts:
#	build.xml
#	test/end-to-end/generate-expected.cmd
#	test/end-to-end/generate-expected.sh
#	test/end-to-end/processor/html/_normalizer.xsl
#	test/end-to-end/run-e2e-tests.cmd
#	test/end-to-end/run-e2e-tests.sh
#	test/run-xspec-tests-ant.cmd
#	test/run-xspec-tests-ant.sh
…oolean-test

# Conflicts:
#	build.xml
#	test/end-to-end/generate-expected.cmd
#	test/end-to-end/generate-expected.sh
#	test/end-to-end/processor/html/_normalizer.xsl
#	test/end-to-end/run-e2e-tests.cmd
#	test/end-to-end/run-e2e-tests.sh
#	test/run-xspec-tests-ant.cmd
#	test/run-xspec-tests-ant.sh
…c-rule

# Conflicts:
#	test/xspec-bat.cmd
#	test/xspec.bats
…oolean-test

# Conflicts:
#	test/xspec-bat.cmd
#	test/xspec.bats
…c-rule

# Conflicts:
#	test/xspec-bat.cmd
#	test/xspec.bats
…into explicit-boolean-test

# Conflicts:
#	test/xspec.bats
…oolean-test

# Conflicts:
#	.travis.yml
#	appveyor.yml
#	test/run-bats.cmd
#	test/run-bats.sh
#	test/win-bats/collection.xml
#	test/xspec.bats
@AirQuick AirQuick added this to the v1.2.0 milestone Jan 25, 2019
…oolean-test

# Conflicts:
#	src/compiler/generate-xspec-tests.xsl
#	test/end-to-end/cases/xspec-focus-1.xspec
#	test/end-to-end/cases/xspec-function.xspec
#	test/end-to-end/cases/xspec-import.xspec
#	test/end-to-end/cases/xspec-imported.xspec
#	test/end-to-end/cases/xspec-pending.xspec
#	test/generate-tests-utils.xspec
#	test/generate-x-utils.xspec
#	test/generate-xspec-tests.xspec
#	test/xspec-focus-2.xspec
#	test/xspec-variable.xspec
@AirQuick AirQuick merged commit 0456f53 into xspec:master Jan 26, 2019
@AirQuick AirQuick deleted the explicit-boolean-test branch January 26, 2019 13:29
@AirQuick
Copy link
Member Author

AirQuick commented Jan 26, 2019

@cirulls
Merged this PR which just hardens some x:expect expressions in test files. Nothing has changed in essence.

As mentioned in #506, this is the last PR of mine for v1.2.0 at the moment. Some other candidates you may want to resolve for v1.2.0 can be found in the project board.

@galtm
This change again incurred a conflict in #475. I hope you can resolve it easily.
The only intent of this change is to rectify @test expressions in files in test/ which satisfy both of the following conditions:

  • The test author expects @test to be either true or false
  • Actually the @test can result in an empty sequence

@galtm
Copy link
Member

galtm commented Jan 27, 2019

@AirQuick
Thanks for the tip. I adapted my code in this commit: fea377c

By the way, in test/generate-xspec.xspec, you changed test="$t:result/t:scenario/t:label eq 'my label'" to test="$t:result/t:scenario/t:label/string()" select="'my label'". When I tried doing something similar in my code in xspec-variable.xspec in my PR#475, it worked in XSLT but not in XQuery. I'm mentioning that just in case it's not what you expected the XQuery implementation to do.

What I did instead in some spots was test for node existence in addition to checking values. If you have a better idea, I'm open to suggestions.

@AirQuick
Copy link
Member Author

Thanks for the update. Unfortunately x:expect[@test][@select] doesn't work now (#440). I think your approach is good and sufficient for now.

@galtm
Copy link
Member

galtm commented Jan 28, 2019

OK, glad the XQuery behavior was at least already known.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants