@@ -929,6 +929,58 @@ describe('GenericsContext', () => {
929
929
typeTypeValidatorOnlyIdentical ,
930
930
) ) . toBeUndefined ( ) ;
931
931
} ) ;
932
+
933
+ it ( 'should merge with left a generic component' , ( ) => {
934
+ expect (
935
+ genericsContext . mergeRanges (
936
+ objectLoader . createCompactedResource ( {
937
+ '@type' : 'ParameterRangeGenericComponent' ,
938
+ component : 'ex:TYPE1' ,
939
+ } ) ,
940
+ objectLoader . createCompactedResource ( 'ex:TYPE1' ) ,
941
+ typeTypeValidatorOnlyIdentical ,
942
+ ) ! . term ,
943
+ ) . toEqualRdfTerm ( objectLoader . createCompactedResource ( 'ex:TYPE1' ) ! . term ) ;
944
+ } ) ;
945
+
946
+ it ( 'should not merge with left a non-matching generic component' , ( ) => {
947
+ expect (
948
+ genericsContext . mergeRanges (
949
+ objectLoader . createCompactedResource ( {
950
+ '@type' : 'ParameterRangeGenericComponent' ,
951
+ component : 'ex:TYPE1' ,
952
+ } ) ,
953
+ objectLoader . createCompactedResource ( 'ex:TYPE2' ) ,
954
+ typeTypeValidatorOnlyIdentical ,
955
+ ) ,
956
+ ) . toBeUndefined ( ) ;
957
+ } ) ;
958
+
959
+ it ( 'should merge with right a generic component' , ( ) => {
960
+ expect (
961
+ genericsContext . mergeRanges (
962
+ objectLoader . createCompactedResource ( 'ex:TYPE1' ) ,
963
+ objectLoader . createCompactedResource ( {
964
+ '@type' : 'ParameterRangeGenericComponent' ,
965
+ component : 'ex:TYPE1' ,
966
+ } ) ,
967
+ typeTypeValidatorOnlyIdentical ,
968
+ ) ! . term ,
969
+ ) . toEqualRdfTerm ( objectLoader . createCompactedResource ( 'ex:TYPE1' ) ! . term ) ;
970
+ } ) ;
971
+
972
+ it ( 'should not merge with right a non-matching generic component' , ( ) => {
973
+ expect (
974
+ genericsContext . mergeRanges (
975
+ objectLoader . createCompactedResource ( 'ex:TYPE2' ) ,
976
+ objectLoader . createCompactedResource ( {
977
+ '@type' : 'ParameterRangeGenericComponent' ,
978
+ component : 'ex:TYPE1' ,
979
+ } ) ,
980
+ typeTypeValidatorOnlyIdentical ,
981
+ ) ,
982
+ ) . toBeUndefined ( ) ;
983
+ } ) ;
932
984
} ) ;
933
985
934
986
describe ( 'isXsdSubType' , ( ) => {
0 commit comments