[DRE-commits] [kwalify] 01/04: [patch] adapt expected test results to recent Ruby

Marc Dequènes duck at moszumanska.debian.org
Wed Aug 5 22:23:37 UTC 2015


This is an automated email from the git hooks/post-receive script.

duck pushed a commit to branch master
in repository kwalify.

commit f1dde003a2841a2b028b1b66a8dcc4eaf3997de9
Author: Marc Dequènes (Duck) <Duck at DuckCorp.org>
Date:   Wed Aug 5 22:26:49 2015 +0200

    [patch] adapt expected test results to recent Ruby
---
 debian/changelog                   |   1 +
 debian/patches/series              |   1 +
 debian/patches/text_fix_data.patch | 218 +++++++++++++++++++++++++++++++++++++
 3 files changed, 220 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 2a52bb6..a5317d5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,7 @@ kwalify (0.7.2-3) UNRELEASED; urgency=medium
   * Added patch to fix several path problems in tests.
   * Added patch to fix tests temporary directory creation and cleanup.
   * Added patch to fix 'Config' class conflict in tests.
+  * Added patch to adapt expected test results to recent Ruby.
 
  -- Marc Dequènes (Duck) <Duck at DuckCorp.org>  Tue, 04 Aug 2015 21:33:19 +0200
 
diff --git a/debian/patches/series b/debian/patches/series
index 5433cb3..414c877 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -6,3 +6,4 @@ proper_string_split.patch
 test_paths_fix.patch
 test_fix_tmpdir.patch
 test_config_class_conflict.patch
