use of nl.ramsolutions.sw.magik.analysis.typing.types.IntrinsicType in project magik-tools by StevenLooman.
the class TypeMatcherTest method testCombinedTypeNotMatchesCombinedType.
@Test
void testCombinedTypeNotMatchesCombinedType() {
final AbstractType type = new CombinedType(new IntrinsicType(GlobalReference.of("sw:type1")), new IntrinsicType(GlobalReference.of("sw:type2")));
final AbstractType criterium = new CombinedType(new IntrinsicType(GlobalReference.of("sw:type2")), new IntrinsicType(GlobalReference.of("sw:type3")));
final boolean matches = TypeMatcher.typeMatches(type, criterium);
assertThat(matches).isFalse();
}
use of nl.ramsolutions.sw.magik.analysis.typing.types.IntrinsicType in project magik-tools by StevenLooman.
the class TypeMatcherTest method testCombinedTypeMatchesCombinedType.
@Test
void testCombinedTypeMatchesCombinedType() {
final AbstractType type = new CombinedType(new IntrinsicType(GlobalReference.of("sw:type1")), new IntrinsicType(GlobalReference.of("sw:type2")));
final AbstractType criterium = new CombinedType(new IntrinsicType(GlobalReference.of("sw:type1")), new IntrinsicType(GlobalReference.of("sw:type2")), new IntrinsicType(GlobalReference.of("sw:type3")));
final boolean matches = TypeMatcher.typeMatches(type, criterium);
assertThat(matches).isTrue();
}
use of nl.ramsolutions.sw.magik.analysis.typing.types.IntrinsicType in project magik-tools by StevenLooman.
the class TypeMatcherTest method testIsKindOfEquals.
@Test
void testIsKindOfEquals() {
final AbstractType type = new IntrinsicType(GlobalReference.of("sw:type"));
final AbstractType criterium = new IntrinsicType(GlobalReference.of("sw:type"));
final boolean isKindOf = TypeMatcher.isKindOf(type, criterium);
assertThat(isKindOf).isTrue();
}
use of nl.ramsolutions.sw.magik.analysis.typing.types.IntrinsicType in project magik-tools by StevenLooman.
the class TypeMatcherTest method testIsKindOfDirectParent.
@Test
void testIsKindOfDirectParent() {
final AbstractType baseType = new IntrinsicType(GlobalReference.of("sw:base"));
final MagikType childType = new IntrinsicType(GlobalReference.of("sw:child"));
childType.addParent(baseType);
final AbstractType criterium = new IntrinsicType(GlobalReference.of("sw:base"));
final boolean isKindOf = TypeMatcher.isKindOf(childType, criterium);
assertThat(isKindOf).isTrue();
}
use of nl.ramsolutions.sw.magik.analysis.typing.types.IntrinsicType in project magik-tools by StevenLooman.
the class TypeMatcherTest method testTypeNotMatchesCombinedType.
@Test
void testTypeNotMatchesCombinedType() {
final AbstractType type = new IntrinsicType(GlobalReference.of("sw:type3"));
final AbstractType criterium = new CombinedType(new IntrinsicType(GlobalReference.of("sw:type1")), new IntrinsicType(GlobalReference.of("sw:type2")));
final boolean matches = TypeMatcher.typeMatches(type, criterium);
assertThat(matches).isFalse();
}
Aggregations