Sha256: bb8b72753123f631c3f192e48da2ca2895cc48d0186e41a0296d42bd5cc16622

Contents?: true

Size: 651 Bytes

Versions: 2

Compression:

Stored size: 651 Bytes

Contents

# encoding: UTF-8

# Copyright 2012 Twitter, Inc
# http://www.apache.org/licenses/LICENSE-2.0

require 'spec_helper'

include TwitterCldr::Parsers

describe UnicodeRegexParser::UnicodeString do
  describe "#to_set" do
    it "should return a zero-length range when representing a single codepoint" do
      str = UnicodeRegexParser::UnicodeString.new([97])
      str.to_set.to_a.should == [97..97]
    end

    it "should return a range containing the codepoint array as both the first and last elements" do
      str = UnicodeRegexParser::UnicodeString.new([97, 98, 99])
      str.to_set.to_a.should == [[97, 98, 99]..[97, 98, 99]]
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
twitter_cldr-3.0.1 spec/parsers/unicode_regex/unicode_string_spec.rb
twitter_cldr-3.0.0 spec/parsers/unicode_regex/unicode_string_spec.rb