summaryrefslogtreecommitdiff
path: root/src/ninep/events.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/ninep/events.zig')
-rw-r--r--src/ninep/events.zig10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ninep/events.zig b/src/ninep/events.zig
index 3910ac05..7b73dc0e 100644
--- a/src/ninep/events.zig
+++ b/src/ninep/events.zig
@@ -938,7 +938,7 @@ test "event records are acme's bytes, one per read, and .again when empty" {
try testing.expectEqualStrings("ML0 ", rd(p, event, 0, 4).bytes);
try testing.expectEqualStrings("3 4 3 one\n", rd(p, event, 0, 4096).bytes);
- const big = "z" ** max_record_text;
+ const big = &@as([max_record_text]u8, @splat('z'));
_ = noteAction(p, 0, .body_exec, 0, max_record_text, 0, big);
try testing.expectEqualStrings("MX0 256 0 0 \n", rd(p, event, 0, 4096).bytes);
@@ -1388,7 +1388,7 @@ test "opens of the log share the open records, and a closed one frees its record
test "a click in the body reports the offsets of the word it takes, so the record can be written back" {
const config = @import("../config.zig");
const gpa = testing.allocator;
- const text = "alpha qty beta\n qty\n\tqty\ndef f(qty): return qty.x\n" ++ "w" ** 100 ++ " qty\n";
+ const text = "alpha qty beta\n qty\n\tqty\ndef f(qty): return qty.x\n" ++ &@as([100]u8, @splat('w')) ++ " qty\n";
const p = try withFile(gpa, text);
defer p.deinit();
// A scratch made over 9P, clicked while another pane has the keyboard.
@@ -1459,7 +1459,7 @@ test "follow new skips what the log held and waits for what comes after" {
test "a long msg record is cut between words at its cap, with an ellipsis" {
const p = try withFile(testing.allocator, "x\n");
defer p.deinit();
- const long = "word " ** 60; // 300 bytes
+ const long = std.mem.asBytes(&@as([60][5]u8, @splat("word ".*))); // 300 bytes
_ = wr(p, Node.of(serialOf(p), .ctl), "Msg " ++ long ++ "\n");
const log = @intFromEnum(tree.TopFile.log);
const h = call(p, .{ .tag = 1, .op = .open, .node = log }).reply.handle;
@@ -1485,7 +1485,7 @@ test "a record is one line of UTF-8: DEL and C1 are spaces, bytes not UTF-8 are
test "a long err record keeps its end, its middle given up to an ellipsis" {
const p = try withFile(testing.allocator, "x\n");
defer p.deinit();
- _ = wr(p, @intFromEnum(tree.TopFile.ctl), "Bogus" ++ "abcdefgh" ** 40 ++ "\n");
+ _ = wr(p, @intFromEnum(tree.TopFile.ctl), "Bogus" ++ std.mem.asBytes(&@as([40][8]u8, @splat("abcdefgh".*))) ++ "\n");
const log = @intFromEnum(tree.TopFile.log);
const h = call(p, .{ .tag = 1, .op = .open, .node = log }).reply.handle;
const text = call(p, .{ .tag = 2, .op = .read, .node = log, .handle = h, .size = 1 << 16 }).bytes;
@@ -1500,7 +1500,7 @@ test "a long err record keeps its end, its middle given up to an ellipsis" {
test "two failures that agree only in what their records cut are two records, not one counted" {
const p = try th.withFile(testing.allocator, "x\n");
defer p.deinit();
- const long = "why " ** 80;
+ const long = std.mem.asBytes(&@as([80][4]u8, @splat("why ".*)));
p.setMessage(0, long ++ "first");
p.setMessage(0, long ++ "second");
try testing.expect(!th.logHas(p, "(x2)"));