Whatprovides unittest (#10385)

* Fix whatprovides: handle case of manifest filelist not corresponding to a package file.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add unit test for whatprovides.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Bump version

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Remove arm manifest for deprecated imagemagick6 package.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

---------

Signed-off-by: Satadru Pramanik <satadru@gmail.com>
This commit is contained in:
Satadru Pramanik, DO, MPH, MEng
2024-08-31 17:30:39 -04:00
committed by GitHub
parent 386f42ff6e
commit 68f183bdfb
5 changed files with 32 additions and 796 deletions

View File

@@ -0,0 +1,21 @@
require 'minitest/autorun'
require_relative '../../commands/whatprovides'
# Add lib to LOAD_PATH
$LOAD_PATH << File.join(CREW_LIB_PATH, 'lib')
String.use_color = false
class WhatprovidesCommandTest < Minitest::Test
def test_whatprovides
expected_output = <<~TEST_EOF
crew_profile_base: /usr/local/etc/profile
Total found: 1
TEST_EOF
assert_output(expected_output, nil) do
# Command.whatprovides(regex)
Command.whatprovides('/usr/local/etc/profile$')
end
end
end

View File

@@ -15,6 +15,7 @@ ruby ../tests/commands/help.rb
ruby ../tests/commands/list.rb
ruby ../tests/commands/prop.rb
ruby ../tests/commands/remove.rb
ruby ../tests/commands/whatprovides.rb
ruby ../tests/lib/docopt.rb
if [[ -n ${CHANGED_PACKAGES-} ]]; then
all_compatible_packages=$(crew list -d compatible)