list to attrs, restructure output

This commit is contained in:
tristan 2024-01-03 19:18:54 +00:00
parent cc834eda99
commit 5007770e88
10 changed files with 66 additions and 58 deletions

View file

@ -6,18 +6,15 @@
(describe "the describe function" [
(it "returns an array with the message changed" {
expected = {
component = "the describe function";
results = [
{
success = true;
msg = "works";
}
];
name = "the describe function";
value = {
"works" = {success = true;};
};
};
actual = describe "the describe function" [
{
success = true;
msg = "works";
value = {success = true;};
name = "works";
}
];
})

10
test/example.test.nix Normal file
View file

@ -0,0 +1,10 @@
{...}: [
{
name = "an example";
value = {
"succeeds" = {
success = true;
};
};
}
]

View file

@ -6,8 +6,10 @@
(describe "it" [
(it "test's itself???" rec {
expected = {
success = true;
msg = "test's itself???";
value = {
success = true;
};
name = "test's itself???";
};
actual = it "test's itself???" {
expected = expected;

View file

@ -7,22 +7,17 @@
in [
(describe "the test function" [
(it "get's test results" {
expected = [
{
"component" = "it";
results = [
{
"msg" = "test's itself???";
"success" = true;
}
];
}
];
actual = (test ./it.test.nix).results;
})
(it "has a path" {
actual = builtins.typeOf (test ./it.test.nix).path;
expected = "path";
expected = {
name = toString ./example.test.nix;
value = {
"an example" = {
succeeds = {
success = true;
};
};
};
};
actual = test ./example.test.nix;
})
(it "fails to build non test" {
actual = test ./bad/string.nix;