|
11 | 11 | $output = zip($one,$two)
|
12 | 12 | notice(inline_template('<%= @output.inspect %>'))
|
13 | 13 | EOS
|
14 |
| - |
15 |
| - expect(apply_manifest(pp, :catch_failures => true).stdout).to match(/\[\["1", "5"\], \["2", "6"\], \["3", "7"\], \["4", "8"\]\]/) |
| 14 | + if is_future_parser_enabled? |
| 15 | + expect(apply_manifest(pp, :catch_failures => true).stdout).to match(/\[\[1, 5\], \[2, 6\], \[3, 7\], \[4, 8\]\]/) |
| 16 | + else |
| 17 | + expect(apply_manifest(pp, :catch_failures => true).stdout).to match(/\[\["1", "5"\], \["2", "6"\], \["3", "7"\], \["4", "8"\]\]/) |
| 18 | + end |
16 | 19 | end
|
17 | 20 | it 'zips two arrays of numbers & bools together' do
|
18 | 21 | pp = <<-EOS
|
|
21 | 24 | $output = zip($one,$two)
|
22 | 25 | notice(inline_template('<%= @output.inspect %>'))
|
23 | 26 | EOS
|
24 |
| - |
25 |
| - expect(apply_manifest(pp, :catch_failures => true).stdout).to match(/\[\["1", true\], \["2", true\], \["three", false\], \["4", false\]\]/) |
| 27 | + if is_future_parser_enabled? |
| 28 | + expect(apply_manifest(pp, :catch_failures => true).stdout).to match(/\[\[1, true\], \[2, true\], \["three", false\], \[4, false\]\]/) |
| 29 | + else |
| 30 | + expect(apply_manifest(pp, :catch_failures => true).stdout).to match(/\[\["1", true\], \["2", true\], \["three", false\], \["4", false\]\]/) |
| 31 | + end |
26 | 32 | end
|
27 | 33 | it 'zips two arrays of numbers together and flattens them' do
|
28 | 34 | # XXX This only tests the argument `true`, even though the following are valid:
|
|
35 | 41 | $output = zip($one,$two,true)
|
36 | 42 | notice(inline_template('<%= @output.inspect %>'))
|
37 | 43 | EOS
|
38 |
| - |
39 |
| - expect(apply_manifest(pp, :catch_failures => true).stdout).to match(/\["1", "5", "2", "6", "3", "7", "4", "8"\]/) |
| 44 | + if is_future_parser_enabled? |
| 45 | + expect(apply_manifest(pp, :catch_failures => true).stdout).to match(/\[1, 5, 2, 6, 3, 7, 4, 8\]/) |
| 46 | + else |
| 47 | + expect(apply_manifest(pp, :catch_failures => true).stdout).to match(/\["1", "5", "2", "6", "3", "7", "4", "8"\]/) |
| 48 | + end |
40 | 49 | end
|
41 | 50 | it 'handles unmatched length' do
|
42 | 51 | # XXX Is this expected behavior?
|
|
46 | 55 | $output = zip($one,$two)
|
47 | 56 | notice(inline_template('<%= @output.inspect %>'))
|
48 | 57 | EOS
|
49 |
| - |
50 |
| - expect(apply_manifest(pp, :catch_failures => true).stdout).to match(/\[\["1", "5"\], \["2", "6"\]\]/) |
| 58 | + if is_future_parser_enabled? |
| 59 | + expect(apply_manifest(pp, :catch_failures => true).stdout).to match(/\[\[1, 5\], \[2, 6\]\]/) |
| 60 | + else |
| 61 | + expect(apply_manifest(pp, :catch_failures => true).stdout).to match(/\[\["1", "5"\], \["2", "6"\]\]/) |
| 62 | + end |
51 | 63 | end
|
52 | 64 | end
|
53 | 65 | describe 'failure' do
|
|
0 commit comments