Refactor some test fixtures.
This commit is contained in:
parent
8a4d1b82f8
commit
1f06eb4dce
|
@ -16,6 +16,10 @@
|
|||
*/
|
||||
package org.apache.commons.lang3;
|
||||
|
||||
import static org.apache.commons.lang3.Supplementary.CharU20000;
|
||||
import static org.apache.commons.lang3.Supplementary.CharU20001;
|
||||
import static org.apache.commons.lang3.Supplementary.CharUSuppCharHigh;
|
||||
import static org.apache.commons.lang3.Supplementary.CharUSuppCharLow;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
@ -29,28 +33,6 @@ import org.junitpioneer.jupiter.DefaultLocale;
|
|||
* Unit tests {@link org.apache.commons.lang3.StringUtils} - Contains methods
|
||||
*/
|
||||
public class StringUtilsContainsTest {
|
||||
/**
|
||||
* Supplementary character U+20000
|
||||
* See http://www.oracle.com/technetwork/articles/javase/supplementary-142654.html
|
||||
*/
|
||||
private static final String CharU20000 = "\uD840\uDC00";
|
||||
/**
|
||||
* Supplementary character U+20001
|
||||
* See http://www.oracle.com/technetwork/articles/javase/supplementary-142654.html
|
||||
*/
|
||||
private static final String CharU20001 = "\uD840\uDC01";
|
||||
/**
|
||||
* Incomplete supplementary character U+20000, high surrogate only.
|
||||
* See http://www.oracle.com/technetwork/articles/javase/supplementary-142654.html
|
||||
*/
|
||||
private static final String CharUSuppCharHigh = "\uDC00";
|
||||
|
||||
/**
|
||||
* Incomplete supplementary character U+20000, low surrogate only.
|
||||
* See http://www.oracle.com/technetwork/articles/javase/supplementary-142654.html
|
||||
*/
|
||||
private static final String CharUSuppCharLow = "\uD840";
|
||||
|
||||
@Test
|
||||
public void testContains_Char() {
|
||||
assertFalse(StringUtils.contains(null, ' '));
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
*/
|
||||
package org.apache.commons.lang3;
|
||||
|
||||
import static org.apache.commons.lang3.Supplementary.CharU20000;
|
||||
import static org.apache.commons.lang3.Supplementary.CharU20001;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
|
@ -31,17 +33,8 @@ import org.junit.jupiter.api.Test;
|
|||
* Unit tests {@link org.apache.commons.lang3.StringUtils} - Equals/IndexOf methods
|
||||
*/
|
||||
public class StringUtilsEqualsIndexOfTest {
|
||||
|
||||
private static final String BAR = "bar";
|
||||
/**
|
||||
* Supplementary character U+20000
|
||||
* See http://www.oracle.com/technetwork/articles/javase/supplementary-142654.html
|
||||
*/
|
||||
private static final String CharU20000 = "\uD840\uDC00";
|
||||
/**
|
||||
* Supplementary character U+20001
|
||||
* See http://www.oracle.com/technetwork/articles/javase/supplementary-142654.html
|
||||
*/
|
||||
private static final String CharU20001 = "\uD840\uDC01";
|
||||
|
||||
private static final String FOO = "foo";
|
||||
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.commons.lang3;
|
||||
|
||||
/**
|
||||
* Supplementary character test fixtures.
|
||||
*
|
||||
* See http://www.oracle.com/technetwork/articles/javase/supplementary-142654.html
|
||||
*/
|
||||
public class Supplementary {
|
||||
|
||||
/**
|
||||
* Supplementary character U+20000 See http://www.oracle.com/technetwork/articles/javase/supplementary-142654.html
|
||||
*/
|
||||
static final String CharU20000 = "\uD840\uDC00";
|
||||
|
||||
/**
|
||||
* Supplementary character U+20001 See http://www.oracle.com/technetwork/articles/javase/supplementary-142654.html
|
||||
*/
|
||||
static final String CharU20001 = "\uD840\uDC01";
|
||||
|
||||
/**
|
||||
* Incomplete supplementary character U+20000, high surrogate only. See
|
||||
* http://www.oracle.com/technetwork/articles/javase/supplementary-142654.html
|
||||
*/
|
||||
static final String CharUSuppCharHigh = "\uDC00";
|
||||
|
||||
/**
|
||||
* Incomplete supplementary character U+20000, low surrogate only. See
|
||||
* http://www.oracle.com/technetwork/articles/javase/supplementary-142654.html
|
||||
*/
|
||||
static final String CharUSuppCharLow = "\uD840";
|
||||
|
||||
}
|
Loading…
Reference in New Issue