Send Beginners mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1.  Inventing QuickCheck properties (Dan Serban)


----------------------------------------------------------------------

Message: 1
Date: Thu, 16 Apr 2015 13:08:21 +0300
From: Dan Serban <[email protected]>
To: [email protected]
Subject: [Haskell-beginners] Inventing QuickCheck properties
Message-ID:
        <CAHaPvSdj1f8BqCshZQqU+9HOboVPDkQu719ei+rgVA3ig0mF=a...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

Hi,

I'm writing QuickCheck properties for the swipeLeft function in a game of 2048.
I could think of 3 very basic properties so far and I'm wondering if
you guys can think of any other interesting ones.
Here are mine:
- Verify That It Makes The Number Of Zeroes Go Up
(applies "length . (filter (==0))" to both input and output and then
does a <= comparison)
- Verify That It Cleanly Separates Zeroes To The Right-Hand Side
(applies "all (==0) . snd . break (==0)" to the output)
- Verify that It Preserves The SumTotal
(assert that the sum of all integers is left unchanged)

-Dan


------------------------------

Subject: Digest Footer

_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


------------------------------

End of Beginners Digest, Vol 82, Issue 18
*****************************************

Reply via email to