From 76c1e620146452c4ffe52bbf44a02868f986a0c4 Mon Sep 17 00:00:00 2001 From: Erik Hollensbe Date: Sun, 26 Jun 2022 12:42:48 -0700 Subject: [PATCH] add testutil module Signed-off-by: Erik Hollensbe --- zerotier-network-hypervisor/src/util/testutil.rs | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 zerotier-network-hypervisor/src/util/testutil.rs diff --git a/zerotier-network-hypervisor/src/util/testutil.rs b/zerotier-network-hypervisor/src/util/testutil.rs new file mode 100644 index 000000000..15dafffdc --- /dev/null +++ b/zerotier-network-hypervisor/src/util/testutil.rs @@ -0,0 +1,4 @@ + // from zeronsd + pub fn randstring(len: u8) -> String { + (0..len).map(|_| (rand::random::() % 26) + 'a' as u8).map(|c| if rand::random::() { (c as char).to_ascii_uppercase() } else { c as char }).map(|c| c.to_string()).collect::>().join("") + }