Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xeger generates a lot of same strings #151

Closed
vasily-kirichenko opened this issue Dec 17, 2017 · 3 comments
Closed

Xeger generates a lot of same strings #151

vasily-kirichenko opened this issue Dec 17, 2017 · 3 comments

Comments

@vasily-kirichenko
Copy link

open Fare
open Hedgehog

[<EntryPoint>]
let main _ =
    let fromRegex (pattern: string) : Gen<string> =
        Gen.sized (fun size ->
            let xeger = Xeger pattern
            Gen.item [ for _ in 1..size -> xeger.Generate() ]
        )
    
    property {
        let! s = fromRegex @"^\[\<([A-Z][a-zA-Z0-9]*)*\>\]$"
        printfn "%s" s
        return true
    } |> Property.print' 10<tests>
 
    0
[<N28UhdD2m8m589286x>]
[<R>]
[<K3Mol1RRwF8U1Kmh84>]
[<J>]
[<>]
[<>]
[<>]
[<>]
[<>]
[<R5gn44pB2>]

Where 5 of 10 tests generates the same sample.

@moodmosaic
Copy link
Member

I'll have a look, though this looks more like an issue related to https://github.com/moodmosaic/Fare/.

@vasily-kirichenko
Copy link
Author

Yeah, it looks like an issue in Fare:

for _ in 1..10 do
        (Xeger @"^\[\<([A-Z][a-zA-Z0-9]*)*\>\]$").Generate() |> printfn "%s"

run #1

[<>]
[<>]
[<>]
[<>]
[<>]
[<>]
[<>]
[<>]
[<>]
[<>]

run #2

[<V5N42Eu>]
[<>]
[<>]
[<>]
[<>]
[<>]
[<>]
[<>]
[<>]
[<>]

run #3

[<Fl>]
[<>]
[<>]
[<IFELv0We6427oTb4116>]
[<IFELv0We6427oTb4116>]
[<IFELv0We6427oTb4116>]
[<IFELv0We6427oTb4116>]
[<IFELv0We6427oTb4116>]
[<IFELv0We6427oTb4116>]
[<IFELv0We6427oTb4116>]

I've created an issue there moodmosaic/Fare#26

@moodmosaic
Copy link
Member

@vasily-kirichenko, should we close this? After all, it's tracked by moodmosaic/Fare#26.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants