diff options
author | Flu0r1ne <flur01ne@flu0r1ne.net> | 2021-08-04 14:32:22 -0500 |
---|---|---|
committer | Flu0r1ne <flur01ne@flu0r1ne.net> | 2021-08-04 14:32:22 -0500 |
commit | f90a14d5d723c5d2b87f2eaa19f441dec33bb9b2 (patch) | |
tree | e0abd76b6ebd9adcc60732d532cb68c512b0c2d1 /fs_test.go | |
parent | a0b020a78eb0b33965c59460fc093c6959216e44 (diff) | |
download | planr-f90a14d5d723c5d2b87f2eaa19f441dec33bb9b2.tar.xz planr-f90a14d5d723c5d2b87f2eaa19f441dec33bb9b2.zip |
Prototyped build pipeline
Diffstat (limited to 'fs_test.go')
-rw-r--r-- | fs_test.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/fs_test.go b/fs_test.go new file mode 100644 index 0000000..4e36469 --- /dev/null +++ b/fs_test.go @@ -0,0 +1,24 @@ +package planr + +import ( + "testing" +) + +func TestCname(t *testing.T) { + ROOT := "/home/rubric" + + v := [] struct { path, cname string } { + {"/home/rubric/tc1.toml", "tc1" }, + {"/home/rubric/alpha/tc1.toml", "alpha.tc1" }, + {"/home/rubric/alpha/beta/tc2.toml", "alpha.beta.tc2"}, + {"/home/rubric/.a/_b./.abcd.toml", ".a._b...abcd"}, + } + + for _, vec := range v { + got := cname(ROOT, vec.path) + + if vec.cname != got { + t.Fatalf("Cname(%s) = %s, wanted %s", vec.path, got, vec.cname) + } + } +} |