590cf4f1c2e8c7b2034cce35b9083b6ac046815d

Author
hauntsaninja
Committer
hauntsaninja
Date

Message

add test

Diff

 1diff --git a/tests/test_plugin.zunit b/tests/test_plugin.zunit
 2index 8a3ebd89b16fe383d37faa8a4049cdaec0ca4f1b..9cf3225506d4c9f74bf290eb466cf131f3656fef 100644
 3--- a/tests/test_plugin.zunit
 4+++ b/tests/test_plugin.zunit
 5@@ -60,3 +60,13 @@
 6     assert $status equals 0
 7     assert "$output" same_as "Switching virtualenv: \e[1m\e[35mfoobar\e[0m \e[32m[🐍$PYTHON_VERSION]\e[0m"
 8 }
 9+
10+
11+@test 'plugin - check randstr' {
12+    unset AUTOSWITCH_DEFAULTENV
13+    load ../autoswitch_virtualenv.plugin.zsh
14+
15+    # check that $(randstr n) returns a string of length n
16+    assert "${#$(randstr)}" equals 8
17+    assert "${#$(randstr 19)}" equals 19
18+}