Sha256: 493d3bf1006e838462f9019bf860f17a82b102a42805e8d8a01125b21ad76bf9

Contents?: true

Size: 532 Bytes

Versions: 6

Compression:

Stored size: 532 Bytes

Contents

require 'spec_helper'

describe 'EcmaReValidator::Comments' do
  it 'should fail if regexp has inline comments' do
    re = /(?#comment)hello/

    expect(EcmaReValidator.valid?(re)).to eql(false)
  end

  it 'should fail if regexp has inline comments across lines' do
    re = %r{
          start         # some text
          \s            # white space char
          (group)       # first group
          (?:alt1|alt2) # some alternation
          end
        }x

    expect(EcmaReValidator.valid?(re)).to eql(false)
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ecma-re-validator-0.3.0 spec/comments_spec.rb
ecma-re-validator-0.2.1 spec/comments_spec.rb
ecma-re-validator-0.2.0 spec/comments_spec.rb
ecma-re-validator-0.1.2 spec/comments_spec.rb
ecma-re-validator-0.1.1 spec/comments_spec.rb
ecma-re-validator-0.1.0 spec/comments_spec.rb