~ubuntu-branches/ubuntu/wily/agda/wily-proposed

« back to all changes in this revision

Viewing changes to src/full/Agda/Utils/FileName.hs

  • Committer: Package Import Robot
  • Author(s): Iain Lane, d5cf60f
  • Date: 2015-05-20 13:08:33 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20150520130833-cdcmhagwsouna237
Tags: 2.4.2.2-2
[d5cf60f] Depend on ${shlibs:Depends}, to get libc (& maybe other) deps

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
{-# LANGUAGE CPP #-}
 
1
{-# LANGUAGE CPP                #-}
2
2
{-# LANGUAGE DeriveDataTypeable #-}
3
3
 
4
4
{-| Operations on file names. -}
30
30
import Agda.Utils.TestHelpers
31
31
import Agda.Utils.QuickCheck
32
32
 
33
 
#include "../undefined.h"
 
33
#include "undefined.h"
34
34
import Agda.Utils.Impossible
35
35
 
36
36
-- | Paths which are known to be absolute.
75
75
      AbsolutePath $ ByteString.pack $ dropTrailingPathSeparator $ normalise f
76
76
  | otherwise    = __IMPOSSIBLE__
77
77
 
 
78
#if mingw32_HOST_OS
 
79
prop_mkAbsolute :: FilePath -> Property
 
80
#else
 
81
prop_mkAbsolute :: FilePath -> Bool
 
82
#endif
78
83
prop_mkAbsolute f =
79
84
  let path = rootPath ++ f
80
85
  in
83
88
#endif
84
89
      absolutePathInvariant $ mkAbsolute $ path
85
90
 
 
91
rootPath :: FilePath
86
92
#if mingw32_HOST_OS
87
93
rootPath = joinDrive "C:" [pathSeparator]
88
94
#else
148
154
------------------------------------------------------------------------
149
155
-- All tests
150
156
 
 
157
tests :: IO Bool
151
158
tests = runTests "Agda.Utils.FileName"
152
159
  [ quickCheck' absolutePathInvariant
153
160
  , quickCheck' prop_mkAbsolute