Sha256: 66b4f0dd070b22959b0027a1fbfc2a27be8d956f2b4f357159e171c1355029b4

Contents?: true

Size: 658 Bytes

Versions: 4

Compression:

Stored size: 658 Bytes

Contents

require 'spec_helper'
module Gisele::Language::Syntax
  describe WhileSt, "to_ast" do

    it 'parses as expected' do
      expr     = "while goodCond Task1 end"
      expected = \
        [:while_st,
          [:bool_expr, [:var_ref, "goodCond"]],
          [:task_call_st, "Task1"]]
      ast(expr, :while_st).should eq(expected)
    end

    it 'recognizes implicit sequences' do
      expr     = "while goodCond Task1 Task2 end"
      expected = \
        [:while_st,
          [:bool_expr, [:var_ref, "goodCond"]],
          [:seq_st, [:task_call_st, "Task1"], [:task_call_st, "Task2"]]]
      ast(expr, :while_st).should eq(expected)
    end

  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
gisele-language-0.6.0 spec/language/syntax/to_ast/test_while_st.rb
gisele-language-0.5.1 spec/language/syntax/to_ast/test_while_st.rb
gisele-language-0.5.0 spec/language/syntax/to_ast/test_while_st.rb
gisele-0.5.0 spec/unit/language/syntax/to_ast/test_while_st.rb