mirror of
https://github.com/ziglang/zig.git
synced 2024-11-30 09:02:32 +00:00
11 lines
256 B
Zig
11 lines
256 B
Zig
const std = @import("std");
|
|
const expect = std.testing.expect;
|
|
|
|
test "vector @splat" {
|
|
const scalar: u32 = 5;
|
|
const result: @Vector(4, u32) = @splat(scalar);
|
|
try expect(std.mem.eql(u32, &@as([4]u32, result), &[_]u32{ 5, 5, 5, 5 }));
|
|
}
|
|
|
|
// test
|