(command.CommandList
  children: [
    (command.ShFunction
      name: test_set_editor
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:FAKE_EDITOR)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$1'))}
                  spids: [87]
                )
              ]
            )
            (C {(export)} {(FAKE_EDITOR)})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:EDITOR)
                  op: assign_op.Equal
                  rhs: {(SQ (Token id:Id.Lit_Chars val:'"$FAKE_EDITOR"' span_id:100))}
                  spids: [98]
                )
              ]
            )
            (C {(export)} {(EDITOR)})
          ]
        )
    )
    (command.ShFunction
      name: test_set_index_version
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:GIT_INDEX_VERSION)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$1'))}
                  spids: [119]
                )
              ]
            )
            (C {(export)} {(GIT_INDEX_VERSION)})
          ]
        )
    )
    (command.ShFunction
      name: test_decode_color
      body: 
        (command.BraceGroup
          children: [
            (C {(awk)} 
              {
                (SQ (Token id:Id.Lit_Chars val:'\n' span_id:143) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\tfunction name(n) {\n'
                    span_id: 144
                  ) (Token id:Id.Lit_Chars val:'\t\t\tif (n == 0) return "RESET";\n' span_id:145) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t\tif (n == 1) return "BOLD";\n'
                    span_id: 146
                  ) (Token id:Id.Lit_Chars val:'\t\t\tif (n == 30) return "BLACK";\n' span_id:147) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t\tif (n == 31) return "RED";\n'
                    span_id: 148
                  ) (Token id:Id.Lit_Chars val:'\t\t\tif (n == 32) return "GREEN";\n' span_id:149) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t\tif (n == 33) return "YELLOW";\n'
                    span_id: 150
                  ) (Token id:Id.Lit_Chars val:'\t\t\tif (n == 34) return "BLUE";\n' span_id:151) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t\tif (n == 35) return "MAGENTA";\n'
                    span_id: 152
                  ) (Token id:Id.Lit_Chars val:'\t\t\tif (n == 36) return "CYAN";\n' span_id:153) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t\tif (n == 37) return "WHITE";\n'
                    span_id: 154
                  ) (Token id:Id.Lit_Chars val:'\t\t\tif (n == 40) return "BLACK";\n' span_id:155) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t\tif (n == 41) return "BRED";\n'
                    span_id: 156
                  ) (Token id:Id.Lit_Chars val:'\t\t\tif (n == 42) return "BGREEN";\n' span_id:157) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t\tif (n == 43) return "BYELLOW";\n'
                    span_id: 158
                  ) (Token id:Id.Lit_Chars val:'\t\t\tif (n == 44) return "BBLUE";\n' span_id:159) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t\tif (n == 45) return "BMAGENTA";\n'
                    span_id: 160
                  ) (Token id:Id.Lit_Chars val:'\t\t\tif (n == 46) return "BCYAN";\n' span_id:161) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t\tif (n == 47) return "BWHITE";\n'
                    span_id: 162
                  ) (Token id:Id.Lit_Chars val:'\t\t}\n' span_id:163) (Token id:Id.Lit_Chars val:'\t\t{\n' span_id:164) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t\twhile (match($0, /\\033\\[[0-9;]*m/) != 0) {\n'
                    span_id: 165
                  ) (Token id:Id.Lit_Chars val:'\t\t\t\tprintf "%s<", substr($0, 1, RSTART-1);\n' span_id:166) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t\t\tcodes = substr($0, RSTART+2, RLENGTH-3);\n'
                    span_id: 167
                  ) (Token id:Id.Lit_Chars val:'\t\t\t\tif (length(codes) == 0)\n' span_id:168) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t\t\t\tprintf "%s", name(0)\n'
                    span_id: 169
                  ) (Token id:Id.Lit_Chars val:'\t\t\t\telse {\n' span_id:170) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t\t\t\tn = split(codes, ary, ";");\n'
                    span_id: 171
                  ) (Token id:Id.Lit_Chars val:'\t\t\t\t\tsep = "";\n' span_id:172) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t\t\t\tfor (i = 1; i <= n; i++) {\n'
                    span_id: 173
                  ) (Token id:Id.Lit_Chars val:'\t\t\t\t\t\tprintf "%s%s", sep, name(ary[i]);\n' span_id:174) 
                  (Token id:Id.Lit_Chars val:'\t\t\t\t\t\tsep = ";"\n' span_id:175) (Token id:Id.Lit_Chars val:'\t\t\t\t\t}\n' span_id:176) 
                  (Token id:Id.Lit_Chars val:'\t\t\t\t}\n' span_id:177) (Token id:Id.Lit_Chars val:'\t\t\t\tprintf ">";\n' span_id:178) 
                  (Token
                    id: Id.Lit_Chars
                    val: 
'\t\t\t\t$0 = substr($0, RSTART + RLENGTH, length($0) - RSTART - RLENGTH + 1);\n'
                    span_id: 179
                  ) (Token id:Id.Lit_Chars val:'\t\t\t}\n' span_id:180) 
                  (Token id:Id.Lit_Chars val:'\t\t\tprint\n' span_id:181) (Token id:Id.Lit_Chars val:'\t\t}\n' span_id:182) (Token id:Id.Lit_Chars val:'\t' span_id:183)
                )
              }
            )
          ]
        )
    )
    (command.ShFunction
      name: lf_to_nul
      body: 
        (command.BraceGroup
          children: [
            (C {(perl)} {(-pe)} {(SQ (Token id:Id.Lit_Chars val:'y/\\012/\\000/' span_id:202))})
          ]
        )
    )
    (command.ShFunction
      name: nul_to_q
      body: 
        (command.BraceGroup
          children: [(C {(perl)} {(-pe)} {(SQ (Token id:Id.Lit_Chars val:'y/\\000/Q/' span_id:221))})]
        )
    )
    (command.ShFunction
      name: q_to_nul
      body: 
        (command.BraceGroup
          children: [(C {(perl)} {(-pe)} {(SQ (Token id:Id.Lit_Chars val:'y/Q/\\000/' span_id:240))})]
        )
    )
    (command.ShFunction
      name: q_to_cr
      body: 
        (command.BraceGroup
          children: [(C {(tr)} {(Q)} {(SQ (Token id:Id.Lit_Chars val:'\\015' span_id:259))})]
        )
    )
    (command.ShFunction
      name: q_to_tab
      body: 
        (command.BraceGroup
          children: [(C {(tr)} {(Q)} {(SQ (Token id:Id.Lit_Chars val:'\\011' span_id:278))})]
        )
    )
    (command.ShFunction
      name: qz_to_tab_space
      body: 
        (command.BraceGroup
          children: [(C {(tr)} {(QZ)} {(SQ (Token id:Id.Lit_Chars val:'\\011\\040' span_id:297))})]
        )
    )
    (command.ShFunction
      name: append_cr
      body: 
        (command.BraceGroup
          children: [
            (command.Pipeline
              children: [
                (C {(sed)} {(-e)} {(SQ (Token id:Id.Lit_Chars val:'s/$/Q/' span_id:316))})
                (C {(tr)} {(Q)} {(SQ (Token id:Id.Lit_Chars val:'\\015' span_id:326))})
              ]
              negated: F
            )
          ]
        )
    )
    (command.ShFunction
      name: remove_cr
      body: 
        (command.BraceGroup
          children: [
            (command.Pipeline
              children: [
                (C {(tr)} {(SQ (Token id:Id.Lit_Chars val:'\\015' span_id:343))} {(Q)})
                (C {(sed)} {(-e)} {(SQ (Token id:Id.Lit_Chars val:'s/Q$//' span_id:355))})
              ]
              negated: F
            )
          ]
        )
    )
    (command.ShFunction
      name: sane_unset
      body: 
        (command.BraceGroup
          children: [
            (C {(unset)} {(DQ ($ Id.VSub_At '$@'))})
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Return val:return span_id:392)
              arg_word: {(0)}
            )
          ]
        )
    )
    (command.ShFunction
      name: test_tick
      body: 
        (command.BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (C {(test)} {(-z)} 
                      {
                        (DQ 
                          (braced_var_sub
                            token: (Token id:Id.VSub_Name val:test_tick span_id:415)
                            suffix_op: (suffix_op.Unary op_id:Id.VTest_Plus arg_word:{(set)})
                          )
                        )
                      }
                    )
                  ]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:test_tick)
                          op: assign_op.Equal
                          rhs: {(1112911993)}
                          spids: [425]
                        )
                      ]
                    )
                  ]
                  spids: [407 422]
                )
              ]
              else_action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:test_tick)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (word_part.ArithSub
                            anode: 
                              (arith_expr.Binary
                                op_id: Id.Arith_Plus
                                left: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$test_tick')})
                                right: (arith_expr.ArithWord w:{(Id.Lit_Digits 60)})
                              )
                          )
                        }
                      spids: [432]
                    )
                  ]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:GIT_COMMITTER_DATE)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_DollarName '$test_tick') (' -0700'))}
                  spids: [446]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:GIT_AUTHOR_DATE)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_DollarName '$test_tick') (' -0700'))}
                  spids: [453]
                )
              ]
            )
            (C {(export)} {(GIT_COMMITTER_DATE)} {(GIT_AUTHOR_DATE)})
          ]
        )
    )
    (command.ShFunction
      name: test_pause
      body: 
        (command.BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(test)} {(DQ ($ Id.VSub_DollarName '$verbose'))} {(Id.Lit_Equals '=')} {(t)})
                      terminator: (Token id:Id.Op_Semi val:';' span_id:501)
                    )
                  ]
                  action: [
                    (command.Simple
                      words: [{(DQ ($ Id.VSub_DollarName '$SHELL_PATH'))}]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_LessAnd val:'<&' span_id:510)
                          fd: -1
                          arg_word: {(6)}
                        )
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:513)
                          fd: -1
                          arg_word: {(3)}
                        )
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:516)
                          fd: 2
                          arg_word: {(4)}
                        )
                      ]
                    )
                  ]
                  spids: [490 503]
                )
              ]
              else_action: [
                (command.Simple
                  words: [{(error)} {(DQ ('test_pause requires --verbose'))}]
                  redirects: [
                    (redir.Redir
                      op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:525)
                      fd: -1
                      arg_word: {(5)}
                    )
                  ]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: debug
      body: 
        (command.BraceGroup
          children: [
            (command.Simple
              words: [{(DQ ($ Id.VSub_At '$@'))}]
              more_env: [(env_pair name:GIT_TEST_GDB val:{(1)} spids:[558])]
            )
          ]
        )
    )
    (command.ShFunction
      name: test_commit
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp]
              children: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:notick)
                      op: assign_op.Equal
                      rhs: (word.Empty)
                      spids: [595]
                    )
                  ]
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:signoff)
                      op: assign_op.Equal
                      rhs: (word.Empty)
                      spids: [600]
                    )
                  ]
                )
                (command.WhileUntil
                  keyword: (Token id:Id.KW_While val:while span_id:605)
                  cond: [
                    (C {(test)} {($ Id.VSub_Pound '$#')} {(Id.KW_Bang '!') (Id.Lit_Equals '=')} {(0)})
                  ]
                  body: 
                    (command.DoGroup
                      children: [
                        (command.Case
                          to_match: {(DQ ($ Id.VSub_Number '$1'))}
                          arms: [
                            (case_arm
                              pat_list: [{(--notick)}]
                              action: [
                                (command.ShAssignment
                                  pairs: [
                                    (assign_pair
                                      lhs: (sh_lhs_expr.Name name:notick)
                                      op: assign_op.Equal
                                      rhs: {(yes)}
                                      spids: [633]
                                    )
                                  ]
                                )
                              ]
                              spids: [629 630 637 -1]
                            )
                            (case_arm
                              pat_list: [{(--signoff)}]
                              action: [
                                (command.ShAssignment
                                  pairs: [
                                    (assign_pair
                                      lhs: (sh_lhs_expr.Name name:signoff)
                                      op: assign_op.Equal
                                      rhs: {(DQ ($ Id.VSub_Number '$1'))}
                                      spids: [644]
                                    )
                                  ]
                                )
                              ]
                              spids: [640 641 650 -1]
                            )
                            (case_arm
                              pat_list: [{(Id.Lit_Star '*')}]
                              action: [
                                (command.ControlFlow
                                  token: (Token id:Id.ControlFlow_Break val:break span_id:657)
                                )
                              ]
                              spids: [653 654 660 -1]
                            )
                          ]
                        )
                        (C {(shift)})
                      ]
                    )
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:file)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (braced_var_sub
                            token: (Token id:Id.VSub_Number val:2 span_id:676)
                            suffix_op: 
                              (suffix_op.Unary
                                op_id: Id.VTest_ColonHyphen
                                arg_word: {(DQ ($ Id.VSub_Number '$1') (.t))}
                              )
                          )
                        }
                      spids: [674]
                    )
                  ]
                )
                (command.Simple
                  words: [
                    {(echo)}
                    {
                      (DQ 
                        (braced_var_sub
                          token: (Token id:Id.VSub_Number val:3 span_id:691)
                          suffix_op: 
                            (suffix_op.Unary
                              op_id: Id.VTest_Hyphen
                              arg_word: {($ Id.VSub_Number '$1')}
                            )
                        )
                      )
                    }
                  ]
                  redirects: [
                    (redir.Redir
                      op: (Token id:Id.Redir_Great val:'>' span_id:697)
                      fd: -1
                      arg_word: {(DQ ($ Id.VSub_DollarName '$file'))}
                    )
                  ]
                )
                (C {(git)} {(add)} {(DQ ($ Id.VSub_DollarName '$file'))})
                (command.If
                  arms: [
                    (if_arm
                      cond: [(C {(test)} {(-z)} {(DQ ($ Id.VSub_DollarName '$notick'))})]
                      action: [(C {(test_tick)})]
                      spids: [717 728]
                    )
                  ]
                )
                (C {(git)} {(commit)} {($ Id.VSub_DollarName '$signoff')} {(-m)} 
                  {(DQ ($ Id.VSub_Number '$1'))}
                )
                (C {(git)} {(tag)} 
                  {
                    (DQ 
                      (braced_var_sub
                        token: (Token id:Id.VSub_Number val:4 span_id:760)
                        suffix_op: 
                          (suffix_op.Unary
                            op_id: Id.VTest_ColonHyphen
                            arg_word: {($ Id.VSub_Number '$1')}
                          )
                      )
                    )
                  }
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: test_merge
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DAmp]
              children: [
                (C {(test_tick)})
                (C {(git)} {(merge)} {(-m)} {(DQ ($ Id.VSub_Number '$1'))} {(DQ ($ Id.VSub_Number '$2'))})
                (C {(git)} {(tag)} {(DQ ($ Id.VSub_Number '$1'))})
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: test_chmod
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {(chmod)} {(DQ ($ Id.VSub_At '$@'))})
                (C {(git)} {(update-index)} {(--add)} {(DQ ('--chmod=') ($ Id.VSub_At '$@'))})
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: test_unconfig
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:config_dir)
                  op: assign_op.Equal
                  rhs: (word.Empty)
                  spids: [869]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [(C {(test)} {(DQ ($ Id.VSub_Number '$1'))} {(Id.Lit_Equals '=')} {(-C)})]
                  action: [
                    (C {(shift)})
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:config_dir)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_Number '$1')}
                          spids: [891]
                        )
                      ]
                    )
                    (C {(shift)})
                  ]
                  spids: [872 885]
                )
              ]
            )
            (C {(git)} 
              {
                (braced_var_sub
                  token: (Token id:Id.VSub_Name val:config_dir span_id:904)
                  suffix_op: 
                    (suffix_op.Unary
                      op_id: Id.VTest_ColonPlus
                      arg_word: {('-C ') (DQ ($ Id.VSub_DollarName '$config_dir'))}
                    )
                )
              } {(config)} {(--unset-all)} {(DQ ($ Id.VSub_At '$@'))}
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:config_status)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_QMark '$?')}
                  spids: [921]
                )
              ]
            )
            (command.Case
              to_match: {(DQ ($ Id.VSub_DollarName '$config_status'))}
              arms: [
                (case_arm
                  pat_list: [{(5)}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:config_status)
                          op: assign_op.Equal
                          rhs: {(0)}
                          spids: [941]
                        )
                      ]
                    )
                  ]
                  spids: [934 935 945 -1]
                )
              ]
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Return val:return span_id:951)
              arg_word: {($ Id.VSub_DollarName '$config_status')}
            )
          ]
        )
    )
    (command.ShFunction
      name: test_config
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:config_dir)
                  op: assign_op.Equal
                  rhs: (word.Empty)
                  spids: [969]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [(C {(test)} {(DQ ($ Id.VSub_Number '$1'))} {(Id.Lit_Equals '=')} {(-C)})]
                  action: [
                    (C {(shift)})
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:config_dir)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_Number '$1')}
                          spids: [991]
                        )
                      ]
                    )
                    (C {(shift)})
                  ]
                  spids: [972 985]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {(test_when_finished)} 
                  {
                    (DQ ('test_unconfig ') 
                      (braced_var_sub
                        token: (Token id:Id.VSub_Name val:config_dir span_id:1006)
                        suffix_op: 
                          (suffix_op.Unary
                            op_id: Id.VTest_ColonPlus
                            arg_word: {("-C '") ($ Id.VSub_DollarName '$config_dir') ("'")}
                          )
                      ) (" '") ($ Id.VSub_Number '$1') ("'")
                    )
                  }
                )
                (C {(git)} 
                  {
                    (braced_var_sub
                      token: (Token id:Id.VSub_Name val:config_dir span_id:1023)
                      suffix_op: 
                        (suffix_op.Unary
                          op_id: Id.VTest_ColonPlus
                          arg_word: {('-C ') (DQ ($ Id.VSub_DollarName '$config_dir'))}
                        )
                    )
                  } {(config)} {(DQ ($ Id.VSub_At '$@'))}
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: test_config_global
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {(test_when_finished)} 
                  {(DQ ("test_unconfig --global '") ($ Id.VSub_Number '$1') ("'"))}
                )
                (C {(git)} {(config)} {(--global)} {(DQ ($ Id.VSub_At '$@'))})
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: write_script
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (command.BraceGroup
                  children: [
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {(echo)} 
                          {
                            (DQ ('#!') 
                              (braced_var_sub
                                token: (Token id:Id.VSub_Number val:2 span_id:1088)
                                suffix_op: 
                                  (suffix_op.Unary
                                    op_id: Id.VTest_Hyphen
                                    arg_word: {(DQ ($ Id.VSub_DollarName '$SHELL_PATH'))}
                                  )
                              )
                            )
                          }
                        )
                        (C {(cat)})
                      ]
                    )
                  ]
                  redirects: [
                    (redir.Redir
                      op: (Token id:Id.Redir_Great val:'>' span_id:1104)
                      fd: -1
                      arg_word: {(DQ ($ Id.VSub_Number '$1'))}
                    )
                  ]
                )
                (C {(chmod)} {(Id.Lit_Other '+') (x)} {(DQ ($ Id.VSub_Number '$1'))})
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: test_set_prereq
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:satisfied_prereq)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_DollarName '$satisfied_prereq') ($ Id.VSub_Number '$1') (' '))}
                  spids: [1163]
                )
              ]
            )
          ]
        )
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:satisfied_prereq)
          op: assign_op.Equal
          rhs: {(DQ (' '))}
          spids: [1172]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:lazily_testable_prereq)
          op: assign_op.Equal
          rhs: (word.Empty)
          spids: [1177]
        )
        (assign_pair
          lhs: (sh_lhs_expr.Name name:lazily_tested_prereq)
          op: assign_op.Equal
          rhs: (word.Empty)
          spids: [1179]
        )
      ]
    )
    (command.ShFunction
      name: test_lazy_prereq
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:lazily_testable_prereq)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ ($ Id.VSub_DollarName '$lazily_testable_prereq') ($ Id.VSub_Number '$1') 
                        (' ')
                      )
                    }
                  spids: [1193]
                )
              ]
            )
            (C {(eval)} 
              {(test_prereq_lazily_) ($ Id.VSub_Number '$1') (Id.Lit_Equals '=') 
                (word_part.EscapedLiteral
                  token: (Token id:Id.Lit_EscapedChar val:'\\$' span_id:1206)
                ) (2)
              }
            )
          ]
        )
    )
    (command.ShFunction
      name: test_run_lazy_prereq_
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:script)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1222) 
                        (Token
                          id: Id.Lit_Chars
                          val: 'mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&\n'
                          span_id: 1223
                        ) (Token id:Id.Lit_Chars val:'(\n' span_id:1224) 
                        (Token
                          id: Id.Lit_Chars
                          val: '\tcd "$TRASH_DIRECTORY/prereq-test-dir" &&'
                          span_id: 1225
                        )
                      ) (DQ ($ Id.VSub_Number '$2')) 
                      (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1231) 
                        (Token id:Id.Lit_Chars val:')' span_id:1232)
                      )
                    }
                  spids: [1220]
                )
              ]
            )
            (command.Simple
              words: [{(say)} {(DQ ('checking prerequisite: ') ($ Id.VSub_Number '$1'))}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:1238)
                  fd: -1
                  arg_word: {(3)}
                )
              ]
            )
            (command.Simple
              words: [{(say)} {(DQ ($ Id.VSub_DollarName '$script'))}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:1249)
                  fd: -1
                  arg_word: {(3)}
                )
              ]
            )
            (C {(test_eval_)} {(DQ ($ Id.VSub_DollarName '$script'))})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:eval_ret)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_QMark '$?')}
                  spids: [1264]
                )
              ]
            )
            (C {(rm)} {(-rf)} {(DQ ($ Id.VSub_DollarName '$TRASH_DIRECTORY') (/prereq-test-dir))})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(test)} {(DQ ($ Id.VSub_DollarName '$eval_ret'))} {(Id.Lit_Equals '=')} {(0)})
                      terminator: (Token id:Id.Op_Semi val:';' span_id:1289)
                    )
                  ]
                  action: [
                    (command.Simple
                      words: [{(say)} {(DQ ('prerequisite ') ($ Id.VSub_Number '$1') (' ok'))}]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:1296)
                          fd: -1
                          arg_word: {(3)}
                        )
                      ]
                    )
                  ]
                  spids: [1278 1291]
                )
              ]
              else_action: [
                (command.Simple
                  words: [{(say)} {(DQ ('prerequisite ') ($ Id.VSub_Number '$1') (' not satisfied'))}]
                  redirects: [
                    (redir.Redir
                      op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:1311)
                      fd: -1
                      arg_word: {(3)}
                    )
                  ]
                )
              ]
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Return val:return span_id:1324)
              arg_word: {($ Id.VSub_DollarName '$eval_ret')}
            )
          ]
        )
    )
    (command.ShFunction
      name: test_have_prereq
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:save_IFS)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_DollarName '$IFS')}
                  spids: [1343]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:IFS)
                  op: assign_op.Equal
                  rhs: {(Id.Lit_Comma ',')}
                  spids: [1347]
                )
              ]
            )
            (C {(Id.KW_Set set)} {(--)} {($ Id.VSub_Star '$*')})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:IFS)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_DollarName '$save_IFS')}
                  spids: [1358]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:total_prereq)
                  op: assign_op.Equal
                  rhs: {(0)}
                  spids: [1363]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:ok_prereq)
                  op: assign_op.Equal
                  rhs: {(0)}
                  spids: [1367]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:missing_prereq)
                  op: assign_op.Equal
                  rhs: (word.Empty)
                  spids: [1371]
                )
              ]
            )
            (command.ForEach
              iter_name: prerequisite
              do_arg_iter: T
              body: 
                (command.DoGroup
                  children: [
                    (command.Case
                      to_match: {(DQ ($ Id.VSub_DollarName '$prerequisite'))}
                      arms: [
                        (case_arm
                          pat_list: [{(Id.KW_Bang '!') (Id.Lit_Star '*')}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:negative_prereq)
                                  op: assign_op.Equal
                                  rhs: {(t)}
                                  spids: [1397]
                                )
                              ]
                            )
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:prerequisite)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (braced_var_sub
                                        token: (Token id:Id.VSub_Name val:prerequisite span_id:1403)
                                        suffix_op: 
                                          (suffix_op.Unary
                                            op_id: Id.VOp1_Pound
                                            arg_word: {('!')}
                                          )
                                      )
                                    }
                                  spids: [1401]
                                )
                              ]
                            )
                          ]
                          spids: [1392 1394 1409 -1]
                        )
                        (case_arm
                          pat_list: [{(Id.Lit_Star '*')}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:negative_prereq)
                                  op: assign_op.Equal
                                  rhs: (word.Empty)
                                  spids: [1416]
                                )
                              ]
                            )
                          ]
                          spids: [1412 1413 -1 1419]
                        )
                      ]
                    )
                    (command.Case
                      to_match: {(DQ (' ') ($ Id.VSub_DollarName '$lazily_tested_prereq') (' '))}
                      arms: [
                        (case_arm
                          pat_list: [
                            {(Id.Lit_Star '*') (DQ (' ') ($ Id.VSub_DollarName '$prerequisite') (' ')) 
                              (Id.Lit_Star '*')
                            }
                          ]
                          spids: [1434 1441 1444 -1]
                        )
                        (case_arm
                          pat_list: [{(Id.Lit_Star '*')}]
                          action: [
                            (command.Case
                              to_match: 
                                {(DQ (' ') ($ Id.VSub_DollarName '$lazily_testable_prereq') (' '))}
                              arms: [
                                (case_arm
                                  pat_list: [
                                    {(Id.Lit_Star '*') 
                                      (DQ (' ') ($ Id.VSub_DollarName '$prerequisite') (' ')) (Id.Lit_Star '*')
                                    }
                                  ]
                                  action: [
                                    (command.AndOr
                                      ops: [Id.Op_DAmp]
                                      children: [
                                        (C {(eval)} 
                                          {
                                            (DQ ('script=') 
                                              (word_part.EscapedLiteral
                                                token: 
                                                  (Token
                                                    id: Id.Lit_EscapedChar
                                                    val: '\\$'
                                                    span_id: 1476
                                                  )
                                              ) (test_prereq_lazily_) ($ Id.VSub_DollarName '$prerequisite')
                                            )
                                          }
                                        )
                                        (command.If
                                          arms: [
                                            (if_arm
                                              cond: [
                                                (C {(test_run_lazy_prereq_)} 
                                                  {(DQ ($ Id.VSub_DollarName '$prerequisite'))} {(DQ ($ Id.VSub_DollarName '$script'))}
                                                )
                                              ]
                                              action: [
                                                (C {(test_set_prereq)} 
                                                  {($ Id.VSub_DollarName '$prerequisite')}
                                                )
                                              ]
                                              spids: [1484 1497]
                                            )
                                          ]
                                        )
                                      ]
                                    )
                                    (command.ShAssignment
                                      pairs: [
                                        (assign_pair
                                          lhs: (sh_lhs_expr.Name name:lazily_tested_prereq)
                                          op: assign_op.Equal
                                          rhs: 
                                            {
                                              (DQ ($ Id.VSub_DollarName '$lazily_tested_prereq') 
                                                ($ Id.VSub_DollarName '$prerequisite') (' ')
                                              )
                                            }
                                          spids: [1508]
                                        )
                                      ]
                                    )
                                  ]
                                  spids: [1462 1469 -1 1516]
                                )
                              ]
                            )
                          ]
                          spids: [1447 1448 1519 -1]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:total_prereq)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (word_part.ArithSub
                                anode: 
                                  (arith_expr.Binary
                                    op_id: Id.Arith_Plus
                                    left: 
                                      (arith_expr.ArithWord
                                        w: {($ Id.VSub_DollarName '$total_prereq')}
                                      )
                                    right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)})
                                  )
                              )
                            }
                          spids: [1526]
                        )
                      ]
                    )
                    (command.Case
                      to_match: {(DQ ($ Id.VSub_DollarName '$satisfied_prereq'))}
                      arms: [
                        (case_arm
                          pat_list: [
                            {(Id.Lit_Star '*') (DQ (' ') ($ Id.VSub_DollarName '$prerequisite') (' ')) 
                              (Id.Lit_Star '*')
                            }
                          ]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:satisfied_this_prereq)
                                  op: assign_op.Equal
                                  rhs: {(t)}
                                  spids: [1556]
                                )
                              ]
                            )
                          ]
                          spids: [1546 1553 1560 -1]
                        )
                        (case_arm
                          pat_list: [{(Id.Lit_Star '*')}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:satisfied_this_prereq)
                                  op: assign_op.Equal
                                  rhs: (word.Empty)
                                  spids: [1567]
                                )
                              ]
                            )
                          ]
                          spids: [1563 1564 -1 1570]
                        )
                      ]
                    )
                    (command.Case
                      to_match: 
                        {
                          (DQ ($ Id.VSub_DollarName '$satisfied_this_prereq') (',') 
                            ($ Id.VSub_DollarName '$negative_prereq')
                          )
                        }
                      arms: [
                        (case_arm
                          pat_list: [{(t) (Id.Lit_Comma ',')} {(Id.Lit_Comma ',') (t)}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:ok_prereq)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (word_part.ArithSub
                                        anode: 
                                          (arith_expr.Binary
                                            op_id: Id.Arith_Plus
                                            left: 
                                              (arith_expr.ArithWord
                                                w: {($ Id.VSub_DollarName '$ok_prereq')}
                                              )
                                            right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)})
                                          )
                                      )
                                    }
                                  spids: [1593]
                                )
                              ]
                            )
                          ]
                          spids: [1585 1590 1604 -1]
                        )
                        (case_arm
                          pat_list: [{(Id.Lit_Star '*')}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:prerequisite)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (braced_var_sub
                                        token: 
                                          (Token
                                            id: Id.VSub_Name
                                            val: negative_prereq
                                            span_id: 1621
                                          )
                                        suffix_op: 
                                          (suffix_op.Unary
                                            op_id: Id.VTest_ColonPlus
                                            arg_word: {('!')}
                                          )
                                      ) ($ Id.VSub_DollarName '$prerequisite')
                                    }
                                  spids: [1619]
                                )
                              ]
                            )
                            (command.If
                              arms: [
                                (if_arm
                                  cond: [
                                    (C {(test)} {(-z)} {(DQ ($ Id.VSub_DollarName '$missing_prereq'))})
                                  ]
                                  action: [
                                    (command.ShAssignment
                                      pairs: [
                                        (assign_pair
                                          lhs: (sh_lhs_expr.Name name:missing_prereq)
                                          op: assign_op.Equal
                                          rhs: {($ Id.VSub_DollarName '$prerequisite')}
                                          spids: [1642]
                                        )
                                      ]
                                    )
                                  ]
                                  spids: [1628 1639]
                                )
                              ]
                              else_action: [
                                (command.ShAssignment
                                  pairs: [
                                    (assign_pair
                                      lhs: (sh_lhs_expr.Name name:missing_prereq)
                                      op: assign_op.Equal
                                      rhs: 
                                        {
                                          (DQ ($ Id.VSub_DollarName '$prerequisite') (',') 
                                            ($ Id.VSub_DollarName '$missing_prereq')
                                          )
                                        }
                                      spids: [1649]
                                    )
                                  ]
                                )
                              ]
                            )
                          ]
                          spids: [1607 1608 -1 1660]
                        )
                      ]
                    )
                  ]
                )
            )
            (C {(test)} {($ Id.VSub_DollarName '$total_prereq')} {(Id.Lit_Equals '=')} 
              {($ Id.VSub_DollarName '$ok_prereq')}
            )
          ]
        )
    )
    (command.ShFunction
      name: test_declared_prereq
      body: 
        (command.BraceGroup
          children: [
            (command.Case
              to_match: {(DQ (',') ($ Id.VSub_DollarName '$test_prereq') (','))}
              arms: [
                (case_arm
                  pat_list: [
                    {(Id.Lit_Star '*') (Id.Lit_Comma ',') ($ Id.VSub_Number '$1') (Id.Lit_Comma ',') 
                      (Id.Lit_Star '*')
                    }
                  ]
                  action: [
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:1705)
                      arg_word: {(0)}
                    )
                  ]
                  spids: [1697 1702 1710 -1]
                )
              ]
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Return val:return span_id:1716)
              arg_word: {(1)}
            )
          ]
        )
    )
    (command.ShFunction
      name: test_verify_prereq
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DPipe Id.Op_DPipe]
              children: [
                (C {(test)} {(-z)} {(DQ ($ Id.VSub_DollarName '$test_prereq'))})
                (command.Simple
                  words: [
                    {(expr)}
                    {(DQ ($ Id.VSub_DollarName '$test_prereq'))}
                    {(Id.Lit_Other ':')}
                    {(SQ (Token id:Id.Lit_Chars val:'[A-Z0-9_,!]*$' span_id:1754))}
                  ]
                  redirects: [
                    (redir.Redir
                      op: (Token id:Id.Redir_Great val:'>' span_id:1744)
                      fd: -1
                      arg_word: {(/dev/null)}
                    )
                  ]
                )
                (C {(error)} 
                  {
                    (DQ ("bug in the test script: '") ($ Id.VSub_DollarName '$test_prereq') 
                      ("' does not look like a prereq")
                    )
                  }
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: test_expect_failure
      body: 
        (command.BraceGroup
          children: [
            (C {(test_start_)})
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DPipe]
              children: [
                (C {(test)} {(DQ ($ Id.VSub_Pound '$#'))} {(Id.Lit_Equals '=')} {(3)})
                (command.BraceGroup
                  children: [
                    (command.Sentence
                      child: 
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:test_prereq)
                              op: assign_op.Equal
                              rhs: {($ Id.VSub_Number '$1')}
                              spids: [1796]
                            )
                          ]
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:1798)
                    )
                    (command.Sentence
                      child: (C {(shift)})
                      terminator: (Token id:Id.Op_Semi val:';' span_id:1801)
                    )
                  ]
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:test_prereq)
                      op: assign_op.Equal
                      rhs: (word.Empty)
                      spids: [1807]
                    )
                  ]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {(test)} {(DQ ($ Id.VSub_Pound '$#'))} {(Id.Lit_Equals '=')} {(2)})
                (C {(error)} 
                  {(DQ ('bug in the test script: not 2 or 3 parameters to test-expect-failure'))}
                )
              ]
            )
            (C {(test_verify_prereq)})
            (C {(export)} {(test_prereq)})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Pipeline
                      children: [(C {(test_skip)} {(DQ ($ Id.VSub_At '$@'))})]
                      negated: T
                    )
                  ]
                  action: [
                    (command.Simple
                      words: [{(say)} {(DQ ('checking known breakage: ') ($ Id.VSub_Number '$2'))}]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:1854)
                          fd: -1
                          arg_word: {(3)}
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [(C {(test_run_)} {(DQ ($ Id.VSub_Number '$2'))} {(expecting_failure)})]
                          action: [(C {(test_known_broken_ok_)} {(DQ ($ Id.VSub_Number '$1'))})]
                          spids: [1863 1874]
                        )
                      ]
                      else_action: [(C {(test_known_broken_failure_)} {(DQ ($ Id.VSub_Number '$1'))})]
                    )
                  ]
                  spids: [1838 1849]
                )
              ]
            )
            (C {(test_finish_)})
          ]
        )
    )
    (command.ShFunction
      name: test_expect_success
      body: 
        (command.BraceGroup
          children: [
            (C {(test_start_)})
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DPipe]
              children: [
                (C {(test)} {(DQ ($ Id.VSub_Pound '$#'))} {(Id.Lit_Equals '=')} {(3)})
                (command.BraceGroup
                  children: [
                    (command.Sentence
                      child: 
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:test_prereq)
                              op: assign_op.Equal
                              rhs: {($ Id.VSub_Number '$1')}
                              spids: [1930]
                            )
                          ]
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:1932)
                    )
                    (command.Sentence
                      child: (C {(shift)})
                      terminator: (Token id:Id.Op_Semi val:';' span_id:1935)
                    )
                  ]
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:test_prereq)
                      op: assign_op.Equal
                      rhs: (word.Empty)
                      spids: [1941]
                    )
                  ]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {(test)} {(DQ ($ Id.VSub_Pound '$#'))} {(Id.Lit_Equals '=')} {(2)})
                (C {(error)} 
                  {(DQ ('bug in the test script: not 2 or 3 parameters to test-expect-success'))}
                )
              ]
            )
            (C {(test_verify_prereq)})
            (C {(export)} {(test_prereq)})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Pipeline
                      children: [(C {(test_skip)} {(DQ ($ Id.VSub_At '$@'))})]
                      negated: T
                    )
                  ]
                  action: [
                    (command.Simple
                      words: [{(say)} {(DQ ('expecting success: ') ($ Id.VSub_Number '$2'))}]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:1988)
                          fd: -1
                          arg_word: {(3)}
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [(C {(test_run_)} {(DQ ($ Id.VSub_Number '$2'))})]
                          action: [(C {(test_ok_)} {(DQ ($ Id.VSub_Number '$1'))})]
                          spids: [1997 2006]
                        )
                      ]
                      else_action: [(C {(test_failure_)} {(DQ ($ Id.VSub_At '$@'))})]
                    )
                  ]
                  spids: [1972 1983]
                )
              ]
            )
            (C {(test_finish_)})
          ]
        )
    )
    (command.ShFunction
      name: test_external
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DPipe]
              children: [
                (C {(test)} {(DQ ($ Id.VSub_Pound '$#'))} {(Id.Lit_Equals '=')} {(4)})
                (command.BraceGroup
                  children: [
                    (command.Sentence
                      child: 
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:test_prereq)
                              op: assign_op.Equal
                              rhs: {($ Id.VSub_Number '$1')}
                              spids: [2083]
                            )
                          ]
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:2085)
                    )
                    (command.Sentence
                      child: (C {(shift)})
                      terminator: (Token id:Id.Op_Semi val:';' span_id:2088)
                    )
                  ]
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:test_prereq)
                      op: assign_op.Equal
                      rhs: (word.Empty)
                      spids: [2094]
                    )
                  ]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {(test)} {(DQ ($ Id.VSub_Pound '$#'))} {(Id.Lit_Equals '=')} {(3)})
                (command.Simple
                  words: [
                    {(error)}
                    {(DQ ('bug in the test script: not 3 or 4 parameters to test_external'))}
                  ]
                  redirects: [
                    (redir.Redir
                      op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:2112)
                      fd: -1
                      arg_word: {(5)}
                    )
                  ]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:descr)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$1'))}
                  spids: [2120]
                )
              ]
            )
            (C {(shift)})
            (C {(test_verify_prereq)})
            (C {(export)} {(test_prereq)})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Pipeline
                      children: [
                        (C {(test_skip)} {(DQ ($ Id.VSub_DollarName '$descr'))} 
                          {(DQ ($ Id.VSub_At '$@'))}
                        )
                      ]
                      negated: T
                    )
                  ]
                  action: [
                    (C {(say_color)} {(DQ )} 
                      {
                        (DQ ('# run ') ($ Id.VSub_DollarName '$test_count') (': ') 
                          ($ Id.VSub_DollarName '$descr') (' (') ($ Id.VSub_Star '$*') (')')
                        )
                      }
                    )
                    (C {(export)} {(TEST_DIRECTORY)} {(TRASH_DIRECTORY)} {(GIT_TEST_LONG)})
                    (command.Simple
                      words: [{(DQ ($ Id.VSub_At '$@'))}]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:2212)
                          fd: 2
                          arg_word: {(4)}
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [(C {(test)} {(DQ ($ Id.VSub_QMark '$?'))} {(Id.Lit_Equals '=')} {(0)})]
                          action: [
                            (command.If
                              arms: [
                                (if_arm
                                  cond: [
                                    (command.Sentence
                                      child: 
                                        (C {(test)} {($ Id.VSub_DollarName '$test_external_has_tap')} 
                                          {(-eq)} {(0)}
                                        )
                                      terminator: (Token id:Id.Op_Semi val:';' span_id:2241)
                                    )
                                  ]
                                  action: [(C {(test_ok_)} {(DQ ($ Id.VSub_DollarName '$descr'))})]
                                  spids: [2232 2243]
                                )
                              ]
                              else_action: [
                                (C {(say_color)} {(DQ )} 
                                  {
                                    (DQ ('# test_external test ') ($ Id.VSub_DollarName '$descr') 
                                      (' was ok')
                                    )
                                  }
                                )
                                (command.ShAssignment
                                  pairs: [
                                    (assign_pair
                                      lhs: (sh_lhs_expr.Name name:test_success)
                                      op: assign_op.Equal
                                      rhs: 
                                        {
                                          (word_part.ArithSub
                                            anode: 
                                              (arith_expr.Binary
                                                op_id: Id.Arith_Plus
                                                left: 
                                                  (arith_expr.ArithWord
                                                    w: {($ Id.VSub_DollarName '$test_success')}
                                                  )
                                                right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)})
                                              )
                                          )
                                        }
                                      spids: [2268]
                                    )
                                  ]
                                )
                              ]
                            )
                          ]
                          spids: [2216 2229]
                        )
                      ]
                      else_action: [
                        (command.If
                          arms: [
                            (if_arm
                              cond: [
                                (command.Sentence
                                  child: 
                                    (C {(test)} {($ Id.VSub_DollarName '$test_external_has_tap')} 
                                      {(-eq)} {(0)}
                                    )
                                  terminator: (Token id:Id.Op_Semi val:';' span_id:2294)
                                )
                              ]
                              action: [
                                (C {(test_failure_)} {(DQ ($ Id.VSub_DollarName '$descr'))} 
                                  {(DQ ($ Id.VSub_At '$@'))}
                                )
                              ]
                              spids: [2285 2296]
                            )
                          ]
                          else_action: [
                            (C {(say_color)} {(error)} 
                              {
                                (DQ ('# test_external test ') ($ Id.VSub_DollarName '$descr') 
                                  (' failed: ') ($ Id.VSub_At '$@')
                                )
                              }
                            )
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:test_failure)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (word_part.ArithSub
                                        anode: 
                                          (arith_expr.Binary
                                            op_id: Id.Arith_Plus
                                            left: 
                                              (arith_expr.ArithWord
                                                w: {($ Id.VSub_DollarName '$test_failure')}
                                              )
                                            right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)})
                                          )
                                      )
                                    }
                                  spids: [2325]
                                )
                              ]
                            )
                          ]
                        )
                      ]
                    )
                  ]
                  spids: [2137 2152]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: test_external_without_stderr
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:tmp)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (braced_var_sub
                        token: (Token id:Id.VSub_Name val:TMPDIR span_id:2371)
                        suffix_op: 
                          (suffix_op.Unary
                            op_id: Id.VTest_ColonHyphen
                            arg_word: {(Id.Lit_Slash /) (tmp)}
                          )
                      )
                    }
                  spids: [2369]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:stderr)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ ($ Id.VSub_DollarName '$tmp') (/git-external-stderr.) ($ Id.VSub_Dollar '$$') 
                        (.tmp)
                      )
                    }
                  spids: [2378]
                )
              ]
            )
            (command.Simple
              words: [{(test_external)} {(DQ ($ Id.VSub_At '$@'))}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_Great val:'4>' span_id:2393)
                  fd: 4
                  arg_word: {(DQ ($ Id.VSub_DollarName '$stderr'))}
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {(test)} {(-f)} {(DQ ($ Id.VSub_DollarName '$stderr'))})
                (C {(error)} 
                  {(DQ ('Internal error: ') ($ Id.VSub_DollarName '$stderr') (' disappeared.'))}
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:descr)
                  op: assign_op.Equal
                  rhs: {(DQ ('no stderr: ') ($ Id.VSub_Number '$1'))}
                  spids: [2419]
                )
              ]
            )
            (C {(shift)})
            (command.Simple
              words: [{(say)} {(DQ ('# expecting no stderr from previous command'))}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:2431)
                  fd: -1
                  arg_word: {(3)}
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [(C {(test)} {(Id.KW_Bang '!')} {(-s)} {(DQ ($ Id.VSub_DollarName '$stderr'))})]
                  action: [
                    (C {(rm)} {(DQ ($ Id.VSub_DollarName '$stderr'))})
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {(test)} {($ Id.VSub_DollarName '$test_external_has_tap')} {(-eq)} 
                                  {(0)}
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:2472)
                            )
                          ]
                          action: [(C {(test_ok_)} {(DQ ($ Id.VSub_DollarName '$descr'))})]
                          spids: [2463 2474]
                        )
                      ]
                      else_action: [
                        (C {(say_color)} {(DQ )} 
                          {
                            (DQ ('# test_external_without_stderr test ') 
                              ($ Id.VSub_DollarName '$descr') (' was ok')
                            )
                          }
                        )
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:test_success)
                              op: assign_op.Equal
                              rhs: 
                                {
                                  (word_part.ArithSub
                                    anode: 
                                      (arith_expr.Binary
                                        op_id: Id.Arith_Plus
                                        left: 
                                          (arith_expr.ArithWord
                                            w: {($ Id.VSub_DollarName '$test_success')}
                                          )
                                        right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)})
                                      )
                                  )
                                }
                              spids: [2499]
                            )
                          ]
                        )
                      ]
                    )
                  ]
                  spids: [2439 2452]
                )
              ]
              else_action: [
                (command.If
                  arms: [
                    (if_arm
                      cond: [
                        (C {(test)} {(DQ ($ Id.VSub_DollarName '$verbose'))} {(Id.Lit_Equals '=')} {(t)})
                      ]
                      action: [
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:output)
                              op: assign_op.Equal
                              rhs: 
                                {
                                  (command_sub
                                    left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2533)
                                    command_list: 
                                      (command.CommandList
                                        children: [
                                          (command.Sentence
                                            child: (C {(echo)})
                                            terminator: (Token id:Id.Op_Semi val:';' span_id:2535)
                                          )
                                          (command.Sentence
                                            child: (C {(echo)} {(DQ ('# Stderr is:'))})
                                            terminator: (Token id:Id.Op_Semi val:';' span_id:2542)
                                          )
                                          (C {(cat)} {(DQ ($ Id.VSub_DollarName '$stderr'))})
                                        ]
                                      )
                                  )
                                }
                              spids: [2532]
                            )
                          ]
                        )
                      ]
                      spids: [2516 2529]
                    )
                  ]
                  else_action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:output)
                          op: assign_op.Equal
                          rhs: (word.Empty)
                          spids: [2555]
                        )
                      ]
                    )
                  ]
                )
                (C {(rm)} {(DQ ($ Id.VSub_DollarName '$stderr'))})
                (command.If
                  arms: [
                    (if_arm
                      cond: [
                        (command.Sentence
                          child: 
                            (C {(test)} {($ Id.VSub_DollarName '$test_external_has_tap')} {(-eq)} {(0)})
                          terminator: (Token id:Id.Op_Semi val:';' span_id:2581)
                        )
                      ]
                      action: [
                        (C {(test_failure_)} {(DQ ($ Id.VSub_DollarName '$descr'))} 
                          {(DQ ($ Id.VSub_At '$@'))} {(DQ ($ Id.VSub_DollarName '$output'))}
                        )
                      ]
                      spids: [2572 2583]
                    )
                  ]
                  else_action: [
                    (C {(say_color)} {(error)} 
                      {
                        (DQ ('# test_external_without_stderr test ') ($ Id.VSub_DollarName '$descr') 
                          (' failed: ') ($ Id.VSub_At '$@') (': ') ($ Id.VSub_DollarName '$output')
                        )
                      }
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:test_failure)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (word_part.ArithSub
                                anode: 
                                  (arith_expr.Binary
                                    op_id: Id.Arith_Plus
                                    left: 
                                      (arith_expr.ArithWord
                                        w: {($ Id.VSub_DollarName '$test_failure')}
                                      )
                                    right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)})
                                  )
                              )
                            }
                          spids: [2618]
                        )
                      ]
                    )
                  ]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: test_path_is_file
      body: 
        (command.BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Pipeline
                      children: [(C {(test)} {(-f)} {(DQ ($ Id.VSub_Number '$1'))})]
                      negated: T
                    )
                  ]
                  action: [
                    (C {(echo)} 
                      {
                        (DQ ('File ') ($ Id.VSub_Number '$1') (" doesn't exist. ") 
                          ($ Id.VSub_Number '$2')
                        )
                      }
                    )
                    (C {(false)})
                  ]
                  spids: [2654 2667]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: test_path_is_dir
      body: 
        (command.BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Pipeline
                      children: [(C {(test)} {(-d)} {(DQ ($ Id.VSub_Number '$1'))})]
                      negated: T
                    )
                  ]
                  action: [
                    (C {(echo)} 
                      {
                        (DQ ('Directory ') ($ Id.VSub_Number '$1') (" doesn't exist. ") 
                          ($ Id.VSub_Number '$2')
                        )
                      }
                    )
                    (C {(false)})
                  ]
                  spids: [2696 2709]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: test_dir_is_empty
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {(test_path_is_dir)} {(DQ ($ Id.VSub_Number '$1'))})
                (command.If
                  arms: [
                    (if_arm
                      cond: [
                        (C {(test)} {(-n)} 
                          {
                            (DQ 
                              (command_sub
                                left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2757)
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (command.Pipeline
                                        children: [
                                          (C {(ls)} {(-a1)} {(DQ ($ Id.VSub_Number '$1'))})
                                          (C {(egrep)} {(-v)} 
                                            {
                                              (SQ 
                                                (Token
                                                  id: Id.Lit_Chars
                                                  val: '^\\.\\.?$'
                                                  span_id: 2773
                                                )
                                              )
                                            }
                                          )
                                        ]
                                        negated: F
                                      )
                                    ]
                                  )
                              )
                            )
                          }
                        )
                      ]
                      action: [
                        (C {(echo)} 
                          {
                            (DQ ("Directory '") ($ Id.VSub_Number '$1') 
                              ("' is not empty, it contains:")
                            )
                          }
                        )
                        (C {(ls)} {(-la)} {(DQ ($ Id.VSub_Number '$1'))})
                        (command.ControlFlow
                          token: (Token id:Id.ControlFlow_Return val:return span_id:2800)
                          arg_word: {(1)}
                        )
                      ]
                      spids: [2750 2779]
                    )
                  ]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: test_path_is_missing
      body: 
        (command.BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: [(C {(test)} {(-e)} {(DQ ($ Id.VSub_Number '$1'))})]
                  action: [
                    (C {(echo)} {(DQ ('Path exists:'))})
                    (C {(ls)} {(-ld)} {(DQ ($ Id.VSub_Number '$1'))})
                    (command.If
                      arms: [
                        (if_arm
                          cond: [(C {(test)} {($ Id.VSub_Pound '$#')} {(-ge)} {(1)})]
                          action: [(C {(echo)} {(DQ ($ Id.VSub_Star '$*'))})]
                          spids: [2848 2859]
                        )
                      ]
                    )
                    (C {(false)})
                  ]
                  spids: [2818 2829]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: test_line_count
      body: 
        (command.BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (C {(test)} {($ Id.VSub_Pound '$#')} {(Id.KW_Bang '!') (Id.Lit_Equals '=')} {(3)})
                  ]
                  action: [
                    (C {(error)} {(DQ ('bug in the test script: not 3 parameters to test_line_count'))})
                  ]
                  spids: [2919 2931]
                )
                (if_arm
                  cond: [
                    (command.Pipeline
                      children: [
                        (C {(test)} 
                          {
                            (command_sub
                              left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2947)
                              command_list: 
                                (command.CommandList
                                  children: [
                                    (command.Simple
                                      words: [{(wc)} {(-l)}]
                                      redirects: [
                                        (redir.Redir
                                          op: (Token id:Id.Redir_Less val:'<' span_id:2952)
                                          fd: -1
                                          arg_word: {(DQ ($ Id.VSub_Number '$3'))}
                                        )
                                      ]
                                    )
                                  ]
                                )
                            )
                          } {(DQ ($ Id.VSub_Number '$1'))} {(DQ ($ Id.VSub_Number '$2'))}
                        )
                      ]
                      negated: T
                    )
                  ]
                  action: [
                    (C {(echo)} 
                      {
                        (DQ ('test_line_count: line count for ') ($ Id.VSub_Number '$3') (' !') 
                          ($ Id.VSub_Number '$1') (' ') ($ Id.VSub_Number '$2')
                        )
                      }
                    )
                    (C {(cat)} {(DQ ($ Id.VSub_Number '$3'))})
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:2989)
                      arg_word: {(1)}
                    )
                  ]
                  spids: [2941 2967]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: list_contains
      body: 
        (command.BraceGroup
          children: [
            (command.Case
              to_match: {(DQ (',') ($ Id.VSub_Number '$1') (','))}
              arms: [
                (case_arm
                  pat_list: [
                    {(Id.Lit_Star '*') (Id.Lit_Comma ',') ($ Id.VSub_Number '$2') (Id.Lit_Comma ',') 
                      (Id.Lit_Star '*')
                    }
                  ]
                  action: [
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:3042)
                      arg_word: {(0)}
                    )
                  ]
                  spids: [3034 3039 3047 -1]
                )
              ]
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Return val:return span_id:3053)
              arg_word: {(1)}
            )
          ]
        )
    )
    (command.ShFunction
      name: test_must_fail
      body: 
        (command.BraceGroup
          children: [
            (command.Case
              to_match: {(DQ ($ Id.VSub_Number '$1'))}
              arms: [
                (case_arm
                  pat_list: [{(Id.Lit_VarLike 'ok=') (Id.Lit_Star '*')}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:_test_ok)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (braced_var_sub
                                token: (Token id:Id.VSub_Number val:1 span_id:3118)
                                suffix_op: (suffix_op.Unary op_id:Id.VOp1_Pound arg_word:{('ok=')})
                              )
                            }
                          spids: [3116]
                        )
                      ]
                    )
                    (C {(shift)})
                  ]
                  spids: [3111 3113 3127 -1]
                )
                (case_arm
                  pat_list: [{(Id.Lit_Star '*')}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:_test_ok)
                          op: assign_op.Equal
                          rhs: (word.Empty)
                          spids: [3134]
                        )
                      ]
                    )
                  ]
                  spids: [3130 3131 3137 -1]
                )
              ]
            )
            (C {(DQ ($ Id.VSub_At '$@'))})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:exit_code)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_QMark '$?')}
                  spids: [3148]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {(test)} {($ Id.VSub_DollarName '$exit_code')} {(-eq)} {(0)})
                        (command.Pipeline
                          children: [
                            (C {(list_contains)} {(DQ ($ Id.VSub_DollarName '$_test_ok'))} {(success)})
                          ]
                          negated: T
                        )
                      ]
                    )
                  ]
                  action: [
                    (command.Simple
                      words: [
                        {(echo)}
                        {(DQ ('test_must_fail: command succeeded: ') ($ Id.VSub_Star '$*'))}
                      ]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:3180)
                          fd: -1
                          arg_word: {(2)}
                        )
                      ]
                    )
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:3189)
                      arg_word: {(1)}
                    )
                  ]
                  spids: [3152 3175]
                )
                (if_arm
                  cond: [
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {(test_match_signal)} {(13)} {($ Id.VSub_DollarName '$exit_code')})
                        (C {(list_contains)} {(DQ ($ Id.VSub_DollarName '$_test_ok'))} {(sigpipe)})
                      ]
                    )
                  ]
                  action: [
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:3216)
                      arg_word: {(0)}
                    )
                  ]
                  spids: [3194 3213]
                )
                (if_arm
                  cond: [
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {(test)} {($ Id.VSub_DollarName '$exit_code')} {(-gt)} {(129)})
                        (C {(test)} {($ Id.VSub_DollarName '$exit_code')} {(-le)} {(192)})
                      ]
                    )
                  ]
                  action: [
                    (command.Simple
                      words: [
                        {(echo)}
                        {
                          (DQ ('test_must_fail: died by signal ') 
                            (word_part.ArithSub
                              anode: 
                                (arith_expr.Binary
                                  op_id: Id.Arith_Minus
                                  left: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$exit_code')})
                                  right: (arith_expr.ArithWord w:{(Id.Lit_Digits 128)})
                                )
                            ) (': ') ($ Id.VSub_Star '$*')
                          )
                        }
                      ]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:3247)
                          fd: -1
                          arg_word: {(2)}
                        )
                      ]
                    )
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:3265)
                      arg_word: {(1)}
                    )
                  ]
                  spids: [3221 3242]
                )
                (if_arm
                  cond: [(C {(test)} {($ Id.VSub_DollarName '$exit_code')} {(-eq)} {(127)})]
                  action: [
                    (command.Simple
                      words: [
                        {(echo)}
                        {(DQ ('test_must_fail: command not found: ') ($ Id.VSub_Star '$*'))}
                      ]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:3286)
                          fd: -1
                          arg_word: {(2)}
                        )
                      ]
                    )
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:3295)
                      arg_word: {(1)}
                    )
                  ]
                  spids: [3270 3281]
                )
                (if_arm
                  cond: [(C {(test)} {($ Id.VSub_DollarName '$exit_code')} {(-eq)} {(126)})]
                  action: [
                    (command.Simple
                      words: [{(echo)} {(DQ ('test_must_fail: valgrind error: ') ($ Id.VSub_Star '$*'))}]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:3316)
                          fd: -1
                          arg_word: {(2)}
                        )
                      ]
                    )
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:3325)
                      arg_word: {(1)}
                    )
                  ]
                  spids: [3300 3311]
                )
              ]
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Return val:return span_id:3333)
              arg_word: {(0)}
            )
          ]
        )
    )
    (command.ShFunction
      name: test_might_fail
      body: 
        (command.BraceGroup
          children: [
            (C {(test_must_fail)} {(Id.Lit_VarLike 'ok=') (success)} {(DQ ($ Id.VSub_At '$@'))})
          ]
        )
    )
    (command.ShFunction
      name: test_expect_code
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:want_code)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$1')}
                  spids: [3418]
                )
              ]
            )
            (C {(shift)})
            (C {(DQ ($ Id.VSub_At '$@'))})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:exit_code)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_QMark '$?')}
                  spids: [3430]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (C {(test)} {($ Id.VSub_DollarName '$exit_code')} {(Id.Lit_Equals '=')} 
                      {($ Id.VSub_DollarName '$want_code')}
                    )
                  ]
                  action: [
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:3448)
                      arg_word: {(0)}
                    )
                  ]
                  spids: [3434 3445]
                )
              ]
            )
            (command.Simple
              words: [
                {(echo)}
                {
                  (DQ ('test_expect_code: command exited with ') ($ Id.VSub_DollarName '$exit_code') 
                    (', we wanted ') ($ Id.VSub_DollarName '$want_code') (' ') ($ Id.VSub_Star '$*')
                  )
                }
              ]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:3459)
                  fd: -1
                  arg_word: {(2)}
                )
              ]
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Return val:return span_id:3472)
              arg_word: {(1)}
            )
          ]
        )
    )
    (command.ShFunction
      name: test_cmp
      body: 
        (command.BraceGroup
          children: [(C {($ Id.VSub_DollarName '$GIT_TEST_CMP')} {(DQ ($ Id.VSub_At '$@'))})]
        )
    )
    (command.ShFunction
      name: test_cmp_bin
      body: (command.BraceGroup children:[(C {(cmp)} {(DQ ($ Id.VSub_At '$@'))})])
    )
    (command.ShFunction
      name: verbose
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {(DQ ($ Id.VSub_At '$@'))})
                (command.ControlFlow
                  token: (Token id:Id.ControlFlow_Return val:return span_id:3575)
                  arg_word: {(0)}
                )
              ]
            )
            (command.Simple
              words: [
                {(echo)}
                {
                  (DQ ('command failed: ') 
                    (command_sub
                      left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:3587)
                      command_list: 
                        (command.CommandList
                          children: [(C {(git)} {(rev-parse)} {(--sq-quote)} {(DQ ($ Id.VSub_At '$@'))})]
                        )
                    )
                  )
                }
              ]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:3582)
                  fd: -1
                  arg_word: {(2)}
                )
              ]
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Return val:return span_id:3601)
              arg_word: {(1)}
            )
          ]
        )
    )
    (command.ShFunction
      name: test_must_be_empty
      body: 
        (command.BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: [(C {(test)} {(-s)} {(DQ ($ Id.VSub_Number '$1'))})]
                  action: [
                    (C {(echo)} {(DQ ("'") ($ Id.VSub_Number '$1') ("' is not empty, it contains:"))})
                    (C {(cat)} {(DQ ($ Id.VSub_Number '$1'))})
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:3653)
                      arg_word: {(1)}
                    )
                  ]
                  spids: [3623 3634]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: test_cmp_rev
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DAmp]
              children: [
                (command.Simple
                  words: [{(git)} {(rev-parse)} {(--verify)} {(DQ ($ Id.VSub_Number '$1'))}]
                  redirects: [
                    (redir.Redir
                      op: (Token id:Id.Redir_Great val:'>' span_id:3684)
                      fd: -1
                      arg_word: {(expect.rev)}
                    )
                  ]
                )
                (command.Simple
                  words: [{(git)} {(rev-parse)} {(--verify)} {(DQ ($ Id.VSub_Number '$2'))}]
                  redirects: [
                    (redir.Redir
                      op: (Token id:Id.Redir_Great val:'>' span_id:3700)
                      fd: -1
                      arg_word: {(actual.rev)}
                    )
                  ]
                )
                (C {(test_cmp)} {(expect.rev)} {(actual.rev)})
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: test_seq
      body: 
        (command.BraceGroup
          children: [
            (command.Case
              to_match: {($ Id.VSub_Pound '$#')}
              arms: [
                (case_arm
                  pat_list: [{(1)}]
                  action: [(C {(Id.KW_Set set)} {(1)} {(DQ ($ Id.VSub_At '$@'))})]
                  spids: [3752 3753 3763 -1]
                )
                (case_arm pat_list:[{(2)}] spids:[3766 3767 3769 -1])
                (case_arm
                  pat_list: [{(Id.Lit_Star '*')}]
                  action: [
                    (C {(error)} {(DQ ('bug in the test script: not 1 or 2 parameters to test_seq'))})
                  ]
                  spids: [3772 3773 3781 -1]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:test_seq_counter__)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$1')}
                  spids: [3787]
                )
              ]
            )
            (command.WhileUntil
              keyword: (Token id:Id.KW_While val:while span_id:3791)
              cond: [
                (C {(test)} {(DQ ($ Id.VSub_DollarName '$test_seq_counter__'))} {(-le)} 
                  {(DQ ($ Id.VSub_Number '$2'))}
                )
              ]
              body: 
                (command.DoGroup
                  children: [
                    (C {(echo)} {(DQ ($ Id.VSub_DollarName '$test_seq_counter__'))})
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:test_seq_counter__)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (word_part.ArithSub
                                anode: 
                                  (arith_expr.Binary
                                    op_id: Id.Arith_Plus
                                    left: 
                                      (arith_expr.ArithWord
                                        w: {($ Id.VSub_DollarName '$test_seq_counter__')}
                                      )
                                    right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)})
                                  )
                              )
                            }
                          spids: [3816]
                        )
                      ]
                    )
                  ]
                )
            )
          ]
        )
    )
    (command.ShFunction
      name: test_when_finished
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {(test)} 
                  {
                    (DQ 
                      (braced_var_sub
                        token: (Token id:Id.VSub_Name val:BASH_SUBSHELL span_id:3925)
                        suffix_op: (suffix_op.Unary op_id:Id.VTest_Hyphen arg_word:{(0)})
                      )
                    )
                  } {(Id.Lit_Equals '=')} {(0)}
                )
                (C {(error)} 
                  {(DQ ('bug in test script: test_when_finished does nothing in a subshell'))}
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:test_cleanup)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ ('{ ') ($ Id.VSub_Star '$*') ('\n') ('\t\t} && (exit ') 
                        (word_part.EscapedLiteral
                          token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:3951)
                        ) (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\$' span_id:3952)) (eval_ret) 
                        (word_part.EscapedLiteral
                          token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:3954)
                        ) ('); eval_ret=') (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\$' span_id:3956)) 
                        ('?; ') ($ Id.VSub_DollarName '$test_cleanup')
                      )
                    }
                  spids: [3945]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: test_create_repo
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {(test)} {(DQ ($ Id.VSub_Pound '$#'))} {(Id.Lit_Equals '=')} {(1)})
                (C {(error)} {(DQ ('bug in the test script: not 1 parameter to test-create-repo'))})
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:repo)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$1'))}
                  spids: [3998]
                )
              ]
            )
            (C {(mkdir)} {(-p)} {(DQ ($ Id.VSub_DollarName '$repo'))})
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (command.Subshell
                  command_list: 
                    (command.CommandList
                      children: [
                        (command.AndOr
                          ops: [Id.Op_DPipe]
                          children: [
                            (C {(cd)} {(DQ ($ Id.VSub_DollarName '$repo'))})
                            (C {(error)} {(DQ ('Cannot setup test environment'))})
                          ]
                        )
                        (command.AndOr
                          ops: [Id.Op_DPipe]
                          children: [
                            (command.Simple
                              words: [
                                {(DQ ($ Id.VSub_DollarName '$GIT_EXEC_PATH') (/git-init))}
                                {
                                  (DQ ('--template=') ($ Id.VSub_DollarName '$GIT_BUILD_DIR') 
                                    (/templates/blt/)
                                  )
                                }
                              ]
                              redirects: [
                                (redir.Redir
                                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:4042)
                                  fd: -1
                                  arg_word: {(3)}
                                )
                                (redir.Redir
                                  op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:4045)
                                  fd: 2
                                  arg_word: {(4)}
                                )
                              ]
                            )
                            (C {(error)} {(DQ ('cannot run git init -- have you built things yet?'))})
                          ]
                        )
                        (C {(mv)} {(.git/hooks)} {(.git/hooks-disabled)})
                      ]
                    )
                )
                (command.ControlFlow
                  token: (Token id:Id.ControlFlow_Exit val:exit span_id:4069)
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: test_ln_s_add
      body: 
        (command.BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: [(C {(test_have_prereq)} {(SYMLINKS)})]
                  action: [
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {(ln)} {(-s)} {(DQ ($ Id.VSub_Number '$1'))} {(DQ ($ Id.VSub_Number '$2'))})
                        (C {(git)} {(update-index)} {(--add)} {(DQ ($ Id.VSub_Number '$2'))})
                      ]
                    )
                  ]
                  spids: [4095 4102]
                )
              ]
              else_action: [
                (command.AndOr
                  ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp]
                  children: [
                    (command.Simple
                      words: [
                        {(printf)}
                        {(SQ (Token id:Id.Lit_Chars val:'%s' span_id:4137))}
                        {(DQ ($ Id.VSub_Number '$1'))}
                      ]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_Great val:'>' span_id:4144)
                          fd: -1
                          arg_word: {(DQ ($ Id.VSub_Number '$2'))}
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:ln_s_obj)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:4153)
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (C {(git)} {(hash-object)} {(-w)} {(DQ ($ Id.VSub_Number '$2'))})
                                    ]
                                  )
                              )
                            }
                          spids: [4152]
                        )
                      ]
                    )
                    (C {(git)} {(update-index)} {(--add)} {(--cacheinfo)} {(120000)} 
                      {($ Id.VSub_DollarName '$ln_s_obj')} {(DQ ($ Id.VSub_Number '$2'))}
                    )
                    (C {(git)} {(update-index)} {(DQ ($ Id.VSub_Number '$2'))})
                  ]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: test_write_lines
      body: 
        (command.BraceGroup
          children: [(C {(printf)} {(DQ ('%s') (Id.Lit_Other '\\') (n))} {(DQ ($ Id.VSub_At '$@'))})]
        )
    )
    (command.ShFunction
      name: perl
      body: 
        (command.BraceGroup
          children: [
            (C {(command)} {(DQ ($ Id.VSub_DollarName '$PERL_PATH'))} {(DQ ($ Id.VSub_At '$@'))})
          ]
        )
    )
    (command.ShFunction
      name: test_normalize_bool
      body: 
        (command.BraceGroup
          children: [
            (command.Simple
              words: [
                {(git)}
                {(-c)}
                {(magic.variable) (Id.Lit_Equals '=') (DQ ($ Id.VSub_Number '$1'))}
                {(config)}
                {(--bool)}
                {(magic.variable)}
              ]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_Great val:'2>' span_id:4279)
                  fd: 2
                  arg_word: {(/dev/null)}
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: test_tristate
      body: 
        (command.BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (C {(eval)} 
                      {
                        (DQ ('test x') 
                          (word_part.EscapedLiteral
                            token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:4345)
                          ) (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\$' span_id:4346)) ('{') 
                          ($ Id.VSub_Number '$1') ('+isset}') (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\"' span_id:4350)) 
                          (' = xisset')
                        )
                      }
                    )
                  ]
                  action: [
                    (C {(eval)} 
                      {
                        (DQ ('\n') ('\t\t\tcase ') 
                          (word_part.EscapedLiteral
                            token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:4367)
                          ) (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\$' span_id:4368)) 
                          ($ Id.VSub_Number '$1') (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\"' span_id:4370)) (' in\n') 
                          ("\t\t\t'')\t") ($ Id.VSub_Number '$1') ('=false ;;\n') ('\t\t\tauto)\t;;\n') ('\t\t\t*)\t') ($ Id.VSub_Number '$1') ('=') 
                          (word_part.EscapedLiteral
                            token: (Token id:Id.Lit_EscapedChar val:'\\$' span_id:4379)
                          ) ('(test_normalize_bool ') 
                          (word_part.EscapedLiteral
                            token: (Token id:Id.Lit_EscapedChar val:'\\$' span_id:4381)
                          ) ($ Id.VSub_Number '$1') (' || echo true) ;;\n') ('\t\t\tesac\n') ('\t\t')
                        )
                      }
                    )
                  ]
                  spids: [4339 4355]
                )
              ]
              else_action: [(C {(eval)} {(DQ ($ Id.VSub_Number '$1') ('=auto'))})]
            )
          ]
        )
    )
    (command.ShFunction
      name: test_skip_or_die
      body: 
        (command.BraceGroup
          children: [
            (command.Case
              to_match: {(DQ ($ Id.VSub_Number '$1'))}
              arms: [
                (case_arm
                  pat_list: [{(auto)}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:skip_all)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_Number '$2')}
                          spids: [4447]
                        )
                      ]
                    )
                    (C {(test_done)})
                  ]
                  spids: [4443 4444 4454 -1]
                )
                (case_arm
                  pat_list: [{(true)}]
                  action: [(C {(error)} {(DQ ($ Id.VSub_Number '$2'))})]
                  spids: [4457 4458 4468 -1]
                )
                (case_arm
                  pat_list: [{(Id.Lit_Star '*')}]
                  action: [
                    (C {(error)} 
                      {
                        (DQ ("BUG: test tristate is '") ($ Id.VSub_Number '$1') ("' (real error: ") 
                          ($ Id.VSub_Number '$2') (')')
                        )
                      }
                    )
                  ]
                  spids: [4471 4472 -1 4486]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: mingw_test_cmp
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(Id.Lit_VarLike 'test_cmp_a=')} {(Id.Lit_VarLike 'test_cmp_b=')})
            (C {(local)} {(Id.Lit_VarLike 'stdin_for_diff=')})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {(test)} {(-s)} {(DQ ($ Id.VSub_Number '$1'))})
                        (C {(test)} {(-s)} {(DQ ($ Id.VSub_Number '$2'))})
                      ]
                    )
                  ]
                  action: [
                    (command.Simple
                      words: [{(mingw_read_file_strip_cr_)} {(test_cmp_a)}]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_Less val:'<' span_id:4586)
                          fd: -1
                          arg_word: {(DQ ($ Id.VSub_Number '$1'))}
                        )
                      ]
                    )
                    (command.Simple
                      words: [{(mingw_read_file_strip_cr_)} {(test_cmp_b)}]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_Less val:'<' span_id:4596)
                          fd: -1
                          arg_word: {(DQ ($ Id.VSub_Number '$2'))}
                        )
                      ]
                    )
                  ]
                  spids: [4554 4575]
                )
                (if_arm
                  cond: [
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {(test)} {(-s)} {(DQ ($ Id.VSub_Number '$1'))})
                        (C {(test)} {(DQ ($ Id.VSub_Number '$2'))} {(Id.Lit_Equals '=')} {(-)})
                      ]
                    )
                  ]
                  action: [
                    (command.Simple
                      words: [{(mingw_read_file_strip_cr_)} {(test_cmp_a)}]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_Less val:'<' span_id:4636)
                          fd: -1
                          arg_word: {(DQ ($ Id.VSub_Number '$1'))}
                        )
                      ]
                    )
                    (C {(mingw_read_file_strip_cr_)} {(test_cmp_b)})
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:stdin_for_diff)
                          op: assign_op.Equal
                          rhs: {(SQ (Token id:Id.Lit_Chars val:'<<<"$test_cmp_b"' span_id:4649))}
                          spids: [4647]
                        )
                      ]
                    )
                  ]
                  spids: [4602 4625]
                )
                (if_arm
                  cond: [
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {(test)} {(DQ ($ Id.VSub_Number '$1'))} {(Id.Lit_Equals '=')} {(-)})
                        (C {(test)} {(-s)} {(DQ ($ Id.VSub_Number '$2'))})
                      ]
                    )
                  ]
                  action: [
                    (C {(mingw_read_file_strip_cr_)} {(test_cmp_a)})
                    (command.Simple
                      words: [{(mingw_read_file_strip_cr_)} {(test_cmp_b)}]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_Less val:'<' span_id:4692)
                          fd: -1
                          arg_word: {(DQ ($ Id.VSub_Number '$2'))}
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:stdin_for_diff)
                          op: assign_op.Equal
                          rhs: {(SQ (Token id:Id.Lit_Chars val:'<<<"$test_cmp_a"' span_id:4700))}
                          spids: [4698]
                        )
                      ]
                    )
                  ]
                  spids: [4653 4676]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DPipe]
              children: [
                (C {(test)} {(-n)} {(DQ ($ Id.VSub_DollarName '$test_cmp_a'))})
                (C {(test)} {(-n)} {(DQ ($ Id.VSub_DollarName '$test_cmp_b'))})
                (C {(test)} {(DQ ($ Id.VSub_DollarName '$test_cmp_a'))} {(Id.Lit_Equals '=')} 
                  {(DQ ($ Id.VSub_DollarName '$test_cmp_b'))}
                )
                (C {(eval)} 
                  {
                    (DQ ('diff -u ') 
                      (word_part.EscapedLiteral
                        token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:4748)
                      ) (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\$' span_id:4749)) ('@') 
                      (word_part.EscapedLiteral
                        token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:4751)
                      ) (' ') ($ Id.VSub_DollarName '$stdin_for_diff')
                    )
                  }
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: mingw_read_file_strip_cr_
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(line)})
            (command.WhileUntil
              keyword: (Token id:Id.KW_While val:while span_id:4783)
              cond: [(C {(Id.Lit_Other ':')})]
              body: 
                (command.DoGroup
                  children: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Simple
                              words: [
                                {(read)}
                                {(-r)}
                                {(-d)}
                                {
                                  (single_quoted
                                    left: (Token id:Id.Left_SingleQuoteC val:"$'" span_id:4804)
                                    tokens: [(Token id:Id.Char_OneChar val:'\\n' span_id:4805)]
                                  )
                                }
                                {(line)}
                              ]
                              more_env: [
                                (env_pair
                                  name: IFS
                                  val: 
                                    {
                                      (single_quoted
                                        left: (Token id:Id.Left_SingleQuoteC val:"$'" span_id:4794)
                                        tokens: [(Token id:Id.Char_OneChar val:'\\r' span_id:4795)]
                                      )
                                    }
                                  spids: [4793]
                                )
                              ]
                            )
                          ]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:line)
                                  op: assign_op.Equal
                                  rhs: 
                                    {($ Id.VSub_DollarName '$line') 
                                      (single_quoted
                                        left: (Token id:Id.Left_SingleQuoteC val:"$'" span_id:4820)
                                        tokens: [(Token id:Id.Char_OneChar val:'\\n' span_id:4821)]
                                      )
                                    }
                                  spids: [4818]
                                )
                              ]
                            )
                          ]
                          spids: [4791 4811]
                        )
                      ]
                      else_action: [
                        (command.If
                          arms: [
                            (if_arm
                              cond: [(C {(test)} {(-z)} {(DQ ($ Id.VSub_DollarName '$line'))})]
                              action: [
                                (command.ControlFlow
                                  token: (Token id:Id.ControlFlow_Break val:break span_id:4858)
                                )
                              ]
                              spids: [4840 4851]
                            )
                          ]
                        )
                      ]
                    )
                    (C {(eval)} 
                      {
                        (DQ ($ Id.VSub_Number '$1') ('=') 
                          (word_part.EscapedLiteral
                            token: (Token id:Id.Lit_EscapedChar val:'\\$' span_id:4872)
                          ) ($ Id.VSub_Number '$1') 
                          (word_part.EscapedLiteral
                            token: (Token id:Id.Lit_EscapedChar val:'\\$' span_id:4874)
                          ) (line)
                        )
                      }
                    )
                  ]
                )
            )
          ]
        )
    )
    (command.ShFunction
      name: test_env
      body: 
        (command.BraceGroup
          children: [
            (command.Subshell
              command_list: 
                (command.CommandList
                  children: [
                    (command.WhileUntil
                      keyword: (Token id:Id.KW_While val:while span_id:4904)
                      cond: [(C {(test)} {($ Id.VSub_Pound '$#')} {(-gt)} {(0)})]
                      body: 
                        (command.DoGroup
                          children: [
                            (command.Case
                              to_match: {(DQ ($ Id.VSub_Number '$1'))}
                              arms: [
                                (case_arm
                                  pat_list: [{(Id.Lit_Star '*') (Id.Lit_Equals '=') (Id.Lit_Star '*')}]
                                  action: [
                                    (C {(eval)} 
                                      {
                                        (DQ 
                                          (braced_var_sub
                                            token: (Token id:Id.VSub_Number val:1 span_id:4937)
                                            suffix_op: 
                                              (suffix_op.Unary
                                                op_id: Id.VOp1_DPercent
                                                arg_word: {('=*')}
                                              )
                                          ) ('=') (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\$' span_id:4942)) ('{1#*=}')
                                        )
                                      }
                                    )
                                    (C {(eval)} 
                                      {
                                        (DQ ('export ') 
                                          (braced_var_sub
                                            token: (Token id:Id.VSub_Number val:1 span_id:4952)
                                            suffix_op: 
                                              (suffix_op.Unary
                                                op_id: Id.VOp1_DPercent
                                                arg_word: {('=*')}
                                              )
                                          )
                                        )
                                      }
                                    )
                                    (C {(shift)})
                                  ]
                                  spids: [4927 4930 4962 -1]
                                )
                                (case_arm
                                  pat_list: [{(Id.Lit_Star '*')}]
                                  action: [
                                    (C {(DQ ($ Id.VSub_At '$@'))})
                                    (command.ControlFlow
                                      token: (Token id:Id.ControlFlow_Exit val:exit span_id:4974)
                                    )
                                  ]
                                  spids: [4965 4966 4977 -1]
                                )
                              ]
                            )
                          ]
                        )
                    )
                  ]
                )
            )
          ]
        )
    )
    (command.ShFunction
      name: test_match_signal
      body: 
        (command.BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (C {(test)} {(DQ ($ Id.VSub_Number '$2'))} {(Id.Lit_Equals '=')} 
                      {
                        (DQ 
                          (word_part.ArithSub
                            anode: 
                              (arith_expr.Binary
                                op_id: Id.Arith_Plus
                                left: (arith_expr.ArithWord w:{(Id.Lit_Digits 128)})
                                right: (arith_expr.ArithWord w:{($ Id.VSub_Number '$1')})
                              )
                          )
                        )
                      }
                    )
                  ]
                  action: [
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:5034)
                      arg_word: {(0)}
                    )
                  ]
                  spids: [5005 5027]
                )
                (if_arm
                  cond: [
                    (C {(test)} {(DQ ($ Id.VSub_Number '$2'))} {(Id.Lit_Equals '=')} 
                      {
                        (DQ 
                          (word_part.ArithSub
                            anode: 
                              (arith_expr.Binary
                                op_id: Id.Arith_Plus
                                left: (arith_expr.ArithWord w:{(Id.Lit_Digits 256)})
                                right: (arith_expr.ArithWord w:{($ Id.VSub_Number '$1')})
                              )
                          )
                        )
                      }
                    )
                  ]
                  action: [
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:5068)
                      arg_word: {(0)}
                    )
                  ]
                  spids: [5039 5061]
                )
              ]
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Return val:return span_id:5076)
              arg_word: {(1)}
            )
          ]
        )
    )
    (command.ShFunction
      name: test_copy_bytes
      body: 
        (command.BraceGroup
          children: [
            (C {(perl)} {(-e)} 
              {
                (SQ (Token id:Id.Lit_Chars val:'\n' span_id:5099) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\tmy $len = $ARGV[1];\n'
                    span_id: 5100
                  ) (Token id:Id.Lit_Chars val:'\t\twhile ($len > 0) {\n' span_id:5101) 
                  (Token id:Id.Lit_Chars val:'\t\t\tmy $s;\n' span_id:5102) (Token id:Id.Lit_Chars val:'\t\t\tmy $nread = sysread(STDIN, $s, $len);\n' span_id:5103) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t\tdie "cannot read: $!" unless defined($nread);\n'
                    span_id: 5104
                  ) (Token id:Id.Lit_Chars val:'\t\t\tprint $s;\n' span_id:5105) 
                  (Token
                    id: Id.Lit_Chars
                    val: '\t\t\t$len -= $nread;\n'
                    span_id: 5106
                  ) (Token id:Id.Lit_Chars val:'\t\t}\n' span_id:5107) (Token id:Id.Lit_Chars val:'\t' span_id:5108)
                )
              } {(-)} {(DQ ($ Id.VSub_Number '$1'))}
            )
          ]
        )
    )
  ]
)