| ... | @@ -363,12 +363,12 @@ test "std.meta.trait.hasDecls" { | ... | @@ -363,12 +363,12 @@ test "std.meta.trait.hasDecls" { |
| 363 | pub fn useless() void {} | 363 | pub fn useless() void {} |
| 364 | }; | 364 | }; |
| 365 | | 365 | |
| 366 | const tuple = .{"a", "b", "c"}; | 366 | const tuple = .{ "a", "b", "c" }; |
| 367 | | 367 | |
| 368 | testing.expect(!hasDecls(TestStruct1, .{"a"})); | 368 | testing.expect(!hasDecls(TestStruct1, .{"a"})); |
| 369 | testing.expect(hasDecls(TestStruct2, .{"a", "b"})); | 369 | testing.expect(hasDecls(TestStruct2, .{ "a", "b" })); |
| 370 | testing.expect(hasDecls(TestStruct2, .{"a", "b", "useless"})); | 370 | testing.expect(hasDecls(TestStruct2, .{ "a", "b", "useless" })); |
| 371 | testing.expect(!hasDecls(TestStruct2, .{"a", "b", "c"})); | 371 | testing.expect(!hasDecls(TestStruct2, .{ "a", "b", "c" })); |
| 372 | testing.expect(!hasDecls(TestStruct2, tuple)); | 372 | testing.expect(!hasDecls(TestStruct2, tuple)); |
| 373 | } | 373 | } |
| 374 | | 374 | |
| ... | @@ -389,14 +389,13 @@ test "std.meta.trait.hasFields" { | ... | @@ -389,14 +389,13 @@ test "std.meta.trait.hasFields" { |
| 389 | pub fn useless() void {} | 389 | pub fn useless() void {} |
| 390 | }; | 390 | }; |
| 391 | | 391 | |
| 392 | | 392 | const tuple = .{ "a", "b", "c" }; |
| 393 | const tuple = .{"a", "b", "c"}; | | |
| 394 | | 393 | |
| 395 | testing.expect(!hasFields(TestStruct1, .{"a"})); | 394 | testing.expect(!hasFields(TestStruct1, .{"a"})); |
| 396 | testing.expect(hasFields(TestStruct2, .{"a", "b"})); | 395 | testing.expect(hasFields(TestStruct2, .{ "a", "b" })); |
| 397 | testing.expect(hasFields(TestStruct2, .{"a", "b", "c"})); | 396 | testing.expect(hasFields(TestStruct2, .{ "a", "b", "c" })); |
| 398 | testing.expect(hasFields(TestStruct2, tuple)); | 397 | testing.expect(hasFields(TestStruct2, tuple)); |
| 399 | testing.expect(!hasFields(TestStruct2, .{"a", "b", "useless"})); | 398 | testing.expect(!hasFields(TestStruct2, .{ "a", "b", "useless" })); |
| 400 | } | 399 | } |
| 401 | | 400 | |
| 402 | pub fn hasFunctions(comptime T: type, comptime names: var) bool { | 401 | pub fn hasFunctions(comptime T: type, comptime names: var) bool { |
| ... | @@ -414,10 +413,10 @@ test "std.meta.trait.hasFunctions" { | ... | @@ -414,10 +413,10 @@ test "std.meta.trait.hasFunctions" { |
| 414 | fn b() void {} | 413 | fn b() void {} |
| 415 | }; | 414 | }; |
| 416 | | 415 | |
| 417 | const tuple = .{"a", "b", "c"}; | 416 | const tuple = .{ "a", "b", "c" }; |
| 418 | | 417 | |
| 419 | testing.expect(!hasFunctions(TestStruct1, .{"a"})); | 418 | testing.expect(!hasFunctions(TestStruct1, .{"a"})); |
| 420 | testing.expect(hasFunctions(TestStruct2, .{"a", "b"})); | 419 | testing.expect(hasFunctions(TestStruct2, .{ "a", "b" })); |
| 421 | testing.expect(!hasFunctions(TestStruct2, .{"a", "b", "c"})); | 420 | testing.expect(!hasFunctions(TestStruct2, .{ "a", "b", "c" })); |
| 422 | testing.expect(!hasFunctions(TestStruct2, tuple)); | 421 | testing.expect(!hasFunctions(TestStruct2, tuple)); |
| 423 | } | 422 | } |