From: Mart Lubbers Date: Thu, 21 Nov 2019 08:44:59 +0000 (+0100) Subject: Merge branch 'master' of git.martlubbers.net:clean-tests X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=dfcca36a36a964320436b622d18bce909ed5a9fc;p=clean-tests.git Merge branch 'master' of git.martlubbers.net:clean-tests --- dfcca36a36a964320436b622d18bce909ed5a9fc diff --cc stampedShare/test.icl index 9b62ee7,04a142c..d9e330e --- a/stampedShare/test.icl +++ b/stampedShare/test.icl @@@ -1,15 -1,19 +1,35 @@@ module test ++<<<<<<< HEAD +import iTasks.Extensions.DateTime +import System.Time +import iTasks + +sh = sharedStore "bork1" ({DateTime|year=0,mon=0,day=0,hour=0,min=0,sec=0}, 42) +sh` = sharedStore "bork2" ({Timespec|tv_sec=0,tv_nsec=0}, 42) + +Start w = doTasks t w + +t = viewSharedInformation [] sh + -&&- updateSharedInformation [] (dateTimeStampedShare sh) + -&&- viewSharedInformation [] sh` + -&&- updateSharedInformation [] (timespecStampedShare sh`) ++======= + import iTasks.Internal.IWorld + import System.Time + import iTasks + + sh = sharedStore "bork2" ({Timespec|tv_sec=0,tv_nsec=0}, 42) + + Start w = doTasks t w + + t = viewSharedInformation [] sh + -&&- updateSharedInformation [] ( + sdsTranslate "" (\p->((), p)) + (sdsStamp sh ticker (\x y->(x, y)))) + + // This gives you 100% cpu because you get updates very fast + //t = viewSharedInformation [] ticker + + ticker = sdsFocus {start={tv_sec=0,tv_nsec=0},interval={Timespec|tv_sec=0,tv_nsec=1000000}} iworldTimespec ++>>>>>>> 49f7dcc4c088dc816398a0c7854d75d7c2628f15 diff --cc test.icl index 6459207,609d79e..2076421 --- a/test.icl +++ b/test.icl @@@ -1,18 -1,25 +1,45 @@@ module test ++<<<<<<< HEAD + +import StdEnv +from Data.Func import $ +import System.Directory +import System.Time + +:: S s a = S .(s -> *(a, s)) +runS (S s) = s + +(>>=) infixl 1 :: u:(S .a .b) v:(.b -> .(S .a .c)) -> w:(S .a .c), [w <= u,w <= v] +(>>=) ma a2mb = S \s + # (a, s) = runS ma s + = runS (a2mb a) s + +Start world = flip runS world + $ (S time) + >>= \_->S (readDirectory "/home/mrl") ++======= + import qualified Data.Map as DM + import iTasks + import Data.Func + import Data.Tuple + import StdEnv + + Start w = doTasksWithOptions (\a o->Ok $ flip tuple {o & autoLayout=True} $ + (parallel + [(Embedded, tab "tab1") + ,(Embedded, tab "tab2") + ] + [ OnAction (Action "New") (always (Embedded, tab "New tab")) + , OnAction (Action " ") (always (Embedded, tab "New tab")) + , OnAction (Action "Close") (never (Embedded, \_->treturn ())) + , OnAction (Action "Dis no icon") (never (Embedded, \_->treturn ())) + , OnAction (Action "+") (always (Embedded, tab "New tab")) + ] + <<@ ArrangeWithTabs True + <<@ ApplyLayout (setActionIcon ('DM'.put " " "new" 'DM'.newMap)) + )) w + + tab title _ = tune (Title title) + $ viewInformation [] () + >>* [OnAction (Action "Close") (always (treturn ()))] ++>>>>>>> 49f7dcc4c088dc816398a0c7854d75d7c2628f15