From 77f28efd3b74bbb89a9506ffcad732e40648ed0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20Fl=C3=B6tzinger?= Date: Thu, 19 Aug 2021 17:57:50 +0200 Subject: [PATCH] Speed up testing process --- nmap_test.go | 2 +- tests/scripts/fake_nmap_delay.sh | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/nmap_test.go b/nmap_test.go index e75a6ae..be64b9c 100644 --- a/nmap_test.go +++ b/nmap_test.go @@ -287,7 +287,7 @@ func TestRunWithProgress(t *testing.T) { compareWholeRun: true, expectedResult: r, - expectedProgress: []float32{56.66, 81.95, 87.84, 94.43, 97.76, 97.76}, + expectedProgress: []float32{3.22, 56.66, 77.02, 81.95, 86.79, 87.84}, expectedErr: nil, }, } diff --git a/tests/scripts/fake_nmap_delay.sh b/tests/scripts/fake_nmap_delay.sh index 73bd33e..48d090a 100755 --- a/tests/scripts/fake_nmap_delay.sh +++ b/tests/scripts/fake_nmap_delay.sh @@ -1,7 +1,12 @@ #!/bin/bash input=$1 +count=0 while IFS= read -r line do echo "$line" - sleep .5 + if [ $count -gt 13 ] && [ $count -lt 23 ] + then + sleep 1 + fi + (( count++ )) done < "$input"