comparison graal/com.oracle.truffle.ruby.test/src/com/oracle/truffle/ruby/test/core/ContinuationTests.java @ 13645:497fada09efb

Ruby: remove versioning.
author Chris Seaton <chris.seaton@oracle.com>
date Wed, 15 Jan 2014 19:27:27 +0000
parents 0fbee3eb71f0
children 62bfc12dc9e1
comparison
equal deleted inserted replaced
13640:bfe7a8c8c3c6 13645:497fada09efb
9 */ 9 */
10 package com.oracle.truffle.ruby.test.core; 10 package com.oracle.truffle.ruby.test.core;
11 11
12 import org.junit.*; 12 import org.junit.*;
13 13
14 import com.oracle.truffle.ruby.runtime.configuration.*;
15 import com.oracle.truffle.ruby.test.*; 14 import com.oracle.truffle.ruby.test.*;
16 15
17 /** 16 /**
18 * Test the {@code Continuation} class. 17 * Test the {@code Continuation} class.
19 */ 18 */
20 public class ContinuationTests extends RubyTests { 19 public class ContinuationTests extends RubyTests {
21 20
22 @Test 21 @Test
23 public void testRequired18() { 22 public void testRequired() {
24 assertPrints(RubyVersion.RUBY_18, "", "callcc { |c| c.call }"); 23 assertPrints("", "require \"continuation\"; callcc { |c| c.call }");
25 }
26
27 @Test
28 public void testRequired19() {
29 assertPrints(RubyVersion.RUBY_19, "", "require \"continuation\"; callcc { |c| c.call }");
30 }
31
32 @Test
33 public void testRequired20() {
34 assertPrints(RubyVersion.RUBY_20, "", "require \"continuation\"; callcc { |c| c.call }");
35 } 24 }
36 25
37 @Test 26 @Test
38 public void testOneShotGoingUpCallstack() { 27 public void testOneShotGoingUpCallstack() {
39 assertPrints(RubyVersion.RUBY_18, "1\n3\n", "callcc { |c| puts 1; c.call; puts 2 }; puts 3"); 28 assertPrints("1\n3\n", "require \"continuation\"; callcc { |c| puts 1; c.call; puts 2 }; puts 3");
40 } 29 }
41 30
42 @Test 31 @Test
43 public void testOneShotGoingUpCallstackReturnValue() { 32 public void testOneShotGoingUpCallstackReturnValue() {
44 assertPrints(RubyVersion.RUBY_18, "14\n", "puts callcc { |c| c.call 14 }"); 33 assertPrints("14\n", "require \"continuation\"; puts callcc { |c| c.call 14 }");
45 } 34 }
46 35
47 @Test 36 @Test
48 public void testNestedOneShotGoingUpCallstack() { 37 public void testNestedOneShotGoingUpCallstack() {
49 assertPrints(RubyVersion.RUBY_18, "1\n2\n4\n5\n", "callcc { |c1| puts 1; callcc { |c2| puts 2; c2.call; puts 3 }; puts 4 }; puts 5"); 38 assertPrints("1\n2\n4\n5\n", "require \"continuation\"; callcc { |c1| puts 1; callcc { |c2| puts 2; c2.call; puts 3 }; puts 4 }; puts 5");
50 assertPrints(RubyVersion.RUBY_18, "1\n2\n5\n", "callcc { |c1| puts 1; callcc { |c2| puts 2; c1.call; puts 3 }; puts 4 }; puts 5"); 39 assertPrints("1\n2\n5\n", "require \"continuation\"; callcc { |c1| puts 1; callcc { |c2| puts 2; c1.call; puts 3 }; puts 4 }; puts 5");
51 } 40 }
52 41
53 } 42 }