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 rt 128221 #353

Merged
merged 6 commits into from Nov 28, 2017
Merged

Fix rt 128221 #353

merged 6 commits into from Nov 28, 2017

Conversation

tbrowder
Copy link
Member

@tbrowder tbrowder commented Nov 7, 2017

Provides new and updated test for Rakudo PR #1240.

  + RT #124403 - Table parsing broken in Rakudo
  + RT #128221 - Weird internal error when parsing some very simple pod...
  + RT #129862 - Pod::To::Text failing on uneven row lengths
  + RT #132341 - table handling should ensure table rows have the same number of cells...
  + RT #132348 - tables should accept an inline comment (Z<some comment>)

Note that this commit should only be used with Rakudo after incorporating its PR #1240.
Copy link
Member

@AlexDaniel AlexDaniel left a comment

Choose a reason for hiding this comment

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

Just some questions and comments. The PR seems to be fine. If anything, would be great if commit messages were more detailed in future PRs (otherwise really hard to follow what changed and why).

# test fix for RT #132341
# also tests fix for RT #129862
=table
X O
Copy link
Member

Choose a reason for hiding this comment

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

These lines originally had trailing whitespace. Was trailing whitespace here part of the test, or is it irrelevant (in your version it is removed)?

Copy link
Member Author

@tbrowder tbrowder Nov 26, 2017

Choose a reason for hiding this comment

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

Whitespace, or the lack of it, no longer matter due to more robust code. But having a test with and without WS would be cool if there is a way to reliably assure keeping any trailing whitespace from being stripped.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it could be done by the code creating a temp file that includes the trailing spaces, and running it as a sub-process.

Copy link
Member Author

Choose a reason for hiding this comment

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

@b2gills good idea!

@@ -88,6 +88,7 @@ is $r.contents[1].elems, 3;
is $r.contents[2].elems, 3;

# test fix for RT #132341
# also tests fix for RT #129862
Copy link
Member

Choose a reason for hiding this comment

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

what do you mean by that? The test was passing before, so what changed? Was this line intended to be here? If yes, then ok.

Copy link
Member Author

Choose a reason for hiding this comment

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

RT #129862 was fixed by a downstream change to Pod::To::Text. The new NQP Pod changes fix that original problem at the source in the Pod code.

is $r.contents.elems, 1;
is $r.contents[0][0], "-r0c0"; # <= note leading hyphen which caused the original issue
is $r.contents[0][1], "r0c1";
is $r.contents.elems, 1, "test {++$t}";
Copy link
Member

Choose a reason for hiding this comment

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

I think the number is included in the test output anyway, so what are these descriptions for?

Copy link
Member Author

Choose a reason for hiding this comment

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

The second two lines removed were redundant. The "test {++$t}" was left from some debugging code--it can be removed.

Copy link
Member

Choose a reason for hiding this comment

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

Remove it then? :)

is $r.headers.elems, 1;
is $r.contents.elems, 7;
is $hdrs, "-Col 1 -Col 2 _Col 3 =Col 4"; # <= note leading hyphen which caused the original issue
is @rows[0], "r0Col 1 -r0Col 2 _r0Col 3 =r0Col 4";
Copy link
Member

Choose a reason for hiding this comment

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

I guess this wasn't simply removed, but moved to another file in a different commit? I see that it has changed, can you clarify?

Copy link
Member Author

@tbrowder tbrowder Nov 26, 2017

Choose a reason for hiding this comment

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

The original skipped test was written by Zoffix early on. The tests were not actually valid due probably to our lack of knowledge of interrogating pod blocks. The tests were corrected.

@AlexDaniel
Copy link
Member

OK let's merge for now, but I hope there'll be a followup for trailing whitespace tests and whatever else you notice.

@AlexDaniel AlexDaniel merged commit 2342d1d into Raku:master Nov 28, 2017
@tbrowder
Copy link
Member Author

tbrowder commented Nov 28, 2017 via email

@tbrowder tbrowder deleted the fix-rt-128221 branch November 28, 2017 20:08
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.

None yet

3 participants