From 8d4d4ceec4d14461eef4d1864073715d600676c3 Mon Sep 17 00:00:00 2001 From: zztkm Date: Tue, 26 Jul 2022 02:03:48 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20Add:=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vss_test.v | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 vss_test.v diff --git a/vss_test.v b/vss_test.v new file mode 100644 index 0000000..df09a86 --- /dev/null +++ b/vss_test.v @@ -0,0 +1,20 @@ +module main + +import os + + +fn normalise_paths(paths []string) []string { + mut res := paths.map(it.replace(os.path_separator, '/')) + res.sort() + return res +} + +fn test_get_paths() { + testpath := "testfiles" + mds := normalise_paths(get_paths(testpath)) + assert mds.len == 2 + assert mds == [ + "testfiles/aaa.md", + "testfiles/bbb.md", + ] +} \ No newline at end of file