From bcfca79758855b8c6fcb5d29b747bd56378e2092 Mon Sep 17 00:00:00 2001 From: Chai Feng Date: Sat, 19 Oct 2019 12:30:41 +0200 Subject: [PATCH] Add a test case for ufw-docker--list-number --- test/ufw-docker.test.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/ufw-docker.test.sh b/test/ufw-docker.test.sh index 4d5e6d8..2579fe2 100755 --- a/test/ufw-docker.test.sh +++ b/test/ufw-docker.test.sh @@ -419,3 +419,14 @@ test-ufw-docker--list-name-80-udp() { test-ufw-docker--list-name-80-udp-assert() { grep "# allow foo\\( 80\\/udp\\)\\?\$" } + + +test-ufw-docker--list-number() { + @mocktrue ufw-docker--list foo 53 udp + + load-ufw-docker-function ufw-docker--list-number + ufw-docker--list-number foo 53 udp +} +test-ufw-docker--list-number-assert() { + sed -e 's/^\[[[:blank:]]*\([[:digit:]]\+\)\].*/\1/' +}