+text_fix_data.patch
diff --git a/debian/patches/text_fix_data.patch b/debian/patches/text_fix_data.patch
new file mode 100644
index 0000000..659999e
--- /dev/null
+++ b/debian/patches/text_fix_data.patch
@@ -0,0 +1,218 @@
+Index: kwalify/test/data/users-guide/example_address_book_ruby.result
+===================================================================
+--- kwalify.orig/test/data/users-guide/example_address_book_ruby.result
++++ kwalify/test/data/users-guide/example_address_book_ruby.result
+@@ -3,7 +3,7 @@ $ ruby example_address_book.rb
+  #<Group:0xddf10 @desc="my friends", @name="friend">,
+  #<Group:0xdde84 @desc="those who works together", @name="business">]
+ [#<Person:0xdefdc
+-  @birth=#<Date: 4903089/2,0,2299161>,
++  @birth=#<Date: 2000-01-01 ((2451545j,0s,0n),+0s,2299161j)>,
+   @blood="A",
+   @deleted=false,
+   @desc=nil,
+@@ -12,7 +12,7 @@ $ ruby example_address_book.rb
+   @name="Sumire",
+   @phone=nil>,
+  #<Person:0xdee9c
+-  @birth=#<Date: 4899437/2,0,2299161>,
++  @birth=#<Date: 1995-01-01 ((2449719j,0s,0n),+0s,2299161j)>,
+   @blood=nil,
+   @deleted=false,
+   @desc=nil,
+Index: kwalify/test/test-databinding.yaml
+===================================================================
+--- kwalify.orig/test/test-databinding.yaml
++++ kwalify/test/test-databinding.yaml
+@@ -51,20 +51,20 @@
+     ruby: |
+ 	[#<My1::Address:0x001
+ 	  @age=15,
+-	  @birth=#<Date: 4895785/2,0,2299161>,
++	  @birth=#<Date: 1990-01-01 ((2447893j,0s,0n),+0s,2299161j)>,
+ 	  @blood="A",
+ 	  @email="foo at mail.com",
+ 	  @name="Foo",
+ 	  @tel="012-345-7777">,
+ 	 #<My1::Address:0x002
+ 	  @age=14,
+-	  @birth=#<Date: 4896517/2,0,2299161>,
++	  @birth=#<Date: 1991-01-02 ((2448259j,0s,0n),+0s,2299161j)>,
+ 	  @email="bar at mail.org",
+ 	  @name="Bar",
+ 	  @tel="012-345-8889">,
+ 	 #<My1::Address:0x003
+ 	  @age=13,
+-	  @birth=#<Date: 4897249/2,0,2299161>,
++	  @birth=#<Date: 1992-01-03 ((2448625j,0s,0n),+0s,2299161j)>,
+ 	  @blood="AB",
+ 	  @email="baz at mail.net",
+ 	  @name="Foo",
+Index: kwalify/test/test-parser-yaml.yaml
+===================================================================
+--- kwalify.orig/test/test-parser-yaml.yaml
++++ kwalify/test/test-parser-yaml.yaml
+@@ -863,7 +863,7 @@ input: |
+   
+ #
+ expected: |
+-  [{"text1"=>"  A\n\n B\n  C\n"}, {"text2"=>"  A\n\n B\n  C\n\n\n"}, {"text3"=>"  A\n\n B\n  C"}]
++  [{"text1"=>"  A\n\n B\n  C\n"}, {"text2"=>"  A\n\n B\n  C\n\n\n"}, {"text3"=>"  A\n \n B\n  C"}]
+ locations:
+   - [ "/",          1,  1 ]
+   - [ "/0",         1,  3 ]
+@@ -1244,13 +1244,13 @@ input: |
+ #
+ expected*:
+   ruby: |
+-    {"sequence"=>
++    {"type"=>"seq",
++     "sequence"=>
+       [{"type"=>"map",
+         "mapping"=>
+          {"name"=>{"type"=>"str"},
+-          "post"=>{"enum"=>["exective", "manager", "clerk"], "type"=>"str"},
+-          "supervisor"=>{...}}}],
+-     "type"=>"seq"}
++          "post"=>{"type"=>"str", "enum"=>["exective", "manager", "clerk"]},
++          "supervisor"=>{...}}}]}
+   java: |
+     {"sequence"=>[{"mapping"=>{"name"=>{"type"=>"str"}, "post"=>{"enum"=>["exective", "manager", "clerk"], "type"=>"str"}, "supervisor"=>{...}}, "type"=>"map"}], "type"=>"seq"}
+ locations:
+@@ -1565,7 +1565,7 @@ input: |
+   - :sym
+ expected*:
+   ruby: |
+-    ["abc", 123, 3.14, true, false, true, false, nil, nil, "123", "456", #<Date: 4906743/2,0,2299161>, :sym]
++    ["abc", 123, 3.14, true, false, true, false, nil, nil, "123", "456", #<Date: 2005-01-01 ((2453372j,0s,0n),+0s,2299161j)>, :sym]
+ #  ruby: |
+ #    ["abc",
+ #     123,
+@@ -1578,11 +1578,11 @@ expected*:
+ #     nil,
+ #     "123",
+ #     "456",
+-#     #<Date: 4906743/2,0,2299161>,
++#     #<Date: 2005-01-01 ((2453372j,0s,0n),+0s,2299161j)>,
+ #     :sym]
+   java: |
+     ["abc", 123, 3.14, true, false, true, false, nil, nil, "123", "456", Tue Feb 01 00:00:00 JST 2005, ":sym"]
+-#  ["abc", 123, true, false, true, false, nil, nil, "123", "456", #<Date: 4906743/2,0,2299161>, :sym]
++#  ["abc", 123, true, false, true, false, nil, nil, "123", "456", #<Date: 2005-01-01 ((2453372j,0s,0n),+0s,2299161j)>, :sym]
+ ##
+ ---
+ name:  scalar2
+@@ -1603,7 +1603,7 @@ input: |
+   - 2005-01-01 : 2005-01-01
+   - :sym : :sym
+ # - ~ : ~
+-# - 2005-01-01 00:00:00 : 2005-01-01 00:00:00
++# - #<Date: 2005-01-01 ((2453372j,0s,0n),+0s,2299161j)> 00:00:00 : #<Date: 2005-01-01 ((2453372j,0s,0n),+0s,2299161j)> 00:00:00
+ expected*:
+   ruby: |
+     [{"abc"=>"ABC"},
+@@ -1617,7 +1617,8 @@ expected*:
+      {nil=>nil},
+      {"123"=>"123"},
+      {"456"=>"456"},
+-     {#<Date: 4906743/2,0,2299161>=>#<Date: 4906743/2,0,2299161>},
++     {#<Date: 2005-01-01 ((2453372j,0s,0n),+0s,2299161j)>=>
++       #<Date: 2005-01-01 ((2453372j,0s,0n),+0s,2299161j)>},
+      {:sym=>:sym}]
+   java: |
+     [{"abc"=>"ABC"}, {123=>123}, {3.14=>3.14}, {true=>true}, {false=>false}, {true=>true}, {false=>false}, "~ : ~", {nil=>nil}, {"123"=>"123"}, {"456"=>"456"}, {Tue Feb 01 00:00:00 JST 2005=>Tue Feb 01 00:00:00 JST 2005}, {":sym"=>":sym"}]
+@@ -1708,7 +1709,7 @@ input: |
+   - {'A': "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e",
+      "B": "\u65e5\u672c\u8a9e" }
+ expected: |
+-    [["\346\227\245\346\234\254\350\252\236", "\346\227\245\346\234\254\350\252\236"], {"A"=>"\346\227\245\346\234\254\350\252\236", "B"=>"\346\227\245\346\234\254\350\252\236"}, ["\346\227\245\346\234\254\350\252\236", "\346\227\245\346\234\254\350\252\236"], {"A"=>"\346\227\245\346\234\254\350\252\236", "B"=>"\346\227\245\346\234\254\350\252\236"}]
++    [["\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E", "日本語"], {"A"=>"\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E", "B"=>"日本語"}, ["\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E", "日本語"], {"A"=>"\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E", "B"=>"日本語"}]
+ locations:
+   - [ "/",	1, 1 ]
+   - [ "/0",	2, 2 ]
+Index: kwalify/test/test-yaml-parser.yaml
+===================================================================
+--- kwalify.orig/test/test-yaml-parser.yaml
++++ kwalify/test/test-yaml-parser.yaml
+@@ -905,13 +905,13 @@ input: |
+ #
+ expected*:
+   ruby: |
+-    {"sequence"=>
++    {"type"=>"seq",
++     "sequence"=>
+       [{"type"=>"map",
+         "mapping"=>
+          {"name"=>{"type"=>"str"},
+-          "post"=>{"enum"=>["exective", "manager", "clerk"], "type"=>"str"},
+-          "supervisor"=>{...}}}],
+-     "type"=>"seq"}
++          "post"=>{"type"=>"str", "enum"=>["exective", "manager", "clerk"]},
++          "supervisor"=>{...}}}]}
+   java: |
+     {"sequence"=>[{"mapping"=>{"name"=>{"type"=>"str"}, "post"=>{"enum"=>["exective", "manager", "clerk"], "type"=>"str"}, "supervisor"=>{...}}, "type"=>"map"}], "type"=>"seq"}
+ ##
+@@ -1148,7 +1148,7 @@ input: |
+   - :sym
+ expected*:
+   ruby: |
+-    ["abc", 123, 3.14, true, false, true, false, nil, nil, "123", "456", #<Date: 4906743/2,0,2299161>, :sym]
++    ["abc", 123, 3.14, true, false, true, false, nil, nil, "123", "456", #<Date: 2005-01-01 ((2453372j,0s,0n),+0s,2299161j)>, :sym]
+ #  ruby: |
+ #    ["abc",
+ #     123,
+@@ -1161,11 +1161,11 @@ expected*:
+ #     nil,
+ #     "123",
+ #     "456",
+-#     #<Date: 4906743/2,0,2299161>,
++#     #<Date: 2005-01-01 ((2453372j,0s,0n),+0s,2299161j)>,
+ #     :sym]
+   java: |
+     ["abc", 123, 3.14, true, false, true, false, nil, nil, "123", "456", Tue Feb 01 00:00:00 JST 2005, ":sym"]
+-#  ["abc", 123, true, false, true, false, nil, nil, "123", "456", #<Date: 4906743/2,0,2299161>, :sym]
++#  ["abc", 123, true, false, true, false, nil, nil, "123", "456", #<Date: 2005-01-01 ((2453372j,0s,0n),+0s,2299161j)>, :sym]
+ ##
+ ---
+ name:  scalar2
+@@ -1200,7 +1200,8 @@ expected*:
+      {nil=>nil},
+      {"123"=>"123"},
+      {"456"=>"456"},
+-     {#<Date: 4906743/2,0,2299161>=>#<Date: 4906743/2,0,2299161>},
++     {#<Date: 2005-01-01 ((2453372j,0s,0n),+0s,2299161j)>=>
++       #<Date: 2005-01-01 ((2453372j,0s,0n),+0s,2299161j)>},
+      {:sym=>:sym}]
+   java: |
+     [{"abc"=>"ABC"}, {123=>123}, {3.14=>3.14}, {true=>true}, {false=>false}, {true=>true}, {false=>false}, "~ : ~", {nil=>nil}, {"123"=>"123"}, {"456"=>"456"}, {Tue Feb 01 00:00:00 JST 2005=>Tue Feb 01 00:00:00 JST 2005}, {":sym"=>":sym"}]
+Index: kwalify/test/test-main.yaml
+===================================================================
+--- kwalify.orig/test/test-main.yaml
++++ kwalify/test/test-main.yaml
+@@ -79,7 +79,7 @@
+     java: CommandOptionException
+   message: "-i: invalid command option."
+   error_symbol*:
+-    ruby: !ruby/sym :command_option_invalid
++    ruby: !ruby/sym command_option_invalid
+     java: command.option.invalid
+ ##
+ - name:  optionError2
+@@ -92,7 +92,7 @@
+     java: CommandOptionException
+   message: "-f: schema filename is required."
+   error_symbol*:
+-    ruby: !ruby/sym :command_option_schema_required
++    ruby: !ruby/sym command_option_schema_required
+     java: command.option.noschema
+ ####
+ ##name:  optionError3
+@@ -130,7 +130,7 @@
+   method: execute
+   args:  [ -vt, document.yaml ]
+   expected: |
+-    0.0.0
++    0.7.2
+ ##
+ - name:  help		# -h
+   desc:  option '-h'

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/kwalify.git



More information about the Pkg-ruby-extras-commits mailing list