(command.CommandList
  children: [
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:test_description spids:[12])
          op: Equal
          rhs: {(SQ <cd_to_toplevel>)}
          spids: [12]
        )
      ]
      spids: [12]
    )
    (C {(.)} {(./test-lib.sh)})
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:EXEC_PATH spids:[23])
          op: Equal
          rhs: 
            {
              (DQ 
                (word_part.CommandSubPart
                  command_list: (command.CommandList children:[(C {(git)} {(--exec-path)})])
                  left_token: <Left_CommandSub '$('>
                  spids: [25 29]
                )
              )
            }
          spids: [23]
        )
      ]
      spids: [23]
    )
    (command.AndOr
      ops: [Op_DPipe]
      children: [
        (C {(test_have_prereq)} {(KW_Bang '!') (MINGW)})
        (command.Case
          to_match: {(DQ ($ VSub_Name '$EXEC_PATH'))}
          arms: [
            (case_arm
              pat_list: [
                {(Lit_Other '[') (A-Za-z) (Lit_Other ']') (Lit_Other ':') (/) (Lit_Other '*')}
              ]
              action: [
                (command.Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (lhs_expr.LhsName name:EXEC_PATH spids:[56])
                      op: Equal
                      rhs: 
                        {
                          (DQ (/) 
                            (word_part.BracedVarSub
                              token: <VSub_Name EXEC_PATH>
                              suffix_op: (suffix_op.StringUnary op_id:VOp1_DPercent arg_word:{(':*')})
                              spids: [59 63]
                            ) 
                            (word_part.BracedVarSub
                              token: <VSub_Name EXEC_PATH>
                              suffix_op: (suffix_op.StringUnary op_id:VOp1_Pound arg_word:{('?:')})
                              spids: [64 68]
                            )
                          )
                        }
                      spids: [56]
                    )
                  ]
                  spids: [56]
                )
              ]
              spids: [47 53 72 16777215]
            )
          ]
          spids: [39 45 74]
        )
      ]
    )
    (command.FuncDef
      name: test_cd_to_toplevel
      body: 
        (command.BraceGroup
          children: [
            (C {(test_expect_success)} {($ VSub_Number '$3')} {(DQ ($ VSub_Number '$2'))} 
              {(SQ <'\n'> <'\t\t(\n'> <'\t\t\tcd '>) (DQ ("'") ($ VSub_Number '$1') ("'")) 
                (SQ <' &&\n'> <'\t\t\tPATH="$EXEC_PATH:$PATH" &&\n'> <'\t\t\t. git-sh-setup &&\n'> 
                  <'\t\t\tcd_to_toplevel &&\n'> <'\t\t\t[ "$(pwd -P)" = "$TOPLEVEL" ]\n'> <'\t\t)\n'> <'\t'>
                )
              }
            )
          ]
          spids: [82]
        )
      spids: [77 81]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:TOPLEVEL spids:[116])
          op: Equal
          rhs: 
            {
              (DQ 
                (word_part.CommandSubPart
                  command_list: (command.CommandList children:[(C {(pwd)} {(-P)})])
                  left_token: <Left_CommandSub '$('>
                  spids: [118 122]
                ) (/repo)
              )
            }
          spids: [116]
        )
      ]
      spids: [116]
    )
    (C {(mkdir)} {(-p)} {(repo/sub/dir)})
    (C {(mv)} {(.git)} {(repo/)})
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:SUBDIRECTORY_OK spids:[138])
          op: Equal
          rhs: {(1)}
          spids: [138]
        )
      ]
      spids: [138]
    )
    (C {(test_cd_to_toplevel)} {(repo)} {(SQ <'at physical root'>)})
    (C {(test_cd_to_toplevel)} {(repo/sub/dir)} {(SQ <'at physical subdir'>)})
    (command.SimpleCommand
      words: [{(ln)} {(-s)} {(repo)} {(symrepo)}]
      redirects: [(redir.Redir op:<Redir_Great '2>'> fd:2 arg_word:{(/dev/null)})]
    )
    (C {(test_cd_to_toplevel)} {(symrepo)} {(SQ <'at symbolic root'>)} {(SYMLINKS)})
    (command.SimpleCommand
      words: [{(ln)} {(-s)} {(repo/sub/dir)} {(subdir-link)}]
      redirects: [(redir.Redir op:<Redir_Great '2>'> fd:2 arg_word:{(/dev/null)})]
    )
    (C {(test_cd_to_toplevel)} {(subdir-link)} {(SQ <'at symbolic subdir'>)} {(SYMLINKS)})
    (C {(cd)} {(repo)})
    (command.SimpleCommand
      words: [{(ln)} {(-s)} {(sub/dir)} {(internal-link)}]
      redirects: [(redir.Redir op:<Redir_Great '2>'> fd:2 arg_word:{(/dev/null)})]
    )
    (C {(test_cd_to_toplevel)} {(internal-link)} {(SQ <'at internal symbolic subdir'>)} {(SYMLINKS)})
    (C {(test_done)})
  ]
)