@@ -66,7 +66,7 @@ test "strcpy" {
6666
6767 s1 [0 ] = 0 ;
6868 _ = strcpy (& s1 , "foobarbaz" );
69- std .testing .expectEqualSlices (u8 , "foobarbaz" , std .mem .spanZ (& s1 ));
69+ try std .testing .expectEqualSlices (u8 , "foobarbaz" , std .mem .spanZ (& s1 ));
7070}
7171
7272fn strncpy (dest : [* :0 ]u8 , src : [* :0 ]const u8 , n : usize ) callconv (.C ) [* :0 ]u8 {
@@ -86,7 +86,7 @@ test "strncpy" {
8686
8787 s1 [0 ] = 0 ;
8888 _ = strncpy (& s1 , "foobarbaz" , @sizeOf (@TypeOf (s1 )));
89- std .testing .expectEqualSlices (u8 , "foobarbaz" , std .mem .spanZ (& s1 ));
89+ try std .testing .expectEqualSlices (u8 , "foobarbaz" , std .mem .spanZ (& s1 ));
9090}
9191
9292fn strcat (dest : [* :0 ]u8 , src : [* :0 ]const u8 ) callconv (.C ) [* :0 ]u8 {
@@ -109,7 +109,7 @@ test "strcat" {
109109 _ = strcat (& s1 , "foo" );
110110 _ = strcat (& s1 , "bar" );
111111 _ = strcat (& s1 , "baz" );
112- std .testing .expectEqualSlices (u8 , "foobarbaz" , std .mem .spanZ (& s1 ));
112+ try std .testing .expectEqualSlices (u8 , "foobarbaz" , std .mem .spanZ (& s1 ));
113113}
114114
115115fn strncat (dest : [* :0 ]u8 , src : [* :0 ]const u8 , avail : usize ) callconv (.C ) [* :0 ]u8 {
@@ -132,7 +132,7 @@ test "strncat" {
132132 _ = strncat (& s1 , "foo1111" , 3 );
133133 _ = strncat (& s1 , "bar1111" , 3 );
134134 _ = strncat (& s1 , "baz1111" , 3 );
135- std .testing .expectEqualSlices (u8 , "foobarbaz" , std .mem .spanZ (& s1 ));
135+ try std .testing .expectEqualSlices (u8 , "foobarbaz" , std .mem .spanZ (& s1 ));
136136}
137137
138138fn strcmp (s1 : [* :0 ]const u8 , s2 : [* :0 ]const u8 ) callconv (.C ) c_int {
@@ -871,13 +871,13 @@ test "fmod, fmodf" {
871871 try std .testing .expect (isNan (generic_fmod (T , 0.0 , 0.0 )));
872872 try std .testing .expect (isNan (generic_fmod (T , 1.0 , 0.0 )));
873873
874- std .testing .expectEqual (@as (T , 0.0 ), generic_fmod (T , 0.0 , 2.0 ));
875- std .testing .expectEqual (@as (T , -0.0 ), generic_fmod (T , -0.0 , 2.0 ));
874+ try std .testing .expectEqual (@as (T , 0.0 ), generic_fmod (T , 0.0 , 2.0 ));
875+ try std .testing .expectEqual (@as (T , -0.0 ), generic_fmod (T , -0.0 , 2.0 ));
876876
877- std .testing .expectEqual (@as (T , -2.0 ), generic_fmod (T , -32.0 , 10.0 ));
878- std .testing .expectEqual (@as (T , -2.0 ), generic_fmod (T , -32.0 , -10.0 ));
879- std .testing .expectEqual (@as (T , 2.0 ), generic_fmod (T , 32.0 , 10.0 ));
880- std .testing .expectEqual (@as (T , 2.0 ), generic_fmod (T , 32.0 , -10.0 ));
877+ try std .testing .expectEqual (@as (T , -2.0 ), generic_fmod (T , -32.0 , 10.0 ));
878+ try std .testing .expectEqual (@as (T , -2.0 ), generic_fmod (T , -32.0 , -10.0 ));
879+ try std .testing .expectEqual (@as (T , 2.0 ), generic_fmod (T , 32.0 , 10.0 ));
880+ try std .testing .expectEqual (@as (T , 2.0 ), generic_fmod (T , 32.0 , -10.0 ));
881881 }
882882}
883883
@@ -902,11 +902,11 @@ test "fmin, fminf" {
902902 const nan_val = math .nan (T );
903903
904904 try std .testing .expect (isNan (generic_fmin (T , nan_val , nan_val )));
905- std .testing .expectEqual (@as (T , 1.0 ), generic_fmin (T , nan_val , 1.0 ));
906- std .testing .expectEqual (@as (T , 1.0 ), generic_fmin (T , 1.0 , nan_val ));
905+ try std .testing .expectEqual (@as (T , 1.0 ), generic_fmin (T , nan_val , 1.0 ));
906+ try std .testing .expectEqual (@as (T , 1.0 ), generic_fmin (T , 1.0 , nan_val ));
907907
908- std .testing .expectEqual (@as (T , 1.0 ), generic_fmin (T , 1.0 , 10.0 ));
909- std .testing .expectEqual (@as (T , -1.0 ), generic_fmin (T , 1.0 , -1.0 ));
908+ try std .testing .expectEqual (@as (T , 1.0 ), generic_fmin (T , 1.0 , 10.0 ));
909+ try std .testing .expectEqual (@as (T , -1.0 ), generic_fmin (T , 1.0 , -1.0 ));
910910 }
911911}
912912
@@ -931,11 +931,11 @@ test "fmax, fmaxf" {
931931 const nan_val = math .nan (T );
932932
933933 try std .testing .expect (isNan (generic_fmax (T , nan_val , nan_val )));
934- std .testing .expectEqual (@as (T , 1.0 ), generic_fmax (T , nan_val , 1.0 ));
935- std .testing .expectEqual (@as (T , 1.0 ), generic_fmax (T , 1.0 , nan_val ));
934+ try std .testing .expectEqual (@as (T , 1.0 ), generic_fmax (T , nan_val , 1.0 ));
935+ try std .testing .expectEqual (@as (T , 1.0 ), generic_fmax (T , 1.0 , nan_val ));
936936
937- std .testing .expectEqual (@as (T , 10.0 ), generic_fmax (T , 1.0 , 10.0 ));
938- std .testing .expectEqual (@as (T , 1.0 ), generic_fmax (T , 1.0 , -1.0 ));
937+ try std .testing .expectEqual (@as (T , 10.0 ), generic_fmax (T , 1.0 , 10.0 ));
938+ try std .testing .expectEqual (@as (T , 1.0 ), generic_fmax (T , 1.0 , -1.0 ));
939939 }
940940}
941941
@@ -1090,7 +1090,7 @@ test "sqrt" {
10901090 // Note that @sqrt will either generate the sqrt opcode (if supported by the
10911091 // target ISA) or a call to `sqrtf` otherwise.
10921092 for (V ) | val |
1093- std .testing .expectEqual (@sqrt (val ), sqrt (val ));
1093+ try std .testing .expectEqual (@sqrt (val ), sqrt (val ));
10941094}
10951095
10961096test "sqrt special" {
@@ -1195,7 +1195,7 @@ test "sqrtf" {
11951195 // Note that @sqrt will either generate the sqrt opcode (if supported by the
11961196 // target ISA) or a call to `sqrtf` otherwise.
11971197 for (V ) | val |
1198- std .testing .expectEqual (@sqrt (val ), sqrtf (val ));
1198+ try std .testing .expectEqual (@sqrt (val ), sqrtf (val ));
11991199}
12001200
12011201test "sqrtf special" {
0 commit comments