two char indent and whitespace error fixes

This commit is contained in:
Ryan Tomayko 2011-03-05 03:48:15 -08:00
parent a2d316b20d
commit f40e57baae
9 changed files with 254 additions and 242 deletions

View File

@ -1,6 +1,4 @@
require 'test/unit' require 'test/unit'
tests = Dir["#{File.dirname(__FILE__)}/test_*.rb"] Dir["#{File.dirname(__FILE__)}/test_*.rb"].
tests.each do |file| each { |file| require file }
require file
end

View File

@ -1,64 +1,63 @@
require File.dirname(__FILE__) + '/helper' require File.dirname(__FILE__) + '/helper'
class RoccoBasicTests < Test::Unit::TestCase class RoccoBasicTests < Test::Unit::TestCase
def test_rocco_exists_and_is_instancable def test_rocco_exists_and_is_instancable
roccoize( "filename.rb", "# Comment 1\ndef codeblock\nend\n" ) roccoize( "filename.rb", "# Comment 1\ndef codeblock\nend\n" )
end end
def test_filename def test_filename
r = roccoize( "filename.rb", "# Comment 1\ndef codeblock\nend\n" ) r = roccoize( "filename.rb", "# Comment 1\ndef codeblock\nend\n" )
assert_equal "filename.rb", r.file assert_equal "filename.rb", r.file
end end
def test_sources def test_sources
r = roccoize( "filename.rb", "# Comment 1\ndef codeblock\nend\n" ) r = roccoize( "filename.rb", "# Comment 1\ndef codeblock\nend\n" )
assert_equal [ "filename.rb" ], r.sources assert_equal [ "filename.rb" ], r.sources
end end
def test_sections def test_sections
r = roccoize( "filename.rb", "# Comment 1\ndef codeblock\nend\n" ) r = roccoize( "filename.rb", "# Comment 1\ndef codeblock\nend\n" )
assert_equal 1, r.sections.length assert_equal 1, r.sections.length
assert_equal 2, r.sections[ 0 ].length assert_equal 2, r.sections[ 0 ].length
assert_equal "<p>Comment 1</p>\n", r.sections[ 0 ][ 0 ] assert_equal "<p>Comment 1</p>\n", r.sections[ 0 ][ 0 ]
assert_equal "<span class=\"k\">def</span> <span class=\"nf\">codeblock</span>\n<span class=\"k\">end</span>", r.sections[ 0 ][ 1 ] assert_equal "<span class=\"k\">def</span> <span class=\"nf\">codeblock</span>\n<span class=\"k\">end</span>", r.sections[ 0 ][ 1 ]
end end
def test_parsing def test_parsing
r = Rocco.new( 'test' ) { "" } # Generate throwaway instance so I can test `parse` r = Rocco.new( 'test' ) { "" } # Generate throwaway instance so I can test `parse`
assert_equal( assert_equal(
[ [
[ [ "Comment 1" ], [ "def codeblock", "end" ] ] [ [ "Comment 1" ], [ "def codeblock", "end" ] ]
], ],
r.parse( "# Comment 1\ndef codeblock\nend\n" ) r.parse( "# Comment 1\ndef codeblock\nend\n" )
) )
assert_equal( assert_equal(
[ [
[ [ "Comment 1" ], [ "def codeblock" ] ], [ [ "Comment 1" ], [ "def codeblock" ] ],
[ [ "Comment 2" ], [ "end" ] ] [ [ "Comment 2" ], [ "end" ] ]
], ],
r.parse( "# Comment 1\ndef codeblock\n# Comment 2\nend\n" ) r.parse( "# Comment 1\ndef codeblock\n# Comment 2\nend\n" )
) )
end end
def test_splitting
r = Rocco.new( 'test' ) { "" } # Generate throwaway instance so I can test `split`
assert_equal(
[
[ "Comment 1" ],
[ "def codeblock\nend" ]
],
r.split([ [ [ "Comment 1" ], [ "def codeblock", "end" ] ] ])
)
assert_equal(
[
[ "Comment 1", "Comment 2" ],
[ "def codeblock", "end" ]
],
r.split( [
[ [ "Comment 1" ], [ "def codeblock" ] ],
[ [ "Comment 2" ], [ "end" ] ]
] )
)
end
def test_splitting
r = Rocco.new( 'test' ) { "" } # Generate throwaway instance so I can test `split`
assert_equal(
[
[ "Comment 1" ],
[ "def codeblock\nend" ]
],
r.split([ [ [ "Comment 1" ], [ "def codeblock", "end" ] ] ])
)
assert_equal(
[
[ "Comment 1", "Comment 2" ],
[ "def codeblock", "end" ]
],
r.split( [
[ [ "Comment 1" ], [ "def codeblock" ] ],
[ [ "Comment 2" ], [ "end" ] ]
] )
)
end
end end

