Sha256: da9afb799327269ccf1608a93808734ab6a3e5c4798cf1844b834800f5c34bb2

Contents?: true

Size: 375 Bytes

Versions: 49

Compression:

Stored size: 375 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

49 entries across 49 versions & 1 rubygems

Version Path
opal-1.4.0 spec/opal/stdlib/strscan/scan_spec.rb
opal-1.4.0.alpha1 spec/opal/stdlib/strscan/scan_spec.rb
opal-1.3.2 spec/opal/stdlib/strscan/scan_spec.rb
opal-1.3.1 spec/opal/stdlib/strscan/scan_spec.rb
opal-1.3.0 spec/opal/stdlib/strscan/scan_spec.rb
opal-1.3.0.rc1 spec/opal/stdlib/strscan/scan_spec.rb
opal-1.3.0.alpha1 spec/opal/stdlib/strscan/scan_spec.rb
opal-1.2.0 spec/opal/stdlib/strscan/scan_spec.rb
opal-1.2.0.beta1 spec/opal/stdlib/strscan/scan_spec.rb
opal-1.1.1 spec/opal/stdlib/strscan/scan_spec.rb
opal-1.1.1.rc1 spec/opal/stdlib/strscan/scan_spec.rb
opal-1.1.0 spec/opal/stdlib/strscan/scan_spec.rb
opal-1.1.0.rc1 spec/opal/stdlib/strscan/scan_spec.rb
opal-0.10.6 spec/opal/stdlib/strscan/scan_spec.rb
opal-0.10.6.beta spec/opal/stdlib/strscan/scan_spec.rb
opal-0.10.5 spec/opal/stdlib/strscan/scan_spec.rb
opal-0.10.4 spec/opal/stdlib/strscan/scan_spec.rb
opal-0.11.0.rc1 spec/opal/stdlib/strscan/scan_spec.rb
opal-0.10.3 spec/opal/stdlib/strscan/scan_spec.rb
opal-0.10.2 spec/opal/stdlib/strscan/scan_spec.rb