commit c91786caf3f12ec9c9ad928fc0e71d43783ea7a8 (tree)
parent f9bdf325d318347547b3ea7735367b56b4a26cd2
Author: data-man <datamanrb@gmail.com>
Date: Thu, 28 May 2020 16:41:15 +0500
zig fmt
Diffstat:
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/lib/std/meta/trait.zig b/lib/std/meta/trait.zig
@@ -363,12 +363,12 @@ test "std.meta.trait.hasDecls" {
pub fn useless() void {}
};
- const tuple = .{"a", "b", "c"};
+ const tuple = .{ "a", "b", "c" };
testing.expect(!hasDecls(TestStruct1, .{"a"}));
- testing.expect(hasDecls(TestStruct2, .{"a", "b"}));
- testing.expect(hasDecls(TestStruct2, .{"a", "b", "useless"}));
- testing.expect(!hasDecls(TestStruct2, .{"a", "b", "c"}));
+ testing.expect(hasDecls(TestStruct2, .{ "a", "b" }));
+ testing.expect(hasDecls(TestStruct2, .{ "a", "b", "useless" }));
+ testing.expect(!hasDecls(TestStruct2, .{ "a", "b", "c" }));
testing.expect(!hasDecls(TestStruct2, tuple));
}
@@ -389,14 +389,13 @@ test "std.meta.trait.hasFields" {
pub fn useless() void {}
};
-
- const tuple = .{"a", "b", "c"};
+ const tuple = .{ "a", "b", "c" };
testing.expect(!hasFields(TestStruct1, .{"a"}));
- testing.expect(hasFields(TestStruct2, .{"a", "b"}));
- testing.expect(hasFields(TestStruct2, .{"a", "b", "c"}));
+ testing.expect(hasFields(TestStruct2, .{ "a", "b" }));
+ testing.expect(hasFields(TestStruct2, .{ "a", "b", "c" }));
testing.expect(hasFields(TestStruct2, tuple));
- testing.expect(!hasFields(TestStruct2, .{"a", "b", "useless"}));
+ testing.expect(!hasFields(TestStruct2, .{ "a", "b", "useless" }));
}
pub fn hasFunctions(comptime T: type, comptime names: var) bool {
@@ -414,10 +413,10 @@ test "std.meta.trait.hasFunctions" {
fn b() void {}
};
- const tuple = .{"a", "b", "c"};
+ const tuple = .{ "a", "b", "c" };
testing.expect(!hasFunctions(TestStruct1, .{"a"}));
- testing.expect(hasFunctions(TestStruct2, .{"a", "b"}));
- testing.expect(!hasFunctions(TestStruct2, .{"a", "b", "c"}));
+ testing.expect(hasFunctions(TestStruct2, .{ "a", "b" }));
+ testing.expect(!hasFunctions(TestStruct2, .{ "a", "b", "c" }));
testing.expect(!hasFunctions(TestStruct2, tuple));
}