View File

@ -1,98 +1,101 @@
require File.dirname(__FILE__) + '/helper' require File.dirname(__FILE__) + '/helper'
class RoccoBlockCommentTest < Test::Unit::TestCase class RoccoBlockCommentTest < Test::Unit::TestCase
def test_basics def test_basics
r = Rocco.new( 'test', '', { :language => "c" } ) { "" } # Generate throwaway instance so I can test `parse` r = Rocco.new( 'test', '', { :language => "c" } ) { "" } # Generate throwaway instance so I can test `parse`
assert_equal( assert_equal(
[ [
[ [ "Comment 1" ], [ "def codeblock", "end" ] ] [ [ "Comment 1" ], [ "def codeblock", "end" ] ]
], ],
r.parse( "/**\n * Comment 1\n */\ndef codeblock\nend\n" ) r.parse( "/**\n * Comment 1\n */\ndef codeblock\nend\n" )
) )
assert_equal( assert_equal(
[ [
[ [ "Comment 1a", "Comment 1b" ], [ "def codeblock", "end" ] ] [ [ "Comment 1a", "Comment 1b" ], [ "def codeblock", "end" ] ]
], ],
r.parse( "/**\n * Comment 1a\n * Comment 1b\n */\ndef codeblock\nend\n" ) r.parse( "/**\n * Comment 1a\n * Comment 1b\n */\ndef codeblock\nend\n" )
) )
end end
def test_multiple_blocks
r = Rocco.new( 'test', '', { :language => "c" } ) { "" } # Generate throwaway instance so I can test `parse`
assert_equal(
[
[ [ "Comment 1" ], [ "def codeblock", "end" ] ],
[ [ "Comment 2" ], [] ]
],
r.parse( "/**\n * Comment 1\n */\ndef codeblock\nend\n/**\n * Comment 2\n */\n" )
)
assert_equal(
[
[ [ "Comment 1" ], [ "def codeblock", "end" ] ],
[ [ "Comment 2" ], [ "if false", "end" ] ]
],
r.parse( "/**\n * Comment 1\n */\ndef codeblock\nend\n/**\n * Comment 2\n */\nif false\nend" )
)
end
def test_block_without_middle_character
r = Rocco.new( 'test', '', { :language => "python" } ) { "" } # Generate throwaway instance so I can test `parse`
assert_equal(
[
[ [ "Comment 1" ], [ "def codeblock", "end" ] ],
[ [ "Comment 2" ], [] ]
],
r.parse( "\"\"\"\n Comment 1\n\"\"\"\ndef codeblock\nend\n\"\"\"\n Comment 2\n\"\"\"\n" )
)
assert_equal(
[
[ [ "Comment 1" ], [ "def codeblock", "end" ] ],
[ [ "Comment 2" ], [ "if false", "end" ] ]
],
r.parse( "\"\"\"\n Comment 1\n\"\"\"\ndef codeblock\nend\n\"\"\"\n Comment 2\n\"\"\"\nif false\nend" )
)
end
def test_language_without_single_line_comments_parse
r = Rocco.new( 'test', '', { :language => "css" } ) { "" } # Generate throwaway instance so I can test `parse`
assert_equal(
[
[ [ "Comment 1" ], [ "def codeblock", "end" ] ],
[ [ "Comment 2" ], [ "if false", "end" ] ]
],
r.parse( "/**\n * Comment 1\n */\ndef codeblock\nend\n/**\n * Comment 2\n */\nif false\nend" )
)
end
def test_language_without_single_line_comments_split
r = Rocco.new( 'test', '', { :language => "css" } ) { "" } # Generate throwaway instance so I can test `parse`
assert_equal(
[
[ "Comment 1", "Comment 2" ],
[ "def codeblock\nend", "if false\nend" ]
],
r.split( [
[ [ "Comment 1" ], [ "def codeblock", "end" ] ],
[ [ "Comment 2" ], [ "if false", "end" ] ]
] )
)
end
def test_language_without_single_line_comments_highlight
r = Rocco.new( 'test', '', { :language => "css" } ) { "" } # Generate throwaway instance so I can test `parse`
highlighted = r.highlight( r.split( r.parse( "/**\n * This is a comment!\n */\n.rule { goes: here; }\n/**\n * Comment 2\n */\n.rule2 { goes: here; }" ) ) ) def test_multiple_blocks
assert_equal( r = Rocco.new( 'test', '', { :language => "c" } ) { "" } # Generate throwaway instance so I can test `parse`
"<p>This is a comment!</p>", assert_equal(
highlighted[0][0] [
); [ [ "Comment 1" ], [ "def codeblock", "end" ] ],
assert_equal( [ [ "Comment 2" ], [] ]
"<p>Comment 2</p>\n", ],
highlighted[1][0] r.parse( "/**\n * Comment 1\n */\ndef codeblock\nend\n/**\n * Comment 2\n */\n" )
); )
assert( assert_equal(
!highlighted[0][1].include?("DIVIDER") && [
!highlighted[1][1].include?("DIVIDER"), [ [ "Comment 1" ], [ "def codeblock", "end" ] ],
"`DIVIDER` stripped successfully." [ [ "Comment 2" ], [ "if false", "end" ] ]
) ],
r.parse( "/**\n * Comment 1\n */\ndef codeblock\nend\n/**\n * Comment 2\n */\nif false\nend" )
)
end
assert( true def test_block_without_middle_character
); r = Rocco.new( 'test', '', { :language => "python" } ) { "" } # Generate throwaway instance so I can test `parse`
end assert_equal(
[
[ [ "Comment 1" ], [ "def codeblock", "end" ] ],
[ [ "Comment 2" ], [] ]
],
r.parse( "\"\"\"\n Comment 1\n\"\"\"\ndef codeblock\nend\n\"\"\"\n Comment 2\n\"\"\"\n" )
)
assert_equal(
[
[ [ "Comment 1" ], [ "def codeblock", "end" ] ],
[ [ "Comment 2" ], [ "if false", "end" ] ]
],
r.parse( "\"\"\"\n Comment 1\n\"\"\"\ndef codeblock\nend\n\"\"\"\n Comment 2\n\"\"\"\nif false\nend" )
)
end
def test_language_without_single_line_comments_parse
r = Rocco.new( 'test', '', { :language => "css" } ) { "" } # Generate throwaway instance so I can test `parse`
assert_equal(
[
[ [ "Comment 1" ], [ "def codeblock", "end" ] ],
[ [ "Comment 2" ], [ "if false", "end" ] ]
],
r.parse( "/**\n * Comment 1\n */\ndef codeblock\nend\n/**\n * Comment 2\n */\nif false\nend" )
)
end
def test_language_without_single_line_comments_split
r = Rocco.new( 'test', '', { :language => "css" } ) { "" } # Generate throwaway instance so I can test `parse`
assert_equal(
[
[ "Comment 1", "Comment 2" ],
[ "def codeblock\nend", "if false\nend" ]
],
r.split( [
[ [ "Comment 1" ], [ "def codeblock", "end" ] ],
[ [ "Comment 2" ], [ "if false", "end" ] ]
] )
)
end
def test_language_without_single_line_comments_highlight
r = Rocco.new( 'test', '', { :language => "css" } ) { "" } # Generate throwaway instance so I can test `parse`
highlighted = r.highlight( r.split( r.parse( "/**\n * This is a comment!\n */\n.rule { goes: here; }\n/**\n * Comment 2\n */\n.rule2 { goes: here; }" ) ) )
assert_equal(
"<p>This is a comment!</p>",
highlighted[0][0]
)
assert_equal(
"<p>Comment 2</p>\n",
highlighted[1][0]
)
assert(
!highlighted[0][1].include?("DIVIDER") &&
!highlighted[1][1].include?("DIVIDER"),
"`DIVIDER` stripped successfully."
)
assert( true )
end
end end

