Skip to content

Commit

Permalink
[cqfn#163] add test for multiple puzzles in single comment block
Browse files Browse the repository at this point in the history
  • Loading branch information
mbao01 committed Jan 10, 2022
1 parent db1daed commit e337cad
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/test_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,31 @@ def test_parsing_leading_spaces
end
end

def test_multiple_puzzles_single_comment_block
Dir.mktmpdir 'test' do |dir|
file = File.join(dir, 'a.txt')
File.write(
file,
"
/*
* \x40todo #1 First one with
* a few lines
* \x40todo #1 Second one also
* with a few lines
*/
"
)
stub_source_find_github_user(file, 'hey') do |source|
PDD.opts = nil
assert_equal 2, source.puzzles.size
puzzle = source.puzzles.last
assert_equal '5-6', puzzle.props[:lines]
assert_equal 'Second one also with a few lines', puzzle.props[:body]
assert_equal '1', puzzle.props[:ticket]
end
end
end

def test_succeed_despite_bad_puzzles
Dir.mktmpdir 'test' do |dir|
file = File.join(dir, 'a.txt')
Expand Down

0 comments on commit e337cad

Please sign in to comment.