@@ -133,12 +133,12 @@ test Int {
133133 const t = std .testing ;
134134 { // Emit i32 as-is
135135 var dst : std .BoundedArray (u8 , 8 ) = .{};
136- Int (i32 ).pipe (dst .writer (), 15 );
137- try t .expectEqual (15 , std .mem .readInt (dst .buffer [1.. 5], .big ));
136+ _ = try Int (i32 ).pipe (dst .writer (), 15 );
137+ try t .expectEqual (15 , std .mem .readInt (i32 , dst .buffer [1.. 5], .big ));
138138 }
139139 { // Emit i32 as the smallest type
140140 var dst : std .BoundedArray (u8 , 8 ) = .{};
141- Int (i32 ).pipeSm (dst .writer (), 15 );
141+ _ = try Int (i32 ).pipeSm (dst .writer (), 15 );
142142 try t .expectEqual (1 , dst .len );
143143 }
144144}
@@ -209,3 +209,18 @@ pub fn Float(T: type) type {
209209 }
210210 };
211211}
212+
213+ test Float {
214+ const t = std .testing ;
215+
216+ { // Write f32 as-is
217+ var dst : std .BoundedArray (u8 , 8 ) = .{};
218+ _ = try Float (f32 ).pipe (dst .writer (), 1 );
219+ try t .expectEqual (1 , readFloatBig (f32 , dst .buffer [1.. 5]));
220+ }
221+ { // Write f64 as the smallest type
222+ var dst : std .BoundedArray (u8 , 8 ) = .{};
223+ _ = try Float (f64 ).pipeSm (dst .writer (), 1 );
224+ try t .expectEqual (5 , dst .len );
225+ }
226+ }
0 commit comments