File: test_gtk_builder_ui_definitions.rb

package info (click to toggle)
ruby-gettext 3.3.3-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 6,424 kB
  • sloc: ruby: 9,643; makefile: 8
file content (45 lines) | stat: -rw-r--r-- 1,660 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Copyright (C) 2020  Sutou Kouhei <kou@clear-code.com>
#
# License: Ruby's or LGPL
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

require "gettext/tools/parser/gtk_builder_ui_definitions"

class TestGtkBuilderUIDefinitionsParser < Test::Unit::TestCase
  include Helper::Parser

  def parse(file)
    GetText::GtkBuilderUIDefinitionsParser.parse(fixture_path(file))
  end

  def test_all
    assert_parse([
                   {
                     :msgid => "label with context",
                     :msgctxt => "context",
                     :references => ["gtk_builder_ui_definitions.ui:19"],
                   },
                   {
                     :msgid => "label simple",
                     :references => ["gtk_builder_ui_definitions.ui:31"],
                   },
                   {
                     :msgid => "multiple\n" + "lines\n" + "label",
                     :references => ["gtk_builder_ui_definitions.ui:55"],
                   },
                 ],
                 "gtk_builder_ui_definitions.ui")
  end
end