summaryrefslogtreecommitdiff
path: root/user/bash-completion/fix-tests.patch
blob: 5576064600542039b4d216880c5595afeeba69d0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
From 70afc1ed3697c3171a004b7db2f19220117d2862 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ville=20Skytt=C3=A4?= <ville.skytta@iki.fi>
Date: Tue, 30 Apr 2019 18:04:13 +0300
Subject: [PATCH] test_getconf: skip if -a doesn't output any POSIX_V*

Refs https://github.com/scop/bash-completion/issues/312
---
 test/t/test_getconf.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/test/t/test_getconf.py b/test/t/test_getconf.py
index 6f9192d251..96713dbe4c 100644
--- a/test/t/test_getconf.py
+++ b/test/t/test_getconf.py
@@ -14,7 +14,9 @@ def test_2(self, completion):
     def test_3(self, completion):
         assert completion
 
-    @pytest.mark.complete("getconf -v ")
+    @pytest.mark.complete(
+        "getconf -v ", skipif="! getconf -a 2>&1 | command grep -q ^POSIX_V"
+    )
     def test_4(self, completion):
         assert completion
 
From 2cdac1b9f24df62a1fa80c1824ee8524c9b02393 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ville=20Skytt=C3=A4?= <ville.skytta@iki.fi>
Date: Wed, 1 May 2019 13:42:52 +0300
Subject: [PATCH] test_iconv: skip option completion if --help fails

Such as on Alpine Linux (musl libc).

Refs https://github.com/scop/bash-completion/issues/312
---
 test/t/test_iconv.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/t/test_iconv.py b/test/t/test_iconv.py
index dc5f8961a6..2edc439b08 100644
--- a/test/t/test_iconv.py
+++ b/test/t/test_iconv.py
@@ -2,7 +2,7 @@
 
 
 class TestIconv:
-    @pytest.mark.complete("iconv -")
+    @pytest.mark.complete("iconv -", skipif="! iconv --help &>/dev/null")
     def test_1(self, completion):
         assert completion
 
--- bash-completion-2.9/test/t/test_cpio.py.old	2019-04-27 08:54:49.000000000 +0000
+++ bash-completion-2.9/test/t/test_cpio.py	2019-07-12 01:02:37.813838612 +0000
@@ -8,9 +8,3 @@
     def test_1(self, completion):
         assert completion
 
-    @pytest.mark.complete("cpio -R ")
-    def test_2(self, bash, completion):
-        users = sorted(
-            assert_bash_exec(bash, "compgen -A user", want_output=True).split()
-        )
-        assert completion == users
--- bash-completion-2.9/test/t/test_getconf.py.old	2019-07-12 01:03:00.331419016 +0000
+++ bash-completion-2.9/test/t/test_getconf.py	2019-07-12 04:15:53.176145140 +0000
@@ -2,7 +2,9 @@
 
 
 class TestGetconf:
-    @pytest.mark.complete("getconf P")
+    @pytest.mark.complete(
+        "getconf P", skipif="! getconf -a 2>&1 | command grep -q ^POSIX_V"
+    )
     def test_1(self, completion):
         assert completion