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.8.3.rc1 spec/opal/stdlib/strscan/scan_spec.rb
opal-1.8.2 spec/opal/stdlib/strscan/scan_spec.rb
opal-1.8.1 spec/opal/stdlib/strscan/scan_spec.rb
opal-1.8.0 spec/opal/stdlib/strscan/scan_spec.rb
opal-1.8.0.beta1 spec/opal/stdlib/strscan/scan_spec.rb
opal-1.7.4 spec/opal/stdlib/strscan/scan_spec.rb
opal-1.8.0.alpha1 spec/opal/stdlib/strscan/scan_spec.rb
opal-1.7.3 spec/opal/stdlib/strscan/scan_spec.rb
opal-1.7.2 spec/opal/stdlib/strscan/scan_spec.rb
opal-1.7.1 spec/opal/stdlib/strscan/scan_spec.rb
opal-1.7.0 spec/opal/stdlib/strscan/scan_spec.rb
opal-1.7.0.rc1 spec/opal/stdlib/strscan/scan_spec.rb
opal-1.6.1 spec/opal/stdlib/strscan/scan_spec.rb
opal-1.6.0 spec/opal/stdlib/strscan/scan_spec.rb
opal-1.6.0.rc1 spec/opal/stdlib/strscan/scan_spec.rb
opal-1.6.0.alpha1 spec/opal/stdlib/strscan/scan_spec.rb
opal-1.5.1 spec/opal/stdlib/strscan/scan_spec.rb
opal-1.5.0 spec/opal/stdlib/strscan/scan_spec.rb
opal-1.5.0.rc1 spec/opal/stdlib/strscan/scan_spec.rb
opal-1.4.1 spec/opal/stdlib/strscan/scan_spec.rb