Sha256: a38fd88c1c9e76b997a085a16be91ebacaeada6dadb5cc8ec59ad9bb8d7b6de1

Contents?: true

Size: 567 Bytes

Versions: 124

Compression:

Stored size: 567 Bytes

Contents

require 'spec_helper'
require 'puppet/pops'
require_relative 'parser_rspec_helper'

describe 'egrammar parsing lambda definitions' do
  include ParserRspecHelper

  context 'without return type' do
    it 'f() |$x| { 1 }' do
      expect(dump(parse('f() |$x| { 1 }'))).to eq("(invoke f (lambda (parameters x) (block\n  1\n)))")
    end
  end

  context 'with return type' do
    it 'f() |$x| >> Integer { 1 }' do
      expect(dump(parse('f() |$x| >> Integer { 1 }'))).to eq("(invoke f (lambda (parameters x) (return_type integer) (block\n  1\n)))")
    end
  end
end

Version data entries

124 entries across 124 versions & 1 rubygems

Version Path
puppet-5.3.7 spec/unit/pops/parser/parse_lambda_spec.rb
puppet-5.3.7-x86-mingw32 spec/unit/pops/parser/parse_lambda_spec.rb
puppet-5.3.7-x64-mingw32 spec/unit/pops/parser/parse_lambda_spec.rb
puppet-5.3.7-universal-darwin spec/unit/pops/parser/parse_lambda_spec.rb
puppet-4.10.12 spec/unit/pops/parser/parse_lambda_spec.rb
puppet-4.10.12-x86-mingw32 spec/unit/pops/parser/parse_lambda_spec.rb
puppet-4.10.12-x64-mingw32 spec/unit/pops/parser/parse_lambda_spec.rb
puppet-4.10.12-universal-darwin spec/unit/pops/parser/parse_lambda_spec.rb
puppet-4.10.11 spec/unit/pops/parser/parse_lambda_spec.rb
puppet-4.10.11-x86-mingw32 spec/unit/pops/parser/parse_lambda_spec.rb
puppet-4.10.11-x64-mingw32 spec/unit/pops/parser/parse_lambda_spec.rb
puppet-4.10.11-universal-darwin spec/unit/pops/parser/parse_lambda_spec.rb
puppet-5.3.6 spec/unit/pops/parser/parse_lambda_spec.rb
puppet-5.3.6-x86-mingw32 spec/unit/pops/parser/parse_lambda_spec.rb
puppet-5.3.6-x64-mingw32 spec/unit/pops/parser/parse_lambda_spec.rb
puppet-5.3.6-universal-darwin spec/unit/pops/parser/parse_lambda_spec.rb
puppet-5.4.0 spec/unit/pops/parser/parse_lambda_spec.rb
puppet-5.4.0-x86-mingw32 spec/unit/pops/parser/parse_lambda_spec.rb
puppet-5.4.0-x64-mingw32 spec/unit/pops/parser/parse_lambda_spec.rb
puppet-5.4.0-universal-darwin spec/unit/pops/parser/parse_lambda_spec.rb