From 2669f6e7d90c77fb074e60bcdca894701b30d9c7 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Sun, 22 Dec 2024 22:09:20 +0100 Subject: [PATCH] Add more tests for --compare --- test/test.bats | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/test.bats b/test/test.bats index 6d2a18f..26cf121 100644 --- a/test/test.bats +++ b/test/test.bats @@ -59,3 +59,16 @@ setup() { ros2nix $(find ws/src -name package.xml) ros2nix --compare $(find ws/src -name package.xml) } + +@test "--compare with changed package.xml" { + ros2nix $(find ws/src -name package.xml) + sed -i -e '4alibpng' ws/src/ros_node/package.xml + run -2 ros2nix --compare $(find ws/src -name package.xml) + assert_line "+ propagatedBuildInputs = [ libpng library ];" +} + +@test "--compare with added package" { + ros2nix ws/src/library/package.xml + run -2 ros2nix --compare ws/src/{library,ros_node}/package.xml + assert_line --partial "Cannot read ws/src/ros_node/package.nix" +}