Commit Graph

69 Commits

Author SHA1 Message Date
Spencer Janssen
01cf4a5581 Whitespace fixes for Properties.hs 2007-10-15 02:27:57 +00:00
Devin Mullins
1d0191184f add mapWorkspace tests
(just completely duplicated the two mapLayout tests :)
2007-10-06 07:31:29 +00:00
Don Stewart
bab04b71d3 comment out type error'd property 2007-10-06 10:22:25 +00:00
Don Stewart
d83ce46a1e add floating property 2007-10-06 10:06:54 +00:00
Spencer Janssen
42b691d515 Add mapLayout 2007-10-04 23:45:37 +00:00
Devin Mullins
65f3f4db8a extract Properties module for re-use by contrib tests
I want to reuse Properties' Arbitrary instance (as well as the T and
NonNegative types) in an upcoming set of SwapWorkspaces QC props.
`module Main where import Main` doesn't work too well. :)

If this patch is accepted, the darcs 'test' pref should be modified to
"-itests tests/Main.hs".
2007-10-04 07:58:52 +00:00
Spencer Janssen
acbe7976d7 Add StackSet.allWindows 2007-10-01 16:39:59 +00:00
Don Stewart
60a40be09e deeper test for differentiate. back to 100% coverage 2007-09-30 07:50:18 +00:00
Don Stewart
2b6a200ad3 properties for tag renaming 2007-09-30 07:46:41 +00:00
Don Stewart
2196ab7469 test lookupWorkspace more deeply 2007-09-30 07:38:22 +00:00
Don Stewart
6640e434bf 100% coverage of alternative branches 2007-09-28 23:57:45 +00:00
Don Stewart
cee31df81d add some more properties for failure cases 2007-09-28 23:32:30 +00:00
David Roundy
70282f23dc add (unused) Layout to StackSet. 2007-09-20 21:28:43 +00:00
Don Stewart
bee79c83e6 add prop for 'differentiate' 2007-09-27 23:19:28 +00:00
Don Stewart
6cff2dddcf new QC properties: floating a window is reversible, screens includes current screen 2007-09-27 22:04:31 +00:00
Don Stewart
d1ad738f6b Add 3 QC properties for focusMaster: local, idempotent, preserves invariant 2007-09-27 21:44:01 +00:00
Karsten Schoelzel
b72c096bc6 Fix float behaviour, add shiftWin.
First, if float is called with window which is on a hidden workspace,
then the window will remain on that hidden workspace.

Now the focus should change more as expected:
float w = (view current) . (shiftWin ws w)
    where
        current is the current screen/workspace
        shiftWin ws w is: - view the workspace w is on
            - set focus on w
            - shift ws
            - set focus back to window it was on that workspace
                unless w was focused

shiftWin was add to StackSet.hs
2007-09-10 09:03:29 +00:00
Spencer Janssen
2f3ccd7ab6 Add greedyView, make it the default action for mod-wer 2007-08-15 02:55:04 +00:00
Karsten Schoelzel
808894c217 QuickCheck filter preserves order 2007-07-28 18:45:34 +00:00
Spencer Janssen
ab830ec227 Move screen details into StackSet 2007-06-29 21:39:17 +00:00
Don Stewart
dbdf0fd5e4 add 2 properties to state where focus goes on delete of focused window 2007-06-26 04:09:07 +00:00
David Roundy
dbd58faffe make workspace tag not need to be a Num.
This change also removes the barely used 'size' field, and replaces
it with a tagMember predicate.  The idea is to move towards the ability
to make the workspace tag be a String, which by default might be "1".."9",
but could also be customized to be something meaningful to the user.
2007-06-14 14:07:09 +00:00
David Roundy
5f8202e79e make focus, up and down complete functions.
This is a rerun of my change to make (Stack a) never be empty.  Gives
us more type-safety.
2007-06-12 15:05:55 +00:00
Spencer Janssen
5f3e91676a Add StackSet.filter 2007-06-11 16:51:54 +00:00
Don Stewart
60f4f4e5e4 HEADS UP: change key binding for swapLeft/Right and IncMaster
The use of arrow keys for swapLeft/Right clash with firefox's back
button. Use the more intuitive mod-shift-jk for this. (It's a movement
operation, after all).

This clashes with IncMaster, so we use mod+comma and mod+period for
these (i.e. the keys mod < and mod > , to move windows to and from the
master area).

While we're here, replace the use of the terms 'left' and 'right' for
navigation, in comments and identifiers, with 'up' and 'down' instead.
Hence mod-j == focusDown. Far more intuitive for people (dons) who live
in fullscreen mode and have vim movement wired into their central
nervous system.

