tests :: TestTree
tests =
    testGroup "ElmFormat.Render.ElmStructure"
    [ testCase "application (single line)" $
        assertOutput "a b c\n" $
            application (FAJoinFirst JoinAll) (word "a" )
                $ map word [ "b", "c" ]
    , testCase "application (multiline)" $
        assertOutput
            ( unlines
                [ "aa"
                , "aa"
                , "    bb"
                , "    bb"
                , "    c"
                ]
            ) $
            application (FAJoinFirst JoinAll)
                ( block "a" )
                [ block "b"
                , line $ identifier "c"
                ]
    , testCase "group (empty)" $
        assertOutput "()\n" $
            group True "(" "," ")" False []
    , testCase "group (single item, single line)" $
        assertOutput "( foo )\n" $
            group True "(" "," ")" False [ word "foo" ]
    , testCase "group (single line)" $
        assertOutput "( foo, bar )\n" $
            group True "(" "," ")" False [ word "foo", word "bar" ]
    , testCase "group (single line, no spaces)" $
        assertOutput "(foo, bar)\n" $
            group False "(" "," ")" False [ word "foo", word "bar" ]
    , testCase "group (multiline)" $
        assertOutput "( aa\n  aa\n, b\n, cc\n  cc\n)\n" $
            group True "(" "," ")" False [ block "a", word "b", block "c" ]
    , testCase "group (forced multiline)" $
        assertOutput "( a\n, b\n, c\n)\n" $
            group True "(" "," ")" True [ word "a", word "b", word "c" ]
    ]
tests :: TestTree
tests =
    testGroup "ElmFormat.Render.ElmStructure"
    [ testCase "application (single line)" $
        assertOutput "a b c\n" $
            application (FAJoinFirst JoinAll) (word "a" )
                $ map word [ "b", "c" ]
    , testCase "application (multiline)" $
        assertOutput
            ( unlines
                [ "aa"
                , "aa"
                , "    bb"
                , "    bb"
                , "    c"
                ]
            ) $
            application (FAJoinFirst JoinAll)
                ( block "a" )
                [ block "b"
                , line $ identifier "c"
                ]
    , testCase "group (empty)" $
        assertOutput "()\n" $
            group True "(" "," ")" False []
    , testCase "group (single item, single line)" $
        assertOutput "( foo )\n" $
            group True "(" "," ")" False [ word "foo" ]
    , testCase "group (single line)" $
        assertOutput "( foo, bar )\n" $
            group True "(" "," ")" False [ word "foo", word "bar" ]
    , testCase "group (single line, no spaces)" $
        assertOutput "(foo, bar)\n" $
            group False "(" "," ")" False [ word "foo", word "bar" ]
    , testCase "group (multiline)" $
        assertOutput "( aa\n  aa\n, b\n, cc\n  cc\n)\n" $
            group True "(" "," ")" False [ block "a", word "b", block "c" ]
    , testCase "group (forced multiline)" $
        assertOutput "( a\n, b\n, c\n)\n" $
            group True "(" "," ")" True [ word "a", word "b", word "c" ]
    ]
tests =
    testGroup "ElmFormat.Render.ElmStructure"
    [ testCase "application (single line)" $
        assertOutput "a b c\n" $
            application (FAJoinFirst JoinAll) (word "a" )
                $ map word [ "b", "c" ]
    , testCase "application (multiline)" $
        assertOutput
            ( unlines
                [ "aa"
                , "aa"
                , "    bb"
                , "    bb"
                , "    c"
                ]
            ) $
            application (FAJoinFirst JoinAll)
                ( block "a" )
                [ block "b"
                , line $ identifier "c"
                ]
    , testCase "group (empty)" $
        assertOutput "()\n" $
            group True "(" "," ")" False []
    , testCase "group (single item, single line)" $
        assertOutput "( foo )\n" $
            group True "(" "," ")" False [ word "foo" ]
    , testCase "group (single line)" $
        assertOutput "( foo, bar )\n" $
            group True "(" "," ")" False [ word "foo", word "bar" ]
    , testCase "group (single line, no spaces)" $
        assertOutput "(foo, bar)\n" $
            group False "(" "," ")" False [ word "foo", word "bar" ]
    , testCase "group (multiline)" $
        assertOutput "( aa\n  aa\n, b\n, cc\n  cc\n)\n" $
            group True "(" "," ")" False [ block "a", word "b", block "c" ]
    , testCase "group (forced multiline)" $
        assertOutput "( a\n, b\n, c\n)\n" $
            group True "(" "," ")" True [ word "a", word "b", word "c" ]
    ]