mirror of
https://gitlab.com/TECHNOFAB/nixtest.git
synced 2025-12-12 02:00:18 +01:00
chore: allow setting pos for entire suite & remove column from pos
This commit is contained in:
parent
e029fae0b8
commit
4aaaf32621
3 changed files with 59 additions and 44 deletions
78
flake.nix
78
flake.nix
|
|
@ -44,45 +44,43 @@
|
|||
nixtest = {
|
||||
skip = "skip.*d";
|
||||
suites = {
|
||||
"suite-one" = [
|
||||
{
|
||||
name = "test-one";
|
||||
# required to figure out file and line, but optional
|
||||
pos = __curPos;
|
||||
expected = 1;
|
||||
actual = 1;
|
||||
}
|
||||
{
|
||||
name = "fail";
|
||||
pos = __curPos;
|
||||
expected = 0;
|
||||
actual = "meow";
|
||||
}
|
||||
{
|
||||
name = "snapshot-test";
|
||||
type = "snapshot";
|
||||
pos = __curPos;
|
||||
actual = "test";
|
||||
}
|
||||
{
|
||||
name = "test-snapshot-drv";
|
||||
type = "snapshot";
|
||||
pos = __curPos;
|
||||
actualDrv = pkgs.runCommand "test-snapshot" {} ''
|
||||
echo '"snapshot drv"' > $out
|
||||
'';
|
||||
}
|
||||
{
|
||||
name = "test-error-drv";
|
||||
pos = __curPos;
|
||||
expected = null;
|
||||
actualDrv = pkgs.runCommand "test-error-drv" {} ''
|
||||
echo "This works, but its better to just write 'fail' to \$out and expect 'success' or sth."
|
||||
exit 1
|
||||
'';
|
||||
}
|
||||
];
|
||||
"other-suite" = [
|
||||
"suite-one" = {
|
||||
pos = __curPos;
|
||||
tests = [
|
||||
{
|
||||
name = "test-one";
|
||||
# required to figure out file and line, but optional
|
||||
expected = 1;
|
||||
actual = 1;
|
||||
}
|
||||
{
|
||||
name = "fail";
|
||||
expected = 0;
|
||||
actual = "meow";
|
||||
}
|
||||
{
|
||||
name = "snapshot-test";
|
||||
type = "snapshot";
|
||||
actual = "test";
|
||||
}
|
||||
{
|
||||
name = "test-snapshot-drv";
|
||||
type = "snapshot";
|
||||
actualDrv = pkgs.runCommand "test-snapshot" {} ''
|
||||
echo '"snapshot drv"' > $out
|
||||
'';
|
||||
}
|
||||
{
|
||||
name = "test-error-drv";
|
||||
expected = null;
|
||||
actualDrv = pkgs.runCommand "test-error-drv" {} ''
|
||||
echo "This works, but its better to just write 'fail' to \$out and expect 'success' or sth."
|
||||
exit 1
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
"other-suite".tests = [
|
||||
{
|
||||
name = "obj-snapshot";
|
||||
type = "snapshot";
|
||||
|
|
@ -93,6 +91,7 @@
|
|||
name = "pretty-snapshot";
|
||||
type = "snapshot";
|
||||
format = "pretty";
|
||||
pos = __curPos;
|
||||
actual = {
|
||||
example = args: {};
|
||||
example2 = {
|
||||
|
|
@ -112,7 +111,6 @@
|
|||
}
|
||||
{
|
||||
name = "skipped";
|
||||
pos = __curPos;
|
||||
expected = null;
|
||||
actual = null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue