[
    {
        "name": "Test.Graph",
        "comment": "\nExecution graphs for [elm-test](/packages/elm-community/elm-test/latest). Define a graph of what operations happen and roughly in what order, and we'll generate total orderings from your graph, and execute them. Hopefully, we'll find some errors this way.\n\n# Fuzzers\n@docs fuzzGraph\n\n# Types\n@docs Action, ExecutionGraph\n\n",
        "unions": [
            {
                "name": "Action",
                "comment": " An `Action` to be performed at this step in the graph. `Expect` is used to run an [elm-test](/packages/elm-community/elm-test/latest) expectation against `a` at this point in the execution. `Modify` is used to modify `a` in some way.\n",
                "args": [
                    "a"
                ],
                "cases": [
                    [
                        "Expect",
                        [
                            "a -> Expectation"
                        ]
                    ],
                    [
                        "Modify",
                        [
                            "a -> a"
                        ]
                    ]
                ]
            }
        ],
        "aliases": [
            {
                "name": "ExecutionGraph",
                "comment": " A graph of `Action`s to be taken and the partial order to take them in. See [drathier/elm-graph](/packages/drathier/elm-graph/latest) for details on modifying the graph.\n",
                "args": [
                    "comparable",
                    "a"
                ],
                "type": "Graph comparable (Action a)"
            }
        ],
        "values": [
            {
                "name": "fuzzGraph",
                "comment": " A fuzztest that uses an execution graph to define what it should do, and then randomizes execution order through the graph.\n\nFor example, consider this execution graph:\n\n                Set.insert 1 → Set.remove 1\n              ↗                             ↘\n    Set.empty → Set.insert 2 → Set.remove 2 → Set.isEmpty\n              ↘                             ↗\n                Set.insert 3 → Set.remove 3\n\nWe could, for example, execute it in this order:\n\n    empty\n      |> insert 1\n      |> insert 2\n      |> remove 1\n      |> insert 3\n      |> remove 3\n      |> remove 2\n      |> Set.isEmpty\n\nBut who in their right mind would think of writing a test-case like that? Good thing we have this tool to find some of [the really obscure bugs](https://xkcd.com/1700).\n\nThe graph above can be modeled using this code (which also has a bunch of expectations mid-way to make narrowing in on an error easier, if there is one):\n\n    fuzzGraph \"Inserting and deleting set elements can be done in almost any order\" Set.empty <|\n      (empty\n        |> insertNodeData 11 (Modify <| Set.insert 1)\n        |> insertNodeData 12 (Expect <| (\\set -> set |> Set.member 1 |> Expect.true \"1 should be a member\"))\n        |> insertNodeData 13 (Modify <| Set.remove 1)\n        |> insertEdge ( 11, 12 )\n        |> insertEdge ( 12, 13 )\n        |> insertNodeData 21 (Modify <| Set.insert 2)\n        |> insertNodeData 22 (Expect <| (\\set -> set |> Set.member 2 |> Expect.true \"2 should be a member\"))\n        |> insertNodeData 23 (Modify <| Set.remove 2)\n        |> insertEdge ( 21, 22 )\n        |> insertEdge ( 22, 23 )\n        |> insertNodeData 31 (Modify <| Set.insert 3)\n        |> insertNodeData 32 (Expect <| (\\set -> set |> Set.member 3 |> Expect.true \"3 should be a member\"))\n        |> insertNodeData 33 (Modify <| Set.remove 3)\n        |> insertEdge ( 31, 32 )\n        |> insertEdge ( 32, 33 )\n        |> insertEdge ( 13, 100 )\n        |> insertEdge ( 23, 100 )\n        |> insertEdge ( 33, 100 )\n        |> insertNodeData 100 (Expect (\\set -> set |> Set.isEmpty |> Expect.true \"expected set to be empty\"))\n      )\n\n\n",
                "type": "String -> a -> ExecutionGraph comparable a -> Test"
            }
        ],
        "binops": []
    }
]