From 4f49b16079b27d7ce633619e4cddfdf2bffbc952 Mon Sep 17 00:00:00 2001 From: cashmere Date: Fri, 4 Sep 2026 09:05:24 +0200 Subject: initial commit --- test/th1-docs.test | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 test/th1-docs.test (limited to 'test/th1-docs.test') diff --git a/test/th1-docs.test b/test/th1-docs.test new file mode 100644 index 0000000..17980d2 --- /dev/null +++ b/test/th1-docs.test @@ -0,0 +1,76 @@ +# +# Copyright (c) 2015 D. Richard Hipp +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the Simplified BSD License (also +# known as the "2-Clause License" or "FreeBSD License".) +# +# This program is distributed in the hope that it will be useful, +# but without any warranty; without even the implied warranty of +# merchantability or fitness for a particular purpose. +# +# Author contact information: +# drh@hwaci.com +# http://www.hwaci.com/drh/ +# +############################################################################ +# +# TH1 Docs +# + +fossil test-th-eval "hasfeature th1Docs" + +if {[normalize_result] ne "1"} { + puts "Fossil was not compiled with TH1 docs support." + test_cleanup_then_return +} + +fossil test-th-eval "hasfeature tcl" + +if {[normalize_result] ne "1"} { + puts "Fossil was not compiled with Tcl support." + test_cleanup_then_return +} + +############################################################################### + +test_setup + +############################################################################### + +set env(TH1_ENABLE_DOCS) 1; # TH1 docs must be enabled for this test. +set env(TH1_ENABLE_TCL) 1; # Tcl integration must be enabled for this test. + +############################################################################### + +set data [fossil info] + +regexp -line -- {^repository: (.*)$} $data dummy repository + +if {[string length $repository] == 0 || ![file exists $repository]} { + error "unable to locate repository" +} + +set dataFileName [file join $::testdir th1-docs-input.txt] +set origFileStat [file join $::testdir fileStat.th1] + +if {![file exists $origFileStat]} { + error "unable to locate [$origFileStat]" +} + +file copy $origFileStat fileStat.th1 +fossil add fileStat.th1 +fossil commit -m "Add fileStat.th1" + +############################################################################### + +set RESULT [test_fossil_http \ + $repository $dataFileName /doc/trunk/fileStat.th1] + +test th1-docs-1a {[regexp {Unnamed Fossil Project: fileStat.th1} $RESULT]} +test th1-docs-1b {[regexp {>\[[0-9a-f]{40,64}\]<} $RESULT]} +test th1-docs-1c {[regexp { contains \d+ files\.} $RESULT]} + +############################################################################### + +test_cleanup -- cgit v1.3.1