summaryrefslogtreecommitdiffhomepage
path: root/test/t/syntax.rb
AgeCommit message (Collapse)Author
2015-11-17mruby-1.2.01.2.0mimaki
2015-09-02Make travis happyZachary Scott
We have do this because mruby's test files are found using MRUBY_ROOT, like this: mrbs = Dir.glob("#{MRUBY_ROOT}/test/t/*.rb")
2015-05-31fix masgn nosplat array rhs bugcremno
The rest lhs variable has to be an empty array if rhs is an array with less elements than pre + post lhs variables. The codegen generated OP_ARRAY with an invalid length (such as 127 for *a, b = []) because rn was negative.
2015-05-31update test/t/syntax.rb to success on CRubyYukihiro "Matz" Matsumoto
2015-05-29add multiple assignment with rest testscremno
2015-05-07fix splat without assignment; fix #2781cremno
The parser generates NODE_NIL for tSTAR without argument in masgns. The codegen didn't handle that.
2015-02-24Fix a bug that no expression case doesn't return valid valueKouhei Sutou
Here is a script that reproduces this problem: x = case when true; 1 end p x # => main # 1 is expected
2015-02-24Fix a bug that if and no return value case can't return true clause valueKouhei Sutou
Here is a script that reproduce this problem: x = if true 1 else case 2 when 3 end 4 end p x # => nil # 1 is expected
2014-12-23Fix splat and multiple assignmentsKouhei Sutou
Case1: From variable Code: a = [1, 2, 3, 4, 5] b, c, *d = a p [a, b, c, d] Before: [[1, 2, 3, 4, 5], 1, 2, []] After: [[1, 2, 3, 4, 5], 1, 2, [3, 4, 5]] Ruby: [[1, 2, 3, 4, 5], 1, 2, [3, 4, 5]] Case2: From variables Code: a = [1, 2, 3] b = [4, 5, 6, 7] c, d, *e, f, g = *a, *b p [a, b, c, d, e, f, g] Before: [[1, 2, 3], [4, 5, 6, 7], 1, 2, [], 6, 7] After: [[1, 2, 3], [4, 5, 6, 7], 1, 2, [3, 4, 5], 6, 7] Ruby: [[1, 2, 3], [4, 5, 6, 7], 1, 2, [3, 4, 5], 6, 7] Case 3: "for" Code: a = [1, 2, 3, 4, 5, 6, 7] for b, c, *d, e, f in [a] do p [a, b, c, d, e, f] end Before: [[1, 2, 3, 4, 5, 6, 7], 1, 2, [], nil, nil] After: [[1, 2, 3, 4, 5, 6, 7], 1, 2, [3, 4, 5], 6, 7] Ruby: [[1, 2, 3, 4, 5, 6, 7], 1, 2, [3, 4, 5], 6, 7]
2014-11-27add multiple assignment decomposition testYukihiro "Matz" Matsumoto
2014-05-03count skipped line numbersNobuyoshi Nakada
2014-05-03skip to the next line and reset column after `=end`Nobuyoshi Nakada
2014-05-03fix embedded documentsNobuyoshi Nakada
tabs are allowed after `=begin` and `=end`. raise `SyntaxError` if no =end is found.
2014-04-28Add tests for multiline comment parsingCarson McDonald
2014-04-21tests should not depend on `mruby-proc-ext`cremno
2014-04-21fix optional block arguments in rhsNobuyoshi Nakada
define optional block arguments as argument variables in the rhs default expressions, as same as mere assignment expressions. Import ruby/ruby@01740f0c273c89f7bcff3d5014d73c8ff6fb1986
2014-04-21fix optional arguments in rhsNobuyoshi Nakada
define optional arguments as argument variables in the rhs default expressions, as same as mere assignment expressions. Import ruby/ruby@01740f0c273c89f7bcff3d5014d73c8ff6fb1986
2014-04-21allow method definition in cmdargNobuyoshi Nakada
save cmdarg_stack and isolate command argument state from outer scope to allow method definition in cmdarg import from ruby/ruby@04bb9d6b75a55d4000700769eead5a5cb942c25b
2014-04-19Allow parenthesed do-block in cmdargNobuyoshi Nakada
Flush cmdarg flags inside left-paren in a command argument, to allow parenthesed `do-block` as an argument without arguments parentheses. `CMDARG_PUSH(0)` for tLPAREN_ARG is before `CMDARG_PUSH(1)` in `command_args` due to look-ahead.
2014-03-28Add test for backquote.take_cheeze
* Implement code generation of NODE_DXSTR. * Fix NOVAL NODE_XSTR.
2014-03-05__FILE__ test: add support for \ as separatorcremno
2014-02-26add test for __LINE__ and __FILE__take_cheeze
2014-01-06tests for "case" expression.Tomoyuki Sahara
2014-01-04Test case statement with splatCarson McDonald
2013-12-20add some tests for case statementsh2so5
2013-08-02I fix order of actual and expect test value in syntax.rb.Jun Hiroe
2013-07-28Add a couple splat testsCarson McDonald
2013-06-14Improve Syntax TestsDaniel Bovensiepen
2012-11-30add test for 'Abbreviated variable assignment as returns'skandhas
2012-11-02add test for 8cf42709Yukihiro Matsumoto
2012-06-12minor correction in test/t/syntax.rbYukihiro Matsumoto