AmpersandTarski / Ampersand

Build database applications faster than anyone else, and keep your data pollution free as a bonus.
http://ampersandtarski.github.io/
GNU General Public License v3.0
40 stars 8 forks source link

Feature/relation default values issue1189 #1226

Closed hanjoosten closed 2 years ago

Michiel-s commented 3 years ago

Great. I'll have a look somewhere this week!

hanjoosten commented 3 years ago

@Michiel-s , I believe this fixes everything in #1189 that needs to be done in the Ampersand generator. Please have a look at it.

Michiel-s commented 2 years ago

@hanjoosten, can you help out with the QuickCheck and prettyprinter issues?

Somehow an empty list shows up as possible SRC/TGT VALUE, see snippet below:

{-0037-} RELATION xq [K_X*IMd] [PROP] DEFAULT
{-0038-} TGT VALUE  [] SRC EVALPHP  "|"
hanjoosten commented 2 years ago

@hanjoosten, can you help out with the QuickCheck and prettyprinter issues?

Somehow an empty list shows up as possible SRC/TGT VALUE, see snippet below:

{-0037-} RELATION xq [K_X*IMd] [PROP] DEFAULT
{-0038-} TGT VALUE  [] SRC EVALPHP  "|"

The issue here is the use of a list, while after the keyword VALUE the list must contain at least one element. In ArbitraryTree.hs we told QuickCheck to try arbitrary elements. Thus, an empty list is a favorite edge case of QuickCheck. The problem could be solved in two ways: Tell QuickCheck to take any list, as long as it contains at least one element, OR change the type of the list to NonEmpty. I chose the latter, because it is nicer. I just fixed that.