Sha256: 2c905fc7f696fcbb4dae26c8c5385e35acfdf5f19df85e73b6af18f69c2d1c15

Contents?: true

Size: 374 Bytes

Versions: 5

Compression:

Stored size: 374 Bytes

Contents

require 'strscan'

describe "StringScanner#scan" do
  context "when the regex has multiple alternatives" do
    it "still anchors to the beginning of the remaining text" do
      # regression test; see GH issue 1074
      scanner = StringScanner.new("10\nb = `2E-16`")
      scanner.scan(/[\d_]+\.[\d_]+\b|[\d_]+(\.[\d_]+)?[eE][-+]?[\d_]+\b/).should be_nil
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
opal-0.9.4 spec/opal/stdlib/strscan/scan_spec.rb
opal-0.9.3 spec/opal/stdlib/strscan/scan_spec.rb
opal-0.9.2 spec/opal/stdlib/strscan/scan_spec.rb
opal-0.9.0 spec/opal/stdlib/strscan/scan_spec.rb
opal-0.9.0.rc1 spec/opal/stdlib/strscan/scan_spec.rb