Initial Release

This commit is contained in:
CJ van den Berg 2024-02-08 22:23:40 +01:00
commit 5a00e06cb9
81 changed files with 12670 additions and 0 deletions

14
test/tests_thespian.zig Normal file
View file

@ -0,0 +1,14 @@
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);
}