feat: remove nix store path prefix if used in flakeModule

This commit is contained in:
technofab 2025-05-03 22:23:05 +02:00
parent 27696c02bc
commit 482f15c486
2 changed files with 12 additions and 4 deletions

View file

@ -1,4 +1,9 @@
{pkgs, ...}: {
{
pkgs,
lib ? pkgs.lib,
self ? "",
...
}: {
mkTest = {
type ? "unit",
name,
@ -7,13 +12,15 @@
actual ? null,
actualDrv ? null,
pos ? null,
}: {
}: let
fileRelative = lib.removePrefix ((toString self) + "/") pos.file;
in {
inherit type name description expected actual;
actualDrv = actualDrv.drvPath or "";
pos =
if pos == null
then ""
else "${pos.file}:${toString pos.line}:${toString pos.column}";
else "${fileRelative}:${toString pos.line}:${toString pos.column}";
};
mkSuite = name: tests: {
inherit name tests;