View File

@ -1,24 +1,25 @@
require File.dirname(__FILE__) + '/helper' require File.dirname(__FILE__) + '/helper'
class RoccoCommentNormalization < Test::Unit::TestCase class RoccoCommentNormalization < Test::Unit::TestCase
def test_normal_comments def test_normal_comments
r = Rocco.new( 'test', '', { :language => "python" } ) { "" } # Generate throwaway instance so I can test `parse` r = Rocco.new( 'test', '', { :language => "python" } ) { "" } # Generate throwaway instance so I can test `parse`
assert_equal( assert_equal(
[ [
[ [ "Comment 1a", "Comment 1b" ], [ "def codeblock", "end" ] ], [ [ "Comment 1a", "Comment 1b" ], [ "def codeblock", "end" ] ],
[ [ "Comment 2a", " Comment 2b" ], [] ] [ [ "Comment 2a", " Comment 2b" ], [] ]
], ],
r.parse( "\"\"\"\n Comment 1a\n Comment 1b\n\"\"\"\ndef codeblock\nend\n\"\"\"\n Comment 2a\n Comment 2b\n\"\"\"\n" ) r.parse( "\"\"\"\n Comment 1a\n Comment 1b\n\"\"\"\ndef codeblock\nend\n\"\"\"\n Comment 2a\n Comment 2b\n\"\"\"\n" )
) )
end end
def test_single_line_comments
r = Rocco.new( 'test', '', { :language => "python" } ) { "" } # Generate throwaway instance so I can test `parse` def test_single_line_comments
assert_equal( r = Rocco.new( 'test', '', { :language => "python" } ) { "" } # Generate throwaway instance so I can test `parse`
[ assert_equal(
[ [ "Comment 1a", "Comment 1b" ], [ "def codeblock", "end" ] ], [
[ [ "Comment 2a", " Comment 2b" ], [] ] [ [ "Comment 1a", "Comment 1b" ], [ "def codeblock", "end" ] ],
], [ [ "Comment 2a", " Comment 2b" ], [] ]
r.parse( "# Comment 1a\n# Comment 1b\ndef codeblock\nend\n# Comment 2a\n# Comment 2b\n" ) ],
) r.parse( "# Comment 1a\n# Comment 1b\ndef codeblock\nend\n# Comment 2a\n# Comment 2b\n" )
end )
end
end end

