/external/hamcrest/hamcrest-library/src/test/java/org/hamcrest/collection/ |
D | IsArrayTest.java | 9 import static org.hamcrest.core.IsEqual.equalTo; 16 return array(equalTo("irrelevant")); in createMatcher() 21 array(equalTo("a"), equalTo("b"), equalTo("c")), new String[]{"a", "b", "c"}); in testMatchesAnArrayThatMatchesAllTheElementMatchers() 26 array(equalTo("a"), equalTo("b")), new String[]{"b", "c"}); in testDoesNotMatchAnArrayWhenElementsDoNotMatch() 31 array(equalTo("a"), equalTo("b")), new String[]{"a", "b", "c"}); in testDoesNotMatchAnArrayOfDifferentSize() 33 array(equalTo("a"), equalTo("b")), new String[]{"a"}); in testDoesNotMatchAnArrayOfDifferentSize() 38 array(equalTo("a")), null); in testDoesNotMatchNull() 42 assertDescription("[\"a\", \"b\"]", array(equalTo("a"), equalTo("b"))); in testHasAReadableDescription() 46 …assertMismatchDescription("element <0> was \"c\"", array(equalTo("a"), equalTo("b")), new String[]… in testHasAReadableMismatchDescriptionUsing() 57 …assertMismatchDescription("element <0> didn't match", array(m, equalTo("b")), new String[]{"c", "b… in testHasAReadableMismatchDescriptionUsingCustomMatchers()
|
D | IsCollectionWithSizeTest.java | 13 import static org.hamcrest.core.IsEqual.equalTo; 23 assertMatches("correct size", hasSize(equalTo(2)), asList(null, null)); in testMatchesWhenSizeIsCorrect() 24 …assertMismatchDescription("collection size was <3>", hasSize(equalTo(2)), asList(null, null, null)… in testMatchesWhenSizeIsCorrect() 29 assertMatches("correct size", hasSize(equalTo(2)), list); in testMatchesCollectionWhenSizeIsCorrectUsingObjectElementType() 30 assertMismatchDescription("collection size was <2>", hasSize(equalTo(3)), list); in testMatchesCollectionWhenSizeIsCorrectUsingObjectElementType() 35 assertMatches("correct size", hasSize(equalTo(2)), list); in testMatchesCollectionWhenSizeIsCorrectUsingStringElementType() 36 assertMismatchDescription("collection size was <2>", hasSize(equalTo(3)), list); in testMatchesCollectionWhenSizeIsCorrectUsingStringElementType() 41 assertMatches("correct size", hasSize(equalTo(2)), list); in testMatchesCollectionWhenSizeIsCorrectUsingWildcardElementType() 42 assertMismatchDescription("collection size was <2>", hasSize(equalTo(3)), list); in testMatchesCollectionWhenSizeIsCorrectUsingWildcardElementType() 47 assertMatches("correct size", hasSize(equalTo(2)), list); in testMatchesListWhenSizeIsCorrectUsingObjectElementType() [all …]
|
D | IsMapWithSizeTest.java | 11 import static org.hamcrest.core.IsEqual.equalTo; 21 assertMatches("correct size", aMapWithSize(equalTo(2)), mapWithKeys("a", "b")); in testMatchesWhenSizeIsCorrect() 22 …assertMismatchDescription("map size was <3>", aMapWithSize(equalTo(2)), mapWithKeys("a", "b", "c")… in testMatchesWhenSizeIsCorrect() 27 assertMatches("correct size", aMapWithSize(equalTo(2)), map); in testMatchesMapWhenSizeIsCorrectUsingObjectElementType() 28 assertMismatchDescription("map size was <2>", aMapWithSize(equalTo(3)), map); in testMatchesMapWhenSizeIsCorrectUsingObjectElementType() 33 assertMatches("correct size", aMapWithSize(equalTo(2)), map); in testMatchesMapWhenSizeIsCorrectUsingStringElementType() 34 assertMismatchDescription("map size was <2>", aMapWithSize(equalTo(3)), map); in testMatchesMapWhenSizeIsCorrectUsingStringElementType() 39 assertMatches("correct size", aMapWithSize(equalTo(2)), map); in testMatchesMapWhenSizeIsCorrectUsingWildcardElementType() 40 assertMismatchDescription("map size was <2>", aMapWithSize(equalTo(3)), map); in testMatchesMapWhenSizeIsCorrectUsingWildcardElementType() 45 assertMatches("correct size", aMapWithSize(equalTo(2)), map); in testMatchesListWhenSizeIsCorrectUsingObjectElementType() [all …]
|
D | IsArrayContainingInAnyOrderTest.java | 7 import static org.hamcrest.core.IsEqual.equalTo; 14 return arrayContainingInAnyOrder(equalTo(1), equalTo(2)); in createMatcher() 19 … assertDescription("[<1>, <2>] in any order", arrayContainingInAnyOrder(equalTo(1), equalTo(2))); in testHasAReadableDescription() 31 …assertMatches("in order", arrayContainingInAnyOrder(equalTo(1), equalTo(2), equalTo(3)), new Integ… in testAppliesMatchersInAnyOrder() 32 …assertMatches("out of order", arrayContainingInAnyOrder(equalTo(1), equalTo(2), equalTo(3)), new I… in testAppliesMatchersInAnyOrder() 33 assertMatches("single", arrayContainingInAnyOrder(equalTo(1)), new Integer[] {1}); in testAppliesMatchersInAnyOrder()
|
D | IsMapContainingTest.java | 11 import static org.hamcrest.core.IsEqual.equalTo; 25 assertMatches("matcherA", hasEntry(equalTo("a"), equalTo(1)), map); in testMatchesMapContainingMatchingKeyAndValue() 26 assertMatches("matcherB", hasEntry(equalTo("b"), equalTo(2)), map); in testMatchesMapContainingMatchingKeyAndValue() 27 … assertMismatchDescription("map was [<a=1>, <b=2>]", hasEntry(equalTo("c"), equalTo(3)), map); in testMatchesMapContainingMatchingKeyAndValue() 46 assertDescription("map containing [\"a\"-><2>]", hasEntry(equalTo("a"), (equalTo(2)))); in testHasReadableDescription()
|
D | IsArrayContainingInOrderTest.java | 7 import static org.hamcrest.core.IsEqual.equalTo; 14 return arrayContaining(equalTo(1), equalTo(2)); in createMatcher() 19 assertDescription("[<1>, <2>]", arrayContaining(equalTo(1), equalTo(2))); in testHasAReadableDescription() 29 …assertMatches("in order", arrayContaining(equalTo(1), equalTo(2), equalTo(3)), new Integer[] {1, 2… in testAppliesMatchersInOrder() 30 assertMatches("single", arrayContaining(equalTo(1)), new Integer[] {1}); in testAppliesMatchersInOrder()
|
D | IsArrayWithSizeTest.java | 8 import static org.hamcrest.core.IsEqual.equalTo; 14 return arrayWithSize(equalTo(2)); in createMatcher() 18 assertMatches("correct size", arrayWithSize(equalTo(3)), new Object[] {1, 2, 3}); in testMatchesWhenSizeIsCorrect() 19 assertDoesNotMatch("incorrect size", arrayWithSize(equalTo(2)), new Object[] {1, 2, 3}); in testMatchesWhenSizeIsCorrect() 33 assertDescription("an array with size <3>", arrayWithSize(equalTo(3))); in testHasAReadableDescription()
|
/external/lottie/lottie/src/test/java/com/airbnb/lottie/ |
D | PerformanceTrackerTest.java | 11 import static org.hamcrest.Matchers.equalTo; 35 assertThat(sortedRenderTimes.size(), equalTo(1)); in testOneFrame() 36 assertThat(sortedRenderTimes.get(0).first, equalTo("Hello")); in testOneFrame() 37 assertThat(sortedRenderTimes.get(0).second, equalTo(16f)); in testOneFrame() 45 assertThat(sortedRenderTimes.size(), equalTo(1)); in testTwoFrames() 46 assertThat(sortedRenderTimes.get(0).first, equalTo("Hello")); in testTwoFrames() 47 assertThat(sortedRenderTimes.get(0).second, equalTo(12f)); in testTwoFrames() 55 assertThat(sortedRenderTimes.size(), equalTo(2)); in testTwoLayers() 56 assertThat(sortedRenderTimes.get(0).first, equalTo("Hello")); in testTwoLayers() 57 assertThat(sortedRenderTimes.get(0).second, equalTo(16f)); in testTwoLayers() [all …]
|
D | MeanCalculatorTest.java | 8 import static org.hamcrest.Matchers.equalTo; 22 assertThat(meanCalculator.getMean(), equalTo(0f)); in testMeanWithNoNumbers() 28 assertThat(meanCalculator.getMean(), equalTo(2f)); in testMeanWithOneNumber() 35 assertThat(meanCalculator.getMean(), equalTo(3f)); in testMeanWithTwoNumbers() 43 assertThat(meanCalculator.getMean(), equalTo(10.5f)); in testMeanWithTwentyNumbers() 50 assertThat(meanCalculator.getMean(), equalTo((float) (Integer.MAX_VALUE - 1))); in testMeanWithHugeNumber() 59 assertThat(meanCalculator.getMean(), equalTo(0f)); in testMeanWithHugeNumberAndNegativeHugeNumber()
|
/external/hamcrest/hamcrest-core/src/test/java/org/hamcrest/core/ |
D | IsCollectionContainingTest.java | 16 import static org.hamcrest.core.IsEqual.equalTo; 22 Matcher<?> matcher = hasItem(equalTo("irrelevant")); in copesWithNullsAndUnknownTypes() 30 final Matcher<Iterable<? super String>> itemMatcher = hasItem(equalTo("a")); in matchesACollectionThatContainsAnElementForTheGivenMatcher() 45 assertDoesNotMatch("doesn't match null", hasItem(equalTo("a")), null); in doesNotMatchNull() 65 … final Matcher<Iterable<String>> matcher1 = hasItems(equalTo("a"), equalTo("b"), equalTo("c")); in matchesMultipleItemsInCollection() 71 … final Matcher<Iterable<String>> matcher3 = hasItems(equalTo("a"), equalTo("b"), equalTo("c")); in matchesMultipleItemsInCollection() 74 … final Matcher<Iterable<String>> matcher4 = hasItems(equalTo("a"), equalTo("b"), equalTo("c")); in matchesMultipleItemsInCollection() 77 … final Matcher<Iterable<String>> matcher5 = hasItems(equalTo("a"), equalTo("b"), equalTo("c")); in matchesMultipleItemsInCollection()
|
D | AllOfTest.java | 9 import static org.hamcrest.core.IsEqual.equalTo; 18 Matcher<String> matcher = allOf(equalTo("irrelevant"), startsWith("irr")); in copesWithNullsAndUnknownTypes() 45 equalTo(new SampleBaseClass("bad")), in supportsMixedTypes() 47 equalTo(new SampleBaseClass("good")), in supportsMixedTypes() 48 equalTo(new SampleSubClass("ugly"))); in supportsMixedTypes() 56 allOf(equalTo("good"), equalTo("bad"), equalTo("ugly"))); in hasAReadableDescription() 61 … assertMismatchDescription("\"good\" was \"bad\"", allOf(equalTo("bad"), equalTo("good")), "bad"); in hasAMismatchDescriptionDescribingTheFirstFailingMatch()
|
D | IsEqualTest.java | 7 import static org.hamcrest.core.IsEqual.equalTo; 14 Matcher<?> matcher = equalTo("irrelevant"); in copesWithNullsAndUnknownTypes() 22 final Matcher<String> matcher1 = equalTo("hi"); in comparesObjectsUsingEqualsMethod() 27 final Matcher<Integer> matcher2 = equalTo(1); in comparesObjectsUsingEqualsMethod() 35 final Matcher<Object> matcher = equalTo(null); in canCompareNullValues() 59 Matcher<Object> matcher = equalTo(null); in honoursIsEqualImplementationEvenWithNullValues() 72 final Matcher<String[]> matcher = equalTo(s1); in comparesTheElementsOfAnObjectArray() 87 final Matcher<int[]> matcher = equalTo(i1); in comparesTheElementsOfAnArrayOfPrimitiveTypes() 102 final Matcher<int[][]> matcher = equalTo(i1); in recursivelyTestsElementsOfArrays() 129 assertDescription("<" + argumentDescription + ">", equalTo(argument)); in includesTheResultOfCallingToStringOnItsArgumentInTheDescription() [all …]
|
D | AnyOfTest.java | 8 import static org.hamcrest.core.IsEqual.equalTo; 16 Matcher<String> matcher = anyOf(equalTo("irrelevant"), startsWith("irr")); in copesWithNullsAndUnknownTypes() 44 equalTo(new SampleBaseClass("bad")), in supportsMixedTypes() 45 equalTo(new SampleBaseClass("good")), in supportsMixedTypes() 46 equalTo(new SampleSubClass("ugly"))); in supportsMixedTypes() 54 anyOf(equalTo("good"), equalTo("bad"), equalTo("ugly"))); in hasAReadableDescription()
|
D | CombinableTest.java | 7 import static org.hamcrest.core.IsEqual.equalTo; 12 …nableMatcher<Integer> EITHER_3_OR_4 = CombinableMatcher.<Integer>either(equalTo(3)).or(equalTo(4)); 13 …r<Integer> NOT_3_AND_NOT_4 = CombinableMatcher.<Integer>both(not(equalTo(3))).and(not(equalTo(4))); 31 CombinableMatcher<? super Integer> tripleAnd = NOT_3_AND_NOT_4.and(equalTo(2)); in acceptsAndRejectsThreeAnds() 51 final CombinableMatcher<Integer> tripleOr = EITHER_3_OR_4.or(equalTo(11)); in acceptsAndRejectsThreeOrs() 66 …Matcher<String> matcher = CombinableMatcher.both(equalTo("yellow")).and(notNullValue(String.class)… in picksUpTypeFromLeftHandSideOfExpression()
|
D | DescribedAsTest.java | 9 import static org.hamcrest.core.IsEqual.equalTo; 37 Matcher<String> matcher = describedAs("irrelevant", equalTo("hi")); in celegatesMatchingToAnotherMatcher() 45 Matcher<Integer> matcher = describedAs("irrelevant", equalTo(2)); in delegatesMismatchDescriptionToAnotherMatcher()
|
/external/hamcrest/hamcrest-library/src/test/java/org/hamcrest/xml/ |
D | HasXPathTest.java | 16 import static org.hamcrest.core.IsEqual.equalTo; 70 assertMatches(hasXPath("/root/something[2]/cheese", equalTo("Cheddar")), xml); in appliesMatcherToXPathInDocument() 73 assertMatches(hasXPath("/root/@type", equalTo("food")), xml); in appliesMatcherToXPathInDocument() 74 assertMatches(hasXPath("//something[@id='b']/cheese", equalTo("Cheddar")), xml); in appliesMatcherToXPathInDocument() 90 assertDoesNotMatch(hasXPath("/root/something[3]/cheese", ns, equalTo("Cheddar")), xml); in failsIfNodeIsMissing() 96 assertDoesNotMatch(hasXPath("//cheese:foreignSomething", equalTo("Badger")), xml); in failsIfNodeIsMissingInNamespace() 103 assertMatches(hasXPath("//cheese:foreignSomething/@milk", ns, equalTo("camel")), xml); in matchesWithNamespace() 104 assertMatches(hasXPath("//cheese:foreignSomething/text()", ns, equalTo("Caravane")), xml); in matchesWithNamespace() 110 hasXPath("\\g:dfgd::DSgf/root/something[2]/cheese", equalTo("blah")); in throwsIllegalArgumentExceptionIfGivenIllegalExpression() 120 hasXPath("/some/path", equalTo("Cheddar"))); in describesItself() [all …]
|
/external/hamcrest/hamcrest-library/src/test/java/org/hamcrest/io/ |
D | FileMatchersTest.java | 8 import static org.hamcrest.core.IsEqual.equalTo; 65 assertMatches("matches file size", FileMatchers.aFileWithSize(equalTo(0L)), file); in testAFileWithSizeMatcherOfLong() 67 …assertDoesNotMatch("doesn't match incorrect file size", FileMatchers.aFileWithSize(equalTo(23L)), … in testAFileWithSizeMatcherOfLong() 71 assertMatches("matches file name", FileMatchers.aFileNamed(equalTo(file.getName())), file); in testAFileNamed() 73 …assertDoesNotMatch("doesn't match incorrect file name", FileMatchers.aFileNamed(equalTo("foo")), f… in testAFileNamed() 77 …assertMatches("matches file canonical path", FileMatchers.aFileWithCanonicalPath(equalTo(file.getC… in testAFileWithCanonicalPath() 79 …oesn't match incorrect canonical path", FileMatchers.aFileWithCanonicalPath(equalTo("foo")), file); in testAFileWithCanonicalPath() 83 …assertMatches("matches file absolute path", FileMatchers.aFileWithAbsolutePath(equalTo(file.getAbs… in testAFileWithAbsolutePath() 85 …"doesn't match incorrect absolute path", FileMatchers.aFileWithAbsolutePath(equalTo("foo")), file); in testAFileWithAbsolutePath()
|
/external/volley/src/test/java/com/android/volley/utils/ |
D | CacheTestUtils.java | 19 import static org.hamcrest.Matchers.equalTo; 62 assertThat(actual.data, is(equalTo(expected.data))); in assertThatEntriesAreEqual() 63 assertThat(actual.etag, is(equalTo(expected.etag))); in assertThatEntriesAreEqual() 64 assertThat(actual.lastModified, is(equalTo(expected.lastModified))); in assertThatEntriesAreEqual() 65 assertThat(actual.responseHeaders, is(equalTo(expected.responseHeaders))); in assertThatEntriesAreEqual() 66 assertThat(actual.serverDate, is(equalTo(expected.serverDate))); in assertThatEntriesAreEqual() 67 assertThat(actual.softTtl, is(equalTo(expected.softTtl))); in assertThatEntriesAreEqual() 68 assertThat(actual.ttl, is(equalTo(expected.ttl))); in assertThatEntriesAreEqual()
|
/external/hamcrest/hamcrest-library/src/test/java/org/hamcrest/beans/ |
D | HasPropertyWithValueTest.java | 16 import static org.hamcrest.core.IsEqual.equalTo; 37 assertMatches("with property", hasProperty("property", equalTo("is expected")), shouldMatch); in testMatchesInfolessBeanWithMatchedNamedProperty() 39 hasProperty("property", equalTo("is expected")), shouldNotMatch); in testMatchesInfolessBeanWithMatchedNamedProperty() 43 assertMatches("with bean info", hasProperty("property", equalTo("with info")), beanWithInfo); in testMatchesBeanWithInfoWithMatchedNamedProperty() 45 hasProperty("property", equalTo("without info")), beanWithInfo); in testMatchesBeanWithInfoWithMatchedNamedProperty() 59 assertDescription("hasProperty(\"property\", <true>)", hasProperty("property", equalTo(true))); in testDescribeTo() 84 assertThat(new X(), HasPropertyWithValue.hasProperty("test", IsEqual.equalTo(1))); in testCanAccessAnAnonymousInnerClass()
|
/external/hamcrest/hamcrest-library/src/test/java/org/hamcrest/object/ |
D | HasToStringTest.java | 7 import static org.hamcrest.core.IsEqual.equalTo; 21 Matcher<Object> matcher = hasToString(equalTo("irrelevant")); in copesWithNullsAndUnknownTypes() 29 final Matcher<Object> matcher = hasToString(equalTo(TO_STRING_RESULT)); in matchesWhenUtilisingANestedMatcher() 45 final Matcher<Object> matcher = hasToString(equalTo(TO_STRING_RESULT)); in describesItself() 51 final Matcher<Object> matcher = hasToString(equalTo(TO_STRING_RESULT)); in describesAMismatch()
|
/external/hamcrest/hamcrest-library/src/main/java/org/hamcrest/collection/ |
D | IsMapContaining.java | 11 import static org.hamcrest.core.IsEqual.equalTo; 75 return new IsMapContaining<K,V>(equalTo(key), equalTo(value)); in hasEntry() 101 return new IsMapContaining<K,Object>(equalTo(key), anything()); in hasKey() 127 return new IsMapContaining<Object,V>(anything(), equalTo(value)); in hasValue()
|
D | IsMapWithSize.java | 8 import static org.hamcrest.core.IsEqual.equalTo; 46 Matcher<? super Integer> matcher = equalTo(size); in aMapWithSize() 58 return IsMapWithSize.aMapWithSize(equalTo(0)); in anEmptyMap()
|
/external/hamcrest/hamcrest-core/src/test/java/org/hamcrest/ |
D | MatcherAssertTest.java | 6 import static org.hamcrest.core.IsEqual.equalTo; 19 assertThat("identifier", actual, equalTo(expected)); in includesDescriptionOfTestedValueInErrorMessage() 37 assertThat(actual, equalTo(expected)); in descriptionCanBeElided() 94 assertThat(1, equalTo((Number) 1)); in canAssertSubtypes()
|
/external/opencensus-java/api/src/test/java/io/opencensus/metrics/export/ |
D | TimeSeriesTest.java | 65 thrown.expectMessage(CoreMatchers.equalTo("labelValues")); in create_WithNullLabelValueList() 73 thrown.expectMessage(CoreMatchers.equalTo("labelValue")); in create_WithNullLabelValue() 80 thrown.expectMessage(CoreMatchers.equalTo("points")); in create_WithNullPointList() 88 thrown.expectMessage(CoreMatchers.equalTo("point")); in create_WithNullPoint() 107 thrown.expectMessage(CoreMatchers.equalTo("labelValues")); in createWithOnePoint_WithNullLabelValueList() 115 thrown.expectMessage(CoreMatchers.equalTo("labelValue")); in createWithOnePoint_WithNullLabelValue() 122 thrown.expectMessage(CoreMatchers.equalTo("point")); in createWithOnePoint_WithNullPointList()
|
/external/javaparser/javaparser-core-testing-bdd/src/test/java/com/github/javaparser/steps/ |
D | SharedSteps.java | 41 import static org.hamcrest.core.IsEqual.equalTo; 100 assertThat(compilationUnit, is(equalTo(compilationUnit2))); in thenTheCompilationUnitIsEqualToTheSecondCompilationUnit() 108 assertThat(compilationUnit.hashCode(), is(equalTo(compilationUnit2.hashCode()))); in thenTheCompilationUnitHasTheSameHashcodeToTheSecondCompilationUnit() 116 assertThat(compilationUnit, not(equalTo(compilationUnit2))); in thenTheCompilationUnitIsNotEqualToTheSecondCompilationUnit() 124 assertThat(compilationUnit.hashCode(), not(equalTo(compilationUnit2.hashCode()))); in thenTheCompilationUnitHasADifferentHashcodeToTheSecondCompilationUnit()
|