thespian/test/tests_thespian.zig
2024-02-08 23:04:55 +01:00

14 lines
524 B
Zig

const std = @import("std");
const thespian = @import("thespian");
const cbor = @import("cbor");
pub const unexpected = thespian.unexpected;
const message = thespian.message;
const error_message = thespian.error_message;
test "thespian.unexpected" {
var buf: [512]u8 = undefined;
try std.testing.expectEqual(error.Exit, unexpected(message.fmt(.{"TEST"})));
const json = try cbor.toJson(error_message(), &buf);
try std.testing.expectEqualStrings("[\"exit\",\"UNEXPECTED_MESSAGE: [\\\"TEST\\\"]\"]", json);
}