View File

@ -1,24 +1,28 @@
require File.dirname(__FILE__) + '/helper' require File.dirname(__FILE__) + '/helper'
class RoccoAutomaticCommentChars < Test::Unit::TestCase class RoccoAutomaticCommentChars < Test::Unit::TestCase
def test_basic_detection def test_basic_detection
r = Rocco.new( 'filename.js' ) { "" } r = Rocco.new( 'filename.js' ) { "" }
assert_equal "//", r.options[:comment_chars][:single] assert_equal "//", r.options[:comment_chars][:single]
end end
def test_fallback_language
r = Rocco.new( 'filename.an_extension_with_no_meaning_whatsoever', '', { :language => "js" } ) { "" } def test_fallback_language
assert_equal "//", r.options[:comment_chars][:single] r = Rocco.new( 'filename.an_extension_with_no_meaning_whatsoever', '', { :language => "js" } ) { "" }
end assert_equal "//", r.options[:comment_chars][:single]
def test_fallback_default end
r = Rocco.new( 'filename.an_extension_with_no_meaning_whatsoever' ) { "" }
assert_equal "#", r.options[:comment_chars][:single], "`:comment_chars` should be `#` when falling back to defaults." def test_fallback_default
end r = Rocco.new( 'filename.an_extension_with_no_meaning_whatsoever' ) { "" }
def test_fallback_user assert_equal "#", r.options[:comment_chars][:single], "`:comment_chars` should be `#` when falling back to defaults."
r = Rocco.new( 'filename.an_extension_with_no_meaning_whatsoever', '', { :comment_chars => "user" } ) { "" } end
assert_equal "user", r.options[:comment_chars][:single], "`:comment_chars` should be the user's default when falling back to user-provided settings."
end def test_fallback_user
def test_fallback_user_with_unknown_language r = Rocco.new( 'filename.an_extension_with_no_meaning_whatsoever', '', { :comment_chars => "user" } ) { "" }
r = Rocco.new( 'filename.an_extension_with_no_meaning_whatsoever', '', { :language => "not-a-language", :comment_chars => "user" } ) { "" } assert_equal "user", r.options[:comment_chars][:single], "`:comment_chars` should be the user's default when falling back to user-provided settings."
assert_equal "user", r.options[:comment_chars][:single], "`:comment_chars` should be the user's default when falling back to user-provided settings." end
end
def test_fallback_user_with_unknown_language
r = Rocco.new( 'filename.an_extension_with_no_meaning_whatsoever', '', { :language => "not-a-language", :comment_chars => "user" } ) { "" }
assert_equal "user", r.options[:comment_chars][:single], "`:comment_chars` should be the user's default when falling back to user-provided settings."
end
end end

View File

