-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
28 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,11 +34,11 @@ def test_parsing | |
File.write( | ||
file, | ||
" | ||
* @todo #44 hello, | ||
* \x40todo #44 hello, | ||
* how are you\t\r\tdoing? | ||
* -something else | ||
Something else | ||
~~ @todo #ABC-3 this is another puzzle | ||
~~ \x40todo #ABC-3 this is another puzzle | ||
~~ and it also has to work | ||
" | ||
) | ||
|
@@ -59,10 +59,10 @@ def test_failing_on_invalid_puzzle | |
file = File.join(dir, 'a.txt') | ||
File.write( | ||
file, | ||
' | ||
* @todo #44 this is an incorrectly formatted puzzle, | ||
" | ||
* \x40todo #44 this is an incorrectly formatted puzzle, | ||
* with a second line without a leading space | ||
' | ||
" | ||
) | ||
error = assert_raises PDD::Error do | ||
PDD::VerboseSource.new(file, PDD::Source.new(file, 'hey')).puzzles | ||
|
@@ -76,22 +76,22 @@ def test_failing_on_incomplete_puzzle | |
file = File.join(dir, 'ff.txt') | ||
File.write( | ||
file, | ||
' | ||
* @todo this puzzle misses ticket name/number | ||
' | ||
" | ||
* \x40todo this puzzle misses ticket name/number | ||
" | ||
) | ||
error = assert_raises PDD::Error do | ||
PDD::VerboseSource.new(file, PDD::Source.new(file, 'ff')).puzzles | ||
end | ||
assert !error.to_s.index('TODO is not followed by a puzzle marker').nil? | ||
assert !error.to_s.index("\x40todo is not followed by").nil? | ||
end | ||
end | ||
|
||
def test_failing_on_broken_unicode | ||
skip if Gem.win_platform? | ||
Dir.mktmpdir 'test' do |dir| | ||
file = File.join(dir, 'xx.txt') | ||
File.write(file, ' * @todo #44 this is a broken unicode: ' + 0x92.chr) | ||
File.write(file, ' * \x40todo #44 this is a broken unicode: ' + 0x92.chr) | ||
assert_raises PDD::Error do | ||
PDD::VerboseSource.new(file, PDD::Source.new(file, 'xx')).puzzles | ||
end | ||
|
@@ -105,7 +105,7 @@ def test_failing_on_invalid_puzzle_without_hash_sign | |
File.write( | ||
file, | ||
' | ||
* @todo 44 this puzzle is not formatted correctly | ||
* \x40todo 44 this puzzle is not formatted correctly | ||
' | ||
) | ||
error = assert_raises PDD::Error do | ||
|
@@ -120,14 +120,14 @@ def test_failing_on_puzzle_without_leading_space | |
file = File.join(dir, 'hey.txt') | ||
File.write( | ||
file, | ||
' | ||
*@todo #999 this is an incorrectly formatted puzzle! | ||
' | ||
" | ||
*\x40todo #999 this is an incorrectly formatted puzzle! | ||
" | ||
) | ||
error = assert_raises PDD::Error do | ||
PDD::VerboseSource.new(file, PDD::Source.new(file, 'x')).puzzles | ||
end | ||
assert !error.message.index('TODO must have a leading space').nil? | ||
assert !error.message.index("\x40todo must have a leading space").nil? | ||
end | ||
end | ||
|
||
|
@@ -140,7 +140,7 @@ def test_reads_git_author | |
git init --quiet . | ||
git config user.email [email protected] | ||
git config user.name test | ||
echo '@todo #1 this is the puzzle' > a.txt | ||
echo '\x40todo #1 this is the puzzle' > a.txt | ||
git add a.txt | ||
git commit --quiet -am 'first version' | ||
") | ||
|
d2d67cb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't able to retrieve PDD puzzles from the code base and submit them to GitHub. If you think that it's a bug on our side, please submit it to yegor256/0pdd:
Please, copy and paste this stack trace to GitHub: