mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-04-11 03:00:13 -04:00
with a more comprehensive execution test that uncovered some missing spots
This commit is contained in:
23
test/fixtures/execution/test_everything.cs
vendored
Normal file
23
test/fixtures/execution/test_everything.cs
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
func: =>
|
||||
a: 3
|
||||
b: []
|
||||
while a >= 0
|
||||
b.push('o')
|
||||
a--.
|
||||
|
||||
c: {
|
||||
text: b
|
||||
}
|
||||
|
||||
c: 'error' unless 42 > 41
|
||||
|
||||
c.text: if false
|
||||
'error'
|
||||
else
|
||||
c.text + '---'.
|
||||
|
||||
c.list: let for let in c.text.split('') if let is '-'.
|
||||
|
||||
c.single: c.list[1, 1][0].
|
||||
|
||||
print(func() == '-')
|
||||
29
test/fixtures/execution/test_everything.js
vendored
Normal file
29
test/fixtures/execution/test_everything.js
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
(function(){
|
||||
var func = function() {
|
||||
var a = 3;
|
||||
var b = [];
|
||||
while (a >= 0) {
|
||||
b.push('o');
|
||||
a--;
|
||||
}
|
||||
var c = {
|
||||
text: b
|
||||
};
|
||||
if (!(42 > 41)) {
|
||||
c = 'error';
|
||||
}
|
||||
c.text = false ? 'error' : c.text + '---';
|
||||
var d = c.text.split('');
|
||||
var g = [];
|
||||
for (var e=0, f=d.length; e<f; e++) {
|
||||
var let = d[e];
|
||||
if (let === '-') {
|
||||
c.list = g.push(let);
|
||||
}
|
||||
}
|
||||
c.list = g;
|
||||
c.single = c.list.slice(1, 1 + 1)[0];
|
||||
return c.single;
|
||||
};
|
||||
print(func() === '-');
|
||||
})();
|
||||
Reference in New Issue
Block a user