@ -13,6 +13,7 @@ class RoccoDescriptiveSectionNamesTests < Test::Unit::TestCase
"The rendered HTML should link to a named section" "The rendered HTML should link to a named section"
) )
end end
def test_section_numbering def test_section_numbering
r = roccoize( "filename.rb", "# # Header 1\ndef codeblock\nend\n# Comment 1\ndef codeblock1\nend\n# # Header 2\ndef codeblock2\nend" ) r = roccoize( "filename.rb", "# # Header 1\ndef codeblock\nend\n# Comment 1\ndef codeblock1\nend\n# # Header 2\ndef codeblock2\nend" )
html = r.to_html html = r.to_html

View File

@ -1,25 +1,27 @@
require File.dirname(__FILE__) + '/helper' require File.dirname(__FILE__) + '/helper'
class RoccoLanguageDetection < Test::Unit::TestCase class RoccoLanguageDetection < Test::Unit::TestCase
def test_basic_detection def test_basic_detection
r = Rocco.new( 'filename.py' ) { "" } r = Rocco.new( 'filename.py' ) { "" }
if r.pygmentize? if r.pygmentize?
assert_equal "python", r.detect_language(), "`detect_language()` should return the correct language" assert_equal "python", r.detect_language(), "`detect_language()` should return the correct language"
assert_equal "python", r.options[:language], "`@options[:language]` should be set to the correct language" assert_equal "python", r.options[:language], "`@options[:language]` should be set to the correct language"
end
end end
def test_fallback_default end
r = Rocco.new( 'filename.an_extension_with_no_meaning_whatsoever' ) { "" }
if r.pygmentize? def test_fallback_default
assert_equal "text", r.detect_language(), "`detect_language()` should return `text` when nothing else is detected" r = Rocco.new( 'filename.an_extension_with_no_meaning_whatsoever' ) { "" }
assert_equal "ruby", r.options[:language], "`@options[:language]` should be set to `ruby` when nothing else is detected" if r.pygmentize?
end assert_equal "text", r.detect_language(), "`detect_language()` should return `text` when nothing else is detected"
assert_equal "ruby", r.options[:language], "`@options[:language]` should be set to `ruby` when nothing else is detected"
end end
def test_fallback_user end
r = Rocco.new( 'filename.an_extension_with_no_meaning_whatsoever', '', { :language => "c" } ) { "" }
if r.pygmentize? def test_fallback_user
assert_equal "text", r.detect_language(), "`detect_language()` should return `text` nothing else is detected" r = Rocco.new( 'filename.an_extension_with_no_meaning_whatsoever', '', { :language => "c" } ) { "" }
assert_equal "c", r.options[:language], "`@options[:language]` should be set to the user's setting when nothing else is detected" if r.pygmentize?
end assert_equal "text", r.detect_language(), "`detect_language()` should return `text` nothing else is detected"
assert_equal "c", r.options[:language], "`@options[:language]` should be set to the user's setting when nothing else is detected"
end end
end
end end

View File

