(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:test_description)
          op: Equal
          rhs: 
            {
              (SQ <"git web--browse basic tests\n"> <"\n"> 
                <"This test checks that git web--browse can handle various valid URLs.">
              )
            }
          spids: [7]
        )
      ]
      spids: [7]
    )
    (C {(.)} {(./test-lib.sh)})
    (FuncDef
      name: test_web_browse
      body: 
        (BraceGroup
          children: [
            (AndOr
              children: [
                (SimpleCommand
                  words: [
                    {(git)}
                    {(web--browse)}
                    {(--browser) (Lit_Other "=") (DQ ($ VSub_Number "$1"))}
                    {(DQ ($ VSub_Number "$2"))}
                  ]
                  redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(actual)} spids:[46])]
                )
                (AndOr
                  children: [
                    (SimpleCommand
                      words: [{(tr)} {(-d)} {(SQ <"\\015">)}]
                      redirects: [
                        (Redir
                          op_id: Redir_Less
                          fd: -1
                          arg_word: {(actual)}
                          spids: [60]
                        )
                        (Redir
                          op_id: Redir_Great
                          fd: -1
                          arg_word: {(text)}
                          spids: [63]
                        )
                      ]
                    )
                    (C {(test_cmp)} {(expect)} {(text)})
                  ]
                  op_id: Op_DAmp
                )
              ]
              op_id: Op_DAmp
            )
          ]
          spids: [25]
        )
      spids: [20 24]
    )
    (C {(test_expect_success)} {(SQ <"URL with an ampersand in it">)} 
      {
        (SQ <"\n"> <"\techo http://example.com/foo\\&bar >expect &&\n"> 
          <"\tgit config browser.custom.cmd echo &&\n"> <"\ttest_web_browse custom http://example.com/foo\\&bar\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"URL with a semi-colon in it">)} 
      {
        (SQ <"\n"> <"\techo http://example.com/foo\\;bar >expect &&\n"> 
          <"\tgit config browser.custom.cmd echo &&\n"> <"\ttest_web_browse custom http://example.com/foo\\;bar\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"URL with a hash in it">)} 
      {
        (SQ <"\n"> <"\techo http://example.com/foo#bar >expect &&\n"> 
          <"\tgit config browser.custom.cmd echo &&\n"> <"\ttest_web_browse custom http://example.com/foo#bar\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"browser paths are properly quoted">)} 
      {
        (SQ <"\n"> <"\techo fake: http://example.com/foo >expect &&\n"> 
          <"\tcat >\"fake browser\" <<-\\EOF &&\n"> <"\t#!/bin/sh\n"> <"\techo fake: \"$@\"\n"> <"\tEOF\n"> <"\tchmod +x \"fake browser\" &&\n"> 
          <"\tgit config browser.w3m.path \"$(pwd)/fake browser\" &&\n"> <"\ttest_web_browse w3m http://example.com/foo\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"browser command allows arbitrary shell code">)} 
      {
        (SQ <"\n"> <"\techo \"arg: http://example.com/foo\" >expect &&\n"> 
          <"\tgit config browser.custom.cmd \"\n"> <"\t\tf() {\n"> <"\t\t\tfor i in \\\"\\$@\\\"; do\n"> <"\t\t\t\techo arg: \\$i\n"> <"\t\t\tdone\n"> 
          <"\t\t}\n"> <"\t\tf\" &&\n"> <"\ttest_web_browse custom http://example.com/foo\n">
        )
      }
    )
    (C {(test_done)})
  ]
)