diff options
author | Ian Lynagh <igloo@earth.li> | 2008-05-20 16:30:12 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2008-05-20 16:30:12 +0000 |
commit | b6b7b6a9a91d50b0f84f216eaf2dd19279ee08cf (patch) | |
tree | f445d078f5ebe37fde758b7f21e61d3dd450956c /tests | |
parent | ee9bbce02746792fd8b5defdf319d94d9708962b (diff) |
Add a test for #2038 (resourceLimit)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/all.T | 1 | ||||
-rw-r--r-- | tests/resourceLimit.hs | 16 | ||||
-rw-r--r-- | tests/resourceLimit.stdout | 2 |
3 files changed, 19 insertions, 0 deletions
diff --git a/tests/all.T b/tests/all.T index a80efc6..8647812 100644 --- a/tests/all.T +++ b/tests/all.T @@ -11,6 +11,7 @@ test('forkprocess01', compose(only_compiler_types(['ghc']), compose(expect_fail_for(['threaded2']), conf)), compile_and_run, ['-package unix']) test('user001', conf, compile_and_run, ['-package unix']) +test('resourceLimit', conf, compile_and_run, ['-package unix']) if config.platform == 'i386-unknown-freebsd': conf = expect_fail diff --git a/tests/resourceLimit.hs b/tests/resourceLimit.hs new file mode 100644 index 0000000..05e35af --- /dev/null +++ b/tests/resourceLimit.hs @@ -0,0 +1,16 @@ + +-- #2038 + +import System.Posix.Resource + +main :: IO () +main = do + let soft = ResourceLimit 5 + hard = ResourceLimit 10 + setResourceLimit ResourceCPUTime (ResourceLimits soft hard) + r <- getResourceLimit ResourceCPUTime + let (ResourceLimit s) = softLimit r + let (ResourceLimit h) = hardLimit r + putStrLn $ show s + putStrLn $ show h + diff --git a/tests/resourceLimit.stdout b/tests/resourceLimit.stdout new file mode 100644 index 0000000..c3ec801 --- /dev/null +++ b/tests/resourceLimit.stdout @@ -0,0 +1,2 @@ +5 +10 |