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

Type not as expected #2

Open
CraigChamberlain opened this issue Apr 12, 2020 · 0 comments
Open

Type not as expected #2

CraigChamberlain opened this issue Apr 12, 2020 · 0 comments

Comments

@CraigChamberlain
Copy link

Hi sorry to bother you again, perhaps this library isn't getting a lot of attention, I don't think its been changed in a few years.

// the result type is Result<'T, 'E list>
let result: Result<People, string list> = all <| fun t ->

    { name = t.Test People.Name "abc"
                |> t.MaxLen 20 "maxlen is 20"
                |> t.MinLen 4 "minlen is 4"
                |> t.End
      age = t.Test People.Age 201
                |> t.Gt 0 "should greater then 0"
                |> t.Lt 200 "should less then 200"
                |> t.End }

Assert.AreEqual (result, Error(Map [ People.Name, ["minlen is 4"]
                                     People.Age, ["should less then 200"] ]))

Docs suggest should expect a List of errors but all returns a Map of errors for example
a Map<string, string list>

From my observations I'm getting just a single error in my string list back. This is the behavior I might expect from fast but I'm getting on all.

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

1 participant