Sha256: 82beaf61d71f970ea48ff2d8f2237748da1542b0f20bb36aea9e173f67c8420b

Contents?: true

Size: 567 Bytes

Versions: 420

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

420 entries across 420 versions & 1 rubygems

Version Path
puppet-5.5.6 spec/unit/pops/parser/parse_lambda_spec.rb
puppet-5.5.6-x86-mingw32 spec/unit/pops/parser/parse_lambda_spec.rb
puppet-5.5.6-x64-mingw32 spec/unit/pops/parser/parse_lambda_spec.rb
puppet-5.5.6-universal-darwin spec/unit/pops/parser/parse_lambda_spec.rb
puppet-5.5.3 spec/unit/pops/parser/parse_lambda_spec.rb
puppet-5.5.3-x86-mingw32 spec/unit/pops/parser/parse_lambda_spec.rb
puppet-5.5.3-x64-mingw32 spec/unit/pops/parser/parse_lambda_spec.rb
puppet-5.5.3-universal-darwin spec/unit/pops/parser/parse_lambda_spec.rb
puppet-5.5.2 spec/unit/pops/parser/parse_lambda_spec.rb
puppet-5.5.2-x86-mingw32 spec/unit/pops/parser/parse_lambda_spec.rb
puppet-5.5.2-x64-mingw32 spec/unit/pops/parser/parse_lambda_spec.rb
puppet-5.5.2-universal-darwin spec/unit/pops/parser/parse_lambda_spec.rb
puppet-5.5.1 spec/unit/pops/parser/parse_lambda_spec.rb
puppet-5.5.1-x86-mingw32 spec/unit/pops/parser/parse_lambda_spec.rb
puppet-5.5.1-x64-mingw32 spec/unit/pops/parser/parse_lambda_spec.rb
puppet-5.5.1-universal-darwin spec/unit/pops/parser/parse_lambda_spec.rb
puppet-5.5.0 spec/unit/pops/parser/parse_lambda_spec.rb
puppet-5.5.0-x86-mingw32 spec/unit/pops/parser/parse_lambda_spec.rb
puppet-5.5.0-x64-mingw32 spec/unit/pops/parser/parse_lambda_spec.rb
puppet-5.5.0-universal-darwin spec/unit/pops/parser/parse_lambda_spec.rb