Package jflex.unicode

Examples of jflex.unicode.UnicodeProperties


      "1.1", "1.1.5", "2", "2.0", "2.1", "3", "3.0", "3.1", "3.2", "4", "4.0",
      "4.1", "5", "5.0", "5.1", "5.2", "6", "6.0"
    };
    for (String version : versions) {
      try {
        UnicodeProperties properties = new UnicodeProperties(version);
        IntCharSet intervals = properties.getIntCharSet("Lu");
        assertNotNull("intervals for 'Lu' property value for version " + version
                      + " should not be null\n" + "Supported properties: "
                      + properties.getPropertyValues(), intervals);
        assertTrue("intervals for 'Lu' property value should have an interval",
                   intervals.numIntervals() > 0);
      } catch (UnicodeProperties.UnsupportedUnicodeVersionException e) {
        assertTrue("Unsupported version '" + version
                   + "' should be supported: " + e, false);
View Full Code Here


    }
  }

  public void testUnsupportedVersion() {
    try {
      new UnicodeProperties("1.0");
      assertTrue("new UnicodeProperties(\"1.0\") should trigger an"
                 + " UnsupportedUnicodeVersionException, but it did not.",false);
    } catch (UnicodeProperties.UnsupportedUnicodeVersionException e) {
      // Drop the exception - it is expected.
    }
View Full Code Here

    }
  }

  public void testDefaultVersion() {
    try {
      UnicodeProperties properties = new UnicodeProperties();
      IntCharSet intervals = properties.getIntCharSet("Lu");
      assertNotNull("intervals for 'Lu' property value for default Unicode "
                    + "version should not be null\n" + "Supported properties: "
                    + properties.getPropertyValues(), intervals);
      assertTrue("intervals for 'Lu' property value should have an interval",
                 intervals.numIntervals() > 0);
    } catch (UnicodeProperties.UnsupportedUnicodeVersionException e) {
      assertTrue("Default version is unsupported: " + e, false);
    }
View Full Code Here

    }
  }

  public void testDefaultVersionAliases() {
    try {
      UnicodeProperties properties = new UnicodeProperties();
      IntCharSet set_1
        = properties.getIntCharSet("General Category : Other Letter");
      assertNotNull("Null interval set returned for "
                    +"\\p{General Category : Other Letter}", set_1);
      assertTrue("Empty interval set returned for "
                  + "\\p{General Category : Other Letter}",
                  set_1.containsElements());
      IntCharSet set_2 = properties.getIntCharSet("Lo");
      assertNotNull("Null interval set returned for \\p{Lo}", set_2);
      assertTrue("Empty interval set returned for \\p{Lo}",
                 set_1.containsElements());
      assertTrue("\\p{General Category : Other Letter} and \\p{Lo} should"
                 +" return the same thing.", set_1.equals(set_2));

      set_1 = properties.getIntCharSet(" Script:Tibetan ");
      assertNotNull("Null interval set returned for \\p{ Script:Tibetan }",
                    set_1);
      assertTrue("Empty interval set returned for \\p{ Script:Tibetan }",
                  set_1.containsElements());
      set_2 = properties.getIntCharSet("-_T i b t_-");
      assertNotNull("Null interval set returned for \\p{-_T i b t_-}", set_2);
      assertTrue("Empty interval set returned for \\p{-_T i b t_-}",
                 set_1.containsElements());
      assertTrue("\\p{ Script:Tibetan } and \\p{-_T i b t_-} should"
                 +" return the same thing.", set_1.equals(set_2));
View Full Code Here

    }
  }

  public void testCaselessMatches_1_1() {
    try {
      UnicodeProperties properties = new UnicodeProperties("1.1");
      IntCharSet caselessMatches = properties.getCaselessMatches('i');
      assertNotNull("'i' has no caseless matches except itself, but it should.",
                    caselessMatches);
      assertTrue("Caseless match set for 'i' should contain 'i', but it doesn't.",
                 caselessMatches.contains('i'));
      assertTrue("Caseless match set for 'i' should contain 'I', but it doesn't.",
View Full Code Here

  }


  public void testCaselessMatches_2_0() {
    try {
      UnicodeProperties properties = new UnicodeProperties("2.0");
      checkCaseless_i_matches(properties);
    } catch (UnicodeProperties.UnsupportedUnicodeVersionException e) {
      assertTrue("Unsupported version '2.0' should be supported: " + e, false);
    }
  }
View Full Code Here

               charCount == 4);
  }

  public void testCaselessMatches_2_1() {
    try {
      UnicodeProperties properties = new UnicodeProperties("2.1");
      checkCaseless_i_matches(properties);
    } catch (UnicodeProperties.UnsupportedUnicodeVersionException e) {
      assertTrue("Unsupported version '2.1' should be supported: " + e, false);
    }
  }
View Full Code Here

    }
  }

  public void testCaselessMatches_3_0() {
    try {
      UnicodeProperties properties = new UnicodeProperties("3.0");
      checkCaseless_i_matches(properties);
    } catch (UnicodeProperties.UnsupportedUnicodeVersionException e) {
      assertTrue("Unsupported version '3.0' should be supported: " + e, false);
    }
  }
View Full Code Here

    }
  }

  public void testCaselessMatches_3_1() {
    try {
      UnicodeProperties properties = new UnicodeProperties("3.1");
      checkCaseless_i_matches(properties);
    } catch (UnicodeProperties.UnsupportedUnicodeVersionException e) {
      assertTrue("Unsupported version '3.1' should be supported: " + e, false);
    }
  }
View Full Code Here

    }
  }

  public void testCaselessMatches_3_2() {
    try {
      UnicodeProperties properties = new UnicodeProperties("3.2");
      checkCaseless_i_matches(properties);
    } catch (UnicodeProperties.UnsupportedUnicodeVersionException e) {
      assertTrue("Unsupported version '3.2' should be supported: " + e, false);
    }
  }
View Full Code Here

TOP

Related Classes of jflex.unicode.UnicodeProperties

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.