Sha256: a18165343f698fcf7026eeca910e1672a01e40739bb7ec96af3d61404dbdefdb

Contents?: true

Size: 577 Bytes

Versions: 5

Compression:

Stored size: 577 Bytes

Contents

require 'spec_helper'
module Gisele::Language
  describe "the Sexp grammar", "case_st" do

    it 'matches when no variable is specified' do
      case_st = \
        [:case_st, nil,
          [:when_clause, [:bool_expr, [:bool_lit, true]], [:nop_st]] ]
      (sexp_grammar[:case_st] === case_st).should be_true
    end

    it 'matches when a variable is specified' do
      case_st = \
        [:case_st, [:var_ref, "varName"],
          [:when_clause, [:bool_expr, [:bool_lit, true]], [:nop_st]] ]
      (sexp_grammar[:case_st] === case_st).should be_true
    end

  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
gisele-language-0.6.0 spec/language/grammar_sexp/test_case_st.rb
gisele-language-0.5.1 spec/language/grammar_sexp/test_case_st.rb
gisele-language-0.5.0 spec/language/grammar_sexp/test_case_st.rb
gisele-0.5.0 spec/unit/language/grammar_sexp/test_case_st.rb
gisele-0.4.0 spec/unit/language/grammar_sexp/test_case_st.rb