Skip to content

Bugfix: only pass lefthand whitespace delta to _handle_indentation#66

Open
djangovanderheijden wants to merge 1 commit intonodejs:mainfrom
djangovanderheijden:main
Open

Bugfix: only pass lefthand whitespace delta to _handle_indentation#66
djangovanderheijden wants to merge 1 commit intonodejs:mainfrom
djangovanderheijden:main

Conversation

@djangovanderheijden
Copy link

This fixes JUnit output in cases where the TAP file does not end with a trailing newline. It also improves behavior when tests are provided with an empty description which is technically allowed as per the TAP spec.

Take the following input file:

1..3
ok 1 Hello, world
ok 2 
ok 3 Hello, world

The resulting XML is as follows:

Before:

<?xml version="1.0" encoding="utf-8"?>
<testsuites disabled="0" errors="0" failures="2" tests="5" time="0.0">
	<testsuite disabled="0" errors="0" failures="2" name="..." skipped="0" tests="5" time="0" hostname="...">
		<testcase name="Hello, world"/>
		<testcase name="None">
			<failure type="failure" message=" (0)"/>
		</testcase>
		<testcase name="None"/>
		<testcase name="None">
			<failure type="failure" message=" (0)"/>
		</testcase>
		<testcase name="Hello, world"/>
	</testsuite>
</testsuites>

After:

<?xml version="1.0" encoding="utf-8"?>
<testsuites disabled="0" errors="0" failures="0" tests="3" time="0.0">
	<testsuite disabled="0" errors="0" failures="0" name="..." skipped="0" tests="3" time="0" hostname="...">
		<testcase name="Hello, world"/>
		<testcase name="None"/>
		<testcase name="Hello, world"/>
	</testsuite>
</testsuites>

…espace stripped from the lefthand side of the test line
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.

1 participant