@@ -898,14 +898,17 @@ static void TestCore(CompareInfo compareInfo, string source, string value, int s
898
898
899
899
Assert . Equal ( offsetResult , sourceBoundedSpan . IndexOf ( valueBoundedSpan , GetStringComparison ( options ) ) ) ;
900
900
Assert . Equal ( offsetResult , compareInfo . IndexOf ( sourceBoundedSpan , valueBoundedSpan , options ) ) ;
901
- Assert . Equal ( offsetResult , compareInfo . IndexOf ( sourceBoundedSpan , valueBoundedSpan , options , out int matchLength ) ) ;
902
- if ( offsetResult >= 0 )
903
- {
904
- Assert . Equal ( valueBoundedSpan . Length , matchLength ) ; // Invariant mode should perform non-linguistic comparisons
905
- }
906
- else
901
+ if ( PlatformDetection . IsNotHybridGlobalizationOnApplePlatform )
907
902
{
908
- Assert . Equal ( 0 , matchLength ) ; // not found
903
+ Assert . Equal ( offsetResult , compareInfo . IndexOf ( sourceBoundedSpan , valueBoundedSpan , options , out int matchLength ) ) ;
904
+ if ( offsetResult >= 0 )
905
+ {
906
+ Assert . Equal ( valueBoundedSpan . Length , matchLength ) ; // Invariant mode should perform non-linguistic comparisons
907
+ }
908
+ else
909
+ {
910
+ Assert . Equal ( 0 , matchLength ) ; // not found
911
+ }
909
912
}
910
913
}
911
914
}
@@ -958,14 +961,17 @@ static void TestCore(CompareInfo compareInfo, string source, string value, int s
958
961
959
962
Assert . Equal ( result , sourceBoundedSpan . LastIndexOf ( valueBoundedSpan , GetStringComparison ( options ) ) ) ;
960
963
Assert . Equal ( result , compareInfo . LastIndexOf ( sourceBoundedSpan , valueBoundedSpan , options ) ) ;
961
- Assert . Equal ( result , compareInfo . LastIndexOf ( sourceBoundedSpan , valueBoundedSpan , options , out int matchLength ) ) ;
962
- if ( result >= 0 )
963
- {
964
- Assert . Equal ( valueBoundedSpan . Length , matchLength ) ; // Invariant mode should perform non-linguistic comparisons
965
- }
966
- else
964
+ if ( PlatformDetection . IsNotHybridGlobalizationOnApplePlatform )
967
965
{
968
- Assert . Equal ( 0 , matchLength ) ; // not found
966
+ Assert . Equal ( result , compareInfo . LastIndexOf ( sourceBoundedSpan , valueBoundedSpan , options , out int matchLength ) ) ;
967
+ if ( result >= 0 )
968
+ {
969
+ Assert . Equal ( valueBoundedSpan . Length , matchLength ) ; // Invariant mode should perform non-linguistic comparisons
970
+ }
971
+ else
972
+ {
973
+ Assert . Equal ( 0 , matchLength ) ; // not found
974
+ }
969
975
}
970
976
}
971
977
}
@@ -993,14 +999,17 @@ public void TestIsPrefix(string source, string value, CompareOptions options, bo
993
999
994
1000
Assert . Equal ( result , sourceBoundedSpan . StartsWith ( valueBoundedSpan , GetStringComparison ( options ) ) ) ;
995
1001
Assert . Equal ( result , compareInfo . IsPrefix ( sourceBoundedSpan , valueBoundedSpan , options ) ) ;
996
- Assert . Equal ( result , compareInfo . IsPrefix ( sourceBoundedSpan , valueBoundedSpan , options , out int matchLength ) ) ;
997
- if ( result )
998
- {
999
- Assert . Equal ( valueBoundedSpan . Length , matchLength ) ; // Invariant mode should perform non-linguistic comparisons
1000
- }
1001
- else
1002
+ if ( PlatformDetection . IsNotHybridGlobalizationOnApplePlatform )
1002
1003
{
1003
- Assert . Equal ( 0 , matchLength ) ; // not found
1004
+ Assert . Equal ( result , compareInfo . IsPrefix ( sourceBoundedSpan , valueBoundedSpan , options , out int matchLength ) ) ;
1005
+ if ( result )
1006
+ {
1007
+ Assert . Equal ( valueBoundedSpan . Length , matchLength ) ; // Invariant mode should perform non-linguistic comparisons
1008
+ }
1009
+ else
1010
+ {
1011
+ Assert . Equal ( 0 , matchLength ) ; // not found
1012
+ }
1004
1013
}
1005
1014
}
1006
1015
}
@@ -1028,14 +1037,17 @@ public void TestIsSuffix(string source, string value, CompareOptions options, bo
1028
1037
1029
1038
Assert . Equal ( result , sourceBoundedSpan . EndsWith ( valueBoundedSpan , GetStringComparison ( options ) ) ) ;
1030
1039
Assert . Equal ( result , compareInfo . IsSuffix ( sourceBoundedSpan , valueBoundedSpan , options ) ) ;
1031
- Assert . Equal ( result , compareInfo . IsSuffix ( sourceBoundedSpan , valueBoundedSpan , options , out int matchLength ) ) ;
1032
- if ( result )
1033
- {
1034
- Assert . Equal ( valueBoundedSpan . Length , matchLength ) ; // Invariant mode should perform non-linguistic comparisons
1035
- }
1036
- else
1040
+ if ( PlatformDetection . IsNotHybridGlobalizationOnApplePlatform )
1037
1041
{
1038
- Assert . Equal ( 0 , matchLength ) ; // not found
1042
+ Assert . Equal ( result , compareInfo . IsSuffix ( sourceBoundedSpan , valueBoundedSpan , options , out int matchLength ) ) ;
1043
+ if ( result )
1044
+ {
1045
+ Assert . Equal ( valueBoundedSpan . Length , matchLength ) ; // Invariant mode should perform non-linguistic comparisons
1046
+ }
1047
+ else
1048
+ {
1049
+ Assert . Equal ( 0 , matchLength ) ; // not found
1050
+ }
1039
1051
}
1040
1052
}
1041
1053
}
0 commit comments