diff options
-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 |