summaryrefslogtreecommitdiff
path: root/test/TestSabadie.hs
blob: d8d19497c43e48594f2e23cdeaa03432a8b2ee55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
module TestSabadie where

import Codec.Wavefront
import System.Directory
import System.IO
import Text.Show.Pretty (ppShow)

getDataDir :: IO FilePath
getDataDir = do
    let tryDir d fallback = do
            found <- doesDirectoryExist d
            if found then return d else fallback
    tryDir "./test-data" $ tryDir "../test-data" (return ".")

main = do
    ddir <- getDataDir
    r1 <- fromFile (ddir ++ "/01.obj")
    either print (putStrLn . ppShow) r1