Principle of least VI surprise: movement down or up means using j and k.
2007-05-26 11:14:53 +00:00
glasser
52608185b4 Add a test that the size field of StackSet is correct to QuickCheck invariant. 2007-05-25 16:31:59 +00:00
Rob
7afc18b0e1 Quickcheck property to check that delete / focus behaviour
See patch "Deleting a window should not affect focus". Checks this property.
2007-05-25 03:54:32 +00:00
Rob
a36bd31973 Fix bug in noDuplicate invariant
ws used by noDuplicates is actually a list of list of elements which 
will pretty rarely raise any flags even if the StackSet actually does
contain duplicates. This patch concatenates ws to ensure the quickcheck
property tests accurately.
2007-05-25 06:08:42 +00:00
bobstopper
bcf305cd1e add swapLeft and swapRight 2007-05-22 05:00:08 +00:00
Don Stewart
ea80d2a71f Move xinerama current/visible/hidden workspace logic into StackSet directly. 2007-05-21 05:52:53 +00:00
Don Stewart
77e46027ed HEADS UP: Rewrite StackSet as a Zipper
In order to give a better account of how focus and master interact, and
how each operation affects focus, we reimplement the StackSet type as a
two level nested 'Zipper'. To quote Oleg:

    A Zipper is essentially an `updateable' and yet pure functional
    cursor into a data structure. Zipper is also a delimited
    continuation reified as a data structure.

That is, we use the Zipper as a cursor which encodes the window which is
in focus. Thus our data structure tracks focus correctly by
construction! We then get simple, obvious semantics for e.g. insert, in
terms of how it affects focus/master. Our transient-messes-with-focus
bug evaporates. 'swap' becomes trivial.

By moving focus directly into the stackset, we can toss some QC
properties about focus handling: it is simply impossible now for focus
to go wrong. As a benefit, we get a dozen new QC properties for free,
governing how master and focus operate.

The encoding of focus in the data type also simplifies the focus
handling in Operations: several operations affecting focus are now
simply wrappers over StackSet.

For the full story, please read the StackSet module, and the QC
properties.

Finally, we save ~40 lines with the simplified logic in Operations.hs

For more info, see the blog post on the implementation,

    http://cgi.cse.unsw.edu.au/~dons/blog/2007/05/17#xmonad_part1b_zipper
2007-05-20 07:00:53 +00:00
Jason Creighton
4206c4bae9 variable number of windows in master area 2007-05-16 03:14:37 +00:00
David Roundy
3cc55de0f4 beautify tile 2007-05-15 15:40:11 +00:00
David Roundy
54ee507cca keep focus stack. 2007-05-10 13:16:37 +00:00
Spencer Janssen
47ae5e4ea5 Remove broken prop_promoterotate, replace it with prop_promote_raise_id 2007-05-08 21:19:07 +00:00
Spencer Janssen
c4030d45e2 Disable shift_reversible until focus issues are decided. 2007-05-08 21:09:52 +00:00
Spencer Janssen
f5b0df6a73 Disable delete.push until focus issues are decided 2007-05-08 20:49:21 +00:00
Spencer Janssen
4afb251f41 Make tests typecheck 2007-05-08 15:24:49 +00:00
Don Stewart
9f4fd822b6 Arbitrary instance for StackSet must set random focus on each workspace
When focus was separated from the stack order on each workspace, we
forgot to update the Arbitrary instance to set random focus. As spotted
by David R, this then invalidates 4 of our QC properties. In particular,
the property involving where focus goes after a random transient
(annoying behaviour) appeared to be correct, but wasn't, due to
inadequate coverage.

This patch sets focus to a random window on each workspace. As a result,
we now catch the focus/raise/delete issue people have been complaining
about.

Lesson: make sure your QuickCheck generators are doing what you think
they are.
2007-05-08 05:11:26 +00:00
David Roundy
ab27c7d48d make quickcheck tests friendlier to read. 2007-05-05 17:54:15 +00:00
Jason Creighton
ab0f3be0af make Properties.hs exit with failure on test failure 2007-05-05 17:43:57 +00:00
Jason Creighton
7a89f431b1 added mirrorLayout to mirror arbitrary layouts 2007-05-04 01:46:53 +00:00
Don Stewart
f5e8b2b6a8 -Wall police 2007-05-03 07:49:37 +00:00
Spencer Janssen
833d5ae357 Fix tests after StackSet changes 2007-05-02 20:16:22 +00:00
Spencer Janssen
1dff21001c First steps to adding floating layer 2007-05-02 19:59:17 +00:00
Don Stewart
af7c76d3fe check we never generate invalid stack sets 2007-04-30 06:59:46 +00:00
Don Stewart
4d9fa8bc98 view n . shift n . view i . shift i) x == x --> shift + view is invertible 2007-04-30 06:29:01 +00:00
Don Stewart
17f70344ec add rotate all and view idempotency tests 2007-04-30 05:57:51 +00:00
Don Stewart
14773f6300 push is idempotent 2007-04-30 05:43:45 +00:00
Don Stewart
89182406a8 add two properties relating to empty window managers 2007-04-30 05:10:16 +00:00