@ -4,57 +4,61 @@ class RoccoSkippableLines < Test::Unit::TestCase
def test_shebang_first_line def test_shebang_first_line
r = Rocco.new( 'filename.sh' ) { "" } r = Rocco.new( 'filename.sh' ) { "" }
assert_equal( assert_equal(
[ [
[ [ "Comment 1" ], [ "def codeblock" ] ], [ [ "Comment 1" ], [ "def codeblock" ] ],
[ [ "Comment 2" ], [ "end" ] ] [ [ "Comment 2" ], [ "end" ] ]
], ],
r.parse( "#!/usr/bin/env bash\n# Comment 1\ndef codeblock\n# Comment 2\nend\n" ), r.parse( "#!/usr/bin/env bash\n# Comment 1\ndef codeblock\n# Comment 2\nend\n" ),
"Shebang should be stripped when it appears as the first line." "Shebang should be stripped when it appears as the first line."
) )
end end
def test_shebang_in_content def test_shebang_in_content
r = Rocco.new( 'filename.sh' ) { "" } r = Rocco.new( 'filename.sh' ) { "" }
assert_equal( assert_equal(
[ [
# @TODO: `#!/` shouldn't be recognized as a comment. # @TODO: `#!/` shouldn't be recognized as a comment.
[ [ "Comment 1", "!/usr/bin/env bash" ], [ "def codeblock" ] ], [ [ "Comment 1", "!/usr/bin/env bash" ], [ "def codeblock" ] ],
[ [ "Comment 2" ], [ "end" ] ] [ [ "Comment 2" ], [ "end" ] ]
], ],
r.parse( "# Comment 1\n#!/usr/bin/env bash\ndef codeblock\n# Comment 2\nend\n" ), r.parse( "# Comment 1\n#!/usr/bin/env bash\ndef codeblock\n# Comment 2\nend\n" ),
"Shebang shouldn't be stripped anywhere other than as the first line." "Shebang shouldn't be stripped anywhere other than as the first line."
) )
end end
def test_encoding_in_ruby def test_encoding_in_ruby
r = Rocco.new( 'filename.rb' ) { "" } r = Rocco.new( 'filename.rb' ) { "" }
assert_equal( assert_equal(
[ [
[ [ "Comment 1" ], [ "def codeblock" ] ], [ [ "Comment 1" ], [ "def codeblock" ] ],
[ [ "Comment 2" ], [ "end" ] ] [ [ "Comment 2" ], [ "end" ] ]
], ],
r.parse( "#!/usr/bin/env bash\n# encoding: utf-8\n# Comment 1\ndef codeblock\n# Comment 2\nend\n" ), r.parse( "#!/usr/bin/env bash\n# encoding: utf-8\n# Comment 1\ndef codeblock\n# Comment 2\nend\n" ),
"Strings matching the PEP 263 encoding definition regex should be stripped when they appear at the top of a python document." "Strings matching the PEP 263 encoding definition regex should be stripped when they appear at the top of a python document."
) )
end end
def test_encoding_in_python def test_encoding_in_python
r = Rocco.new( 'filename.py' ) { "" } r = Rocco.new( 'filename.py' ) { "" }
assert_equal( assert_equal(
[ [
[ [ "Comment 1" ], [ "def codeblock" ] ], [ [ "Comment 1" ], [ "def codeblock" ] ],
[ [ "Comment 2" ], [ "end" ] ] [ [ "Comment 2" ], [ "end" ] ]
], ],
r.parse( "#!/usr/bin/env bash\n# encoding: utf-8\n# Comment 1\ndef codeblock\n# Comment 2\nend\n" ), r.parse( "#!/usr/bin/env bash\n# encoding: utf-8\n# Comment 1\ndef codeblock\n# Comment 2\nend\n" ),
"Strings matching the PEP 263 encoding definition regex should be stripped when they appear at the top of a python document." "Strings matching the PEP 263 encoding definition regex should be stripped when they appear at the top of a python document."
) )
end end
def test_encoding_in_notpython def test_encoding_in_notpython
r = Rocco.new( 'filename.sh' ) { "" } r = Rocco.new( 'filename.sh' ) { "" }
assert_equal( assert_equal(
[ [
[ [ "encoding: utf-8", "Comment 1" ], [ "def codeblock" ] ], [ [ "encoding: utf-8", "Comment 1" ], [ "def codeblock" ] ],
[ [ "Comment 2" ], [ "end" ] ] [ [ "Comment 2" ], [ "end" ] ]
], ],
r.parse( "#!/usr/bin/env bash\n# encoding: utf-8\n# Comment 1\ndef codeblock\n# Comment 2\nend\n" ), r.parse( "#!/usr/bin/env bash\n# encoding: utf-8\n# Comment 1\ndef codeblock\n# Comment 2\nend\n" ),
"Strings matching the PEP 263 encoding definition regex should be stripped when they appear at the top of a python document." "Strings matching the PEP 263 encoding definition regex should be stripped when they appear at the top of a python document."
) )
end end
end end

View File

@ -13,6 +13,7 @@ class RoccoSourceListTests < Test::Unit::TestCase
"URLs correctly generated for files in a flat directory structure" "URLs correctly generated for files in a flat directory structure"
) )
end end
def test_heiarachical_sourcelist def test_heiarachical_sourcelist
r = Rocco.new( 'a/issue26.sh', [ 'a/issue26a.sh', 'b/issue26b.sh', 'c/issue26c.sh' ] ) { r = Rocco.new( 'a/issue26.sh', [ 'a/issue26a.sh', 'b/issue26b.sh', 'c/issue26c.sh' ] ) {
"# Comment 1\n# Comment 1\nprint 'omg!'" "# Comment 1\n# Comment 1\nprint 'omg!'"
@ -25,5 +26,4 @@ class RoccoSourceListTests < Test::Unit::TestCase
"URLs correctly generated for files in a flat directory structure" "URLs correctly generated for files in a flat directory structure"
) )
end end
end end