Permalink
Browse files

Fix tests.

  • Loading branch information...
1 parent 29a6389 commit 92609fdf03887f358ec024da895ac8ebc67b9f9d Sven Felix Oberquelle committed with Apr 12, 2011
Showing with 52 additions and 52 deletions.
  1. +52 −52 test/test_parser.rb
View
@@ -11,75 +11,75 @@ class TestGetTextParser < Test::Unit::TestCase
def test_ruby
@ary = GetText::RGetText.parse(['testlib/gettext.rb'])
- assert_target 'aaa', ['testlib/gettext.rb:8']
- assert_target 'aaa\n', ['testlib/gettext.rb:12']
- assert_target 'bbb\nccc', ['testlib/gettext.rb:16']
- assert_target 'bbb\nccc\nddd\n', ['testlib/gettext.rb:20']
- assert_target 'eee', ['testlib/gettext.rb:27', 'testlib/gettext.rb:31']
- assert_target 'fff', ['testlib/gettext.rb:31']
- assert_target 'ggghhhiii', ['testlib/gettext.rb:35']
- assert_target 'a"b"c"', ['testlib/gettext.rb:41']
- assert_target 'd"e"f"', ['testlib/gettext.rb:45']
- assert_target 'jjj', ['testlib/gettext.rb:49']
- assert_target 'kkk', ['testlib/gettext.rb:50']
- assert_target 'lllmmm', ['testlib/gettext.rb:54']
- assert_target 'nnn\nooo', ['testlib/gettext.rb:62']
- assert_target "\#", ['testlib/gettext.rb:66', 'testlib/gettext.rb:70']
- assert_target "\\taaa", ['testlib/gettext.rb:74']
- assert_target "Here document1\\nHere document2\\n", ['testlib/gettext.rb:78']
- assert_target "Francois Pinard", ['testlib/gettext.rb:97'] do |t|
+ assert_target 'aaa', ['testlib/gettext.rb:10']
+ assert_target 'aaa\n', ['testlib/gettext.rb:14']
+ assert_target 'bbb\nccc', ['testlib/gettext.rb:18']
+ assert_target 'bbb\nccc\nddd\n', ['testlib/gettext.rb:22']
+ assert_target 'eee', ['testlib/gettext.rb:29', 'testlib/gettext.rb:33']
+ assert_target 'fff', ['testlib/gettext.rb:33']
+ assert_target 'ggghhhiii', ['testlib/gettext.rb:37']
+ assert_target 'a"b"c"', ['testlib/gettext.rb:43']
+ assert_target 'd"e"f"', ['testlib/gettext.rb:47']
+ assert_target 'jjj', ['testlib/gettext.rb:51']
+ assert_target 'kkk', ['testlib/gettext.rb:52']
+ assert_target 'lllmmm', ['testlib/gettext.rb:56']
+ assert_target 'nnn\nooo', ['testlib/gettext.rb:64']
+ assert_target "\#", ['testlib/gettext.rb:68', 'testlib/gettext.rb:72']
+ assert_target "\\taaa", ['testlib/gettext.rb:76']
+ assert_target "Here document1\\nHere document2\\n", ['testlib/gettext.rb:80']
+ assert_target "Francois Pinard", ['testlib/gettext.rb:99'] do |t|
assert_match /proper name/, t.comment
assert_match /Pronunciation/, t.comment
end
- assert_target "self explaining", ['testlib/gettext.rb:102'] do |t|
+ assert_target "self explaining", ['testlib/gettext.rb:104'] do |t|
assert_nil t.comment
end
- # TODO: assert_target "in_quote", ['testlib/gettext.rb:96']
+ # TODO: assert_target "in_quote", ['testlib/gettext.rb:98']
end
def test_ruby_N
@ary = GetText::RGetText.parse(['testlib/N_.rb'])
- assert_target 'aaa', ['testlib/N_.rb:8']
- assert_target 'aaa\n', ['testlib/N_.rb:12']
- assert_target 'bbb\nccc', ['testlib/N_.rb:16']
- assert_target 'bbb\nccc\nddd\n', ['testlib/N_.rb:20']
- assert_target 'eee', ['testlib/N_.rb:27', 'testlib/N_.rb:31']
- assert_target 'fff', ['testlib/N_.rb:31']
- assert_target 'ggghhhiii', ['testlib/N_.rb:35']
- assert_target 'a"b"c"', ['testlib/N_.rb:41']
- assert_target 'd"e"f"', ['testlib/N_.rb:45']
- assert_target 'jjj', ['testlib/N_.rb:49']
- assert_target 'kkk', ['testlib/N_.rb:50']
- assert_target 'lllmmm', ['testlib/N_.rb:54']
- assert_target 'nnn\nooo', ['testlib/N_.rb:62']
+ assert_target 'aaa', ['testlib/N_.rb:10']
+ assert_target 'aaa\n', ['testlib/N_.rb:14']
+ assert_target 'bbb\nccc', ['testlib/N_.rb:18']
+ assert_target 'bbb\nccc\nddd\n', ['testlib/N_.rb:22']
+ assert_target 'eee', ['testlib/N_.rb:29', 'testlib/N_.rb:33']
+ assert_target 'fff', ['testlib/N_.rb:33']
+ assert_target 'ggghhhiii', ['testlib/N_.rb:37']
+ assert_target 'a"b"c"', ['testlib/N_.rb:43']
+ assert_target 'd"e"f"', ['testlib/N_.rb:47']
+ assert_target 'jjj', ['testlib/N_.rb:51']
+ assert_target 'kkk', ['testlib/N_.rb:52']
+ assert_target 'lllmmm', ['testlib/N_.rb:56']
+ assert_target 'nnn\nooo', ['testlib/N_.rb:64']
end
def test_ruby_n
@ary = GetText::RGetText.parse(['testlib/ngettext.rb'])
- assert_plural_target "aaa", "aaa2", ['testlib/ngettext.rb:8']
- assert_plural_target "bbb\\n", "ccc2\\nccc2", ['testlib/ngettext.rb:12']
- assert_plural_target "ddd\\nddd", "ddd2\\nddd2", ['testlib/ngettext.rb:16']
- assert_plural_target "eee\\neee\\n", "eee2\\neee2\\n", ['testlib/ngettext.rb:21']
- assert_plural_target "ddd\\neee\\n", "ddd\\neee2", ['testlib/ngettext.rb:27']
- assert_plural_target "fff", "fff2", ['testlib/ngettext.rb:34', 'testlib/ngettext.rb:38']
- assert_plural_target "ggg", "ggg2", ['testlib/ngettext.rb:38']
- assert_plural_target "ggghhhiii", "jjjkkklll", ['testlib/ngettext.rb:42']
- assert_plural_target "a\"b\"c\"", "a\"b\"c\"2", ['testlib/ngettext.rb:51']
- assert_plural_target "mmmmmm", "mmm2mmm2", ['testlib/ngettext.rb:59']
- assert_plural_target "nnn", "nnn2", ['testlib/ngettext.rb:60']
- assert_plural_target "comment", "comments", ['testlib/ngettext.rb:76'] do |t|
- assert_equal "please provide translations for all \n the plural forms!", t.comment
+ assert_plural_target "aaa", "aaa2", ['testlib/ngettext.rb:10']
+ assert_plural_target "bbb\\n", "ccc2\\nccc2", ['testlib/ngettext.rb:14']
+ assert_plural_target "ddd\\nddd", "ddd2\\nddd2", ['testlib/ngettext.rb:18']
+ assert_plural_target "eee\\neee\\n", "eee2\\neee2\\n", ['testlib/ngettext.rb:23']
+ assert_plural_target "ddd\\neee\\n", "ddd\\neee2", ['testlib/ngettext.rb:29']
+ assert_plural_target "fff", "fff2", ['testlib/ngettext.rb:36', 'testlib/ngettext.rb:40']
+ assert_plural_target "ggg", "ggg2", ['testlib/ngettext.rb:40']
+ assert_plural_target "ggghhhiii", "jjjkkklll", ['testlib/ngettext.rb:44']
+ assert_plural_target "a\"b\"c\"", "a\"b\"c\"2", ['testlib/ngettext.rb:53']
+ assert_plural_target "mmmmmm", "mmm2mmm2", ['testlib/ngettext.rb:61']
+ assert_plural_target "nnn", "nnn2", ['testlib/ngettext.rb:62']
+ assert_plural_target "comment", "comments", ['testlib/ngettext.rb:78'] do |t|
+ assert_equal "please provide translations for all\n the plural forms!", t.comment
end
end
def test_ruby_p
@ary = GetText::RGetText.parse(['testlib/pgettext.rb'])
- assert_target_in_context "AAA", "BBB", ["testlib/pgettext.rb:8", "testlib/pgettext.rb:12"]
- assert_target_in_context "AAA|BBB", "CCC", ["testlib/pgettext.rb:16"]
- assert_target_in_context "AAA", "CCC", ["testlib/pgettext.rb:20"]
- assert_target_in_context "CCC", "BBB", ["testlib/pgettext.rb:24"]
- assert_target_in_context "program", "name", ['testlib/pgettext.rb:34'] do |t|
+ assert_target_in_context "AAA", "BBB", ["testlib/pgettext.rb:10", "testlib/pgettext.rb:14"]
+ assert_target_in_context "AAA|BBB", "CCC", ["testlib/pgettext.rb:18"]
+ assert_target_in_context "AAA", "CCC", ["testlib/pgettext.rb:22"]
+ assert_target_in_context "CCC", "BBB", ["testlib/pgettext.rb:26"]
+ assert_target_in_context "program", "name", ['testlib/pgettext.rb:36'] do |t|
assert_equal "please translate 'name' in the context of 'program'.\n Hint: the translation should NOT contain the translation of 'program'.", t.comment
end
end
@@ -121,8 +121,8 @@ def test_rgettext_parse
assert_plural_target "ccc1", "ccc2", ['testlib/erb.rxml:14']
@ary = GetText::RGetText.parse(['testlib/ngettext.rb'])
- assert_plural_target "ooo", "ppp", ['testlib/ngettext.rb:64', 'testlib/ngettext.rb:65']
- assert_plural_target "qqq", "rrr", ['testlib/ngettext.rb:69', 'testlib/ngettext.rb:70']
+ assert_plural_target "ooo", "ppp", ['testlib/ngettext.rb:66', 'testlib/ngettext.rb:67']
+ assert_plural_target "qqq", "rrr", ['testlib/ngettext.rb:71', 'testlib/ngettext.rb:72']
end
private

0 comments on commit 92609fd

Please sign in to comment.