[erlang-questions] QuickCheck module for testing the new string module

Björn Gustavsson <>
Thu Apr 6 15:43:41 CEST 2017


Running on the latest string.erl is boring since all tests pass. But I
found this this output in one of my xterm windows:

24> c(string_eqc), eqc:quickcheck(eqc:numtests(10000, string_eqc:prop_chomp())).
....................................................................................................(x10)..............................................................................Failed!
After 881 tests.
{{[1060,10,13,13,10,10,13,13],[1060,10,13,13,10,10,13,13]},
 {list,{split,2,{{split,1,{list,binary}},list}}}}
flat: passed
binary: passed
mixed: failed
string:chomp([[[[1060]|<<"\n\r\r">>],10,10,13,13]])
Shrinking .xxxxxxxxx..xxxxxxx.(4 times)
{{"\r\r\n\n\r","\r\r\n\n\r"},{list,{split,2,{{split,1,{list,binary}},list}}}}
mixed: failed
string:chomp([[[[]|<<"\r\r">>],10,10,13]])
false
25> string:chomp([[[[]|<<"\r\r">>],10,10,13]]).
[13,<<"\r">>,10,13]

(Dan has now fixed this bug.)

/Bjorn

On Thu, Apr 6, 2017 at 3:30 PM, Alex S. <> wrote:
> Hey Björn,
>
> for those of us who don’t have QC handy, could you provide the sample run output, please?
>> 6 апр. 2017 г., в 16:26, Björn Gustavsson <> написал(а):
>>
>> I have written a QuickCheck module to test Dan's new string module
>> (https://github.com/erlang/otp/pull/1330). It found some bugs.
>>
>> Here is the gist for anyone interested:
>>
>> https://gist.github.com/bjorng/03a869392d5a969ebf2c40044b664190
>>
>> Comments are welcome. This is my first major use of QuickCheck. I am
>> interested in how I could improve the QC specifications and
>> generators.
>>
>> /Björn
>> --
>> Björn Gustavsson, Erlang/OTP, Ericsson AB
>> _______________________________________________
>> erlang-questions mailing list
>> 
>> http://erlang.org/mailman/listinfo/erlang-questions
>



-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB


More information about the erlang-questions mailing list