| ... | ... | @@ -911,8 +911,11 @@ pub fn join(allocator: *Allocator, separator: []const u8, slices: []const []cons |
| 911 | 911 | } |
| 912 | 912 | |
| 913 | 913 | test "mem.join" { |
| 914 | | assert(eql(u8, try join(debug.global_allocator, ",", [][]const u8{ "a", "b", "c" }), "a,b,c")); |
| 915 | | assert(eql(u8, try join(debug.global_allocator, ",", [][]const u8{"a"}), "a")); |
| 914 | var buf: [1024]u8 = undefined; |
| 915 | const a = &std.heap.FixedBufferAllocator.init(&buf).allocator; |
| 916 | assert(eql(u8, try join(a, ",", [][]const u8{ "a", "b", "c" }), "a,b,c")); |
| 917 | assert(eql(u8, try join(a, ",", [][]const u8{"a"}), "a")); |
| 918 | assert(eql(u8, try join(a, ",", [][]const u8{ "a", "", "b", "", "c" }), "a,,b,,c")); |
| 916 | 919 | } |
| 917 | 920 | |
| 918 | 921 | test "testStringEquality" { |