new test main with code directly (fixes)

This commit is contained in:
2026-03-24 13:42:32 +00:00
parent 14f9b5dd26
commit 5630f8f119
63 changed files with 1677 additions and 198 deletions
@@ -0,0 +1,62 @@
declare host LowLog {
[Host(module = "log", name = "write", version = 1)]
[Capability(name = "log")]
fn write(level: int, message: str) -> void;
[Host(module = "log", name = "write_tag", version = 1)]
[Capability(name = "log")]
fn write_tag(level: int, tag: int, message: str) -> void;
}
declare service Log
{
fn trace(msg: str) -> void
{
LowLog.write(0, msg);
}
fn debug(msg: str) -> void
{
LowLog.write(1, msg);
}
fn info(msg: str) -> void
{
LowLog.write(2, msg);
}
fn warn(msg: str) -> void
{
LowLog.write(3, msg);
}
fn error(msg: str) -> void
{
LowLog.write(4, msg);
}
fn trace(tag: int, msg: str) -> void
{
LowLog.write_tag(0, tag, msg);
}
fn debug(tag: int, msg: str) -> void
{
LowLog.write_tag(1, tag, msg);
}
fn info(tag: int, msg: str) -> void
{
LowLog.write_tag(2, tag, msg);
}
fn warn(tag: int, msg: str) -> void
{
LowLog.write_tag(3, tag, msg);
}
fn error(tag: int, msg: str) -> void
{
LowLog.write_tag(4, tag, msg);
}
}
@@ -0,0 +1,2 @@
mod host LowLog;
pub service Log;