(command.CommandList
  children: [
    (C {(.)} {(./test-lib.sh)})
    (C {(unset)} {(CVS_SERVER)})
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Pipeline
              children: [
                (command.Simple
                  words: [{(type)} {(cvs)}]
                  redirects: [
                    (redir.Redir
                      op: (Token id:Id.Redir_Great val:'>' span_id:22)
                      fd: -1
                      arg_word: {(/dev/null)}
                    )
                    (redir.Redir
                      op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:25)
                      fd: 2
                      arg_word: {(1)}
                    )
                  ]
                )
              ]
              negated: T
            )
          ]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:skip_all)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (SQ 
                        (Token
                          id: Id.Lit_Chars
                          val: 'skipping cvsimport tests, cvs not found'
                          span_id: 33
                        )
                      )
                    }
                  spids: [31]
                )
              ]
            )
            (C {(test_done)})
          ]
          spids: [14 28]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:CVS)
          op: assign_op.Equal
          rhs: {(DQ ('cvs -f'))}
          spids: [42]
        )
      ]
    )
    (C {(export)} {(CVS)})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:cvsps_version)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:53)
                command_list: 
                  (command.CommandList
                    children: [
                      (command.Pipeline
                        children: [
                          (command.Simple
                            words: [{(cvsps)} {(-h)}]
                            redirects: [
                              (redir.Redir
                                op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:58)
                                fd: 2
                                arg_word: {(1)}
                              )
                            ]
                          )
                          (C {(sed)} {(-ne)} 
                            {(SQ (Token id:Id.Lit_Chars val:'s/cvsps version //p' span_id:68))}
                          )
                        ]
                        negated: F
                      )
                    ]
                  )
              )
            }
          spids: [52]
        )
      ]
    )
    (command.Case
      to_match: {(DQ ($ Id.VSub_DollarName '$cvsps_version'))}
      arms: [
        (case_arm pat_list:[{(2.1)} {(2.2) (Id.Lit_Star '*')}] spids:[80 86 89 -1])
        (case_arm
          pat_list: [{(SQ )}]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:skip_all)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (SQ 
                        (Token
                          id: Id.Lit_Chars
                          val: 'skipping cvsimport tests, cvsps not found'
                          span_id: 98
                        )
                      )
                    }
                  spids: [96]
                )
              ]
            )
            (C {(test_done)})
          ]
          spids: [91 93 105 -1]
        )
        (case_arm
          pat_list: [{(Id.Lit_Star '*')}]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:skip_all)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (SQ 
                        (Token
                          id: Id.Lit_Chars
                          val: 'skipping cvsimport tests, unsupported cvsps version'
                          span_id: 113
                        )
                      )
                    }
                  spids: [111]
                )
              ]
            )
            (C {(test_done)})
          ]
          spids: [107 108 120 -1]
        )
      ]
    )
    (command.ShFunction
      name: setup_cvs_test_repository
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DAmp]
              children: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:CVSROOT)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (DQ 
                            (command_sub
                              left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:135)
                              command_list: (command.CommandList children:[(C {(pwd)})])
                            ) (/.cvsroot)
                          )
                        }
                      spids: [133]
                    )
                  ]
                )
                (C {(cp)} {(-r)} 
                  {
                    (DQ ($ Id.VSub_DollarName '$TEST_DIRECTORY') (/) ($ Id.VSub_Number '$1') (/cvsroot))
                  } {(DQ ($ Id.VSub_DollarName '$CVSROOT'))}
                )
                (C {(export)} {(CVSROOT)})
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: test_cvs_co
      body: 
        (command.BraceGroup
          children: [
            (C {(rm)} {(-rf)} {(module-cvs-) (DQ ($ Id.VSub_Number '$1'))})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (C {(Id.Lit_LBracket '[')} {(DQ ($ Id.VSub_Number '$1'))} {(Id.Lit_Equals '=')} 
                      {(DQ (master))} {(Id.Lit_RBracket ']')}
                    )
                  ]
                  action: [
                    (C {($ Id.VSub_DollarName '$CVS')} {(co)} {(-P)} {(-d)} 
                      {(module-cvs-) (DQ ($ Id.VSub_Number '$1'))} {(-A)} {(module)}
                    )
                  ]
                  spids: [191 208]
                )
              ]
              else_action: [
                (C {($ Id.VSub_DollarName '$CVS')} {(co)} {(-P)} {(-d)} 
                  {(module-cvs-) (DQ ($ Id.VSub_Number '$1'))} {(-r)} {(DQ ($ Id.VSub_Number '$1'))} {(module)}
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: test_git_co
      body: 
        (command.BraceGroup
          children: [
            (command.Subshell
              command_list: 
                (command.CommandList
                  children: [
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {(cd)} {(module-git)})
                        (C {(git)} {(checkout)} {(DQ ($ Id.VSub_Number '$1'))})
                      ]
                    )
                  ]
                )
            )
          ]
        )
    )
    (command.ShFunction
      name: test_cmp_branch_file
      body: 
        (command.BraceGroup
          children: [
            (C {(test_cmp)} 
              {(module-cvs-) (DQ ($ Id.VSub_Number '$1')) (/) (DQ ($ Id.VSub_Number '$2'))} {(module-git/) (DQ ($ Id.VSub_Number '$2'))}
            )
          ]
        )
    )
    (command.ShFunction
      name: test_cmp_branch_tree
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp]
              children: [
                (C {(test_cvs_co)} {(DQ ($ Id.VSub_Number '$1'))})
                (C {(test_git_co)} {(DQ ($ Id.VSub_Number '$1'))})
                (command.Pipeline
                  children: [
                    (command.Subshell
                      command_list: 
                        (command.CommandList
                          children: [
                            (C {(cd)} {(module-cvs-) (DQ ($ Id.VSub_Number '$1'))})
                            (C {(find)} {(.)} {(-type)} {(d)} {(-name)} {(CVS)} {(-prune)} {(-o)} {(-type)} 
                              {(f)} {(-print)}
                            )
                          ]
                        )
                    )
                    (command.Simple
                      words: [{(sort)}]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_Great val:'>' span_id:404)
                          fd: -1
                          arg_word: {(module-cvs-) (DQ ($ Id.VSub_Number '$1')) (.list)}
                        )
                      ]
                    )
                  ]
                  negated: F
                )
                (command.Pipeline
                  children: [
                    (command.Subshell
                      command_list: 
                        (command.CommandList
                          children: [
                            (C {(cd)} {(module-git)})
                            (C {(find)} {(.)} {(-type)} {(d)} {(-name)} {(.git)} {(-prune)} {(-o)} {(-type)} 
                              {(f)} {(-print)}
                            )
                          ]
                        )
                    )
                    (command.Simple
                      words: [{(sort)}]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_Great val:'>' span_id:451)
                          fd: -1
                          arg_word: {(module-git-) (DQ ($ Id.VSub_Number '$1')) (.list)}
                        )
                      ]
                    )
                  ]
                  negated: F
                )
                (C {(test_cmp)} {(module-cvs-) (DQ ($ Id.VSub_Number '$1')) (.list)} 
                  {(module-git-) (DQ ($ Id.VSub_Number '$1')) (.list)}
                )
                (command.Pipeline
                  children: [
                    (C {(cat)} {(module-cvs-) (DQ ($ Id.VSub_Number '$1')) (.list)})
                    (command.WhileUntil
                      keyword: (Token id:Id.KW_While val:while span_id:488)
                      cond: [(C {(read)} {(f)})]
                      body: 
                        (command.DoGroup
                          children: [
                            (command.AndOr
                              ops: [Id.Op_DPipe]
                              children: [
                                (C {(test_cmp_branch_file)} {(DQ ($ Id.VSub_Number '$1'))} 
                                  {(DQ ($ Id.VSub_DollarName '$f'))}
                                )
                                (command.ControlFlow
                                  token: (Token id:Id.ControlFlow_Return val:return span_id:510)
                                  arg_word: {(1)}
                                )
                              ]
                            )
                          ]
                        )
                    )
                  ]
                  negated: F
                )
              ]
            )
          ]
        )
    )
  ]
)