|
|
3322d9 |
From 81a56bce3a41896310bd1bed733b894b0c094979 Mon Sep 17 00:00:00 2001
|
|
|
3322d9 |
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
|
|
|
3322d9 |
Date: Tue, 5 Mar 2013 10:02:31 +0100
|
|
|
3322d9 |
Subject: [PATCH 1/5] Fix embedded YAML to be compatible with Psych.
|
|
|
3322d9 |
|
|
|
3322d9 |
---
|
|
|
3322d9 |
test/test-engines.rb | 32 +++++++++++++++++++++-----------
|
|
|
3322d9 |
1 file changed, 21 insertions(+), 11 deletions(-)
|
|
|
3322d9 |
|
|
|
3322d9 |
diff --git a/test/test-engines.rb b/test/test-engines.rb
|
|
|
3322d9 |
index 8f0705a..a183231 100644
|
|
|
3322d9 |
--- a/test/test-engines.rb
|
|
|
3322d9 |
+++ b/test/test-engines.rb
|
|
|
3322d9 |
@@ -71,7 +71,8 @@ __END__
|
|
|
3322d9 |
- name: ruby2_options
|
|
|
3322d9 |
lang: ruby
|
|
|
3322d9 |
class: Eruby
|
|
|
3322d9 |
- options: { :bufvar: '@_out_buf' }
|
|
|
3322d9 |
+ options:
|
|
|
3322d9 |
+ :bufvar: '@_out_buf'
|
|
|
3322d9 |
input: |
|
|
|
3322d9 |
|
|
|
3322d9 |
<% for item in @items %>
|
|
|
3322d9 |
@@ -137,7 +138,9 @@ __END__
|
|
|
3322d9 |
- name: c1
|
|
|
3322d9 |
lang: c
|
|
|
3322d9 |
class: Ec
|
|
|
3322d9 |
- options: { :filename: foo.html, :indent: ' ' }
|
|
|
3322d9 |
+ options:
|
|
|
3322d9 |
+ :filename: foo.html
|
|
|
3322d9 |
+ :indent: ' '
|
|
|
3322d9 |
input: |4
|
|
|
3322d9 |
|
|
|
3322d9 |
|
|
|
3322d9 |
@@ -167,7 +170,9 @@ __END__
|
|
|
3322d9 |
- name: cpp1
|
|
|
3322d9 |
lang: cpp
|
|
|
3322d9 |
class: Ecpp
|
|
|
3322d9 |
- options: { :filename: foo.html, :indent: ' ' }
|
|
|
3322d9 |
+ options:
|
|
|
3322d9 |
+ :filename: foo.html
|
|
|
3322d9 |
+ :indent: ' '
|
|
|
3322d9 |
input: |4
|
|
|
3322d9 |
|
|
|
3322d9 |
|
|
|
3322d9 |
@@ -197,7 +202,10 @@ __END__
|
|
|
3322d9 |
- name: java1
|
|
|
3322d9 |
lang: java
|
|
|
3322d9 |
class: Ejava
|
|
|
3322d9 |
- options: { :buf: _buf, :bufclass: StringBuilder, :indent: ' ' }
|
|
|
3322d9 |
+ options:
|
|
|
3322d9 |
+ :buf: _buf,
|
|
|
3322d9 |
+ :bufclass: StringBuilder
|
|
|
3322d9 |
+ :indent: ' '
|
|
|
3322d9 |
input: |
|
|
|
3322d9 |
|
|
|
3322d9 |
|
|
|
3322d9 |
@@ -220,19 +228,19 @@ __END__
|
|
|
3322d9 |
expected: |4
|
|
|
3322d9 |
StringBuilder _buf = new StringBuilder(); _buf.append("\n"
|
|
|
3322d9 |
+ " \n");
|
|
|
3322d9 |
-
|
|
|
3322d9 |
+
|
|
|
3322d9 |
int i = 0;
|
|
|
3322d9 |
for (Iterator it = list.iterator(); it.hasNext(); ) {
|
|
|
3322d9 |
String s = (String)it.next();
|
|
|
3322d9 |
i++;
|
|
|
3322d9 |
-
|
|
|
3322d9 |
+
|
|
|
3322d9 |
_buf.append(" \n"
|
|
|
3322d9 |
+ " "); _buf.append(i); _buf.append("\n"
|
|
|
3322d9 |
+ " "); _buf.append(escape(s)); _buf.append("\n"
|
|
|
3322d9 |
+ " \n");
|
|
|
3322d9 |
-
|
|
|
3322d9 |
+
|
|
|
3322d9 |
}
|
|
|
3322d9 |
-
|
|
|
3322d9 |
+
|
|
|
3322d9 |
_buf.append(" \n"
|
|
|
3322d9 |
+ "\n");
|
|
|
3322d9 |
System.err.println("*** debug: i="+(i)); _buf.append("\n");
|
|
|
3322d9 |
@@ -242,7 +250,7 @@ __END__
|
|
|
3322d9 |
lang: scheme
|
|
|
3322d9 |
class: Escheme
|
|
|
3322d9 |
options:
|
|
|
3322d9 |
- input: &scheme1_input|
|
|
|
3322d9 |
+ input: &scheme1_input |
|
|
|
3322d9 |
<% (let ((i 0)) %>
|
|
|
3322d9 |
|
|
|
3322d9 |
|
|
|
3322d9 |
@@ -290,7 +298,8 @@ __END__
|
|
|
3322d9 |
- name: scheme2
|
|
|
3322d9 |
lang: scheme
|
|
|
3322d9 |
class: Escheme
|
|
|
3322d9 |
- options: { :func: 'display' }
|
|
|
3322d9 |
+ options:
|
|
|
3322d9 |
+ :func: 'display'
|
|
|
3322d9 |
input: *scheme1_input
|
|
|
3322d9 |
expected: |4
|
|
|
3322d9 |
(let ((i 0))
|
|
|
3322d9 |
@@ -401,7 +410,8 @@ __END__
|
|
|
3322d9 |
- name: javascript2
|
|
|
3322d9 |
lang: javascript
|
|
|
3322d9 |
class: Ejavascript
|
|
|
3322d9 |
- options: { :docwrite: false }
|
|
|
3322d9 |
+ options:
|
|
|
3322d9 |
+ :docwrite: false
|
|
|
3322d9 |
input: *javascript_input
|
|
|
3322d9 |
expected: |4
|
|
|
3322d9 |
var _buf = [];
|
|
|
3322d9 |
--
|
|
|
3322d9 |
1.8.1.4
|
|
|
3322d9 |
|
|
|
3322d9 |
|
|
|
3322d9 |
From bbf33e57251d353ffe4789c7f4e445305b707d12 Mon Sep 17 00:00:00 2001
|
|
|
3322d9 |
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
|
|
|
3322d9 |
Date: Tue, 5 Mar 2013 10:03:23 +0100
|
|
|
3322d9 |
Subject: [PATCH 2/5] Fix embedded YAML to be compatible with Psych.
|
|
|
3322d9 |
|
|
|
3322d9 |
---
|
|
|
3322d9 |
test/test-erubis.rb | 34 ++++++++++++++++++++--------------
|
|
|
3322d9 |
1 file changed, 20 insertions(+), 14 deletions(-)
|
|
|
3322d9 |
|
|
|
3322d9 |
diff --git a/test/test-erubis.rb b/test/test-erubis.rb
|
|
|
3322d9 |
index ad00e5e..89e94f7 100644
|
|
|
3322d9 |
--- a/test/test-erubis.rb
|
|
|
3322d9 |
+++ b/test/test-erubis.rb
|
|
|
3322d9 |
@@ -220,13 +220,13 @@ y = 20
|
|
|
3322d9 |
|
|
|
3322d9 |
__END__
|
|
|
3322d9 |
- name: basic1
|
|
|
3322d9 |
- input: &basic1_input|
|
|
|
3322d9 |
+ input: &basic1_input |
|
|
|
3322d9 |
|
|
|
3322d9 |
<% for item in list %>
|
|
|
3322d9 |
<%= item %>
|
|
|
3322d9 |
<% end %>
|
|
|
3322d9 |
|
|
|
3322d9 |
- src: &basic1_src|
|
|
|
3322d9 |
+ src: &basic1_src |
|
|
|
3322d9 |
_buf = ''; _buf << '
|
|
|
3322d9 |
'; for item in list
|
|
|
3322d9 |
_buf << ' '; _buf << ( item ).to_s; _buf << '
|
|
|
3322d9 |
@@ -234,7 +234,7 @@ __END__
|
|
|
3322d9 |
_buf << '
|
|
|
3322d9 |
';
|
|
|
3322d9 |
_buf.to_s
|
|
|
3322d9 |
- output: &basic1_output|
|
|
|
3322d9 |
+ output: &basic1_output |
|
|
|
3322d9 |
|
|
|
3322d9 |
<aaa>
|
|
|
3322d9 |
b&b
|
|
|
3322d9 |
@@ -344,7 +344,7 @@ __END__
|
|
|
3322d9 |
- name: quotation1
|
|
|
3322d9 |
desc: single quotation and backslash
|
|
|
3322d9 |
class: Eruby
|
|
|
3322d9 |
- input: "ation1_input|
|
|
|
3322d9 |
+ input: "ation1_input |
|
|
|
3322d9 |
a = "'"
|
|
|
3322d9 |
b = "\""
|
|
|
3322d9 |
c = '\''
|
|
|
3322d9 |
@@ -451,7 +451,9 @@ __END__
|
|
|
3322d9 |
##
|
|
|
3322d9 |
- name: bodyonly1
|
|
|
3322d9 |
testopt: skip_output
|
|
|
3322d9 |
- options: { :preamble: no, :postamble: no }
|
|
|
3322d9 |
+ options:
|
|
|
3322d9 |
+ :preamble: no
|
|
|
3322d9 |
+ :postamble: no
|
|
|
3322d9 |
input: *basic1_input
|
|
|
3322d9 |
src: |4
|
|
|
3322d9 |
_buf << '
|
|
|
3322d9 |
@@ -496,7 +498,7 @@ __END__
|
|
|
3322d9 |
##
|
|
|
3322d9 |
- name: nomatch1
|
|
|
3322d9 |
desc: bug
|
|
|
3322d9 |
- input: &nomatch1|
|
|
|
3322d9 |
+ input: &nomatch1 |
|
|
|
3322d9 |
|
|
|
3322d9 |
foo
|
|
|
3322d9 |
|
|
|
3322d9 |
@@ -510,7 +512,8 @@ __END__
|
|
|
3322d9 |
|
|
|
3322d9 |
##
|
|
|
3322d9 |
- name: escape1
|
|
|
3322d9 |
- options: { :escape: true }
|
|
|
3322d9 |
+ options:
|
|
|
3322d9 |
+ :escape: true
|
|
|
3322d9 |
input: |
|
|
|
3322d9 |
<% str = '<>&"' %>
|
|
|
3322d9 |
<%= str %>
|
|
|
3322d9 |
@@ -570,7 +573,7 @@ __END__
|
|
|
3322d9 |
##
|
|
|
3322d9 |
- name: optimized1
|
|
|
3322d9 |
class: OptimizedEruby
|
|
|
3322d9 |
- input: &optimized1_input|
|
|
|
3322d9 |
+ input: &optimized1_input |
|
|
|
3322d9 |
|
|
|
3322d9 |
<% for item in list %>
|
|
|
3322d9 |
|
|
|
3322d9 |
@@ -677,7 +680,7 @@ __END__
|
|
|
3322d9 |
- name: optimized4
|
|
|
3322d9 |
desc: single quotation and backslash
|
|
|
3322d9 |
class: OptimizedEruby
|
|
|
3322d9 |
- input: &optimized4_input|
|
|
|
3322d9 |
+ input: &optimized4_input |
|
|
|
3322d9 |
a = "'"
|
|
|
3322d9 |
b = "\""
|
|
|
3322d9 |
c = '\''
|
|
|
3322d9 |
@@ -751,14 +754,14 @@ __END__
|
|
|
3322d9 |
- name: pi1
|
|
|
3322d9 |
class: PI::Eruby
|
|
|
3322d9 |
testopt: evaluate
|
|
|
3322d9 |
- input: &input_pi1|
|
|
|
3322d9 |
+ input: &input_pi1 |
|
|
|
3322d9 |
|
|
|
3322d9 |
|
|
|
3322d9 |
@{item}@ / @!{item}@
|
|
|
3322d9 |
<%= item %> / <%== item %>
|
|
|
3322d9 |
|
|
|
3322d9 |
|
|
|
3322d9 |
- src: &src_pi1|
|
|
|
3322d9 |
+ src: &src_pi1 |
|
|
|
3322d9 |
_buf = ''; _buf << '
|
|
|
3322d9 |
'; for item in @list
|
|
|
3322d9 |
_buf << ' '; _buf << Erubis::XmlHelper.escape_xml(item); _buf << ' / '; _buf << (item).to_s; _buf << '
|
|
|
3322d9 |
@@ -767,7 +770,7 @@ __END__
|
|
|
3322d9 |
_buf << '
|
|
|
3322d9 |
';
|
|
|
3322d9 |
_buf.to_s
|
|
|
3322d9 |
- output: &output_pi1|
|
|
|
3322d9 |
+ output: &output_pi1 |
|
|
|
3322d9 |
|
|
|
3322d9 |
<aaa> / <aaa>
|
|
|
3322d9 |
<aaa> / <aaa>
|
|
|
3322d9 |
@@ -780,7 +783,8 @@ __END__
|
|
|
3322d9 |
##
|
|
|
3322d9 |
- name: pi2
|
|
|
3322d9 |
class: PI::Eruby
|
|
|
3322d9 |
- options: { :escape: false }
|
|
|
3322d9 |
+ options:
|
|
|
3322d9 |
+ :escape: false
|
|
|
3322d9 |
testopt: evaluate
|
|
|
3322d9 |
input: *input_pi1
|
|
|
3322d9 |
src: |
|
|
|
3322d9 |
@@ -805,7 +809,9 @@ __END__
|
|
|
3322d9 |
##
|
|
|
3322d9 |
- name: pi3
|
|
|
3322d9 |
class: PI::Eruby
|
|
|
3322d9 |
- options: { :pi: hoge, :embchar: '$' }
|
|
|
3322d9 |
+ options:
|
|
|
3322d9 |
+ :pi: hoge
|
|
|
3322d9 |
+ :embchar: '$'
|
|
|
3322d9 |
testopt: evaluate
|
|
|
3322d9 |
input: |
|
|
|
3322d9 |
|
|
|
3322d9 |
--
|
|
|
3322d9 |
1.8.1.4
|
|
|
3322d9 |
|
|
|
3322d9 |
|
|
|
3322d9 |
From 8c847c79dc4a6a6886d51d01178b7e6bff6e9ad7 Mon Sep 17 00:00:00 2001
|
|
|
3322d9 |
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
|
|
|
3322d9 |
Date: Tue, 5 Mar 2013 10:04:36 +0100
|
|
|
3322d9 |
Subject: [PATCH 3/5] Fix embedded YAML to be compatible with Psych.
|
|
|
3322d9 |
|
|
|
3322d9 |
---
|
|
|
3322d9 |
test/test-enhancers.rb | 14 ++++++++------
|
|
|
3322d9 |
1 file changed, 8 insertions(+), 6 deletions(-)
|
|
|
3322d9 |
|
|
|
3322d9 |
diff --git a/test/test-enhancers.rb b/test/test-enhancers.rb
|
|
|
3322d9 |
index 3b46721..0ad9f65 100644
|
|
|
3322d9 |
--- a/test/test-enhancers.rb
|
|
|
3322d9 |
+++ b/test/test-enhancers.rb
|
|
|
3322d9 |
@@ -106,13 +106,13 @@ __END__
|
|
|
3322d9 |
##
|
|
|
3322d9 |
- name: basic1
|
|
|
3322d9 |
class: Eruby
|
|
|
3322d9 |
- input: &basic1_input|
|
|
|
3322d9 |
+ input: &basic1_input |
|
|
|
3322d9 |
|
|
|
3322d9 |
<% for item in list %>
|
|
|
3322d9 |
<%= item %>
|
|
|
3322d9 |
<% end %>
|
|
|
3322d9 |
|
|
|
3322d9 |
- src: &basic1_src|
|
|
|
3322d9 |
+ src: &basic1_src |
|
|
|
3322d9 |
_buf = ''; _buf << '
|
|
|
3322d9 |
'; for item in list
|
|
|
3322d9 |
_buf << ' '; _buf << ( item ).to_s; _buf << '
|
|
|
3322d9 |
@@ -120,7 +120,7 @@ __END__
|
|
|
3322d9 |
_buf << '
|
|
|
3322d9 |
';
|
|
|
3322d9 |
_buf.to_s
|
|
|
3322d9 |
- output: &basic1_output|
|
|
|
3322d9 |
+ output: &basic1_output |
|
|
|
3322d9 |
|
|
|
3322d9 |
<aaa>
|
|
|
3322d9 |
b&b
|
|
|
3322d9 |
@@ -193,7 +193,7 @@ __END__
|
|
|
3322d9 |
##
|
|
|
3322d9 |
- name: printenabled1
|
|
|
3322d9 |
class: PrintEnabledEruby
|
|
|
3322d9 |
- input: &printenabled1_input|
|
|
|
3322d9 |
+ input: &printenabled1_input |
|
|
|
3322d9 |
|
|
|
3322d9 |
<% for item in list %>
|
|
|
3322d9 |
<% print item %>
|
|
|
3322d9 |
@@ -425,7 +425,8 @@ __END__
|
|
|
3322d9 |
##
|
|
|
3322d9 |
- name: bipattern2
|
|
|
3322d9 |
class: BiPatternEruby
|
|
|
3322d9 |
- options: { :bipattern: '\$\{ \}' }
|
|
|
3322d9 |
+ options:
|
|
|
3322d9 |
+ :bipattern: '\$\{ \}'
|
|
|
3322d9 |
input: |
|
|
|
3322d9 |
<% for item in list %>
|
|
|
3322d9 |
<%=item%> % <%==item%>
|
|
|
3322d9 |
@@ -500,7 +501,8 @@ __END__
|
|
|
3322d9 |
##
|
|
|
3322d9 |
- name: prefixedline1
|
|
|
3322d9 |
class: PrefixedLineEruby
|
|
|
3322d9 |
- options: { :prefixchar: '!' }
|
|
|
3322d9 |
+ options:
|
|
|
3322d9 |
+ :prefixchar: '!'
|
|
|
3322d9 |
input: |
|
|
|
3322d9 |
|
|
|
3322d9 |
! for item in list
|
|
|
3322d9 |
--
|
|
|
3322d9 |
1.8.1.4
|
|
|
3322d9 |
|
|
|
3322d9 |
|
|
|
3322d9 |
From f993710234852a713a351fcd06ca027b1b46d809 Mon Sep 17 00:00:00 2001
|
|
|
3322d9 |
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
|
|
|
3322d9 |
Date: Tue, 5 Mar 2013 10:06:30 +0100
|
|
|
3322d9 |
Subject: [PATCH 4/5] Add support for Ruby 2.0.0 error messages.
|
|
|
3322d9 |
|
|
|
3322d9 |
---
|
|
|
3322d9 |
test/test-main.rb | 13 +++++++++++++
|
|
|
3322d9 |
test/testutil.rb | 4 ++++
|
|
|
3322d9 |
2 files changed, 17 insertions(+)
|
|
|
3322d9 |
|
|
|
3322d9 |
diff --git a/test/test-main.rb b/test/test-main.rb
|
|
|
3322d9 |
index 0e63229..e4d6c2a 100644
|
|
|
3322d9 |
--- a/test/test-main.rb
|
|
|
3322d9 |
+++ b/test/test-main.rb
|
|
|
3322d9 |
@@ -273,6 +273,19 @@ END
|
|
|
3322d9 |
errmsgs << <<'END'
|
|
|
3322d9 |
7: syntax error, unexpected $end, expecting keyword_end
|
|
|
3322d9 |
END
|
|
|
3322d9 |
+ elsif ruby20?
|
|
|
3322d9 |
+ errmsgs << <<'END'
|
|
|
3322d9 |
+3: syntax error, unexpected ']', expecting ')'
|
|
|
3322d9 |
+ _buf << ' '; _buf << ( item[:name]] ).to_s; _buf << '
|
|
|
3322d9 |
+ ^
|
|
|
3322d9 |
+-:4: syntax error, unexpected keyword_end, expecting ')'
|
|
|
3322d9 |
+'; end
|
|
|
3322d9 |
+ ^
|
|
|
3322d9 |
+-:7: syntax error, unexpected end-of-input, expecting ')'
|
|
|
3322d9 |
+END
|
|
|
3322d9 |
+ errmsgs << <<'END'
|
|
|
3322d9 |
+7: syntax error, unexpected end-of-input, expecting keyword_end
|
|
|
3322d9 |
+END
|
|
|
3322d9 |
elsif rubinius?
|
|
|
3322d9 |
errmsgs << <<'END'
|
|
|
3322d9 |
3: expecting ')'
|
|
|
3322d9 |
diff --git a/test/testutil.rb b/test/testutil.rb
|
|
|
3322d9 |
index e5293a5..59c3779 100644
|
|
|
3322d9 |
--- a/test/testutil.rb
|
|
|
3322d9 |
+++ b/test/testutil.rb
|
|
|
3322d9 |
@@ -17,6 +17,10 @@ def ruby19? # :nodoc:
|
|
|
3322d9 |
RUBY_VERSION =~ /\A1.9/
|
|
|
3322d9 |
end
|
|
|
3322d9 |
|
|
|
3322d9 |
+def ruby20? # :nodoc:
|
|
|
3322d9 |
+ RUBY_VERSION =~ /\A2.0/
|
|
|
3322d9 |
+end
|
|
|
3322d9 |
+
|
|
|
3322d9 |
def rubinius? # :nodoc:
|
|
|
3322d9 |
defined?(RUBY_ENGINE) && RUBY_ENGINE == "rbx"
|
|
|
3322d9 |
end
|
|
|
3322d9 |
--
|
|
|
3322d9 |
1.8.1.4
|
|
|
3322d9 |
|
|
|
3322d9 |
|
|
|
3322d9 |
From 99d0db2f38d7a4b9cf782e2e4a73bde0d73277e9 Mon Sep 17 00:00:00 2001
|
|
|
3322d9 |
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
|
|
|
3322d9 |
Date: Tue, 5 Mar 2013 10:07:02 +0100
|
|
|
3322d9 |
Subject: [PATCH 5/5] Add support for Ruby 2.0.0.
|
|
|
3322d9 |
|
|
|
3322d9 |
---
|
|
|
3322d9 |
test/test-users-guide.rb | 2 +-
|
|
|
3322d9 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
3322d9 |
|
|
|
3322d9 |
diff --git a/test/test-users-guide.rb b/test/test-users-guide.rb
|
|
|
3322d9 |
index 2687a83..b89706b 100644
|
|
|
3322d9 |
--- a/test/test-users-guide.rb
|
|
|
3322d9 |
+++ b/test/test-users-guide.rb
|
|
|
3322d9 |
@@ -28,7 +28,7 @@ class KwarkUsersGuideTest < Test::Unit::TestCase
|
|
|
3322d9 |
s =~ /\A\$ (.*?)\n/
|
|
|
3322d9 |
command = $1
|
|
|
3322d9 |
expected = $'
|
|
|
3322d9 |
- if ruby19?
|
|
|
3322d9 |
+ if ruby19? || ruby20?
|
|
|
3322d9 |
case @name
|
|
|
3322d9 |
when 'test_main_program1_result'
|
|
|
3322d9 |
expected.sub!('["eruby", "items", "x", "_buf"]', '[:_buf, :eruby, :items, :x]')
|
|
|
3322d9 |
--
|
|
|
3322d9 |
1.8.1.4
|
|
|
3322d9 |
|