test/browser.test.html in rubyjs-0.7.0 vs test/browser.test.html in rubyjs-0.7.1
- old
+ new
@@ -784,11 +784,11 @@
<tr id="line_76" style="background: #ff8888">
<td>
<pre id="out_76"></pre>
</td>
<td>
- <pre id="exp_76">Test lebewesen</pre>
+ <pre id="exp_76">Test insertion sort</pre>
</td>
</tr>
<tr id="line_77" style="background: #ff8888">
@@ -804,101 +804,101 @@
<tr id="line_78" style="background: #ff8888">
<td>
<pre id="out_78"></pre>
</td>
<td>
- <pre id="exp_78">miau, ich bin Leni</pre>
+ <pre id="exp_78">Before insertion sort:</pre>
</td>
</tr>
<tr id="line_79" style="background: #ff8888">
<td>
<pre id="out_79"></pre>
</td>
<td>
- <pre id="exp_79">wau wau</pre>
+ <pre id="exp_79">[3, 6, 2, 5, 3, 7, 1, 8]</pre>
</td>
</tr>
<tr id="line_80" style="background: #ff8888">
<td>
<pre id="out_80"></pre>
</td>
<td>
- <pre id="exp_80">ich jage Leni</pre>
+ <pre id="exp_80">After insertion sort:</pre>
</td>
</tr>
<tr id="line_81" style="background: #ff8888">
<td>
<pre id="out_81"></pre>
</td>
<td>
- <pre id="exp_81">~~~~~~~~~~~~~~~~~~~~</pre>
+ <pre id="exp_81">[1, 2, 3, 3, 5, 6, 7, 8]</pre>
</td>
</tr>
<tr id="line_82" style="background: #ff8888">
<td>
<pre id="out_82"></pre>
</td>
<td>
- <pre id="exp_82">Test expr</pre>
+ <pre id="exp_82">~~~~~~~~~~~~~~~~~~~~</pre>
</td>
</tr>
<tr id="line_83" style="background: #ff8888">
<td>
<pre id="out_83"></pre>
</td>
<td>
- <pre id="exp_83">~~~~~~~~~~~~~~~~~~~~</pre>
+ <pre id="exp_83">Test lebewesen</pre>
</td>
</tr>
<tr id="line_84" style="background: #ff8888">
<td>
<pre id="out_84"></pre>
</td>
<td>
- <pre id="exp_84">1</pre>
+ <pre id="exp_84">~~~~~~~~~~~~~~~~~~~~</pre>
</td>
</tr>
<tr id="line_85" style="background: #ff8888">
<td>
<pre id="out_85"></pre>
</td>
<td>
- <pre id="exp_85">true</pre>
+ <pre id="exp_85">miau, ich bin Leni</pre>
</td>
</tr>
<tr id="line_86" style="background: #ff8888">
<td>
<pre id="out_86"></pre>
</td>
<td>
- <pre id="exp_86">~~~~~~~~~~~~~~~~~~~~</pre>
+ <pre id="exp_86">wau wau</pre>
</td>
</tr>
<tr id="line_87" style="background: #ff8888">
<td>
<pre id="out_87"></pre>
</td>
<td>
- <pre id="exp_87">Test simple output</pre>
+ <pre id="exp_87">ich jage Leni</pre>
</td>
</tr>
<tr id="line_88" style="background: #ff8888">
@@ -914,11 +914,11 @@
<tr id="line_89" style="background: #ff8888">
<td>
<pre id="out_89"></pre>
</td>
<td>
- <pre id="exp_89">Hello World from RubyJS</pre>
+ <pre id="exp_89">Test expr</pre>
</td>
</tr>
<tr id="line_90" style="background: #ff8888">
@@ -934,131 +934,131 @@
<tr id="line_91" style="background: #ff8888">
<td>
<pre id="out_91"></pre>
</td>
<td>
- <pre id="exp_91">Test if</pre>
+ <pre id="exp_91">1</pre>
</td>
</tr>
<tr id="line_92" style="background: #ff8888">
<td>
<pre id="out_92"></pre>
</td>
<td>
- <pre id="exp_92">~~~~~~~~~~~~~~~~~~~~</pre>
+ <pre id="exp_92">true</pre>
</td>
</tr>
<tr id="line_93" style="background: #ff8888">
<td>
<pre id="out_93"></pre>
</td>
<td>
- <pre id="exp_93">OK</pre>
+ <pre id="exp_93">~~~~~~~~~~~~~~~~~~~~</pre>
</td>
</tr>
<tr id="line_94" style="background: #ff8888">
<td>
<pre id="out_94"></pre>
</td>
<td>
- <pre id="exp_94">OK</pre>
+ <pre id="exp_94">Test simple output</pre>
</td>
</tr>
<tr id="line_95" style="background: #ff8888">
<td>
<pre id="out_95"></pre>
</td>
<td>
- <pre id="exp_95">OK</pre>
+ <pre id="exp_95">~~~~~~~~~~~~~~~~~~~~</pre>
</td>
</tr>
<tr id="line_96" style="background: #ff8888">
<td>
<pre id="out_96"></pre>
</td>
<td>
- <pre id="exp_96">OK</pre>
+ <pre id="exp_96">Hello World from RubyJS</pre>
</td>
</tr>
<tr id="line_97" style="background: #ff8888">
<td>
<pre id="out_97"></pre>
</td>
<td>
- <pre id="exp_97">"a"</pre>
+ <pre id="exp_97">~~~~~~~~~~~~~~~~~~~~</pre>
</td>
</tr>
<tr id="line_98" style="background: #ff8888">
<td>
<pre id="out_98"></pre>
</td>
<td>
- <pre id="exp_98">"a"</pre>
+ <pre id="exp_98">Test if</pre>
</td>
</tr>
<tr id="line_99" style="background: #ff8888">
<td>
<pre id="out_99"></pre>
</td>
<td>
- <pre id="exp_99">true</pre>
+ <pre id="exp_99">~~~~~~~~~~~~~~~~~~~~</pre>
</td>
</tr>
<tr id="line_100" style="background: #ff8888">
<td>
<pre id="out_100"></pre>
</td>
<td>
- <pre id="exp_100">"b"</pre>
+ <pre id="exp_100">OK</pre>
</td>
</tr>
<tr id="line_101" style="background: #ff8888">
<td>
<pre id="out_101"></pre>
</td>
<td>
- <pre id="exp_101">false</pre>
+ <pre id="exp_101">OK</pre>
</td>
</tr>
<tr id="line_102" style="background: #ff8888">
<td>
<pre id="out_102"></pre>
</td>
<td>
- <pre id="exp_102">nil</pre>
+ <pre id="exp_102">OK</pre>
</td>
</tr>
<tr id="line_103" style="background: #ff8888">
<td>
<pre id="out_103"></pre>
</td>
<td>
- <pre id="exp_103">"a"</pre>
+ <pre id="exp_103">OK</pre>
</td>
</tr>
<tr id="line_104" style="background: #ff8888">
@@ -1074,101 +1074,101 @@
<tr id="line_105" style="background: #ff8888">
<td>
<pre id="out_105"></pre>
</td>
<td>
- <pre id="exp_105">~~~~~~~~~~~~~~~~~~~~</pre>
+ <pre id="exp_105">"a"</pre>
</td>
</tr>
<tr id="line_106" style="background: #ff8888">
<td>
<pre id="out_106"></pre>
</td>
<td>
- <pre id="exp_106">Test class</pre>
+ <pre id="exp_106">true</pre>
</td>
</tr>
<tr id="line_107" style="background: #ff8888">
<td>
<pre id="out_107"></pre>
</td>
<td>
- <pre id="exp_107">~~~~~~~~~~~~~~~~~~~~</pre>
+ <pre id="exp_107">"b"</pre>
</td>
</tr>
<tr id="line_108" style="background: #ff8888">
<td>
<pre id="out_108"></pre>
</td>
<td>
- <pre id="exp_108">true</pre>
+ <pre id="exp_108">false</pre>
</td>
</tr>
<tr id="line_109" style="background: #ff8888">
<td>
<pre id="out_109"></pre>
</td>
<td>
- <pre id="exp_109">false</pre>
+ <pre id="exp_109">nil</pre>
</td>
</tr>
<tr id="line_110" style="background: #ff8888">
<td>
<pre id="out_110"></pre>
</td>
<td>
- <pre id="exp_110">false</pre>
+ <pre id="exp_110">"a"</pre>
</td>
</tr>
<tr id="line_111" style="background: #ff8888">
<td>
<pre id="out_111"></pre>
</td>
<td>
- <pre id="exp_111">false</pre>
+ <pre id="exp_111">"a"</pre>
</td>
</tr>
<tr id="line_112" style="background: #ff8888">
<td>
<pre id="out_112"></pre>
</td>
<td>
- <pre id="exp_112">false</pre>
+ <pre id="exp_112">~~~~~~~~~~~~~~~~~~~~</pre>
</td>
</tr>
<tr id="line_113" style="background: #ff8888">
<td>
<pre id="out_113"></pre>
</td>
<td>
- <pre id="exp_113">true</pre>
+ <pre id="exp_113">Test class</pre>
</td>
</tr>
<tr id="line_114" style="background: #ff8888">
<td>
<pre id="out_114"></pre>
</td>
<td>
- <pre id="exp_114">false</pre>
+ <pre id="exp_114">~~~~~~~~~~~~~~~~~~~~</pre>
</td>
</tr>
<tr id="line_115" style="background: #ff8888">
@@ -1184,41 +1184,41 @@
<tr id="line_116" style="background: #ff8888">
<td>
<pre id="out_116"></pre>
</td>
<td>
- <pre id="exp_116">true</pre>
+ <pre id="exp_116">false</pre>
</td>
</tr>
<tr id="line_117" style="background: #ff8888">
<td>
<pre id="out_117"></pre>
</td>
<td>
- <pre id="exp_117">true</pre>
+ <pre id="exp_117">false</pre>
</td>
</tr>
<tr id="line_118" style="background: #ff8888">
<td>
<pre id="out_118"></pre>
</td>
<td>
- <pre id="exp_118">true</pre>
+ <pre id="exp_118">false</pre>
</td>
</tr>
<tr id="line_119" style="background: #ff8888">
<td>
<pre id="out_119"></pre>
</td>
<td>
- <pre id="exp_119">true</pre>
+ <pre id="exp_119">false</pre>
</td>
</tr>
<tr id="line_120" style="background: #ff8888">
@@ -1234,21 +1234,21 @@
<tr id="line_121" style="background: #ff8888">
<td>
<pre id="out_121"></pre>
</td>
<td>
- <pre id="exp_121">true</pre>
+ <pre id="exp_121">false</pre>
</td>
</tr>
<tr id="line_122" style="background: #ff8888">
<td>
<pre id="out_122"></pre>
</td>
<td>
- <pre id="exp_122">false</pre>
+ <pre id="exp_122">true</pre>
</td>
</tr>
<tr id="line_123" style="background: #ff8888">
@@ -1274,31 +1274,31 @@
<tr id="line_125" style="background: #ff8888">
<td>
<pre id="out_125"></pre>
</td>
<td>
- <pre id="exp_125">false</pre>
+ <pre id="exp_125">true</pre>
</td>
</tr>
<tr id="line_126" style="background: #ff8888">
<td>
<pre id="out_126"></pre>
</td>
<td>
- <pre id="exp_126">"String"</pre>
+ <pre id="exp_126">true</pre>
</td>
</tr>
<tr id="line_127" style="background: #ff8888">
<td>
<pre id="out_127"></pre>
</td>
<td>
- <pre id="exp_127">"NilClass"</pre>
+ <pre id="exp_127">true</pre>
</td>
</tr>
<tr id="line_128" style="background: #ff8888">
@@ -1314,2161 +1314,2161 @@
<tr id="line_129" style="background: #ff8888">
<td>
<pre id="out_129"></pre>
</td>
<td>
- <pre id="exp_129">true</pre>
+ <pre id="exp_129">false</pre>
</td>
</tr>
<tr id="line_130" style="background: #ff8888">
<td>
<pre id="out_130"></pre>
</td>
<td>
- <pre id="exp_130">String</pre>
+ <pre id="exp_130">true</pre>
</td>
</tr>
<tr id="line_131" style="background: #ff8888">
<td>
<pre id="out_131"></pre>
</td>
<td>
- <pre id="exp_131">T_TestClass::A</pre>
+ <pre id="exp_131">true</pre>
</td>
</tr>
<tr id="line_132" style="background: #ff8888">
<td>
<pre id="out_132"></pre>
</td>
<td>
- <pre id="exp_132">T_TestClass::B</pre>
+ <pre id="exp_132">false</pre>
</td>
</tr>
<tr id="line_133" style="background: #ff8888">
<td>
<pre id="out_133"></pre>
</td>
<td>
- <pre id="exp_133">T_TestClass::C</pre>
+ <pre id="exp_133">"String"</pre>
</td>
</tr>
<tr id="line_134" style="background: #ff8888">
<td>
<pre id="out_134"></pre>
</td>
<td>
- <pre id="exp_134">T_TestClass::D</pre>
+ <pre id="exp_134">"NilClass"</pre>
</td>
</tr>
<tr id="line_135" style="background: #ff8888">
<td>
<pre id="out_135"></pre>
</td>
<td>
- <pre id="exp_135">T_TestClass::X</pre>
+ <pre id="exp_135">true</pre>
</td>
</tr>
<tr id="line_136" style="background: #ff8888">
<td>
<pre id="out_136"></pre>
</td>
<td>
- <pre id="exp_136">"T_TestClass::X"</pre>
+ <pre id="exp_136">true</pre>
</td>
</tr>
<tr id="line_137" style="background: #ff8888">
<td>
<pre id="out_137"></pre>
</td>
<td>
- <pre id="exp_137">"T_TestClass::A"</pre>
+ <pre id="exp_137">String</pre>
</td>
</tr>
<tr id="line_138" style="background: #ff8888">
<td>
<pre id="out_138"></pre>
</td>
<td>
- <pre id="exp_138">"T_TestClass::B"</pre>
+ <pre id="exp_138">T_TestClass::A</pre>
</td>
</tr>
<tr id="line_139" style="background: #ff8888">
<td>
<pre id="out_139"></pre>
</td>
<td>
- <pre id="exp_139">~~~~~~~~~~~~~~~~~~~~</pre>
+ <pre id="exp_139">T_TestClass::B</pre>
</td>
</tr>
<tr id="line_140" style="background: #ff8888">
<td>
<pre id="out_140"></pre>
</td>
<td>
- <pre id="exp_140">Test case</pre>
+ <pre id="exp_140">T_TestClass::C</pre>
</td>
</tr>
<tr id="line_141" style="background: #ff8888">
<td>
<pre id="out_141"></pre>
</td>
<td>
- <pre id="exp_141">~~~~~~~~~~~~~~~~~~~~</pre>
+ <pre id="exp_141">T_TestClass::D</pre>
</td>
</tr>
<tr id="line_142" style="background: #ff8888">
<td>
<pre id="out_142"></pre>
</td>
<td>
- <pre id="exp_142">OKAY</pre>
+ <pre id="exp_142">T_TestClass::X</pre>
</td>
</tr>
<tr id="line_143" style="background: #ff8888">
<td>
<pre id="out_143"></pre>
</td>
<td>
- <pre id="exp_143">true</pre>
+ <pre id="exp_143">"T_TestClass::X"</pre>
</td>
</tr>
<tr id="line_144" style="background: #ff8888">
<td>
<pre id="out_144"></pre>
</td>
<td>
- <pre id="exp_144">true</pre>
+ <pre id="exp_144">"T_TestClass::A"</pre>
</td>
</tr>
<tr id="line_145" style="background: #ff8888">
<td>
<pre id="out_145"></pre>
</td>
<td>
- <pre id="exp_145">OK</pre>
+ <pre id="exp_145">"T_TestClass::B"</pre>
</td>
</tr>
<tr id="line_146" style="background: #ff8888">
<td>
<pre id="out_146"></pre>
</td>
<td>
- <pre id="exp_146">OKAY</pre>
+ <pre id="exp_146">~~~~~~~~~~~~~~~~~~~~</pre>
</td>
</tr>
<tr id="line_147" style="background: #ff8888">
<td>
<pre id="out_147"></pre>
</td>
<td>
- <pre id="exp_147">~~~~~~~~~~~~~~~~~~~~</pre>
+ <pre id="exp_147">Test case</pre>
</td>
</tr>
<tr id="line_148" style="background: #ff8888">
<td>
<pre id="out_148"></pre>
</td>
<td>
- <pre id="exp_148">Test splat</pre>
+ <pre id="exp_148">~~~~~~~~~~~~~~~~~~~~</pre>
</td>
</tr>
<tr id="line_149" style="background: #ff8888">
<td>
<pre id="out_149"></pre>
</td>
<td>
- <pre id="exp_149">~~~~~~~~~~~~~~~~~~~~</pre>
+ <pre id="exp_149">OKAY</pre>
</td>
</tr>
<tr id="line_150" style="background: #ff8888">
<td>
<pre id="out_150"></pre>
</td>
<td>
- <pre id="exp_150">[]</pre>
+ <pre id="exp_150">true</pre>
</td>
</tr>
<tr id="line_151" style="background: #ff8888">
<td>
<pre id="out_151"></pre>
</td>
<td>
- <pre id="exp_151">[]</pre>
+ <pre id="exp_151">true</pre>
</td>
</tr>
<tr id="line_152" style="background: #ff8888">
<td>
<pre id="out_152"></pre>
</td>
<td>
- <pre id="exp_152">[1]</pre>
+ <pre id="exp_152">OK</pre>
</td>
</tr>
<tr id="line_153" style="background: #ff8888">
<td>
<pre id="out_153"></pre>
</td>
<td>
- <pre id="exp_153">[1]</pre>
+ <pre id="exp_153">OKAY</pre>
</td>
</tr>
<tr id="line_154" style="background: #ff8888">
<td>
<pre id="out_154"></pre>
</td>
<td>
- <pre id="exp_154">[1]</pre>
+ <pre id="exp_154">~~~~~~~~~~~~~~~~~~~~</pre>
</td>
</tr>
<tr id="line_155" style="background: #ff8888">
<td>
<pre id="out_155"></pre>
</td>
<td>
- <pre id="exp_155">[1, 2]</pre>
+ <pre id="exp_155">Test splat</pre>
</td>
</tr>
<tr id="line_156" style="background: #ff8888">
<td>
<pre id="out_156"></pre>
</td>
<td>
- <pre id="exp_156">[1, 2]</pre>
+ <pre id="exp_156">~~~~~~~~~~~~~~~~~~~~</pre>
</td>
</tr>
<tr id="line_157" style="background: #ff8888">
<td>
<pre id="out_157"></pre>
</td>
<td>
- <pre id="exp_157">[1, 2]</pre>
+ <pre id="exp_157">[]</pre>
</td>
</tr>
<tr id="line_158" style="background: #ff8888">
<td>
<pre id="out_158"></pre>
</td>
<td>
- <pre id="exp_158">[1, 1, 2]</pre>
+ <pre id="exp_158">[]</pre>
</td>
</tr>
<tr id="line_159" style="background: #ff8888">
<td>
<pre id="out_159"></pre>
</td>
<td>
- <pre id="exp_159">~~~~~~~~~~~~~~~~~~~~</pre>
+ <pre id="exp_159">[1]</pre>
</td>
</tr>
<tr id="line_160" style="background: #ff8888">
<td>
<pre id="out_160"></pre>
</td>
<td>
- <pre id="exp_160">Test string</pre>
+ <pre id="exp_160">[1]</pre>
</td>
</tr>
<tr id="line_161" style="background: #ff8888">
<td>
<pre id="out_161"></pre>
</td>
<td>
- <pre id="exp_161">~~~~~~~~~~~~~~~~~~~~</pre>
+ <pre id="exp_161">[1]</pre>
</td>
</tr>
<tr id="line_162" style="background: #ff8888">
<td>
<pre id="out_162"></pre>
</td>
<td>
- <pre id="exp_162">"hello"</pre>
+ <pre id="exp_162">[1, 2]</pre>
</td>
</tr>
<tr id="line_163" style="background: #ff8888">
<td>
<pre id="out_163"></pre>
</td>
<td>
- <pre id="exp_163">"hallo\b\t\n"</pre>
+ <pre id="exp_163">[1, 2]</pre>
</td>
</tr>
<tr id="line_164" style="background: #ff8888">
<td>
<pre id="out_164"></pre>
</td>
<td>
- <pre id="exp_164">"hallo\\leute"</pre>
+ <pre id="exp_164">[1, 2]</pre>
</td>
</tr>
<tr id="line_165" style="background: #ff8888">
<td>
<pre id="out_165"></pre>
</td>
<td>
- <pre id="exp_165">"\"super\""</pre>
+ <pre id="exp_165">[1, 1, 2]</pre>
</td>
</tr>
<tr id="line_166" style="background: #ff8888">
<td>
<pre id="out_166"></pre>
</td>
<td>
- <pre id="exp_166">1</pre>
+ <pre id="exp_166">~~~~~~~~~~~~~~~~~~~~</pre>
</td>
</tr>
<tr id="line_167" style="background: #ff8888">
<td>
<pre id="out_167"></pre>
</td>
<td>
- <pre id="exp_167">3</pre>
+ <pre id="exp_167">Test string</pre>
</td>
</tr>
<tr id="line_168" style="background: #ff8888">
<td>
<pre id="out_168"></pre>
</td>
<td>
- <pre id="exp_168">nil</pre>
+ <pre id="exp_168">~~~~~~~~~~~~~~~~~~~~</pre>
</td>
</tr>
<tr id="line_169" style="background: #ff8888">
<td>
<pre id="out_169"></pre>
</td>
<td>
- <pre id="exp_169">2</pre>
+ <pre id="exp_169">"hello"</pre>
</td>
</tr>
<tr id="line_170" style="background: #ff8888">
<td>
<pre id="out_170"></pre>
</td>
<td>
- <pre id="exp_170">8</pre>
+ <pre id="exp_170">"hallo\b\t\n"</pre>
</td>
</tr>
<tr id="line_171" style="background: #ff8888">
<td>
<pre id="out_171"></pre>
</td>
<td>
- <pre id="exp_171">"h"</pre>
+ <pre id="exp_171">"hallo\\leute"</pre>
</td>
</tr>
<tr id="line_172" style="background: #ff8888">
<td>
<pre id="out_172"></pre>
</td>
<td>
- <pre id="exp_172">"ha"</pre>
+ <pre id="exp_172">"\"super\""</pre>
</td>
</tr>
<tr id="line_173" style="background: #ff8888">
<td>
<pre id="out_173"></pre>
</td>
<td>
- <pre id="exp_173">"hallo"</pre>
+ <pre id="exp_173">1</pre>
</td>
</tr>
<tr id="line_174" style="background: #ff8888">
<td>
<pre id="out_174"></pre>
</td>
<td>
- <pre id="exp_174">"0000000010"</pre>
+ <pre id="exp_174">3</pre>
</td>
</tr>
<tr id="line_175" style="background: #ff8888">
<td>
<pre id="out_175"></pre>
</td>
<td>
- <pre id="exp_175">"10"</pre>
+ <pre id="exp_175">nil</pre>
</td>
</tr>
<tr id="line_176" style="background: #ff8888">
<td>
<pre id="out_176"></pre>
</td>
<td>
- <pre id="exp_176">"()(x"</pre>
+ <pre id="exp_176">2</pre>
</td>
</tr>
<tr id="line_177" style="background: #ff8888">
<td>
<pre id="out_177"></pre>
</td>
<td>
- <pre id="exp_177">"1000000000"</pre>
+ <pre id="exp_177">8</pre>
</td>
</tr>
<tr id="line_178" style="background: #ff8888">
<td>
<pre id="out_178"></pre>
</td>
<td>
- <pre id="exp_178">"10"</pre>
+ <pre id="exp_178">"h"</pre>
</td>
</tr>
<tr id="line_179" style="background: #ff8888">
<td>
<pre id="out_179"></pre>
</td>
<td>
- <pre id="exp_179">"x()("</pre>
+ <pre id="exp_179">"ha"</pre>
</td>
</tr>
<tr id="line_180" style="background: #ff8888">
<td>
<pre id="out_180"></pre>
</td>
<td>
- <pre id="exp_180">"abc 3 def"</pre>
+ <pre id="exp_180">"hallo"</pre>
</td>
</tr>
<tr id="line_181" style="background: #ff8888">
<td>
<pre id="out_181"></pre>
</td>
<td>
- <pre id="exp_181">"\"hallo\",4.5"</pre>
+ <pre id="exp_181">"0000000010"</pre>
</td>
</tr>
<tr id="line_182" style="background: #ff8888">
<td>
<pre id="out_182"></pre>
</td>
<td>
- <pre id="exp_182">"harro"</pre>
+ <pre id="exp_182">"10"</pre>
</td>
</tr>
<tr id="line_183" style="background: #ff8888">
<td>
<pre id="out_183"></pre>
</td>
<td>
- <pre id="exp_183">"harro"</pre>
+ <pre id="exp_183">"()(x"</pre>
</td>
</tr>
<tr id="line_184" style="background: #ff8888">
<td>
<pre id="out_184"></pre>
</td>
<td>
- <pre id="exp_184">"harro"</pre>
+ <pre id="exp_184">"1000000000"</pre>
</td>
</tr>
<tr id="line_185" style="background: #ff8888">
<td>
<pre id="out_185"></pre>
</td>
<td>
- <pre id="exp_185">"hablah blaho"</pre>
+ <pre id="exp_185">"10"</pre>
</td>
</tr>
<tr id="line_186" style="background: #ff8888">
<td>
<pre id="out_186"></pre>
</td>
<td>
- <pre id="exp_186">"ll"</pre>
+ <pre id="exp_186">"x()("</pre>
</td>
</tr>
<tr id="line_187" style="background: #ff8888">
<td>
<pre id="out_187"></pre>
</td>
<td>
- <pre id="exp_187">"ll"</pre>
+ <pre id="exp_187">"abc 3 def"</pre>
</td>
</tr>
<tr id="line_188" style="background: #ff8888">
<td>
<pre id="out_188"></pre>
</td>
<td>
- <pre id="exp_188">"ll"</pre>
+ <pre id="exp_188">"\"hallo\",4.5"</pre>
</td>
</tr>
<tr id="line_189" style="background: #ff8888">
<td>
<pre id="out_189"></pre>
</td>
<td>
- <pre id="exp_189">~~~~~~~~~~~~~~~~~~~~</pre>
+ <pre id="exp_189">"harro"</pre>
</td>
</tr>
<tr id="line_190" style="background: #ff8888">
<td>
<pre id="out_190"></pre>
</td>
<td>
- <pre id="exp_190">Test inspect</pre>
+ <pre id="exp_190">"harro"</pre>
</td>
</tr>
<tr id="line_191" style="background: #ff8888">
<td>
<pre id="out_191"></pre>
</td>
<td>
- <pre id="exp_191">~~~~~~~~~~~~~~~~~~~~</pre>
+ <pre id="exp_191">"harro"</pre>
</td>
</tr>
<tr id="line_192" style="background: #ff8888">
<td>
<pre id="out_192"></pre>
</td>
<td>
- <pre id="exp_192">[{"Hello"=>"Rubyconf"}]</pre>
+ <pre id="exp_192">"hablah blaho"</pre>
</td>
</tr>
<tr id="line_193" style="background: #ff8888">
<td>
<pre id="out_193"></pre>
</td>
<td>
- <pre id="exp_193">~~~~~~~~~~~~~~~~~~~~</pre>
+ <pre id="exp_193">"ll"</pre>
</td>
</tr>
<tr id="line_194" style="background: #ff8888">
<td>
<pre id="out_194"></pre>
</td>
<td>
- <pre id="exp_194">Test regexp</pre>
+ <pre id="exp_194">"ll"</pre>
</td>
</tr>
<tr id="line_195" style="background: #ff8888">
<td>
<pre id="out_195"></pre>
</td>
<td>
- <pre id="exp_195">~~~~~~~~~~~~~~~~~~~~</pre>
+ <pre id="exp_195">"ll"</pre>
</td>
</tr>
<tr id="line_196" style="background: #ff8888">
<td>
<pre id="out_196"></pre>
</td>
<td>
- <pre id="exp_196">"okay"</pre>
+ <pre id="exp_196">~~~~~~~~~~~~~~~~~~~~</pre>
</td>
</tr>
<tr id="line_197" style="background: #ff8888">
<td>
<pre id="out_197"></pre>
</td>
<td>
- <pre id="exp_197">2</pre>
+ <pre id="exp_197">Test inspect</pre>
</td>
</tr>
<tr id="line_198" style="background: #ff8888">
<td>
<pre id="out_198"></pre>
</td>
<td>
- <pre id="exp_198">"ll"</pre>
+ <pre id="exp_198">~~~~~~~~~~~~~~~~~~~~</pre>
</td>
</tr>
<tr id="line_199" style="background: #ff8888">
<td>
<pre id="out_199"></pre>
</td>
<td>
- <pre id="exp_199">nil</pre>
+ <pre id="exp_199">[{"Hello"=>"Rubyconf"}]</pre>
</td>
</tr>
<tr id="line_200" style="background: #ff8888">
<td>
<pre id="out_200"></pre>
</td>
<td>
- <pre id="exp_200">nil</pre>
+ <pre id="exp_200">~~~~~~~~~~~~~~~~~~~~</pre>
</td>
</tr>
<tr id="line_201" style="background: #ff8888">
<td>
<pre id="out_201"></pre>
</td>
<td>
- <pre id="exp_201">"ll"</pre>
+ <pre id="exp_201">Test regexp</pre>
</td>
</tr>
<tr id="line_202" style="background: #ff8888">
<td>
<pre id="out_202"></pre>
</td>
<td>
- <pre id="exp_202">"o"</pre>
+ <pre id="exp_202">~~~~~~~~~~~~~~~~~~~~</pre>
</td>
</tr>
<tr id="line_203" style="background: #ff8888">
<td>
<pre id="out_203"></pre>
</td>
<td>
- <pre id="exp_203">nil</pre>
+ <pre id="exp_203">"okay"</pre>
</td>
</tr>
<tr id="line_204" style="background: #ff8888">
<td>
<pre id="out_204"></pre>
</td>
<td>
- <pre id="exp_204">nil</pre>
+ <pre id="exp_204">2</pre>
</td>
</tr>
<tr id="line_205" style="background: #ff8888">
<td>
<pre id="out_205"></pre>
</td>
<td>
- <pre id="exp_205">~~~~~~~~~~~~~~~~~~~~</pre>
+ <pre id="exp_205">"ll"</pre>
</td>
</tr>
<tr id="line_206" style="background: #ff8888">
<td>
<pre id="out_206"></pre>
</td>
<td>
- <pre id="exp_206">Test args</pre>
+ <pre id="exp_206">nil</pre>
</td>
</tr>
<tr id="line_207" style="background: #ff8888">
<td>
<pre id="out_207"></pre>
</td>
<td>
- <pre id="exp_207">~~~~~~~~~~~~~~~~~~~~</pre>
+ <pre id="exp_207">nil</pre>
</td>
</tr>
<tr id="line_208" style="background: #ff8888">
<td>
<pre id="out_208"></pre>
</td>
<td>
- <pre id="exp_208">0</pre>
+ <pre id="exp_208">"ll"</pre>
</td>
</tr>
<tr id="line_209" style="background: #ff8888">
<td>
<pre id="out_209"></pre>
</td>
<td>
- <pre id="exp_209">1</pre>
+ <pre id="exp_209">"o"</pre>
</td>
</tr>
<tr id="line_210" style="background: #ff8888">
<td>
<pre id="out_210"></pre>
</td>
<td>
- <pre id="exp_210">"hallo"</pre>
+ <pre id="exp_210">nil</pre>
</td>
</tr>
<tr id="line_211" style="background: #ff8888">
<td>
<pre id="out_211"></pre>
</td>
<td>
- <pre id="exp_211">[]</pre>
+ <pre id="exp_211">nil</pre>
</td>
</tr>
<tr id="line_212" style="background: #ff8888">
<td>
<pre id="out_212"></pre>
</td>
<td>
- <pre id="exp_212">--</pre>
+ <pre id="exp_212">~~~~~~~~~~~~~~~~~~~~</pre>
</td>
</tr>
<tr id="line_213" style="background: #ff8888">
<td>
<pre id="out_213"></pre>
</td>
<td>
- <pre id="exp_213">1</pre>
+ <pre id="exp_213">Test args</pre>
</td>
</tr>
<tr id="line_214" style="background: #ff8888">
<td>
<pre id="out_214"></pre>
</td>
<td>
- <pre id="exp_214">2</pre>
+ <pre id="exp_214">~~~~~~~~~~~~~~~~~~~~</pre>
</td>
</tr>
<tr id="line_215" style="background: #ff8888">
<td>
<pre id="out_215"></pre>
</td>
<td>
- <pre id="exp_215">"hallo"</pre>
+ <pre id="exp_215">0</pre>
</td>
</tr>
<tr id="line_216" style="background: #ff8888">
<td>
<pre id="out_216"></pre>
</td>
<td>
- <pre id="exp_216">[]</pre>
+ <pre id="exp_216">1</pre>
</td>
</tr>
<tr id="line_217" style="background: #ff8888">
<td>
<pre id="out_217"></pre>
</td>
<td>
- <pre id="exp_217">--</pre>
+ <pre id="exp_217">"hallo"</pre>
</td>
</tr>
<tr id="line_218" style="background: #ff8888">
<td>
<pre id="out_218"></pre>
</td>
<td>
- <pre id="exp_218">1</pre>
+ <pre id="exp_218">[]</pre>
</td>
</tr>
<tr id="line_219" style="background: #ff8888">
<td>
<pre id="out_219"></pre>
</td>
<td>
- <pre id="exp_219">2</pre>
+ <pre id="exp_219">--</pre>
</td>
</tr>
<tr id="line_220" style="background: #ff8888">
<td>
<pre id="out_220"></pre>
</td>
<td>
- <pre id="exp_220">9</pre>
+ <pre id="exp_220">1</pre>
</td>
</tr>
<tr id="line_221" style="background: #ff8888">
<td>
<pre id="out_221"></pre>
</td>
<td>
- <pre id="exp_221">[]</pre>
+ <pre id="exp_221">2</pre>
</td>
</tr>
<tr id="line_222" style="background: #ff8888">
<td>
<pre id="out_222"></pre>
</td>
<td>
- <pre id="exp_222">--</pre>
+ <pre id="exp_222">"hallo"</pre>
</td>
</tr>
<tr id="line_223" style="background: #ff8888">
<td>
<pre id="out_223"></pre>
</td>
<td>
- <pre id="exp_223">1</pre>
+ <pre id="exp_223">[]</pre>
</td>
</tr>
<tr id="line_224" style="background: #ff8888">
<td>
<pre id="out_224"></pre>
</td>
<td>
- <pre id="exp_224">2</pre>
+ <pre id="exp_224">--</pre>
</td>
</tr>
<tr id="line_225" style="background: #ff8888">
<td>
<pre id="out_225"></pre>
</td>
<td>
- <pre id="exp_225">9</pre>
+ <pre id="exp_225">1</pre>
</td>
</tr>
<tr id="line_226" style="background: #ff8888">
<td>
<pre id="out_226"></pre>
</td>
<td>
- <pre id="exp_226">[5]</pre>
+ <pre id="exp_226">2</pre>
</td>
</tr>
<tr id="line_227" style="background: #ff8888">
<td>
<pre id="out_227"></pre>
</td>
<td>
- <pre id="exp_227">--</pre>
+ <pre id="exp_227">9</pre>
</td>
</tr>
<tr id="line_228" style="background: #ff8888">
<td>
<pre id="out_228"></pre>
</td>
<td>
- <pre id="exp_228">1</pre>
+ <pre id="exp_228">[]</pre>
</td>
</tr>
<tr id="line_229" style="background: #ff8888">
<td>
<pre id="out_229"></pre>
</td>
<td>
- <pre id="exp_229">2</pre>
+ <pre id="exp_229">--</pre>
</td>
</tr>
<tr id="line_230" style="background: #ff8888">
<td>
<pre id="out_230"></pre>
</td>
<td>
- <pre id="exp_230">9</pre>
+ <pre id="exp_230">1</pre>
</td>
</tr>
<tr id="line_231" style="background: #ff8888">
<td>
<pre id="out_231"></pre>
</td>
<td>
- <pre id="exp_231">[5, 6]</pre>
+ <pre id="exp_231">2</pre>
</td>
</tr>
<tr id="line_232" style="background: #ff8888">
<td>
<pre id="out_232"></pre>
</td>
<td>
- <pre id="exp_232">--</pre>
+ <pre id="exp_232">9</pre>
</td>
</tr>
<tr id="line_233" style="background: #ff8888">
<td>
<pre id="out_233"></pre>
</td>
<td>
- <pre id="exp_233">1</pre>
+ <pre id="exp_233">[5]</pre>
</td>
</tr>
<tr id="line_234" style="background: #ff8888">
<td>
<pre id="out_234"></pre>
</td>
<td>
- <pre id="exp_234">2</pre>
+ <pre id="exp_234">--</pre>
</td>
</tr>
<tr id="line_235" style="background: #ff8888">
<td>
<pre id="out_235"></pre>
</td>
<td>
- <pre id="exp_235">9</pre>
+ <pre id="exp_235">1</pre>
</td>
</tr>
<tr id="line_236" style="background: #ff8888">
<td>
<pre id="out_236"></pre>
</td>
<td>
- <pre id="exp_236">[5, 6, 7, 8, 9, 10, 11, 12]</pre>
+ <pre id="exp_236">2</pre>
</td>
</tr>
<tr id="line_237" style="background: #ff8888">
<td>
<pre id="out_237"></pre>
</td>
<td>
- <pre id="exp_237">~~~~~~~~~~~~~~~~~~~~</pre>
+ <pre id="exp_237">9</pre>
</td>
</tr>
<tr id="line_238" style="background: #ff8888">
<td>
<pre id="out_238"></pre>
</td>
<td>
- <pre id="exp_238">Test array</pre>
+ <pre id="exp_238">[5, 6]</pre>
</td>
</tr>
<tr id="line_239" style="background: #ff8888">
<td>
<pre id="out_239"></pre>
</td>
<td>
- <pre id="exp_239">~~~~~~~~~~~~~~~~~~~~</pre>
+ <pre id="exp_239">--</pre>
</td>
</tr>
<tr id="line_240" style="background: #ff8888">
<td>
<pre id="out_240"></pre>
</td>
<td>
- <pre id="exp_240">"b"</pre>
+ <pre id="exp_240">1</pre>
</td>
</tr>
<tr id="line_241" style="background: #ff8888">
<td>
<pre id="out_241"></pre>
</td>
<td>
- <pre id="exp_241">["a", "c"]</pre>
+ <pre id="exp_241">2</pre>
</td>
</tr>
<tr id="line_242" style="background: #ff8888">
<td>
<pre id="out_242"></pre>
</td>
<td>
- <pre id="exp_242">nil</pre>
+ <pre id="exp_242">9</pre>
</td>
</tr>
<tr id="line_243" style="background: #ff8888">
<td>
<pre id="out_243"></pre>
</td>
<td>
- <pre id="exp_243">test native JS array mapping</pre>
+ <pre id="exp_243">[5, 6, 7, 8, 9, 10, 11, 12]</pre>
</td>
</tr>
<tr id="line_244" style="background: #ff8888">
<td>
<pre id="out_244"></pre>
</td>
<td>
- <pre id="exp_244">[1, 2, nil, [nil, nil, 4]]</pre>
+ <pre id="exp_244">~~~~~~~~~~~~~~~~~~~~</pre>
</td>
</tr>
<tr id="line_245" style="background: #ff8888">
<td>
<pre id="out_245"></pre>
</td>
<td>
- <pre id="exp_245">~~~~~~~~~~~~~~~~~~~~</pre>
+ <pre id="exp_245">Test array</pre>
</td>
</tr>
<tr id="line_246" style="background: #ff8888">
<td>
<pre id="out_246"></pre>
</td>
<td>
- <pre id="exp_246">Test eql</pre>
+ <pre id="exp_246">~~~~~~~~~~~~~~~~~~~~</pre>
</td>
</tr>
<tr id="line_247" style="background: #ff8888">
<td>
<pre id="out_247"></pre>
</td>
<td>
- <pre id="exp_247">~~~~~~~~~~~~~~~~~~~~</pre>
+ <pre id="exp_247">"b"</pre>
</td>
</tr>
<tr id="line_248" style="background: #ff8888">
<td>
<pre id="out_248"></pre>
</td>
<td>
- <pre id="exp_248">true</pre>
+ <pre id="exp_248">["a", "c"]</pre>
</td>
</tr>
<tr id="line_249" style="background: #ff8888">
<td>
<pre id="out_249"></pre>
</td>
<td>
- <pre id="exp_249">false</pre>
+ <pre id="exp_249">nil</pre>
</td>
</tr>
<tr id="line_250" style="background: #ff8888">
<td>
<pre id="out_250"></pre>
</td>
<td>
- <pre id="exp_250">false</pre>
+ <pre id="exp_250">test native JS array mapping</pre>
</td>
</tr>
<tr id="line_251" style="background: #ff8888">
<td>
<pre id="out_251"></pre>
</td>
<td>
- <pre id="exp_251">true</pre>
+ <pre id="exp_251">[1, 2, nil, [nil, nil, 4]]</pre>
</td>
</tr>
<tr id="line_252" style="background: #ff8888">
<td>
<pre id="out_252"></pre>
</td>
<td>
- <pre id="exp_252">false</pre>
+ <pre id="exp_252">~~~~~~~~~~~~~~~~~~~~</pre>
</td>
</tr>
<tr id="line_253" style="background: #ff8888">
<td>
<pre id="out_253"></pre>
</td>
<td>
- <pre id="exp_253">~~~~~~~~~~~~~~~~~~~~</pre>
+ <pre id="exp_253">Test eql</pre>
</td>
</tr>
<tr id="line_254" style="background: #ff8888">
<td>
<pre id="out_254"></pre>
</td>
<td>
- <pre id="exp_254">Test send</pre>
+ <pre id="exp_254">~~~~~~~~~~~~~~~~~~~~</pre>
</td>
</tr>
<tr id="line_255" style="background: #ff8888">
<td>
<pre id="out_255"></pre>
</td>
<td>
- <pre id="exp_255">~~~~~~~~~~~~~~~~~~~~</pre>
+ <pre id="exp_255">true</pre>
</td>
</tr>
<tr id="line_256" style="background: #ff8888">
<td>
<pre id="out_256"></pre>
</td>
<td>
- <pre id="exp_256">send</pre>
+ <pre id="exp_256">false</pre>
</td>
</tr>
<tr id="line_257" style="background: #ff8888">
<td>
<pre id="out_257"></pre>
</td>
<td>
- <pre id="exp_257">1</pre>
+ <pre id="exp_257">false</pre>
</td>
</tr>
<tr id="line_258" style="background: #ff8888">
<td>
<pre id="out_258"></pre>
</td>
<td>
- <pre id="exp_258">2</pre>
+ <pre id="exp_258">true</pre>
</td>
</tr>
<tr id="line_259" style="background: #ff8888">
<td>
<pre id="out_259"></pre>
</td>
<td>
- <pre id="exp_259">nil</pre>
+ <pre id="exp_259">false</pre>
</td>
</tr>
<tr id="line_260" style="background: #ff8888">
<td>
<pre id="out_260"></pre>
</td>
<td>
- <pre id="exp_260">"in B"</pre>
+ <pre id="exp_260">~~~~~~~~~~~~~~~~~~~~</pre>
</td>
</tr>
<tr id="line_261" style="background: #ff8888">
<td>
<pre id="out_261"></pre>
</td>
<td>
- <pre id="exp_261">1</pre>
+ <pre id="exp_261">Test send</pre>
</td>
</tr>
<tr id="line_262" style="background: #ff8888">
<td>
<pre id="out_262"></pre>
</td>
<td>
- <pre id="exp_262">2</pre>
+ <pre id="exp_262">~~~~~~~~~~~~~~~~~~~~</pre>
</td>
</tr>
<tr id="line_263" style="background: #ff8888">
<td>
<pre id="out_263"></pre>
</td>
<td>
- <pre id="exp_263">nil</pre>
+ <pre id="exp_263">send</pre>
</td>
</tr>
<tr id="line_264" style="background: #ff8888">
<td>
<pre id="out_264"></pre>
</td>
<td>
- <pre id="exp_264">respond_to?</pre>
+ <pre id="exp_264">1</pre>
</td>
</tr>
<tr id="line_265" style="background: #ff8888">
<td>
<pre id="out_265"></pre>
</td>
<td>
- <pre id="exp_265">true</pre>
+ <pre id="exp_265">2</pre>
</td>
</tr>
<tr id="line_266" style="background: #ff8888">
<td>
<pre id="out_266"></pre>
</td>
<td>
- <pre id="exp_266">true</pre>
+ <pre id="exp_266">nil</pre>
</td>
</tr>
<tr id="line_267" style="background: #ff8888">
<td>
<pre id="out_267"></pre>
</td>
<td>
- <pre id="exp_267">true</pre>
+ <pre id="exp_267">"in B"</pre>
</td>
</tr>
<tr id="line_268" style="background: #ff8888">
<td>
<pre id="out_268"></pre>
</td>
<td>
- <pre id="exp_268">false</pre>
+ <pre id="exp_268">1</pre>
</td>
</tr>
<tr id="line_269" style="background: #ff8888">
<td>
<pre id="out_269"></pre>
</td>
<td>
- <pre id="exp_269">false</pre>
+ <pre id="exp_269">2</pre>
</td>
</tr>
<tr id="line_270" style="background: #ff8888">
<td>
<pre id="out_270"></pre>
</td>
<td>
- <pre id="exp_270">method_missing</pre>
+ <pre id="exp_270">nil</pre>
</td>
</tr>
<tr id="line_271" style="background: #ff8888">
<td>
<pre id="out_271"></pre>
</td>
<td>
- <pre id="exp_271">false</pre>
+ <pre id="exp_271">respond_to?</pre>
</td>
</tr>
<tr id="line_272" style="background: #ff8888">
<td>
<pre id="out_272"></pre>
</td>
<td>
- <pre id="exp_272">"mm: blah_blah, 123"</pre>
+ <pre id="exp_272">true</pre>
</td>
</tr>
<tr id="line_273" style="background: #ff8888">
<td>
<pre id="out_273"></pre>
</td>
<td>
- <pre id="exp_273">catched!!!</pre>
+ <pre id="exp_273">true</pre>
</td>
</tr>
<tr id="line_274" style="background: #ff8888">
<td>
<pre id="out_274"></pre>
</td>
<td>
- <pre id="exp_274">"goood"</pre>
+ <pre id="exp_274">true</pre>
</td>
</tr>
<tr id="line_275" style="background: #ff8888">
<td>
<pre id="out_275"></pre>
</td>
<td>
- <pre id="exp_275">class Method</pre>
+ <pre id="exp_275">false</pre>
</td>
</tr>
<tr id="line_276" style="background: #ff8888">
<td>
<pre id="out_276"></pre>
</td>
<td>
- <pre id="exp_276">#<Method: String#to_s></pre>
+ <pre id="exp_276">false</pre>
</td>
</tr>
<tr id="line_277" style="background: #ff8888">
<td>
<pre id="out_277"></pre>
</td>
<td>
- <pre id="exp_277">"hallo"</pre>
+ <pre id="exp_277">method_missing</pre>
</td>
</tr>
<tr id="line_278" style="background: #ff8888">
<td>
<pre id="out_278"></pre>
</td>
<td>
- <pre id="exp_278">#<Method: Array#+></pre>
+ <pre id="exp_278">false</pre>
</td>
</tr>
<tr id="line_279" style="background: #ff8888">
<td>
<pre id="out_279"></pre>
</td>
<td>
- <pre id="exp_279">[1, 2, 3, 2, 3]</pre>
+ <pre id="exp_279">"mm: blah_blah, 123"</pre>
</td>
</tr>
<tr id="line_280" style="background: #ff8888">
<td>
<pre id="out_280"></pre>
</td>
<td>
- <pre id="exp_280">#<Method: Array#+></pre>
+ <pre id="exp_280">catched!!!</pre>
</td>
</tr>
<tr id="line_281" style="background: #ff8888">
<td>
<pre id="out_281"></pre>
</td>
<td>
- <pre id="exp_281">[1, 2, 3]</pre>
+ <pre id="exp_281">"goood"</pre>
</td>
</tr>
<tr id="line_282" style="background: #ff8888">
<td>
<pre id="out_282"></pre>
</td>
<td>
- <pre id="exp_282">~~~~~~~~~~~~~~~~~~~~</pre>
+ <pre id="exp_282">class Method</pre>
</td>
</tr>
<tr id="line_283" style="background: #ff8888">
<td>
<pre id="out_283"></pre>
</td>
<td>
- <pre id="exp_283">Test range</pre>
+ <pre id="exp_283">#<Method: String#to_s></pre>
</td>
</tr>
<tr id="line_284" style="background: #ff8888">
<td>
<pre id="out_284"></pre>
</td>
<td>
- <pre id="exp_284">~~~~~~~~~~~~~~~~~~~~</pre>
+ <pre id="exp_284">"hallo"</pre>
</td>
</tr>
<tr id="line_285" style="background: #ff8888">
<td>
<pre id="out_285"></pre>
</td>
<td>
- <pre id="exp_285">0</pre>
+ <pre id="exp_285">#<Method: Array#+></pre>
</td>
</tr>
<tr id="line_286" style="background: #ff8888">
<td>
<pre id="out_286"></pre>
</td>
<td>
- <pre id="exp_286">2</pre>
+ <pre id="exp_286">[1, 2, 3, 2, 3]</pre>
</td>
</tr>
<tr id="line_287" style="background: #ff8888">
<td>
<pre id="out_287"></pre>
</td>
<td>
- <pre id="exp_287">0..2</pre>
+ <pre id="exp_287">#<Method: Array#+></pre>
</td>
</tr>
<tr id="line_288" style="background: #ff8888">
<td>
<pre id="out_288"></pre>
</td>
<td>
- <pre id="exp_288">"0..2"</pre>
+ <pre id="exp_288">[1, 2, 3]</pre>
</td>
</tr>
<tr id="line_289" style="background: #ff8888">
<td>
<pre id="out_289"></pre>
</td>
<td>
- <pre id="exp_289">"0...2"</pre>
+ <pre id="exp_289">~~~~~~~~~~~~~~~~~~~~</pre>
</td>
</tr>
<tr id="line_290" style="background: #ff8888">
<td>
<pre id="out_290"></pre>
</td>
<td>
- <pre id="exp_290">0</pre>
+ <pre id="exp_290">Test range</pre>
</td>
</tr>
<tr id="line_291" style="background: #ff8888">
<td>
<pre id="out_291"></pre>
</td>
<td>
- <pre id="exp_291">1</pre>
+ <pre id="exp_291">~~~~~~~~~~~~~~~~~~~~</pre>
</td>
</tr>
<tr id="line_292" style="background: #ff8888">
<td>
<pre id="out_292"></pre>
</td>
<td>
- <pre id="exp_292">2</pre>
+ <pre id="exp_292">0</pre>
</td>
</tr>
<tr id="line_293" style="background: #ff8888">
<td>
<pre id="out_293"></pre>
</td>
<td>
- <pre id="exp_293">3</pre>
+ <pre id="exp_293">2</pre>
</td>
</tr>
<tr id="line_294" style="background: #ff8888">
<td>
<pre id="out_294"></pre>
</td>
<td>
- <pre id="exp_294">4</pre>
+ <pre id="exp_294">0..2</pre>
</td>
</tr>
<tr id="line_295" style="background: #ff8888">
<td>
<pre id="out_295"></pre>
</td>
<td>
- <pre id="exp_295">0</pre>
+ <pre id="exp_295">"1..6"</pre>
</td>
</tr>
<tr id="line_296" style="background: #ff8888">
<td>
<pre id="out_296"></pre>
</td>
<td>
- <pre id="exp_296">1</pre>
+ <pre id="exp_296">"1...2"</pre>
</td>
</tr>
<tr id="line_297" style="background: #ff8888">
<td>
<pre id="out_297"></pre>
</td>
<td>
- <pre id="exp_297">2</pre>
+ <pre id="exp_297">"0..2"</pre>
</td>
</tr>
<tr id="line_298" style="background: #ff8888">
<td>
<pre id="out_298"></pre>
</td>
<td>
- <pre id="exp_298">3</pre>
+ <pre id="exp_298">"0...2"</pre>
</td>
</tr>
<tr id="line_299" style="background: #ff8888">
<td>
<pre id="out_299"></pre>
</td>
<td>
- <pre id="exp_299">true</pre>
+ <pre id="exp_299">0</pre>
</td>
</tr>
<tr id="line_300" style="background: #ff8888">
<td>
<pre id="out_300"></pre>
</td>
<td>
- <pre id="exp_300">false</pre>
+ <pre id="exp_300">1</pre>
</td>
</tr>
<tr id="line_301" style="background: #ff8888">
<td>
<pre id="out_301"></pre>
</td>
<td>
- <pre id="exp_301">false</pre>
+ <pre id="exp_301">2</pre>
</td>
</tr>
<tr id="line_302" style="background: #ff8888">
<td>
<pre id="out_302"></pre>
</td>
<td>
- <pre id="exp_302">false</pre>
+ <pre id="exp_302">3</pre>
</td>
</tr>
<tr id="line_303" style="background: #ff8888">
<td>
<pre id="out_303"></pre>
</td>
<td>
- <pre id="exp_303">true</pre>
+ <pre id="exp_303">4</pre>
</td>
</tr>
<tr id="line_304" style="background: #ff8888">
<td>
<pre id="out_304"></pre>
</td>
<td>
- <pre id="exp_304">true</pre>
+ <pre id="exp_304">0</pre>
</td>
</tr>
<tr id="line_305" style="background: #ff8888">
<td>
<pre id="out_305"></pre>
</td>
<td>
- <pre id="exp_305">false</pre>
+ <pre id="exp_305">1</pre>
</td>
</tr>
<tr id="line_306" style="background: #ff8888">
<td>
<pre id="out_306"></pre>
</td>
<td>
- <pre id="exp_306">[]</pre>
+ <pre id="exp_306">2</pre>
</td>
</tr>
<tr id="line_307" style="background: #ff8888">
<td>
<pre id="out_307"></pre>
</td>
<td>
- <pre id="exp_307">[-5, -4, -3, -2, -1]</pre>
+ <pre id="exp_307">3</pre>
</td>
</tr>
<tr id="line_308" style="background: #ff8888">
<td>
<pre id="out_308"></pre>
</td>
<td>
- <pre id="exp_308">0</pre>
+ <pre id="exp_308">true</pre>
</td>
</tr>
<tr id="line_309" style="background: #ff8888">
<td>
<pre id="out_309"></pre>
</td>
<td>
- <pre id="exp_309">0</pre>
+ <pre id="exp_309">false</pre>
</td>
</tr>
<tr id="line_310" style="background: #ff8888">
<td>
<pre id="out_310"></pre>
</td>
<td>
- <pre id="exp_310">4</pre>
+ <pre id="exp_310">false</pre>
</td>
</tr>
<tr id="line_311" style="background: #ff8888">
<td>
<pre id="out_311"></pre>
</td>
<td>
- <pre id="exp_311">4</pre>
+ <pre id="exp_311">false</pre>
</td>
</tr>
<tr id="line_312" style="background: #ff8888">
<td>
<pre id="out_312"></pre>
</td>
<td>
- <pre id="exp_312">false</pre>
+ <pre id="exp_312">true</pre>
</td>
</tr>
<tr id="line_313" style="background: #ff8888">
<td>
<pre id="out_313"></pre>
</td>
<td>
- <pre id="exp_313">1</pre>
+ <pre id="exp_313">true</pre>
</td>
</tr>
<tr id="line_314" style="background: #ff8888">
<td>
<pre id="out_314"></pre>
</td>
<td>
- <pre id="exp_314">1</pre>
+ <pre id="exp_314">false</pre>
</td>
</tr>
<tr id="line_315" style="background: #ff8888">
<td>
<pre id="out_315"></pre>
</td>
<td>
- <pre id="exp_315">5</pre>
+ <pre id="exp_315">[]</pre>
</td>
</tr>
<tr id="line_316" style="background: #ff8888">
<td>
<pre id="out_316"></pre>
</td>
<td>
- <pre id="exp_316">5</pre>
+ <pre id="exp_316">[-5, -4, -3, -2, -1]</pre>
</td>
</tr>
<tr id="line_317" style="background: #ff8888">
<td>
<pre id="out_317"></pre>
</td>
<td>
- <pre id="exp_317">true</pre>
+ <pre id="exp_317">0</pre>
</td>
</tr>
<tr id="line_318" style="background: #ff8888">
<td>
<pre id="out_318"></pre>
</td>
<td>
- <pre id="exp_318">true</pre>
+ <pre id="exp_318">0</pre>
</td>
</tr>
<tr id="line_319" style="background: #ff8888">
<td>
<pre id="out_319"></pre>
</td>
<td>
- <pre id="exp_319">false</pre>
+ <pre id="exp_319">4</pre>
</td>
</tr>
<tr id="line_320" style="background: #ff8888">
<td>
<pre id="out_320"></pre>
</td>
<td>
- <pre id="exp_320">false</pre>
+ <pre id="exp_320">4</pre>
</td>
</tr>
<tr id="line_321" style="background: #ff8888">
<td>
<pre id="out_321"></pre>
</td>
<td>
- <pre id="exp_321">true</pre>
+ <pre id="exp_321">false</pre>
</td>
</tr>
<tr id="line_322" style="background: #ff8888">
<td>
<pre id="out_322"></pre>
</td>
<td>
- <pre id="exp_322">true</pre>
+ <pre id="exp_322">1</pre>
</td>
</tr>
<tr id="line_323" style="background: #ff8888">
<td>
<pre id="out_323"></pre>
</td>
<td>
- <pre id="exp_323">true</pre>
+ <pre id="exp_323">1</pre>
</td>
</tr>
<tr id="line_324" style="background: #ff8888">
<td>
<pre id="out_324"></pre>
</td>
<td>
- <pre id="exp_324">false</pre>
+ <pre id="exp_324">5</pre>
</td>
</tr>
<tr id="line_325" style="background: #ff8888">
<td>
<pre id="out_325"></pre>
</td>
<td>
- <pre id="exp_325">~~~~~~~~~~~~~~~~~~~~</pre>
+ <pre id="exp_325">5</pre>
</td>
</tr>
<tr id="line_326" style="background: #ff8888">
<td>
<pre id="out_326"></pre>
</td>
<td>
- <pre id="exp_326">Test massign</pre>
+ <pre id="exp_326">true</pre>
</td>
</tr>
<tr id="line_327" style="background: #ff8888">
<td>
<pre id="out_327"></pre>
</td>
<td>
- <pre id="exp_327">~~~~~~~~~~~~~~~~~~~~</pre>
+ <pre id="exp_327">true</pre>
</td>
</tr>
<tr id="line_328" style="background: #ff8888">
<td>
<pre id="out_328"></pre>
</td>
<td>
- <pre id="exp_328">1</pre>
+ <pre id="exp_328">false</pre>
</td>
</tr>
<tr id="line_329" style="background: #ff8888">
<td>
<pre id="out_329"></pre>
</td>
<td>
- <pre id="exp_329">2</pre>
+ <pre id="exp_329">false</pre>
</td>
</tr>
<tr id="line_330" style="background: #ff8888">
<td>
<pre id="out_330"></pre>
</td>
<td>
- <pre id="exp_330">--</pre>
+ <pre id="exp_330">true</pre>
</td>
</tr>
<tr id="line_331" style="background: #ff8888">
<td>
<pre id="out_331"></pre>
</td>
<td>
- <pre id="exp_331">1</pre>
+ <pre id="exp_331">true</pre>
</td>
</tr>
<tr id="line_332" style="background: #ff8888">
<td>
<pre id="out_332"></pre>
</td>
<td>
- <pre id="exp_332">2</pre>
+ <pre id="exp_332">true</pre>
</td>
</tr>
<tr id="line_333" style="background: #ff8888">
<td>
<pre id="out_333"></pre>
</td>
<td>
- <pre id="exp_333">--</pre>
+ <pre id="exp_333">false</pre>
</td>
</tr>
<tr id="line_334" style="background: #ff8888">
<td>
<pre id="out_334"></pre>
</td>
<td>
- <pre id="exp_334">1</pre>
+ <pre id="exp_334">55</pre>
</td>
</tr>
<tr id="line_335" style="background: #ff8888">
<td>
<pre id="out_335"></pre>
</td>
<td>
- <pre id="exp_335">2</pre>
+ <pre id="exp_335">100</pre>
</td>
</tr>
<tr id="line_336" style="background: #ff8888">
<td>
<pre id="out_336"></pre>
</td>
<td>
- <pre id="exp_336">nil</pre>
+ <pre id="exp_336">54</pre>
</td>
</tr>
<tr id="line_337" style="background: #ff8888">
<td>
<pre id="out_337"></pre>
</td>
<td>
- <pre id="exp_337">--</pre>
+ <pre id="exp_337">100</pre>
</td>
</tr>
<tr id="line_338" style="background: #ff8888">
<td>
<pre id="out_338"></pre>
</td>
<td>
- <pre id="exp_338">1</pre>
+ <pre id="exp_338">~~~~~~~~~~~~~~~~~~~~</pre>
</td>
</tr>
<tr id="line_339" style="background: #ff8888">
<td>
<pre id="out_339"></pre>
</td>
<td>
- <pre id="exp_339">2</pre>
+ <pre id="exp_339">Test massign</pre>
</td>
</tr>
<tr id="line_340" style="background: #ff8888">
<td>
<pre id="out_340"></pre>
</td>
<td>
- <pre id="exp_340">3</pre>
+ <pre id="exp_340">~~~~~~~~~~~~~~~~~~~~</pre>
</td>
</tr>
<tr id="line_341" style="background: #ff8888">
<td>
<pre id="out_341"></pre>
</td>
<td>
- <pre id="exp_341">--</pre>
+ <pre id="exp_341">1</pre>
</td>
</tr>
<tr id="line_342" style="background: #ff8888">
<td>
<pre id="out_342"></pre>
</td>
<td>
- <pre id="exp_342">swap</pre>
+ <pre id="exp_342">2</pre>
</td>
</tr>
<tr id="line_343" style="background: #ff8888">
<td>
<pre id="out_343"></pre>
</td>
<td>
- <pre id="exp_343">1</pre>
+ <pre id="exp_343">--</pre>
</td>
</tr>
<tr id="line_344" style="background: #ff8888">
<td>
<pre id="out_344"></pre>
</td>
<td>
- <pre id="exp_344">2</pre>
+ <pre id="exp_344">1</pre>
</td>
</tr>
<tr id="line_345" style="background: #ff8888">
@@ -3484,131 +3484,131 @@
<tr id="line_346" style="background: #ff8888">
<td>
<pre id="out_346"></pre>
</td>
<td>
- <pre id="exp_346">1</pre>
+ <pre id="exp_346">--</pre>
</td>
</tr>
<tr id="line_347" style="background: #ff8888">
<td>
<pre id="out_347"></pre>
</td>
<td>
- <pre id="exp_347">--</pre>
+ <pre id="exp_347">1</pre>
</td>
</tr>
<tr id="line_348" style="background: #ff8888">
<td>
<pre id="out_348"></pre>
</td>
<td>
- <pre id="exp_348">splat1</pre>
+ <pre id="exp_348">2</pre>
</td>
</tr>
<tr id="line_349" style="background: #ff8888">
<td>
<pre id="out_349"></pre>
</td>
<td>
- <pre id="exp_349">1</pre>
+ <pre id="exp_349">nil</pre>
</td>
</tr>
<tr id="line_350" style="background: #ff8888">
<td>
<pre id="out_350"></pre>
</td>
<td>
- <pre id="exp_350">2</pre>
+ <pre id="exp_350">--</pre>
</td>
</tr>
<tr id="line_351" style="background: #ff8888">
<td>
<pre id="out_351"></pre>
</td>
<td>
- <pre id="exp_351">nil</pre>
+ <pre id="exp_351">1</pre>
</td>
</tr>
<tr id="line_352" style="background: #ff8888">
<td>
<pre id="out_352"></pre>
</td>
<td>
- <pre id="exp_352">[]</pre>
+ <pre id="exp_352">2</pre>
</td>
</tr>
<tr id="line_353" style="background: #ff8888">
<td>
<pre id="out_353"></pre>
</td>
<td>
- <pre id="exp_353">--</pre>
+ <pre id="exp_353">3</pre>
</td>
</tr>
<tr id="line_354" style="background: #ff8888">
<td>
<pre id="out_354"></pre>
</td>
<td>
- <pre id="exp_354">splat2</pre>
+ <pre id="exp_354">--</pre>
</td>
</tr>
<tr id="line_355" style="background: #ff8888">
<td>
<pre id="out_355"></pre>
</td>
<td>
- <pre id="exp_355">1</pre>
+ <pre id="exp_355">swap</pre>
</td>
</tr>
<tr id="line_356" style="background: #ff8888">
<td>
<pre id="out_356"></pre>
</td>
<td>
- <pre id="exp_356">[2]</pre>
+ <pre id="exp_356">1</pre>
</td>
</tr>
<tr id="line_357" style="background: #ff8888">
<td>
<pre id="out_357"></pre>
</td>
<td>
- <pre id="exp_357">--</pre>
+ <pre id="exp_357">2</pre>
</td>
</tr>
<tr id="line_358" style="background: #ff8888">
<td>
<pre id="out_358"></pre>
</td>
<td>
- <pre id="exp_358">splat3</pre>
+ <pre id="exp_358">2</pre>
</td>
</tr>
<tr id="line_359" style="background: #ff8888">
@@ -3624,41 +3624,41 @@
<tr id="line_360" style="background: #ff8888">
<td>
<pre id="out_360"></pre>
</td>
<td>
- <pre id="exp_360">[2, 3, 4, 5]</pre>
+ <pre id="exp_360">--</pre>
</td>
</tr>
<tr id="line_361" style="background: #ff8888">
<td>
<pre id="out_361"></pre>
</td>
<td>
- <pre id="exp_361">--</pre>
+ <pre id="exp_361">splat1</pre>
</td>
</tr>
<tr id="line_362" style="background: #ff8888">
<td>
<pre id="out_362"></pre>
</td>
<td>
- <pre id="exp_362">splat with globals</pre>
+ <pre id="exp_362">1</pre>
</td>
</tr>
<tr id="line_363" style="background: #ff8888">
<td>
<pre id="out_363"></pre>
</td>
<td>
- <pre id="exp_363">nil</pre>
+ <pre id="exp_363">2</pre>
</td>
</tr>
<tr id="line_364" style="background: #ff8888">
@@ -3674,386 +3674,676 @@
<tr id="line_365" style="background: #ff8888">
<td>
<pre id="out_365"></pre>
</td>
<td>
- <pre id="exp_365">1</pre>
+ <pre id="exp_365">[]</pre>
</td>
</tr>
<tr id="line_366" style="background: #ff8888">
<td>
<pre id="out_366"></pre>
</td>
<td>
- <pre id="exp_366">2</pre>
+ <pre id="exp_366">--</pre>
</td>
</tr>
<tr id="line_367" style="background: #ff8888">
<td>
<pre id="out_367"></pre>
</td>
<td>
- <pre id="exp_367">--</pre>
+ <pre id="exp_367">splat2</pre>
</td>
</tr>
<tr id="line_368" style="background: #ff8888">
<td>
<pre id="out_368"></pre>
</td>
<td>
- <pre id="exp_368">~~~~~~~~~~~~~~~~~~~~</pre>
+ <pre id="exp_368">1</pre>
</td>
</tr>
<tr id="line_369" style="background: #ff8888">
<td>
<pre id="out_369"></pre>
</td>
<td>
- <pre id="exp_369">Test new</pre>
+ <pre id="exp_369">[2]</pre>
</td>
</tr>
<tr id="line_370" style="background: #ff8888">
<td>
<pre id="out_370"></pre>
</td>
<td>
- <pre id="exp_370">~~~~~~~~~~~~~~~~~~~~</pre>
+ <pre id="exp_370">--</pre>
</td>
</tr>
<tr id="line_371" style="background: #ff8888">
<td>
<pre id="out_371"></pre>
</td>
<td>
- <pre id="exp_371">test</pre>
+ <pre id="exp_371">splat3</pre>
</td>
</tr>
<tr id="line_372" style="background: #ff8888">
<td>
<pre id="out_372"></pre>
</td>
<td>
- <pre id="exp_372">~~~~~~~~~~~~~~~~~~~~</pre>
+ <pre id="exp_372">1</pre>
</td>
</tr>
<tr id="line_373" style="background: #ff8888">
<td>
<pre id="out_373"></pre>
</td>
<td>
- <pre id="exp_373">Test exception</pre>
+ <pre id="exp_373">[2, 3, 4, 5]</pre>
</td>
</tr>
<tr id="line_374" style="background: #ff8888">
<td>
<pre id="out_374"></pre>
</td>
<td>
- <pre id="exp_374">~~~~~~~~~~~~~~~~~~~~</pre>
+ <pre id="exp_374">--</pre>
</td>
</tr>
<tr id="line_375" style="background: #ff8888">
<td>
<pre id="out_375"></pre>
</td>
<td>
- <pre id="exp_375">"before block"</pre>
+ <pre id="exp_375">splat with globals</pre>
</td>
</tr>
<tr id="line_376" style="background: #ff8888">
<td>
<pre id="out_376"></pre>
</td>
<td>
- <pre id="exp_376">"in block"</pre>
+ <pre id="exp_376">nil</pre>
</td>
</tr>
<tr id="line_377" style="background: #ff8888">
<td>
<pre id="out_377"></pre>
</td>
<td>
- <pre id="exp_377">"after block"</pre>
+ <pre id="exp_377">nil</pre>
</td>
</tr>
<tr id="line_378" style="background: #ff8888">
<td>
<pre id="out_378"></pre>
</td>
<td>
- <pre id="exp_378">"block"</pre>
+ <pre id="exp_378">1</pre>
</td>
</tr>
<tr id="line_379" style="background: #ff8888">
<td>
<pre id="out_379"></pre>
</td>
<td>
- <pre id="exp_379">"else"</pre>
+ <pre id="exp_379">2</pre>
</td>
</tr>
<tr id="line_380" style="background: #ff8888">
<td>
<pre id="out_380"></pre>
</td>
<td>
- <pre id="exp_380">#<RuntimeError: test></pre>
+ <pre id="exp_380">--</pre>
</td>
</tr>
<tr id="line_381" style="background: #ff8888">
<td>
<pre id="out_381"></pre>
</td>
<td>
- <pre id="exp_381">before begin</pre>
+ <pre id="exp_381">~~~~~~~~~~~~~~~~~~~~</pre>
</td>
</tr>
<tr id="line_382" style="background: #ff8888">
<td>
<pre id="out_382"></pre>
</td>
<td>
- <pre id="exp_382">before raise</pre>
+ <pre id="exp_382">Test hot ruby</pre>
</td>
</tr>
<tr id="line_383" style="background: #ff8888">
<td>
<pre id="out_383"></pre>
</td>
<td>
- <pre id="exp_383">#<Exception: blah></pre>
+ <pre id="exp_383">~~~~~~~~~~~~~~~~~~~~</pre>
</td>
</tr>
<tr id="line_384" style="background: #ff8888">
<td>
<pre id="out_384"></pre>
</td>
<td>
- <pre id="exp_384">yes</pre>
+ <pre id="exp_384">InsertionSort</pre>
</td>
</tr>
<tr id="line_385" style="background: #ff8888">
<td>
<pre id="out_385"></pre>
</td>
<td>
- <pre id="exp_385">ensure</pre>
+ <pre id="exp_385">Before insertion sort:</pre>
</td>
</tr>
<tr id="line_386" style="background: #ff8888">
<td>
<pre id="out_386"></pre>
</td>
<td>
- <pre id="exp_386">after begin</pre>
+ <pre id="exp_386">[3, 6, 2, 5, 3, 7, 1, 8]</pre>
</td>
</tr>
<tr id="line_387" style="background: #ff8888">
<td>
<pre id="out_387"></pre>
</td>
<td>
- <pre id="exp_387">--</pre>
+ <pre id="exp_387">After insertion sort:</pre>
</td>
</tr>
<tr id="line_388" style="background: #ff8888">
<td>
<pre id="out_388"></pre>
</td>
<td>
- <pre id="exp_388">abc</pre>
+ <pre id="exp_388">[1, 2, 3, 3, 5, 6, 7, 8]</pre>
</td>
</tr>
<tr id="line_389" style="background: #ff8888">
<td>
<pre id="out_389"></pre>
</td>
<td>
- <pre id="exp_389">#<RuntimeError: r></pre>
+ <pre id="exp_389">Array args</pre>
</td>
</tr>
<tr id="line_390" style="background: #ff8888">
<td>
<pre id="out_390"></pre>
</td>
<td>
- <pre id="exp_390">b</pre>
+ <pre id="exp_390">Hello World !</pre>
</td>
</tr>
<tr id="line_391" style="background: #ff8888">
<td>
<pre id="out_391"></pre>
</td>
<td>
- <pre id="exp_391">e</pre>
+ <pre id="exp_391">Block</pre>
</td>
</tr>
<tr id="line_392" style="background: #ff8888">
<td>
<pre id="out_392"></pre>
</td>
<td>
- <pre id="exp_392">#<ArgumentError: wrong number of arguments (1 for 0)></pre>
+ <pre id="exp_392">Action is eloquence - William Shakespeare</pre>
</td>
</tr>
-<tr><td colspan="2" style="background: grey"> </td></tr>
-
- <tr id="line_393">
+ <tr id="line_393" style="background: #ff8888">
<td>
<pre id="out_393"></pre>
</td>
<td>
- <pre id="exp_393"></pre>
+ <pre id="exp_393">Class</pre>
</td>
</tr>
- <tr id="line_394">
+ <tr id="line_394" style="background: #ff8888">
<td>
<pre id="out_394"></pre>
</td>
<td>
- <pre id="exp_394"></pre>
+ <pre id="exp_394">PI is about</pre>
</td>
</tr>
- <tr id="line_395">
+ <tr id="line_395" style="background: #ff8888">
<td>
<pre id="out_395"></pre>
</td>
<td>
- <pre id="exp_395"></pre>
+ <pre id="exp_395">3.14159292035</pre>
</td>
</tr>
- <tr id="line_396">
+ <tr id="line_396" style="background: #ff8888">
<td>
<pre id="out_396"></pre>
</td>
<td>
- <pre id="exp_396"></pre>
+ <pre id="exp_396">Const</pre>
</td>
</tr>
- <tr id="line_397">
+ <tr id="line_397" style="background: #ff8888">
<td>
<pre id="out_397"></pre>
</td>
<td>
- <pre id="exp_397"></pre>
+ <pre id="exp_397">~~~~~~~~~~~~~~~~~~~~</pre>
</td>
</tr>
- <tr id="line_398">
+ <tr id="line_398" style="background: #ff8888">
<td>
<pre id="out_398"></pre>
</td>
<td>
- <pre id="exp_398"></pre>
+ <pre id="exp_398">Test new</pre>
</td>
</tr>
- <tr id="line_399">
+ <tr id="line_399" style="background: #ff8888">
<td>
<pre id="out_399"></pre>
</td>
<td>
- <pre id="exp_399"></pre>
+ <pre id="exp_399">~~~~~~~~~~~~~~~~~~~~</pre>
</td>
</tr>
- <tr id="line_400">
+ <tr id="line_400" style="background: #ff8888">
<td>
<pre id="out_400"></pre>
</td>
<td>
- <pre id="exp_400"></pre>
+ <pre id="exp_400">test</pre>
</td>
</tr>
- <tr id="line_401">
+ <tr id="line_401" style="background: #ff8888">
<td>
<pre id="out_401"></pre>
</td>
<td>
- <pre id="exp_401"></pre>
+ <pre id="exp_401">~~~~~~~~~~~~~~~~~~~~</pre>
</td>
</tr>
- <tr id="line_402">
+ <tr id="line_402" style="background: #ff8888">
<td>
<pre id="out_402"></pre>
</td>
<td>
- <pre id="exp_402"></pre>
+ <pre id="exp_402">Test exception</pre>
</td>
</tr>
+ <tr id="line_403" style="background: #ff8888">
+ <td>
+ <pre id="out_403"></pre>
+ </td>
+ <td>
+ <pre id="exp_403">~~~~~~~~~~~~~~~~~~~~</pre>
+ </td>
+ </tr>
+
+
+ <tr id="line_404" style="background: #ff8888">
+ <td>
+ <pre id="out_404"></pre>
+ </td>
+ <td>
+ <pre id="exp_404">"before block"</pre>
+ </td>
+ </tr>
+
+
+ <tr id="line_405" style="background: #ff8888">
+ <td>
+ <pre id="out_405"></pre>
+ </td>
+ <td>
+ <pre id="exp_405">"in block"</pre>
+ </td>
+ </tr>
+
+
+ <tr id="line_406" style="background: #ff8888">
+ <td>
+ <pre id="out_406"></pre>
+ </td>
+ <td>
+ <pre id="exp_406">"after block"</pre>
+ </td>
+ </tr>
+
+
+ <tr id="line_407" style="background: #ff8888">
+ <td>
+ <pre id="out_407"></pre>
+ </td>
+ <td>
+ <pre id="exp_407">"block"</pre>
+ </td>
+ </tr>
+
+
+ <tr id="line_408" style="background: #ff8888">
+ <td>
+ <pre id="out_408"></pre>
+ </td>
+ <td>
+ <pre id="exp_408">"else"</pre>
+ </td>
+ </tr>
+
+
+ <tr id="line_409" style="background: #ff8888">
+ <td>
+ <pre id="out_409"></pre>
+ </td>
+ <td>
+ <pre id="exp_409">#<RuntimeError: test></pre>
+ </td>
+ </tr>
+
+
+ <tr id="line_410" style="background: #ff8888">
+ <td>
+ <pre id="out_410"></pre>
+ </td>
+ <td>
+ <pre id="exp_410">before begin</pre>
+ </td>
+ </tr>
+
+
+ <tr id="line_411" style="background: #ff8888">
+ <td>
+ <pre id="out_411"></pre>
+ </td>
+ <td>
+ <pre id="exp_411">before raise</pre>
+ </td>
+ </tr>
+
+
+ <tr id="line_412" style="background: #ff8888">
+ <td>
+ <pre id="out_412"></pre>
+ </td>
+ <td>
+ <pre id="exp_412">#<Exception: blah></pre>
+ </td>
+ </tr>
+
+
+ <tr id="line_413" style="background: #ff8888">
+ <td>
+ <pre id="out_413"></pre>
+ </td>
+ <td>
+ <pre id="exp_413">yes</pre>
+ </td>
+ </tr>
+
+
+ <tr id="line_414" style="background: #ff8888">
+ <td>
+ <pre id="out_414"></pre>
+ </td>
+ <td>
+ <pre id="exp_414">ensure</pre>
+ </td>
+ </tr>
+
+
+ <tr id="line_415" style="background: #ff8888">
+ <td>
+ <pre id="out_415"></pre>
+ </td>
+ <td>
+ <pre id="exp_415">after begin</pre>
+ </td>
+ </tr>
+
+
+ <tr id="line_416" style="background: #ff8888">
+ <td>
+ <pre id="out_416"></pre>
+ </td>
+ <td>
+ <pre id="exp_416">--</pre>
+ </td>
+ </tr>
+
+
+ <tr id="line_417" style="background: #ff8888">
+ <td>
+ <pre id="out_417"></pre>
+ </td>
+ <td>
+ <pre id="exp_417">abc</pre>
+ </td>
+ </tr>
+
+
+ <tr id="line_418" style="background: #ff8888">
+ <td>
+ <pre id="out_418"></pre>
+ </td>
+ <td>
+ <pre id="exp_418">#<RuntimeError: r></pre>
+ </td>
+ </tr>
+
+
+ <tr id="line_419" style="background: #ff8888">
+ <td>
+ <pre id="out_419"></pre>
+ </td>
+ <td>
+ <pre id="exp_419">b</pre>
+ </td>
+ </tr>
+
+
+ <tr id="line_420" style="background: #ff8888">
+ <td>
+ <pre id="out_420"></pre>
+ </td>
+ <td>
+ <pre id="exp_420">e</pre>
+ </td>
+ </tr>
+
+
+ <tr id="line_421" style="background: #ff8888">
+ <td>
+ <pre id="out_421"></pre>
+ </td>
+ <td>
+ <pre id="exp_421">#<ArgumentError: wrong number of arguments (1 for 0)></pre>
+ </td>
+ </tr>
+
+
+<tr><td colspan="2" style="background: grey"> </td></tr>
+
+ <tr id="line_422">
+ <td>
+ <pre id="out_422"></pre>
+ </td>
+ <td>
+ <pre id="exp_422"></pre>
+ </td>
+ </tr>
+
+
+ <tr id="line_423">
+ <td>
+ <pre id="out_423"></pre>
+ </td>
+ <td>
+ <pre id="exp_423"></pre>
+ </td>
+ </tr>
+
+
+ <tr id="line_424">
+ <td>
+ <pre id="out_424"></pre>
+ </td>
+ <td>
+ <pre id="exp_424"></pre>
+ </td>
+ </tr>
+
+
+ <tr id="line_425">
+ <td>
+ <pre id="out_425"></pre>
+ </td>
+ <td>
+ <pre id="exp_425"></pre>
+ </td>
+ </tr>
+
+
+ <tr id="line_426">
+ <td>
+ <pre id="out_426"></pre>
+ </td>
+ <td>
+ <pre id="exp_426"></pre>
+ </td>
+ </tr>
+
+
+ <tr id="line_427">
+ <td>
+ <pre id="out_427"></pre>
+ </td>
+ <td>
+ <pre id="exp_427"></pre>
+ </td>
+ </tr>
+
+
+ <tr id="line_428">
+ <td>
+ <pre id="out_428"></pre>
+ </td>
+ <td>
+ <pre id="exp_428"></pre>
+ </td>
+ </tr>
+
+
+ <tr id="line_429">
+ <td>
+ <pre id="out_429"></pre>
+ </td>
+ <td>
+ <pre id="exp_429"></pre>
+ </td>
+ </tr>
+
+
+ <tr id="line_430">
+ <td>
+ <pre id="out_430"></pre>
+ </td>
+ <td>
+ <pre id="exp_430"></pre>
+ </td>
+ </tr>
+
+
+ <tr id="line_431">
+ <td>
+ <pre id="out_431"></pre>
+ </td>
+ <td>
+ <pre id="exp_431"></pre>
+ </td>
+ </tr>
+
+
</tbody>
</table>
- <pre id="source">require 'common'<br/><br/>#<br/># file: test/test_hash.rb<br/>#<br/><br/>module T_TestHash<br/>class TestHash<br/> if $RUBYJS<br/> def hash<br/> `var el = {}; el["1"] = null; return el`<br/> end<br/> else<br/> def hash<br/> {"1" => nil}<br/> end<br/> end<br/><br/> def test<br/> h = {"a" => 6, "b" => 7, "1" => 1, 1 => 2, "1,2" => "hello", [1,2] => "good"} <br/> p h["a"]<br/> p h["b"] <br/> p h["1"]<br/> p h[1]<br/> p h["1,2"]<br/> p h[[1,2]] <br/><br/> puts "test native JS hash"<br/> a = hash()<br/> #p a<br/> end<br/><br/> def self.main<br/> new.test<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_yield.rb<br/>#<br/><br/>module T_TestYield<br/>class TestYield<br/> def three_times_yield<br/> yield 1<br/> yield 2<br/> yield 3<br/> end<br/><br/> def test_three_times_yield<br/> puts "three_times_yield"<br/> three_times_yield {|i| p i }<br/> puts "--"<br/> end<br/><br/> def three_times_block(&block)<br/> block.call(1)<br/> block.call(2)<br/> block.call(3)<br/> end<br/><br/> def test_three_times_block<br/> puts "three_times_block"<br/> three_times_block {|i| p i }<br/> puts "--"<br/> end<br/><br/> def three_times_indirect(&block)<br/> three_times_yield(&block) <br/> three_times_block(&block) <br/> end<br/><br/> def test_three_times_indirect<br/> puts "three_times_indirect"<br/> three_times_indirect {|i| p i}<br/> puts "--"<br/> end<br/><br/> def three_times_yield2<br/> p yield(1)<br/> p yield(2)<br/> p yield(3)<br/> end<br/><br/> def test_three_times_yield2<br/> puts "three_times_yield2"<br/> three_times_yield2 {|i|<br/> if i == 1<br/> i<br/> else<br/> next i+1<br/> end<br/> }<br/> end<br/><br/> def loop<br/> while true<br/> yield<br/> end<br/> p "not reached"<br/> end<br/><br/> def loop2(&block)<br/> while true<br/> block.call<br/> end<br/> p "not reached"<br/> end<br/><br/> def test_loop<br/> puts "loop"<br/> i = 0 <br/> res = loop do <br/> i += 1<br/> next if i % 2 == 1 <br/> p i<br/> break "out", i if i > 8<br/> end <br/> p res<br/> puts "--"<br/> end<br/><br/> def test_loop2<br/> puts "loop2"<br/> i = 0 <br/> res = loop2 do <br/> i += 1<br/> next if i % 2 == 1 <br/> p i<br/> break "out", i if i > 8<br/> end <br/> p res<br/> puts "--"<br/> end<br/><br/> def test_while_loop<br/> puts "while-loop"<br/> i = 0 <br/> while true<br/> i += 1<br/> next if i % 2 == 1 <br/> p i<br/> break if i > 8<br/> end<br/> puts "----"<br/> while i > 0<br/> p i<br/> i -= 1<br/> end<br/> puts "--"<br/> end<br/><br/> def return_in_block(&block)<br/> p "return_in_block before"<br/> block.call<br/> p "return_in_block after"<br/> end<br/><br/> def test_return_in_block<br/> p "before"<br/> return_in_block { return 4 }<br/> p "after (NOT)"<br/> end<br/><br/> def test_proc<br/> p "test_proc"<br/> a = proc { return 0 }<br/> p a.call<br/> a = Proc.new { break 3 }<br/> p a.call<br/> end<br/><br/> def test<br/> test_three_times_yield<br/> test_three_times_block<br/> test_three_times_indirect<br/> test_three_times_yield2<br/> test_loop<br/> test_loop2<br/> test_while_loop<br/><br/> begin<br/> test_proc<br/> rescue LocalJumpError => e<br/> p e<br/> end<br/><br/> p test_return_in_block()<br/> end<br/><br/> def self.main<br/> new.test<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_lebewesen.rb<br/>#<br/><br/>module T_TestLebewesen<br/>class TestLebewesen<br/> def self.main<br/> leni = Katze.new("AA-BB", "Leni")<br/> flocki = Katze.new("AC-DC", "Flocki") <br/> bello = Hund.new("AA-ZZ")<br/> leni.miau<br/> bello.wau<br/> bello.jage(leni)<br/> end<br/>end<br/><br/>class Lebewesen<br/> def initialize(dns)<br/> @dns = dns<br/> end<br/>end<br/><br/>class Katze < Lebewesen<br/> attr_reader :name<br/><br/> def initialize(dns, name)<br/> super(dns)<br/> @name = name<br/> end<br/><br/> def miau<br/> puts "miau, ich bin " + @name<br/> end<br/>end<br/><br/>class Hund < Lebewesen<br/> def wau<br/> puts "wau wau"<br/> end<br/><br/> def jage(katze)<br/> puts "ich jage " + katze.name<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_expr.rb<br/>#<br/><br/>module T_TestExpr<br/>class TestExpr<br/> def test<br/> i = if true then 1 else 2 end<br/> p i<br/> i = true or return<br/> p i<br/> end<br/><br/> def self.main<br/> new.test<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_simple_output.rb<br/>#<br/><br/>module T_TestSimpleOutput<br/>class TestSimpleOutput <br/> def self.main()<br/> puts "Hello World from RubyJS"<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_if.rb<br/>#<br/><br/>module T_TestIf<br/>class TestIf<br/> def test<br/> puts "OK" if true<br/> puts "NOT OK" if false<br/> puts "OK" unless false<br/> puts "NOT OK" unless true<br/> puts "OK" if true and true and (true or false) and (!false)<br/><br/> puts "OK" if 5 < 6 and 6 < 7<br/><br/> # test the "||" operator<br/> p(false || "a") # => "a"<br/> p(nil || "a") # => "a"<br/> p(true || "a") # => true<br/> p("b" || "a") # => "b"<br/><br/> # test the "&&" operator<br/><br/> p(false && "a") # => false<br/> p(nil && "a") # => nil<br/> p(true && "a") # => "a"<br/> p("b" && "a") # => "a"<br/> end<br/><br/> def self.main<br/> new.test<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_class.rb<br/>#<br/><br/>module T_TestClass<br/>module X<br/>end<br/><br/>class A<br/> include X<br/>end<br/><br/>class B < A<br/>end<br/><br/>class C < B<br/>end<br/><br/>class D<br/>end<br/><br/>class TestClass<br/> def self.main<br/> p A.new.instance_of?(A) # => true<br/> p A.new.instance_of?(B) # => false<br/> p B.new.instance_of?(A) # => false<br/> p A.new.instance_of?(X) # => false<br/> p B.new.instance_of?(X) # => false<br/><br/> p A.new.kind_of?(A) # => true<br/> p A.new.kind_of?(B) # => false<br/> p B.new.kind_of?(A) # => true<br/> p A.new.kind_of?(X) # => true<br/> p B.new.kind_of?(X) # => true<br/><br/> p C.new.kind_of?(X) # => true<br/> p C.new.kind_of?(A) # => true<br/> p C.new.kind_of?(B) # => true<br/> p C.new.kind_of?(C) # => true<br/> p C.new.kind_of?(D) # => false<br/> p C.new.kind_of?(Object) # => true<br/> p C.new.kind_of?(Kernel) # => true<br/> p C.new.kind_of?(Class) # => false<br/><br/> p ("hallo".class.name)<br/> p (nil.class.name)<br/> p (nil.instance_of?(NilClass))<br/> p ("hallo".instance_of?(String))<br/> p ("hallo".class)<br/> p A<br/> p B<br/> p C<br/> p D<br/> p X<br/><br/> p X.name<br/> p A.name<br/> p B.name<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_case.rb<br/>#<br/><br/>module T_TestCase<br/>class TestCase<br/> def test<br/> case 1+1<br/> when 1, 3<br/> puts "NOT OKAY"<br/> when 2<br/> puts "OKAY"<br/> else<br/> puts "NOT OKAY"<br/> end<br/><br/> p (Array === [])<br/> p (RuntimeError === RuntimeError.new)<br/><br/> case 1<br/> when Fixnum <br/> puts "OK"<br/> when 1<br/> puts "OK"<br/> end<br/><br/> case 4<br/> when 0..3<br/> puts "NOT OKAY"<br/> when 1...4<br/> puts "NOT OKAY"<br/> when 2..4<br/> puts "OKAY"<br/> end<br/> end<br/><br/> def self.main<br/> new.test<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_splat.rb<br/>#<br/><br/>module T_TestSplat<br/>class TestSplat<br/> def m(*args)<br/> p args<br/> end<br/><br/> def self.main<br/> obj = new()<br/><br/> obj.m<br/> obj.m(*[])<br/><br/> obj.m(1)<br/> obj.m(*[1])<br/> obj.m(1,*[])<br/><br/> obj.m(1,2)<br/> obj.m(*[1,2])<br/> obj.m(1,*[2])<br/> obj.m(1,*[1,2])<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_string.rb<br/>#<br/><br/>module T_TestString<br/>class TestString<br/> def test<br/> # inspect<br/> p "hello"<br/> p "hallo\b\t\n"<br/> p "hallo\\leute"<br/> p '"super"'<br/> <br/> # index<br/> p "hello".index('e')<br/> p "hello".index('lo')<br/> p "hello".index('a')<br/> p "hello hello".index('ll')<br/> p "hello hello".index('ll', 3)<br/><br/> # []<br/> p "hallo"[0,1]<br/> p "hallo"[0,2]<br/> p "hallo"[0,5]<br/><br/> p ("10".rjust(10, "0"))<br/> p ("10".rjust(1, "blah"))<br/> p ("x".rjust(4, "()"))<br/><br/> p ("10".ljust(10, "0"))<br/> p ("10".ljust(1, "blah"))<br/> p ("x".ljust(4, "()"))<br/><br/><br/> # string interpolation<br/> p "abc #{ 1 + 2 } def"<br/> @a = "hallo".inspect<br/> @b = 4.5<br/> p "#{@a},#{@b}"<br/><br/> # gsub<br/> s = "hallo".gsub("l", "r")<br/> p s<br/> s = "hallo".gsub(/ll/, "rr")<br/> p s<br/> s = "hallo".gsub(/l/) { "r" }<br/> p s<br/> s = "hallo".gsub(/ll/) { "blah blah" }<br/> p s<br/> "hallllllo".gsub(/(l)l/) {|i| p i }<br/> end<br/><br/> def self.main<br/> new.test<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_inspect.rb<br/>#<br/><br/>module T_TestInspect<br/>class TestInspect<br/> def test<br/> o = [{"Hello"=>'Rubyconf'}]<br/> puts o.inspect<br/> end<br/><br/> def self.main<br/> new.test<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_regexp.rb<br/>#<br/><br/>module T_TestRegexp<br/>class TestRegexp<br/> def test<br/> p "okay" if "hallo" =~ /ll/<br/> pos = "hallo" =~ /ll/<br/> p pos<br/><br/> "hallo" =~ /(ll)/<br/> p $1<br/> p $2<br/> p $3<br/><br/> "hallo" =~ /a(ll)(o)/<br/> p $1<br/> p $2<br/> p $3<br/> p $4<br/> end<br/><br/> def self.main<br/> new.test<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_args.rb<br/>#<br/><br/>module T_TestArgs<br/>class TestArgs<br/> def m(a, b=1, c="hallo", *args) <br/> p a<br/> p b<br/> p c<br/> p args<br/> end<br/><br/> def self.main<br/> obj = new()<br/><br/> obj.m(0)<br/> puts "--"<br/> obj.m(1,2)<br/> puts "--"<br/> obj.m(1,2,9)<br/> puts "--"<br/> obj.m(1,2,9,5)<br/> puts "--"<br/> obj.m(1,2,9,5,6)<br/> puts "--"<br/> obj.m(1,2,9,5,6,7,8,9,10,11,12)<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_array.rb<br/>#<br/><br/>module T_TestArray<br/>class TestArray<br/> if $RUBYJS<br/> def array<br/> [1, 2, `null`, [`null`, `null`, 4]]<br/> end<br/> else<br/> def array<br/> [1, 2, nil, [nil, nil, 4]]<br/> end<br/> end<br/><br/> def test<br/> # delete<br/> a = [ "a", "b", "b", "b", "c" ]<br/> p a.delete("b") #=> "b"<br/> p a #=> ["a", "c"]<br/> p a.delete("z") #=> nil<br/><br/> puts "test native JS array mapping"<br/> p array()<br/> end<br/><br/> def self.main<br/> new.test<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_eql.rb<br/>#<br/><br/>module T_TestEql<br/>class TestEql<br/> def self.main<br/> p "a".eql?("a") # => true<br/> p "a".eql?(1) # => false<br/> p "1".eql?(1) # => false<br/> p [1,2].eql?([1,2]) # => true<br/> p 1.eql?("1") # => false<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_send.rb<br/>#<br/><br/>module T_TestSend<br/>class A<br/> def a_method(a,b)<br/> p a, b<br/> end<br/>end<br/><br/>class B < A<br/> def a_method(b, a)<br/> p "in B"<br/> super<br/> end<br/><br/> def c_method(b)<br/> end<br/>end<br/><br/>class C<br/> def method_missing(id, *args, &block)<br/> p "mm: #{id}, #{args}"<br/> end<br/>end<br/><br/>class TestSend<br/> def self.main<br/> puts "send"<br/> p A.new.send("a_method", 1, 2)<br/> p B.new.send("a_method", 1, 2)<br/><br/> puts "respond_to?"<br/> p A.new.respond_to?(:a_method)<br/> p A.new.respond_to?(:to_s)<br/> p A.new.respond_to?(:inspect)<br/> p A.new.respond_to?(:b_method)<br/> p A.new.respond_to?(:c_method)<br/><br/> puts "method_missing"<br/> p C.new.respond_to?(:blah_blah)<br/> C.new.blah_blah(1,2,3)<br/><br/> begin<br/> A.new.blah_blah<br/> puts "FAILURE?"<br/> rescue NoMethodError<br/> puts "catched!!!"<br/> end<br/><br/> begin<br/> A.not_a_method<br/> rescue NoMethodError<br/> p "goood"<br/> end<br/><br/> puts "class Method"<br/> m = "hallo".method(:to_s)<br/> p m<br/> p m.call<br/><br/> a = [1,2,3]<br/> m = a.method(:+)<br/> p m<br/> p m.call([2,3])<br/> p m<br/> p a<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_range.rb<br/>#<br/><br/>module T_TestRange<br/>class TestRange<br/> def test<br/> a = Range.new(0,2)<br/> p a.first<br/> p a.last<br/> p a<br/><br/> p ((0..2).to_s)<br/> p ((0...2).to_s)<br/><br/> (0..4).each do |i| p i end<br/> (0...4).each do |i| p i end<br/> (-1..-4).each do |i| p i end<br/><br/> p ((0..4).include?(4))<br/> p ((0..4).include?(5))<br/> p ((0...4).include?(5))<br/> p ((0...4).include?(4))<br/> p ((0...4).include?(3))<br/> p ((0...4).include?(0))<br/> p ((0...4).include?(-1))<br/><br/> p ((-1..-5).to_a)<br/> p ((-5..-1).to_a)<br/><br/> r = Range.new(0, 4)<br/> p r.first<br/> p r.begin<br/> p r.last<br/> p r.end<br/> p r.exclude_end?<br/><br/> r = 1...5<br/> p r.first<br/> p r.begin<br/> p r.last<br/> p r.end<br/> p r.exclude_end?<br/><br/> p (false == false)<br/> p (false == true)<br/> p (true == false)<br/> p (true == true)<br/><br/> p ((0..2) == (0..2))<br/> p ((0..2) == Range.new(0,2))<br/> p ((0..2) == (0...2))<br/> end<br/><br/> def self.main<br/> new.test<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_massign.rb<br/>#<br/><br/>module T_TestMassign<br/>class TestMassign<br/> def self.main<br/> a, b = 1, 2<br/> p a<br/> p b<br/> puts "--"<br/><br/> a, b = 1, 2, 3<br/> p a<br/> p b<br/> puts "--"<br/><br/> c = 5<br/> a, b, c = 1, 2 <br/> p a<br/> p b<br/> p c<br/> puts "--"<br/><br/> @a, b, @c = 1, 2, 3<br/> p @a<br/> p b<br/> p @c<br/> puts "--"<br/><br/> puts "swap"<br/> # swap<br/> a, b = 1, 2<br/> p a<br/> p b<br/> a, b = b, a<br/> p a<br/> p b<br/> puts "--"<br/><br/> puts "splat1"<br/> a, b, c, *d = 1, 2 <br/> p a<br/> p b<br/> p c<br/> p d<br/> puts "--"<br/><br/> puts "splat2"<br/> a, *b = 1, 2<br/> p a<br/> p b<br/> puts "--"<br/><br/> puts "splat3"<br/> a, *b = 1, 2, 3, 4, 5<br/> p a<br/> p b<br/> puts "--"<br/><br/> puts "splat with globals"<br/> p $a<br/> p $b<br/> $a, $b = 1, 2 <br/> p $a<br/> p $b<br/> puts "--"<br/> <br/> #TODO: a, b = 1 (to_ary)<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_new.rb<br/>#<br/><br/>module T_TestNew<br/>class TestNew<br/> def initialize<br/> end<br/><br/> def test<br/> puts "test"<br/> end<br/><br/> def self.main()<br/> new().test<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_exception.rb<br/>#<br/><br/>module T_TestException<br/>class TestException<br/> def self.main<br/><br/> p "before block"<br/> begin<br/> p "in block"<br/> end<br/> p "after block"<br/><br/> ###<br/> begin<br/> p "block"<br/> rescue<br/> p "rescue"<br/> rescue Exception => a<br/> p "another rescue"<br/> p a<br/> else<br/> p "else"<br/> end<br/><br/> p RuntimeError.new("test")<br/><br/> puts "before begin"<br/> begin<br/> puts "before raise"<br/> raise Exception, "blah" <br/> puts "after raise"<br/> rescue<br/> puts "noooo"<br/> rescue Exception => a<br/> p a<br/> puts "yes"<br/> ensure<br/> puts "ensure"<br/> end<br/> puts "after begin"<br/><br/> puts "--"<br/><br/> begin<br/> puts "abc"<br/> raise "r"<br/> rescue<br/> p $!<br/> puts "b"<br/> ensure<br/> puts "e"<br/> end<br/><br/> #<br/> # Test arity checks<br/> #<br/><br/> begin<br/> p("hallo".to_s(2))<br/> rescue ArgumentError => a<br/> p a<br/> end<br/> end<br/>end<br/>end<br/><br/><br/><br/> class TestSuite<br/> def self.main<br/> begin<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test hash'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestHash::TestHash.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test yield'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestYield::TestYield.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test lebewesen'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestLebewesen::TestLebewesen.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test expr'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestExpr::TestExpr.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test simple output'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestSimpleOutput::TestSimpleOutput.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test if'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestIf::TestIf.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test class'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestClass::TestClass.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test case'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestCase::TestCase.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test splat'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestSplat::TestSplat.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test string'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestString::TestString.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test inspect'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestInspect::TestInspect.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test regexp'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestRegexp::TestRegexp.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test args'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestArgs::TestArgs.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test array'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestArray::TestArray.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test eql'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestEql::TestEql.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test send'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestSend::TestSend.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test range'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestRange::TestRange.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test massign'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestMassign::TestMassign.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test new'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestNew::TestNew.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test exception'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestException::TestException.main<br/> <br/> rescue Exception => a<br/> p "unhandled exception"<br/> p a<br/> end<br/> end<br/> end<br/> TestSuite.main unless $RUBYJS<br/> </pre>
+ <pre id="source">require 'common'<br/><br/>#<br/># file: test/test_hash.rb<br/>#<br/><br/>module T_TestHash<br/>class TestHash<br/> if $RUBYJS<br/> def hash<br/> `var el = {}; el["1"] = null; return el`<br/> end<br/> else<br/> def hash<br/> {"1" => nil}<br/> end<br/> end<br/><br/> def test<br/> h = {"a" => 6, "b" => 7, "1" => 1, 1 => 2, "1,2" => "hello", [1,2] => "good"} <br/> p h["a"]<br/> p h["b"] <br/> p h["1"]<br/> p h[1]<br/> p h["1,2"]<br/> p h[[1,2]] <br/><br/> puts "test native JS hash"<br/> a = hash()<br/> #p a<br/> end<br/><br/> def self.main<br/> new.test<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_yield.rb<br/>#<br/><br/>module T_TestYield<br/>class TestYield<br/> def three_times_yield<br/> yield 1<br/> yield 2<br/> yield 3<br/> end<br/><br/> def test_three_times_yield<br/> puts "three_times_yield"<br/> three_times_yield {|i| p i }<br/> puts "--"<br/> end<br/><br/> def three_times_block(&block)<br/> block.call(1)<br/> block.call(2)<br/> block.call(3)<br/> end<br/><br/> def test_three_times_block<br/> puts "three_times_block"<br/> three_times_block {|i| p i }<br/> puts "--"<br/> end<br/><br/> def three_times_indirect(&block)<br/> three_times_yield(&block) <br/> three_times_block(&block) <br/> end<br/><br/> def test_three_times_indirect<br/> puts "three_times_indirect"<br/> three_times_indirect {|i| p i}<br/> puts "--"<br/> end<br/><br/> def three_times_yield2<br/> p yield(1)<br/> p yield(2)<br/> p yield(3)<br/> end<br/><br/> def test_three_times_yield2<br/> puts "three_times_yield2"<br/> three_times_yield2 {|i|<br/> if i == 1<br/> i<br/> else<br/> next i+1<br/> end<br/> }<br/> end<br/><br/> def loop<br/> while true<br/> yield<br/> end<br/> p "not reached"<br/> end<br/><br/> def loop2(&block)<br/> while true<br/> block.call<br/> end<br/> p "not reached"<br/> end<br/><br/> def test_loop<br/> puts "loop"<br/> i = 0 <br/> res = loop do <br/> i += 1<br/> next if i % 2 == 1 <br/> p i<br/> break "out", i if i > 8<br/> end <br/> p res<br/> puts "--"<br/> end<br/><br/> def test_loop2<br/> puts "loop2"<br/> i = 0 <br/> res = loop2 do <br/> i += 1<br/> next if i % 2 == 1 <br/> p i<br/> break "out", i if i > 8<br/> end <br/> p res<br/> puts "--"<br/> end<br/><br/> def test_while_loop<br/> puts "while-loop"<br/> i = 0 <br/> while true<br/> i += 1<br/> next if i % 2 == 1 <br/> p i<br/> break if i > 8<br/> end<br/> puts "----"<br/> while i > 0<br/> p i<br/> i -= 1<br/> end<br/> puts "--"<br/> end<br/><br/> def return_in_block(&block)<br/> p "return_in_block before"<br/> block.call<br/> p "return_in_block after"<br/> end<br/><br/> def test_return_in_block<br/> p "before"<br/> return_in_block { return 4 }<br/> p "after (NOT)"<br/> end<br/><br/> def test_proc<br/> p "test_proc"<br/> a = proc { return 0 }<br/> p a.call<br/> a = Proc.new { break 3 }<br/> p a.call<br/> end<br/><br/> def test<br/> test_three_times_yield<br/> test_three_times_block<br/> test_three_times_indirect<br/> test_three_times_yield2<br/> test_loop<br/> test_loop2<br/> test_while_loop<br/><br/> begin<br/> test_proc<br/> rescue LocalJumpError => e<br/> p e<br/> end<br/><br/> p test_return_in_block()<br/> end<br/><br/> def self.main<br/> new.test<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_insertion_sort.rb<br/>#<br/><br/>module T_TestInsertionSort<br/>class TestInsertionSort<br/> def sort ary<br/> puts "Before insertion sort:"<br/> p ary<br/><br/> for i in 1..(ary.length-1) do<br/> n = i<br/> while n >= 1 && ary[n] < ary[n - 1] do<br/> if ary[n] < ary[n - 1]<br/> tmp = ary[n]<br/> ary[n] = ary[n - 1]<br/> ary[n - 1] = tmp<br/> end<br/> n -= 1<br/> end<br/> end<br/><br/> puts "After insertion sort:"<br/> p ary<br/> end<br/><br/> def self.main<br/> new.sort [3, 6, 2, 5, 3, 7, 1, 8]<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_lebewesen.rb<br/>#<br/><br/>module T_TestLebewesen<br/>class TestLebewesen<br/> def self.main<br/> leni = Katze.new("AA-BB", "Leni")<br/> flocki = Katze.new("AC-DC", "Flocki") <br/> bello = Hund.new("AA-ZZ")<br/> leni.miau<br/> bello.wau<br/> bello.jage(leni)<br/> end<br/>end<br/><br/>class Lebewesen<br/> def initialize(dns)<br/> @dns = dns<br/> end<br/>end<br/><br/>class Katze < Lebewesen<br/> attr_reader :name<br/><br/> def initialize(dns, name)<br/> super(dns)<br/> @name = name<br/> end<br/><br/> def miau<br/> puts "miau, ich bin " + @name<br/> end<br/>end<br/><br/>class Hund < Lebewesen<br/> def wau<br/> puts "wau wau"<br/> end<br/><br/> def jage(katze)<br/> puts "ich jage " + katze.name<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_expr.rb<br/>#<br/><br/>module T_TestExpr<br/>class TestExpr<br/> def test<br/> i = if true then 1 else 2 end<br/> p i<br/> i = true or return<br/> p i<br/> end<br/><br/> def self.main<br/> new.test<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_simple_output.rb<br/>#<br/><br/>module T_TestSimpleOutput<br/>class TestSimpleOutput <br/> def self.main()<br/> puts "Hello World from RubyJS"<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_if.rb<br/>#<br/><br/>module T_TestIf<br/>class TestIf<br/> def test<br/> puts "OK" if true<br/> puts "NOT OK" if false<br/> puts "OK" unless false<br/> puts "NOT OK" unless true<br/> puts "OK" if true and true and (true or false) and (!false)<br/><br/> puts "OK" if 5 < 6 and 6 < 7<br/><br/> # test the "||" operator<br/> p(false || "a") # => "a"<br/> p(nil || "a") # => "a"<br/> p(true || "a") # => true<br/> p("b" || "a") # => "b"<br/><br/> # test the "&&" operator<br/><br/> p(false && "a") # => false<br/> p(nil && "a") # => nil<br/> p(true && "a") # => "a"<br/> p("b" && "a") # => "a"<br/> end<br/><br/> def self.main<br/> new.test<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_class.rb<br/>#<br/><br/>module T_TestClass<br/>module X<br/>end<br/><br/>class A<br/> include X<br/>end<br/><br/>class B < A<br/>end<br/><br/>class C < B<br/>end<br/><br/>class D<br/>end<br/><br/>class TestClass<br/> def self.main<br/> p A.new.instance_of?(A) # => true<br/> p A.new.instance_of?(B) # => false<br/> p B.new.instance_of?(A) # => false<br/> p A.new.instance_of?(X) # => false<br/> p B.new.instance_of?(X) # => false<br/><br/> p A.new.kind_of?(A) # => true<br/> p A.new.kind_of?(B) # => false<br/> p B.new.kind_of?(A) # => true<br/> p A.new.kind_of?(X) # => true<br/> p B.new.kind_of?(X) # => true<br/><br/> p C.new.kind_of?(X) # => true<br/> p C.new.kind_of?(A) # => true<br/> p C.new.kind_of?(B) # => true<br/> p C.new.kind_of?(C) # => true<br/> p C.new.kind_of?(D) # => false<br/> p C.new.kind_of?(Object) # => true<br/> p C.new.kind_of?(Kernel) # => true<br/> p C.new.kind_of?(Class) # => false<br/><br/> p ("hallo".class.name)<br/> p (nil.class.name)<br/> p (nil.instance_of?(NilClass))<br/> p ("hallo".instance_of?(String))<br/> p ("hallo".class)<br/> p A<br/> p B<br/> p C<br/> p D<br/> p X<br/><br/> p X.name<br/> p A.name<br/> p B.name<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_case.rb<br/>#<br/><br/>module T_TestCase<br/>class TestCase<br/> def test<br/> case 1+1<br/> when 1, 3<br/> puts "NOT OKAY"<br/> when 2<br/> puts "OKAY"<br/> else<br/> puts "NOT OKAY"<br/> end<br/><br/> p (Array === [])<br/> p (RuntimeError === RuntimeError.new)<br/><br/> case 1<br/> when Fixnum <br/> puts "OK"<br/> when 1<br/> puts "OK"<br/> end<br/><br/> case 4<br/> when 0..3<br/> puts "NOT OKAY"<br/> when 1...4<br/> puts "NOT OKAY"<br/> when 2..4<br/> puts "OKAY"<br/> end<br/> end<br/><br/> def self.main<br/> new.test<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_splat.rb<br/>#<br/><br/>module T_TestSplat<br/>class TestSplat<br/> def m(*args)<br/> p args<br/> end<br/><br/> def self.main<br/> obj = new()<br/><br/> obj.m<br/> obj.m(*[])<br/><br/> obj.m(1)<br/> obj.m(*[1])<br/> obj.m(1,*[])<br/><br/> obj.m(1,2)<br/> obj.m(*[1,2])<br/> obj.m(1,*[2])<br/> obj.m(1,*[1,2])<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_string.rb<br/>#<br/><br/>module T_TestString<br/>class TestString<br/> def test<br/> # inspect<br/> p "hello"<br/> p "hallo\b\t\n"<br/> p "hallo\\leute"<br/> p '"super"'<br/> <br/> # index<br/> p "hello".index('e')<br/> p "hello".index('lo')<br/> p "hello".index('a')<br/> p "hello hello".index('ll')<br/> p "hello hello".index('ll', 3)<br/><br/> # []<br/> p "hallo"[0,1]<br/> p "hallo"[0,2]<br/> p "hallo"[0,5]<br/><br/> p ("10".rjust(10, "0"))<br/> p ("10".rjust(1, "blah"))<br/> p ("x".rjust(4, "()"))<br/><br/> p ("10".ljust(10, "0"))<br/> p ("10".ljust(1, "blah"))<br/> p ("x".ljust(4, "()"))<br/><br/><br/> # string interpolation<br/> p "abc #{ 1 + 2 } def"<br/> @a = "hallo".inspect<br/> @b = 4.5<br/> p "#{@a},#{@b}"<br/><br/> # gsub<br/> s = "hallo".gsub("l", "r")<br/> p s<br/> s = "hallo".gsub(/ll/, "rr")<br/> p s<br/> s = "hallo".gsub(/l/) { "r" }<br/> p s<br/> s = "hallo".gsub(/ll/) { "blah blah" }<br/> p s<br/> "hallllllo".gsub(/(l)l/) {|i| p i }<br/> end<br/><br/> def self.main<br/> new.test<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_inspect.rb<br/>#<br/><br/>module T_TestInspect<br/>class TestInspect<br/> def test<br/> o = [{"Hello"=>'Rubyconf'}]<br/> puts o.inspect<br/> end<br/><br/> def self.main<br/> new.test<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_regexp.rb<br/>#<br/><br/>module T_TestRegexp<br/>class TestRegexp<br/> def test<br/> p "okay" if "hallo" =~ /ll/<br/> pos = "hallo" =~ /ll/<br/> p pos<br/><br/> "hallo" =~ /(ll)/<br/> p $1<br/> p $2<br/> p $3<br/><br/> "hallo" =~ /a(ll)(o)/<br/> p $1<br/> p $2<br/> p $3<br/> p $4<br/> end<br/><br/> def self.main<br/> new.test<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_args.rb<br/>#<br/><br/>module T_TestArgs<br/>class TestArgs<br/> def m(a, b=1, c="hallo", *args) <br/> p a<br/> p b<br/> p c<br/> p args<br/> end<br/><br/> def self.main<br/> obj = new()<br/><br/> obj.m(0)<br/> puts "--"<br/> obj.m(1,2)<br/> puts "--"<br/> obj.m(1,2,9)<br/> puts "--"<br/> obj.m(1,2,9,5)<br/> puts "--"<br/> obj.m(1,2,9,5,6)<br/> puts "--"<br/> obj.m(1,2,9,5,6,7,8,9,10,11,12)<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_array.rb<br/>#<br/><br/>module T_TestArray<br/>class TestArray<br/> if $RUBYJS<br/> def array<br/> [1, 2, `null`, [`null`, `null`, 4]]<br/> end<br/> else<br/> def array<br/> [1, 2, nil, [nil, nil, 4]]<br/> end<br/> end<br/><br/> def test<br/> # delete<br/> a = [ "a", "b", "b", "b", "c" ]<br/> p a.delete("b") #=> "b"<br/> p a #=> ["a", "c"]<br/> p a.delete("z") #=> nil<br/><br/> puts "test native JS array mapping"<br/> p array()<br/> end<br/><br/> def self.main<br/> new.test<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_eql.rb<br/>#<br/><br/>module T_TestEql<br/>class TestEql<br/> def self.main<br/> p "a".eql?("a") # => true<br/> p "a".eql?(1) # => false<br/> p "1".eql?(1) # => false<br/> p [1,2].eql?([1,2]) # => true<br/> p 1.eql?("1") # => false<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_send.rb<br/>#<br/><br/>module T_TestSend<br/>class A<br/> def a_method(a,b)<br/> p a, b<br/> end<br/>end<br/><br/>class B < A<br/> def a_method(b, a)<br/> p "in B"<br/> super<br/> end<br/><br/> def c_method(b)<br/> end<br/>end<br/><br/>class C<br/> def method_missing(id, *args, &block)<br/> p "mm: #{id}, #{args}"<br/> end<br/>end<br/><br/>class TestSend<br/> def self.main<br/> puts "send"<br/> p A.new.send("a_method", 1, 2)<br/> p B.new.send("a_method", 1, 2)<br/><br/> puts "respond_to?"<br/> p A.new.respond_to?(:a_method)<br/> p A.new.respond_to?(:to_s)<br/> p A.new.respond_to?(:inspect)<br/> p A.new.respond_to?(:b_method)<br/> p A.new.respond_to?(:c_method)<br/><br/> puts "method_missing"<br/> p C.new.respond_to?(:blah_blah)<br/> C.new.blah_blah(1,2,3)<br/><br/> begin<br/> A.new.blah_blah<br/> puts "FAILURE?"<br/> rescue NoMethodError<br/> puts "catched!!!"<br/> end<br/><br/> begin<br/> A.not_a_method<br/> rescue NoMethodError<br/> p "goood"<br/> end<br/><br/> puts "class Method"<br/> m = "hallo".method(:to_s)<br/> p m<br/> p m.call<br/><br/> a = [1,2,3]<br/> m = a.method(:+)<br/> p m<br/> p m.call([2,3])<br/> p m<br/> p a<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_range.rb<br/>#<br/><br/>module T_TestRange<br/>class TestRange<br/> def test<br/> a = Range.new(0,2)<br/> p a.first<br/> p a.last<br/> p a<br/><br/> i = 1<br/> p ((i..i+5).to_s)<br/> p ((i...i+i).to_s)<br/><br/> p ((0..2).to_s)<br/> p ((0...2).to_s)<br/><br/> (0..4).each do |i| p i end<br/> (0...4).each do |i| p i end<br/> (-1..-4).each do |i| p i end<br/><br/> p ((0..4).include?(4))<br/> p ((0..4).include?(5))<br/> p ((0...4).include?(5))<br/> p ((0...4).include?(4))<br/> p ((0...4).include?(3))<br/> p ((0...4).include?(0))<br/> p ((0...4).include?(-1))<br/><br/> p ((-1..-5).to_a)<br/> p ((-5..-1).to_a)<br/><br/> r = Range.new(0, 4)<br/> p r.first<br/> p r.begin<br/> p r.last<br/> p r.end<br/> p r.exclude_end?<br/><br/> r = 1...5<br/> p r.first<br/> p r.begin<br/> p r.last<br/> p r.end<br/> p r.exclude_end?<br/><br/> p (false == false)<br/> p (false == true)<br/> p (true == false)<br/> p (true == true)<br/><br/> p ((0..2) == (0..2))<br/> p ((0..2) == Range.new(0,2))<br/> p ((0..2) == (0...2))<br/><br/> j = 55<br/> p j<br/> for i in 1..100<br/> j = i<br/> end<br/> p j<br/><br/> j = 54<br/> p j<br/> for j in 1..100<br/> end<br/> p j<br/> end<br/><br/> def self.main<br/> new.test<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_massign.rb<br/>#<br/><br/>module T_TestMassign<br/>class TestMassign<br/> def self.main<br/> a, b = 1, 2<br/> p a<br/> p b<br/> puts "--"<br/><br/> a, b = 1, 2, 3<br/> p a<br/> p b<br/> puts "--"<br/><br/> c = 5<br/> a, b, c = 1, 2 <br/> p a<br/> p b<br/> p c<br/> puts "--"<br/><br/> @a, b, @c = 1, 2, 3<br/> p @a<br/> p b<br/> p @c<br/> puts "--"<br/><br/> puts "swap"<br/> # swap<br/> a, b = 1, 2<br/> p a<br/> p b<br/> a, b = b, a<br/> p a<br/> p b<br/> puts "--"<br/><br/> puts "splat1"<br/> a, b, c, *d = 1, 2 <br/> p a<br/> p b<br/> p c<br/> p d<br/> puts "--"<br/><br/> puts "splat2"<br/> a, *b = 1, 2<br/> p a<br/> p b<br/> puts "--"<br/><br/> puts "splat3"<br/> a, *b = 1, 2, 3, 4, 5<br/> p a<br/> p b<br/> puts "--"<br/><br/> puts "splat with globals"<br/> p $a<br/> p $b<br/> $a, $b = 1, 2 <br/> p $a<br/> p $b<br/> puts "--"<br/> <br/> #TODO: a, b = 1 (to_ary)<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_hot_ruby.rb<br/>#<br/><br/>module T_TestHotRuby<br/>#<br/># Examples taken from: http://hotruby.accelart.jp/<br/>#<br/>class TestHotRuby<br/> def sort ary<br/> puts "Before insertion sort:"<br/> p ary<br/><br/> for i in 1..(ary.length-1) do<br/> n = i<br/> while n >= 1 && ary[n] < ary[n - 1] do<br/> if ary[n] < ary[n - 1]<br/> tmp = ary[n]<br/> ary[n] = ary[n - 1]<br/> ary[n - 1] = tmp<br/> end<br/> n -= 1<br/> end<br/> end<br/><br/> puts "After insertion sort:"<br/> p ary<br/> end<br/><br/> def addPrint a, b, c<br/> puts a + b + c<br/> end<br/><br/> def self.main<br/> t = new()<br/><br/> puts "InsertionSort"<br/> t.sort [3, 6, 2, 5, 3, 7, 1, 8]<br/><br/> puts "Array args"<br/> ary = [' World ', '!']<br/> t.addPrint 'Hello', *ary<br/><br/> puts "Block"<br/> Foo.new.main<br/><br/> puts "Class"<br/> puts Pi::PI<br/> # different precision on Ruby vs. Javascript<br/> puts Pi.new.calc.to_s[0,13] <br/><br/><br/> puts "Const"<br/> # FIXME<br/>=begin<br/> Bar_::Baz_.new.run <br/> Bar2.new.run<br/> Object::Bar2.new.run<br/> Bar3.new.run<br/>=end<br/> end<br/>end<br/><br/>#<br/># Block<br/>#<br/>class Hoge<br/> def add_msg &block<br/> block.call "is" # s/yield/call/<br/> end<br/>end<br/> <br/>class Foo<br/> NAME = ' - William Shakespeare'<br/> def main<br/> pre = "Action"<br/> @space = " "<br/> Hoge.new.add_msg do |msg|<br/> fuga = "eloquence"<br/> puts pre + @space + msg + @space + fuga + NAME<br/> end<br/> end<br/>end<br/><br/>#<br/># Class<br/>#<br/>class Pi<br/> def initialize<br/> @a = 355.0<br/> end<br/> <br/> def calc<br/> b = 113.0<br/> return @a / b<br/> end<br/> <br/> PI = 'PI is about'<br/>end<br/> <br/>#<br/># Const<br/># <br/>class Foo_<br/> CONST = 'Foo'<br/>end<br/><br/>class Bar_<br/> CONST = 'Bar'<br/><br/> class Baz_ < Foo_<br/> def run<br/> puts CONST # => "Bar" Outer class const<br/> # In this case, you have to specify if you want to see parent class const.<br/> puts Foo_::CONST # => "Foo"<br/> end<br/> end<br/>end<br/> <br/>class Foo2<br/> CONST = 'Foo'<br/>end<br/> <br/>CONST = 'Object'<br/> <br/>class Bar2 < Foo2<br/> def run<br/> puts CONST # => "Foo"<br/> end<br/>end<br/><br/># If you specify "Object", then const in Object is searched before.<br/>class Object<br/> class Bar2 < Foo2<br/> def run<br/> puts CONST # => "Object"<br/> end<br/> end<br/>end<br/> <br/>class Foo3<br/> CONST = 'Foo'<br/>end<br/>class Bar3 < Foo3<br/> def run<br/> puts CONST # => "Foo"<br/> #CONST = 'Bar' # Define Bar's const "CONST"<br/> puts CONST # => "Bar" (Foo::CONST is hidden)<br/> puts Foo3::CONST # => "Foo" (You can see by "::")<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_new.rb<br/>#<br/><br/>module T_TestNew<br/>class TestNew<br/> def initialize<br/> end<br/><br/> def test<br/> puts "test"<br/> end<br/><br/> def self.main()<br/> new().test<br/> end<br/>end<br/>end<br/><br/><br/>#<br/># file: test/test_exception.rb<br/>#<br/><br/>module T_TestException<br/>class TestException<br/> def self.main<br/><br/> p "before block"<br/> begin<br/> p "in block"<br/> end<br/> p "after block"<br/><br/> ###<br/> begin<br/> p "block"<br/> rescue<br/> p "rescue"<br/> rescue Exception => a<br/> p "another rescue"<br/> p a<br/> else<br/> p "else"<br/> end<br/><br/> p RuntimeError.new("test")<br/><br/> puts "before begin"<br/> begin<br/> puts "before raise"<br/> raise Exception, "blah" <br/> puts "after raise"<br/> rescue<br/> puts "noooo"<br/> rescue Exception => a<br/> p a<br/> puts "yes"<br/> ensure<br/> puts "ensure"<br/> end<br/> puts "after begin"<br/><br/> puts "--"<br/><br/> begin<br/> puts "abc"<br/> raise "r"<br/> rescue<br/> p $!<br/> puts "b"<br/> ensure<br/> puts "e"<br/> end<br/><br/> #<br/> # Test arity checks<br/> #<br/><br/> begin<br/> p("hallo".to_s(2))<br/> rescue ArgumentError => a<br/> p a<br/> end<br/> end<br/>end<br/>end<br/><br/><br/><br/> class TestSuite<br/> def self.main<br/> begin<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test hash'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestHash::TestHash.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test yield'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestYield::TestYield.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test insertion sort'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestInsertionSort::TestInsertionSort.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test lebewesen'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestLebewesen::TestLebewesen.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test expr'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestExpr::TestExpr.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test simple output'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestSimpleOutput::TestSimpleOutput.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test if'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestIf::TestIf.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test class'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestClass::TestClass.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test case'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestCase::TestCase.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test splat'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestSplat::TestSplat.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test string'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestString::TestString.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test inspect'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestInspect::TestInspect.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test regexp'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestRegexp::TestRegexp.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test args'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestArgs::TestArgs.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test array'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestArray::TestArray.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test eql'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestEql::TestEql.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test send'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestSend::TestSend.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test range'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestRange::TestRange.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test massign'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestMassign::TestMassign.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test hot ruby'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestHotRuby::TestHotRuby.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test new'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestNew::TestNew.main<br/> <br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> puts 'Test exception'<br/> puts '~~~~~~~~~~~~~~~~~~~~'<br/> T_TestException::TestException.main<br/> <br/> rescue Exception => a<br/> p "unhandled exception"<br/> p a<br/> end<br/> end<br/> end<br/> TestSuite.main unless $RUBYJS<br/> </pre>
</body></html>