Просмотр исходного кода

Issues caused due to random generator

function random() {
    head /dev/urandom | tr -dc A-Za-z0-9 | head -c$1
}
to be replaced with
function random() {
   head /dev/urandom | tr -dc 0-9 | head -c$1
}
System expects an number
Jaap Marcus 5 лет назад
Родитель
Сommit
11cae65d14
2 измененных файлов с 2 добавлено и 2 удалено
  1. 1 1
      test/test.bats
  2. 1 1
      test/test_actions.sh

+ 1 - 1
test/test.bats

@@ -6,7 +6,7 @@ load 'test_helper/bats-file/load'
 
 
 function random() {
-    head /dev/urandom | tr -dc A-Za-z0-9 | head -c$1
+    head /dev/urandom | tr -dc 0-9 | head -c$1
 }
 
 function setup() {

+ 1 - 1
test/test_actions.sh

@@ -7,7 +7,7 @@ V_TEST="$HESTIA/test"
 
 # Define functions
 random() {
-    head /dev/urandom | tr -dc A-Za-z0-9 | head -c$1
+    head /dev/urandom | tr -dc 0-9 | head -c$1
 }
 
 echo_result() {