Files
lamv/tests/testDetection.nim
2020-02-13 22:00:59 +01:00

18 lines
417 B
Nim

import unittest, os
import lamv
suite "Test the file detection":
setup:
const root = "./example"
test "Directory does not exist":
expect(OSError):
discard scanDir("./ThisDirDoesNotExist")
test "Find org files":
let files = scanDir(root)
var parts: tuple[dir, name, ext: string]
check files.len > 1
for file in files:
parts = splitFile(file)
check parts.ext == ".org"