diff options
author | 2022-08-12 05:04:00 -0500 | |
---|---|---|
committer | 2022-08-12 03:04:00 -0700 | |
commit | c33f39b39cf866363e3a50e8897ed72eba4d1eda (patch) | |
tree | ae900c0ba9679e618bf934d7b1343f1f276a194b /src | |
parent | bcc4580cdceece582a776fc9fb3de1cc78c2b2aa (diff) | |
download | bun-c33f39b39cf866363e3a50e8897ed72eba4d1eda.tar.gz bun-c33f39b39cf866363e3a50e8897ed72eba4d1eda.tar.zst bun-c33f39b39cf866363e3a50e8897ed72eba4d1eda.zip |
refactor(src/tagged_pointer): `IntPrimtiive` -> `IntPrimitive` (#1046)
Signed-off-by: Ryan Russell <git@ryanrussell.org>
Signed-off-by: Ryan Russell <git@ryanrussell.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/tagged_pointer.zig | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/tagged_pointer.zig b/src/tagged_pointer.zig index 9e6fe1646..dd6215439 100644 --- a/src/tagged_pointer.zig +++ b/src/tagged_pointer.zig @@ -163,32 +163,32 @@ pub fn TaggedPointerUnion(comptime Types: anytype) type { } test "TaggedPointerUnion" { - const IntPrimtiive = struct { val: u32 = 0 }; + const IntPrimitive = struct { val: u32 = 0 }; const StringPrimitive = struct { val: []const u8 = "" }; const Object = struct { blah: u32, val: u32 }; // const Invalid = struct { // wrong: bool = true, // }; - const Union = TaggedPointerUnion(.{ IntPrimtiive, StringPrimitive, Object }); + const Union = TaggedPointerUnion(.{ IntPrimitive, StringPrimitive, Object }); var str = try default_allocator.create(StringPrimitive); str.* = StringPrimitive{ .val = "hello!" }; var un = Union.init(str); try std.testing.expect(un.is(StringPrimitive)); try std.testing.expectEqualStrings(un.as(StringPrimitive).val, "hello!"); - try std.testing.expect(!un.is(IntPrimtiive)); - const num = try default_allocator.create(IntPrimtiive); + try std.testing.expect(!un.is(IntPrimitive)); + const num = try default_allocator.create(IntPrimitive); num.val = 9999; var un2 = Union.init(num); - try std.testing.expect(un2.as(IntPrimtiive).val == 9999); + try std.testing.expect(un2.as(IntPrimitive).val == 9999); try std.testing.expect(un.tag() == .StringPrimitive); - try std.testing.expect(un2.tag() == .IntPrimtiive); + try std.testing.expect(un2.tag() == .IntPrimitive); un2.repr.data = 0; - try std.testing.expect(un2.tag() != .IntPrimtiive); - try std.testing.expect(un2.get(IntPrimtiive) == null); + try std.testing.expect(un2.tag() != .IntPrimitive); + try std.testing.expect(un2.get(IntPrimitive) == null); // try std.testing.expect(un2.is(Invalid) == false); } |