(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:test_description)
          op: Equal
          rhs: 
            {
              (SQ <'gitweb as standalone script (basic tests).\n'> <'\n'> 
                <'This test runs gitweb (git web interface) as CGI script from\n'> <'commandline, and checks that it would not write any errors\n'> <'or warnings to log.'>
              )
            }
          spids: [13]
        )
      ]
      spids: [13]
    )
    (C {(.)} {(./gitweb-lib.sh)})
    (C {(test_expect_success)} {(SQ <'no commits: projects_list (implicit)'>)} {(SQ <gitweb_run>)})
    (C {(test_expect_success)} {(SQ <'no commits: projects_index'>)} 
      {(SQ <'gitweb_run "a=project_index"'>)}
    )
    (C {(test_expect_success)} {(SQ <'no commits: .git summary (implicit)'>)} 
      {(SQ <'gitweb_run "p=.git"'>)}
    )
    (C {(test_expect_success)} {(SQ <'no commits: .git commit (implicit HEAD)'>)} 
      {(SQ <'gitweb_run "p=.git;a=commit"'>)}
    )
    (C {(test_expect_success)} {(SQ <'no commits: .git commitdiff (implicit HEAD)'>)} 
      {(SQ <'gitweb_run "p=.git;a=commitdiff"'>)}
    )
    (C {(test_expect_success)} {(SQ <'no commits: .git tree (implicit HEAD)'>)} 
      {(SQ <'gitweb_run "p=.git;a=tree"'>)}
    )
    (C {(test_expect_success)} {(SQ <'no commits: .git heads'>)} {(SQ <'gitweb_run "p=.git;a=heads"'>)})
    (C {(test_expect_success)} {(SQ <'no commits: .git tags'>)} {(SQ <'gitweb_run "p=.git;a=tags"'>)})
    (C {(test_expect_success)} {(SQ <'Make initial commit'>)} 
      {
        (SQ <'echo "Not an empty file." > file &&\n'> <'\t git add file &&\n'> 
          <'\t git commit -a -m "Initial commit." &&\n'> <'\t git branch b'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'projects_list (implicit)'>)} {(SQ <gitweb_run>)})
    (C {(test_expect_success)} {(SQ <projects_index>)} {(SQ <'gitweb_run "a=project_index"'>)})
    (C {(test_expect_success)} {(SQ <'.git summary (implicit)'>)} {(SQ <'gitweb_run "p=.git"'>)})
    (C {(test_expect_success)} {(SQ <'.git commit (implicit HEAD)'>)} 
      {(SQ <'gitweb_run "p=.git;a=commit"'>)}
    )
    (C {(test_expect_success)} {(SQ <'.git commitdiff (implicit HEAD, root commit)'>)} 
      {(SQ <'gitweb_run "p=.git;a=commitdiff"'>)}
    )
    (C {(test_expect_success)} {(SQ <'.git commitdiff_plain (implicit HEAD, root commit)'>)} 
      {(SQ <'gitweb_run "p=.git;a=commitdiff_plain"'>)}
    )
    (C {(test_expect_success)} {(SQ <'.git commit (HEAD)'>)} 
      {(SQ <'gitweb_run "p=.git;a=commit;h=HEAD"'>)}
    )
    (C {(test_expect_success)} {(SQ <'.git tree (implicit HEAD)'>)} {(SQ <'gitweb_run "p=.git;a=tree"'>)})
    (C {(test_expect_success)} {(SQ <'.git blob (file)'>)} {(SQ <'gitweb_run "p=.git;a=blob;f=file"'>)})
    (C {(test_expect_success)} {(SQ <'.git blob_plain (file)'>)} 
      {(SQ <'gitweb_run "p=.git;a=blob_plain;f=file"'>)}
    )
    (C {(test_expect_success)} {(SQ <'.git commit (non-existent)'>)} 
      {(SQ <'gitweb_run "p=.git;a=commit;h=non-existent"'>)}
    )
    (C {(test_expect_success)} {(SQ <'.git commitdiff (non-existent)'>)} 
      {(SQ <'gitweb_run "p=.git;a=commitdiff;h=non-existent"'>)}
    )
    (C {(test_expect_success)} {(SQ <'.git commitdiff (non-existent vs HEAD)'>)} 
      {(SQ <'gitweb_run "p=.git;a=commitdiff;hp=non-existent;h=HEAD"'>)}
    )
    (C {(test_expect_success)} {(SQ <'.git tree (0000000000000000000000000000000000000000)'>)} 
      {(SQ <'gitweb_run "p=.git;a=tree;h=0000000000000000000000000000000000000000"'>)}
    )
    (C {(test_expect_success)} {(SQ <'.git tag (0000000000000000000000000000000000000000)'>)} 
      {(SQ <'gitweb_run "p=.git;a=tag;h=0000000000000000000000000000000000000000"'>)}
    )
    (C {(test_expect_success)} {(SQ <'.git blob (non-existent)'>)} 
      {(SQ <'gitweb_run "p=.git;a=blob;f=non-existent"'>)}
    )
    (C {(test_expect_success)} {(SQ <'.git blob_plain (non-existent)'>)} 
      {(SQ <'gitweb_run "p=.git;a=blob_plain;f=non-existent"'>)}
    )
    (C {(test_expect_success)} {(SQ <'commitdiff(0): root'>)} {(SQ <'gitweb_run "p=.git;a=commitdiff"'>)})
    (C {(test_expect_success)} {(SQ <'commitdiff(0): file added'>)} 
      {
        (SQ <'echo "New file" > new_file &&\n'> <'\t git add new_file &&\n'> 
          <'\t git commit -a -m "File added." &&\n'> <'\t gitweb_run "p=.git;a=commitdiff"'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'commitdiff(0): mode change'>)} 
      {
        (SQ <'test_chmod +x new_file &&\n'> <'\t git commit -a -m "Mode changed." &&\n'> 
          <'\t gitweb_run "p=.git;a=commitdiff"'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'commitdiff(0): file renamed'>)} 
      {
        (SQ <'git mv new_file renamed_file &&\n'> <'\t git commit -a -m "File renamed." &&\n'> 
          <'\t gitweb_run "p=.git;a=commitdiff"'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'commitdiff(0): file to symlink'>)} 
      {
        (SQ <'rm renamed_file &&\n'> <'\t test_ln_s_add file renamed_file &&\n'> 
          <'\t git commit -a -m "File to symlink." &&\n'> <'\t gitweb_run "p=.git;a=commitdiff"'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'commitdiff(0): file deleted'>)} 
      {
        (SQ <'git rm renamed_file &&\n'> <'\t rm -f renamed_file &&\n'> 
          <'\t git commit -a -m "File removed." &&\n'> <'\t gitweb_run "p=.git;a=commitdiff"'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'commitdiff(0): file copied / new file'>)} 
      {
        (SQ <'cp file file2 &&\n'> <'\t git add file2 &&\n'> 
          <'\t git commit -a -m "File copied." &&\n'> <'\t gitweb_run "p=.git;a=commitdiff"'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'commitdiff(0): mode change and modified'>)} 
      {
        (SQ <'echo "New line" >> file2 &&\n'> <'\t test_chmod +x file2 &&\n'> 
          <'\t git commit -a -m "Mode change and modification." &&\n'> <'\t gitweb_run "p=.git;a=commitdiff"'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'commitdiff(0): renamed and modified'>)} 
      {
        (SQ <'cat >file2<<EOF &&\n'> <'Dominus regit me,\n'> <'et nihil mihi deerit.\n'> 
          <'In loco pascuae ibi me collocavit,\n'> <'super aquam refectionis educavit me;\n'> <'animam meam convertit,\n'> 
          <'deduxit me super semitas jusitiae,\n'> <'propter nomen suum.\n'> <'EOF\n'> <'\t git commit -a -m "File added." &&\n'> 
          <'\t git mv file2 file3 &&\n'> <'\t echo "Propter nomen suum." >> file3 &&\n'> 
          <'\t git commit -a -m "File rename and modification." &&\n'> <'\t gitweb_run "p=.git;a=commitdiff"'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'commitdiff(0): renamed, mode change and modified'>)} 
      {
        (SQ <'git mv file3 file2 &&\n'> <'\t echo "Propter nomen suum." >> file2 &&\n'> 
          <'\t test_chmod +x file2 &&\n'> <'\t git commit -a -m "File rename, mode change and modification." &&\n'> 
          <'\t gitweb_run "p=.git;a=commitdiff"'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'setup typechange commits'>)} 
      {
        (SQ <'\n'> <'\techo "hello world" > foo &&\n'> <'\techo "hi planet" > bar &&\n'> 
          <'\tgit update-index --add foo bar &&\n'> <'\tgit commit -m initial &&\n'> <'\tgit branch initial &&\n'> <'\trm -f foo &&\n'> 
          <'\ttest_ln_s_add bar foo &&\n'> <'\tgit commit -m "foo symlinked to bar" &&\n'> <'\tgit branch foo-symlinked-to-bar &&\n'> 
          <'\trm -f foo &&\n'> <'\techo "how far is the sun?" > foo &&\n'> <'\tgit update-index foo &&\n'> 
          <'\tgit commit -m "foo back to file" &&\n'> <'\tgit branch foo-back-to-file &&\n'> <'\trm -f foo &&\n'> <'\tgit update-index --remove foo &&\n'> 
          <'\tmkdir foo &&\n'> <'\techo "if only I knew" > foo/baz &&\n'> <'\tgit update-index --add foo/baz &&\n'> 
          <'\tgit commit -m "foo becomes a directory" &&\n'> <'\tgit branch "foo-becomes-a-directory" &&\n'> <'\techo "hello world" > foo/baz &&\n'> 
          <'\tgit update-index foo/baz &&\n'> <'\tgit commit -m "foo/baz is the original foo" &&\n'> <'\tgit branch foo-baz-renamed-from-foo\n'> 
          <'\t'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'commitdiff(2): file renamed from foo to foo/baz'>)} 
      {(SQ <'gitweb_run "p=.git;a=commitdiff;hp=initial;h=foo-baz-renamed-from-foo"'>)}
    )
    (C {(test_expect_success)} {(SQ <'commitdiff(2): file renamed from foo/baz to foo'>)} 
      {(SQ <'gitweb_run "p=.git;a=commitdiff;hp=foo-baz-renamed-from-foo;h=initial"'>)}
    )
    (C {(test_expect_success)} {(SQ <'commitdiff(2): directory becomes file'>)} 
      {(SQ <'gitweb_run "p=.git;a=commitdiff;hp=foo-becomes-a-directory;h=initial"'>)}
    )
    (C {(test_expect_success)} {(SQ <'commitdiff(2): file becomes directory'>)} 
      {(SQ <'gitweb_run "p=.git;a=commitdiff;hp=initial;h=foo-becomes-a-directory"'>)}
    )
    (C {(test_expect_success)} {(SQ <'commitdiff(2): file becomes symlink'>)} 
      {(SQ <'gitweb_run "p=.git;a=commitdiff;hp=initial;h=foo-symlinked-to-bar"'>)}
    )
    (C {(test_expect_success)} {(SQ <'commitdiff(2): symlink becomes file'>)} 
      {(SQ <'gitweb_run "p=.git;a=commitdiff;hp=foo-symlinked-to-bar;h=foo-back-to-file"'>)}
    )
    (C {(test_expect_success)} {(SQ <'commitdiff(2): symlink becomes directory'>)} 
      {(SQ <'gitweb_run "p=.git;a=commitdiff;hp=foo-symlinked-to-bar;h=foo-becomes-a-directory"'>)}
    )
    (C {(test_expect_success)} {(SQ <'commitdiff(2): directory becomes symlink'>)} 
      {(SQ <'gitweb_run "p=.git;a=commitdiff;hp=foo-becomes-a-directory;h=foo-symlinked-to-bar"'>)}
    )
    (C {(test_expect_success)} {(SQ <'setup incomplete lines'>)} 
      {
        (SQ <'\n'> <'\tcat >file<<-\\EOF &&\n'> <'\tDominus regit me,\n'> <'\tet nihil mihi deerit.\n'> 
          <'\tIn loco pascuae ibi me collocavit,\n'> <'\tsuper aquam refectionis educavit me;\n'> <'\tanimam meam convertit,\n'> 
          <'\tdeduxit me super semitas jusitiae,\n'> <'\tpropter nomen suum.\n'> <'\tCHANGE_ME\n'> <'\tEOF\n'> 
          <'\tgit commit -a -m "Preparing for incomplete lines" &&\n'> <'\techo "incomplete" | tr -d "\\\\012" >>file &&\n'> 
          <'\tgit commit -a -m "Add incomplete line" &&\n'> <'\tgit tag incomplete_lines_add &&\n'> <'\tsed -e s/CHANGE_ME/change_me/ <file >file+ &&\n'> 
          <'\tmv -f file+ file &&\n'> <'\tgit commit -a -m "Incomplete context line" &&\n'> <'\tgit tag incomplete_lines_ctx &&\n'> 
          <'\techo "Dominus regit me," >file &&\n'> <'\techo "incomplete line" | tr -d "\\\\012" >>file &&\n'> 
          <'\tgit commit -a -m "Change incomplete line" &&\n'> <'\tgit tag incomplete_lines_chg &&\n'> <'\techo "Dominus regit me," >file &&\n'> 
          <'\tgit commit -a -m "Remove incomplete line" &&\n'> <'\tgit tag incomplete_lines_rem\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'commitdiff(1): addition of incomplete line'>)} 
      {(SQ <'\n'> <'\tgitweb_run "p=.git;a=commitdiff;h=incomplete_lines_add"\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'commitdiff(1): incomplete line as context line'>)} 
      {(SQ <'\n'> <'\tgitweb_run "p=.git;a=commitdiff;h=incomplete_lines_ctx"\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'commitdiff(1): change incomplete line'>)} 
      {(SQ <'\n'> <'\tgitweb_run "p=.git;a=commitdiff;h=incomplete_lines_chg"\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'commitdiff(1): removal of incomplete line'>)} 
      {(SQ <'\n'> <'\tgitweb_run "p=.git;a=commitdiff;h=incomplete_lines_rem"\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'Create a merge'>)} 
      {
        (SQ <'git checkout b &&\n'> <'\t echo "Branch" >> b &&\n'> <'\t git add b &&\n'> 
          <'\t git commit -a -m "On branch" &&\n'> <'\t git checkout master &&\n'> <'\t git merge b &&\n'> <'\t git tag merge_commit'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'commit(0): merge commit'>)} {(SQ <'gitweb_run "p=.git;a=commit"'>)})
    (C {(test_expect_success)} {(SQ <'commitdiff(0): merge commit'>)} 
      {(SQ <'gitweb_run "p=.git;a=commitdiff"'>)}
    )
    (C {(test_expect_success)} {(SQ <'Prepare large commit'>)} 
      {
        (SQ <'git checkout b &&\n'> <'\t echo "To be changed" > 01-change &&\n'> 
          <'\t echo "To be renamed" > 02-pure-rename-from &&\n'> <'\t echo "To be deleted" > 03-delete &&\n'> 
          <'\t echo "To be renamed and changed" > 04-rename-from &&\n'> <'\t echo "To have mode changed" > 05-mode-change &&\n'> 
          <'\t echo "File to symlink" > 06-file-or-symlink &&\n'> <'\t echo "To be changed and have mode changed" > 07-change-mode-change\t&&\n'> <'\t git add 0* &&\n'> 
          <'\t git commit -a -m "Prepare large commit" &&\n'> <'\t echo "Changed" > 01-change &&\n'> <'\t git mv 02-pure-rename-from 02-pure-rename-to &&\n'> 
          <'\t git rm 03-delete && rm -f 03-delete &&\n'> <'\t echo "A new file" > 03-new &&\n'> <'\t git add 03-new &&\n'> 
          <'\t git mv 04-rename-from 04-rename-to &&\n'> <'\t echo "Changed" >> 04-rename-to &&\n'> <'\t test_chmod +x 05-mode-change &&\n'> 
          <'\t rm -f 06-file-or-symlink &&\n'> <'\t test_ln_s_add 01-change 06-file-or-symlink &&\n'> 
          <'\t echo "Changed and have mode changed" > 07-change-mode-change\t&&\n'> <'\t test_chmod +x 07-change-mode-change &&\n'> <'\t git commit -a -m "Large commit" &&\n'> 
          <'\t git checkout master'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'commit(1): large commit'>)} 
      {(SQ <'gitweb_run "p=.git;a=commit;h=b"'>)}
    )
    (C {(test_expect_success)} {(SQ <'commitdiff(1): large commit'>)} 
      {(SQ <'gitweb_run "p=.git;a=commitdiff;h=b"'>)}
    )
    (C {(test_expect_success)} {(SQ <'side-by-side: addition of incomplete line'>)} 
      {(SQ <'\n'> <'\tgitweb_run "p=.git;a=commitdiff;h=incomplete_lines_add;ds=sidebyside"\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'side-by-side: incomplete line as context line'>)} 
      {(SQ <'\n'> <'\tgitweb_run "p=.git;a=commitdiff;h=incomplete_lines_ctx;ds=sidebyside"\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'side-by-side: changed incomplete line'>)} 
      {(SQ <'\n'> <'\tgitweb_run "p=.git;a=commitdiff;h=incomplete_lines_chg;ds=sidebyside"\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'side-by-side: removal of incomplete line'>)} 
      {(SQ <'\n'> <'\tgitweb_run "p=.git;a=commitdiff;h=incomplete_lines_rem;ds=sidebyside"\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'side-by-side: merge commit'>)} 
      {(SQ <'\n'> <'\tgitweb_run "p=.git;a=commitdiff;h=merge_commit;ds=sidebyside"\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'tags: list of different types of tags'>)} 
      {
        (SQ <'git checkout master &&\n'> <'\t git tag -a -m "Tag commit object" tag-commit HEAD &&\n'> 
          <'\t git tag -a -m "" tag-commit-nomessage HEAD &&\n'> <'\t git tag -a -m "Tag tag object" tag-tag tag-commit &&\n'> 
          <'\t git tag -a -m "Tag tree object" tag-tree HEAD^{tree} &&\n'> <'\t git tag -a -m "Tag blob object" tag-blob HEAD:file &&\n'> 
          <'\t git tag lightweight/tag-commit HEAD &&\n'> <'\t git tag lightweight/tag-tag tag-commit &&\n'> 
          <'\t git tag lightweight/tag-tree HEAD^{tree} &&\n'> <'\t git tag lightweight/tag-blob HEAD:file &&\n'> <'\t gitweb_run "p=.git;a=tags"'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'tag: Tag to commit object'>)} 
      {(SQ <'gitweb_run "p=.git;a=tag;h=tag-commit"'>)}
    )
    (C {(test_expect_success)} {(SQ <'tag: on lightweight tag (invalid)'>)} 
      {(SQ <'gitweb_run "p=.git;a=tag;h=lightweight/tag-commit"'>)}
    )
    (C {(test_expect_success)} {(SQ <'logs: log (implicit HEAD)'>)} {(SQ <'gitweb_run "p=.git;a=log"'>)})
    (C {(test_expect_success)} {(SQ <'logs: shortlog (implicit HEAD)'>)} 
      {(SQ <'gitweb_run "p=.git;a=shortlog"'>)}
    )
    (C {(test_expect_success)} {(SQ <'logs: history (implicit HEAD, file)'>)} 
      {(SQ <'gitweb_run "p=.git;a=history;f=file"'>)}
    )
    (C {(test_expect_success)} {(SQ <'logs: history (implicit HEAD, non-existent file)'>)} 
      {(SQ <'gitweb_run "p=.git;a=history;f=non-existent"'>)}
    )
    (C {(test_expect_success)} {(SQ <'logs: history (implicit HEAD, deleted file)'>)} 
      {
        (SQ <'git checkout master &&\n'> <'\t echo "to be deleted" > deleted_file &&\n'> 
          <'\t git add deleted_file &&\n'> <'\t git commit -m "Add file to be deleted" &&\n'> <'\t git rm deleted_file &&\n'> 
          <'\t git commit -m "Delete file" &&\n'> <'\t gitweb_run "p=.git;a=history;f=deleted_file"'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'path_info: project'>)} {(SQ <'gitweb_run "" "/.git"'>)})
    (C {(test_expect_success)} {(SQ <'path_info: project/branch'>)} {(SQ <'gitweb_run "" "/.git/b"'>)})
    (C {(test_expect_success)} {(SQ <'path_info: project/branch:file'>)} 
      {(SQ <'gitweb_run "" "/.git/master:file"'>)}
    )
    (C {(test_expect_success)} {(SQ <'path_info: project/branch:dir/'>)} 
      {(SQ <'gitweb_run "" "/.git/master:foo/"'>)}
    )
    (C {(test_expect_success)} {(SQ <'path_info: project/branch (non-existent)'>)} 
      {(SQ <'gitweb_run "" "/.git/non-existent"'>)}
    )
    (C {(test_expect_success)} {(SQ <'path_info: project/branch:filename (non-existent branch)'>)} 
      {(SQ <'gitweb_run "" "/.git/non-existent:non-existent"'>)}
    )
    (C {(test_expect_success)} {(SQ <'path_info: project/branch:file (non-existent)'>)} 
      {(SQ <'gitweb_run "" "/.git/master:non-existent"'>)}
    )
    (C {(test_expect_success)} {(SQ <'path_info: project/branch:dir/ (non-existent)'>)} 
      {(SQ <'gitweb_run "" "/.git/master:non-existent/"'>)}
    )
    (C {(test_expect_success)} {(SQ <'path_info: project/branch:/file'>)} 
      {(SQ <'gitweb_run "" "/.git/master:/file"'>)}
    )
    (C {(test_expect_success)} {(SQ <'path_info: project/:/file (implicit HEAD)'>)} 
      {(SQ <'gitweb_run "" "/.git/:/file"'>)}
    )
    (C {(test_expect_success)} {(SQ <'path_info: project/:/ (implicit HEAD, top tree)'>)} 
      {(SQ <'gitweb_run "" "/.git/:/"'>)}
    )
    (C {(test_expect_success)} {(SQ <'feeds: OPML'>)} {(SQ <'gitweb_run "a=opml"'>)})
    (C {(test_expect_success)} {(SQ <'feed: RSS'>)} {(SQ <'gitweb_run "p=.git;a=rss"'>)})
    (C {(test_expect_success)} {(SQ <'feed: Atom'>)} {(SQ <'gitweb_run "p=.git;a=atom"'>)})
    (C {(test_expect_success)} {(SQ <'encode(commit): utf8'>)} 
      {
        (SQ <'. "$TEST_DIRECTORY"/t3901-utf8.txt &&\n'> 
          <'\t test_when_finished "GIT_AUTHOR_NAME=\\"A U Thor\\"" &&\n'> <'\t test_when_finished "GIT_COMMITTER_NAME=\\"C O Mitter\\"" &&\n'> <'\t echo "UTF-8" >> file &&\n'> 
          <'\t git add file &&\n'> <'\t git commit -F "$TEST_DIRECTORY"/t3900/1-UTF-8.txt &&\n'> <'\t gitweb_run "p=.git;a=commit"'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'encode(commit): iso-8859-1'>)} 
      {
        (SQ <'. "$TEST_DIRECTORY"/t3901-8859-1.txt &&\n'> 
          <'\t test_when_finished "GIT_AUTHOR_NAME=\\"A U Thor\\"" &&\n'> <'\t test_when_finished "GIT_COMMITTER_NAME=\\"C O Mitter\\"" &&\n'> 
          <'\t echo "ISO-8859-1" >> file &&\n'> <'\t git add file &&\n'> <'\t test_config i18n.commitencoding ISO-8859-1 &&\n'> 
          <'\t git commit -F "$TEST_DIRECTORY"/t3900/ISO8859-1.txt &&\n'> <'\t gitweb_run "p=.git;a=commit"'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'encode(log): utf-8 and iso-8859-1'>)} 
      {(SQ <'gitweb_run "p=.git;a=log"'>)}
    )
    (C {(test_expect_success)} {(SQ <'opt: log --no-merges'>)} 
      {(SQ <'gitweb_run "p=.git;a=log;opt=--no-merges"'>)}
    )
    (C {(test_expect_success)} {(SQ <'opt: atom --no-merges'>)} 
      {(SQ <'gitweb_run "p=.git;a=log;opt=--no-merges"'>)}
    )
    (C {(test_expect_success)} {(SQ <'opt: "file" history --no-merges'>)} 
      {(SQ <'gitweb_run "p=.git;a=history;f=file;opt=--no-merges"'>)}
    )
    (C {(test_expect_success)} {(SQ <'opt: log --no-such-option (invalid option)'>)} 
      {(SQ <'gitweb_run "p=.git;a=log;opt=--no-such-option"'>)}
    )
    (C {(test_expect_success)} {(SQ <'opt: tree --no-merges (invalid option for action)'>)} 
      {(SQ <'gitweb_run "p=.git;a=tree;opt=--no-merges"'>)}
    )
    (C {(test_expect_success)} {(SQ <'URL: no project URLs, no base URL'>)} 
      {(SQ <'gitweb_run "p=.git;a=summary"'>)}
    )
    (C {(test_expect_success)} {(SQ <'URL: project URLs via gitweb.url'>)} 
      {
        (SQ <'git config --add gitweb.url git://example.com/git/trash.git &&\n'> 
          <'        git config --add gitweb.url http://example.com/git/trash.git &&\n'> <'        gitweb_run "p=.git;a=summary"'>
        )
      }
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:16777215 arg_word:{(.git/cloneurl)} spids:[1648])
        (HereDoc
          op_id: Redir_DLess
          fd: 16777215
          body: {('git://example.com/git/trash.git\n') ('http://example.com/git/trash.git\n')}
          do_expansion: False
          here_end: EOF
          was_filled: True
          spids: [1651]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <'URL: project URLs via cloneurl file'>)} 
      {(SQ <'gitweb_run "p=.git;a=summary"'>)}
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_DGreat fd:16777215 arg_word:{(gitweb_config.perl)} spids:[1680])
        (HereDoc
          op_id: Redir_DLess
          fd: 16777215
          body: 
            {('\n') ('# turn on override for each overridable feature\n') 
              ('foreach my $key (keys %feature) {\n') ("\tif ($feature{$key}{'sub'}) {\n") ("\t\t$feature{$key}{'override'} = 1;\n") ('\t}\n') ('}\n')
            }
          do_expansion: False
          here_end: EOF
          was_filled: True
          spids: [1683]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <'config override: projects list (implicit)'>)} {(SQ <gitweb_run>)})
    (C {(test_expect_success)} 
      {(SQ <'config override: tree view, features not overridden in repo config'>)} {(SQ <'gitweb_run "p=.git;a=tree"'>)}
    )
    (C {(test_expect_success)} {(SQ <'config override: tree view, features disabled in repo config'>)} 
      {
        (SQ <'git config gitweb.blame no &&\n'> <'\t git config gitweb.snapshot none &&\n'> 
          <'\t git config gitweb.avatar gravatar &&\n'> <'\t gitweb_run "p=.git;a=tree"'>
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ <'config override: tree view, features enabled in repo config (1)'>)} 
      {
        (SQ <'git config gitweb.blame yes &&\n'> 
          <'\t git config gitweb.snapshot "zip,tgz, tbz2" &&\n'> <'\t gitweb_run "p=.git;a=tree"'>
        )
      }
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:16777215 arg_word:{(.git/config)} spids:[1755])
        (HereDoc
          op_id: Redir_DLess
          fd: 16777215
          body: 
            {('# testing noval and alternate separator\n') ('[gitweb]\n') ('\tblame\n') 
              ('\tsnapshot = zip tgz\n')
            }
          do_expansion: False
          here_end: EOF
          was_filled: True
          spids: [1758]
        )
      ]
    )
    (C {(test_expect_success)} 
      {(SQ <'config override: tree view, features enabled in repo config (2)'>)} {(SQ <'gitweb_run "p=.git;a=tree"'>)}
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_DGreat fd:16777215 arg_word:{(gitweb_config.perl)} spids:[1786])
        (HereDoc
          op_id: Redir_DLess
          fd: 16777215
          body: 
            {('\n') ('# enable search\n') ("$feature{'search'}{'default'} = [1];\n") 
              ("$feature{'grep'}{'default'} = [1];\n") ("$feature{'pickaxe'}{'default'} = [1];\n")
            }
          do_expansion: False
          here_end: EOF
          was_filled: True
          spids: [1789]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <'search: preparation'>)} 
      {
        (SQ <'echo "1st MATCH" >>file &&\n'> <'\t echo "2nd MATCH" >>file &&\n'> 
          <'\t echo "MATCH" >>bar &&\n'> <'\t git add file bar &&\n'> <'\t git commit -m "Added MATCH word"'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'search: commit author'>)} 
      {(SQ <'gitweb_run "p=.git;a=search;h=HEAD;st=author;s=A+U+Thor"'>)}
    )
    (C {(test_expect_success)} {(SQ <'search: commit message'>)} 
      {(SQ <'gitweb_run "p=.git;a=search;h=HEAD;st=commitr;s=MATCH"'>)}
    )
    (C {(test_expect_success)} {(SQ <'search: grep'>)} 
      {(SQ <'gitweb_run "p=.git;a=search;h=HEAD;st=grep;s=MATCH"'>)}
    )
    (C {(test_expect_success)} {(SQ <'search: pickaxe'>)} 
      {(SQ <'gitweb_run "p=.git;a=search;h=HEAD;st=pickaxe;s=MATCH"'>)}
    )
    (C {(test_expect_success)} {(SQ <'search: projects'>)} {(SQ <'gitweb_run "a=project_list;s=.git"'>)})
    (C {(test_expect_success)} {(SQ <'README.html with non-ASCII characters (utf-8)'>)} 
      {
        (SQ <'echo "<b>UTF-8 example:</b><br />" > .git/README.html &&\n'> 
          <'\t cat "$TEST_DIRECTORY"/t3900/1-UTF-8.txt >> .git/README.html &&\n'> <'\t gitweb_run "p=.git;a=summary"'>
        )
      }
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:highlight_version)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [
                      (SimpleCommand
                        words: [{(highlight)} {(--version)}]
                        redirects: [
                          (Redir
                            op_id: Redir_Less
                            fd: 16777215
                            arg_word: {(/dev/null)}
                            spids: [1926]
                          )
                          (Redir
                            op_id: Redir_Great
                            fd: 2
                            arg_word: {(/dev/null)}
                            spids: [1929]
                          )
                        ]
                      )
                    ]
                  )
                left_token: <Left_CommandSub '$('>
                spids: [1921 1931]
              )
            }
          spids: [1920]
        )
      ]
      spids: [1920]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: (C {(Lit_Other '[')} {($ VSub_QMark '$?')} {(-eq)} {(127)} {(Lit_Other ']')})
              terminator: <Op_Semi ';'>
            )
          ]
          action: [(C {(say)} {(DQ ("Skipping syntax highlighting tests: 'highlight' not found"))})]
          spids: [16777215 1946]
        )
        (if_arm
          cond: [
            (Sentence
              child: (C {(test)} {(-z)} {(DQ ($ VSub_Name '$highlight_version'))})
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (C {(say)} {(DQ ("Skipping syntax highlighting tests: incorrect 'highlight' found"))})
          ]
          spids: [1955 1966]
        )
      ]
      else_action: [
        (C {(test_set_prereq)} {(HIGHLIGHT)})
        (SimpleCommand
          words: [{(cat)}]
          redirects: [
            (Redir
              op_id: Redir_DGreat
              fd: 16777215
              arg_word: {(gitweb_config.perl)}
              spids: [1985]
            )
            (HereDoc
              op_id: Redir_DLessDash
              fd: 16777215
              body: 
                {('our $highlight_bin = "highlight";\n') 
                  ("$feature{'highlight'}{'override'} = 1;\n")
                }
              do_expansion: False
              here_end: EOF
              was_filled: True
              spids: [1988]
            )
          ]
        )
      ]
      spids: [1975 1992]
    )
    (C {(test_expect_success)} {(HIGHLIGHT)} 
      {(SQ <'syntax highlighting (no highlight, unknown syntax)'>)} {(SQ <'git config gitweb.highlight yes &&\n'> <'\t gitweb_run "p=.git;a=blob;f=file"'>)}
    )
    (C {(test_expect_success)} {(HIGHLIGHT)} {(SQ <'syntax highlighting (highlighted, shell script)'>)} 
      {
        (SQ <'git config gitweb.highlight yes &&\n'> <'\t echo "#!/usr/bin/sh" > test.sh &&\n'> 
          <'\t git add test.sh &&\n'> <'\t git commit -m "Add test.sh" &&\n'> <'\t gitweb_run "p=.git;a=blob;f=test.sh"'>
        )
      }
    )
    (C {(test_expect_success)} {(HIGHLIGHT)} 
      {(SQ <'syntax highlighting (highlighter language autodetection)'>)} 
      {
        (SQ <'git config gitweb.highlight yes &&\n'> <'\t echo "#!/usr/bin/perl" > test &&\n'> 
          <'\t git add test &&\n'> <'\t git commit -m "Add test" &&\n'> <'\t gitweb_run "p=.git;a=blob;f=test"'>
        )
      }
    )
    (AndOr
      children: [
        (SimpleCommand
          words: [{(cat)}]
          redirects: [
            (Redir
              op_id: Redir_DGreat
              fd: 16777215
              arg_word: {(gitweb_config.perl)}
              spids: [2064]
            )
            (HereDoc
              op_id: Redir_DLess
              fd: 16777215
              body: {("$feature{'forks'}{'default'} = [1];\n")}
              do_expansion: False
              here_end: EOF
              was_filled: True
              spids: [2067]
            )
          ]
        )
        (C {(test_expect_success)} {(SQ <'forks: prepare'>)} 
          {
            (SQ <'git init --bare foo.git &&\n'> 
              <'\t git --git-dir=foo.git --work-tree=. add file &&\n'> <'\t git --git-dir=foo.git --work-tree=. commit -m "Initial commit" &&\n'> 
              <'\t echo "foo" > foo.git/description &&\n'> <'\t mkdir -p foo &&\n'> <'\t (cd foo &&\n'> 
              <'\t  git clone --shared --bare ../foo.git foo-forked.git &&\n'> <'\t  echo "fork of foo" > foo-forked.git/description)'>
            )
          }
        )
      ]
      op_id: Op_DAmp
    )
    (C {(test_expect_success)} {(SQ <'forks: projects list'>)} {(SQ <gitweb_run>)})
    (C {(test_expect_success)} {(SQ <'forks: forks action'>)} {(SQ <'gitweb_run "p=foo.git;a=forks"'>)})
    (AndOr
      children: [
        (SimpleCommand
          words: [{(cat)}]
          redirects: [
            (Redir
              op_id: Redir_DGreat
              fd: 16777215
              arg_word: {(gitweb_config.perl)}
              spids: [2135]
            )
            (HereDoc
              op_id: Redir_DLessDash
              fd: 16777215
              body: 
                {("# we don't test _setting_ content tags, so any true value is good\n") 
                  ("$feature{'ctags'}{'default'} = ['ctags_script.cgi'];\n")
                }
              do_expansion: False
              here_end: EOF
              was_filled: True
              spids: [2138]
            )
          ]
        )
        (C {(test_expect_success)} {(SQ <'ctags: tag cloud in projects list'>)} 
          {
            (SQ <'mkdir .git/ctags &&\n'> <'\t echo "2" > .git/ctags/foo &&\n'> 
              <'\t echo "1" > .git/ctags/bar &&\n'> <'\tgitweb_run'>
            )
          }
        )
      ]
      op_id: Op_DAmp
    )
    (C {(test_expect_success)} {(SQ <'ctags: search projects by existing tag'>)} 
      {(SQ <'gitweb_run "by_tag=foo"'>)}
    )
    (C {(test_expect_success)} {(SQ <'ctags: search projects by non existent tag'>)} 
      {(SQ <'gitweb_run "by_tag=non-existent"'>)}
    )
    (C {(test_expect_success)} {(SQ <'ctags: malformed tag weights'>)} 
      {
        (SQ <'mkdir -p .git/ctags &&\n'> <'\t echo "not-a-number" > .git/ctags/nan &&\n'> 
          <'\t echo "not-a-number-2" > .git/ctags/nan2 &&\n'> <'\t echo "0.1" >.git/ctags/floating-point &&\n'> <'\t gitweb_run'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'categories: projects list, only default category'>)} 
      {
        (SQ <'echo "\\$projects_list_group_categories = 1;" >>gitweb_config.perl &&\n'> 
          <'\t gitweb_run'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'unborn HEAD: "summary" page (with "heads" subview)'>)} 
      {
        (SQ <'{\n'> <'\t\tgit checkout orphan_branch ||\n'> 
          <'\t\tgit checkout --orphan orphan_branch\n'> <'\t } &&\n'> <'\t test_when_finished "git checkout master" &&\n'> <'\t gitweb_run "p=.git;a=summary"'>
        )
      }
    )
    (C {(test_done)})
  ]
)