test/tools/test_msgmerge.rb in gettext-3.1.4 vs test/tools/test_msgmerge.rb in gettext-3.1.5

- old
+ new

@@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2012-2014 Kouhei Sutou <kou@clear-code.com> +# Copyright (C) 2012-2015 Kouhei Sutou <kou@clear-code.com> # Copyright (C) 2010 Eddie Lau <tatonlto@gmail.com> # # License: Ruby's or LGPL # # This library is free software: you can redistribute it and/or modify @@ -215,9 +215,34 @@ :translator_comment => "header comment", :flag => "fuzzy") merged_po = merge assert_equal(pot_creation_date, merged_po[""].msgstr) + end + + def test_already_fuzzy_po + @po["hello"] = generate_entry(:msgid => "hello", + :msgstr => "bonjour", + :flag => "fuzzy") + @pot["hello"] = generate_entry(:msgid => "hello", + :msgstr => nil) + @pot["helol"] = generate_entry(:msgid => "helol", + :msgstr => nil, + :flag => "fuzzy") + merged_po = merge + assert_true(merged_po.has_key?("helol")) + assert_equal(["fuzzy"], merged_po["helol"].flags) + end + + def test_already_fuzzy_pot + @po["hello"] = generate_entry(:msgid => "hello", + :msgstr => "bonjour") + @pot["helol"] = generate_entry(:msgid => "helol", + :msgstr => nil, + :flag => "fuzzy") + merged_po = merge + assert_true(merged_po.has_key?("helol")) + assert_equal(["fuzzy"], merged_po["helol"].flags) end end class TestAddFuzzy < self def test_nonexistent_msgctxt