diff options
Diffstat (limited to 'test/TestSabadie.hs')
-rw-r--r-- | test/TestSabadie.hs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/TestSabadie.hs b/test/TestSabadie.hs new file mode 100644 index 0000000..a01693b --- /dev/null +++ b/test/TestSabadie.hs | |||
@@ -0,0 +1,19 @@ | |||
1 | module TestSabadie where | ||
2 | |||
3 | import Codec.Wavefront | ||
4 | import System.Directory | ||
5 | import System.IO | ||
6 | |||
7 | getDataDir :: IO FilePath | ||
8 | getDataDir = do | ||
9 | let tryDir d fallback = do | ||
10 | found <- doesDirectoryExist d | ||
11 | if found then return d else fallback | ||
12 | tryDir "./test-data" $ tryDir "../test-data" (return ".") | ||
13 | |||
14 | main = do | ||
15 | ddir <- getDataDir | ||
16 | r1 <- fromFile (ddir ++ "/01.obj") | ||
17 | print r1 | ||
18 | -- Failed: ` vp ` [...]: Failed reading: empty | ||
19 | -- Reason: vp token and blank lines | ||