Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | * factored out th1 tests from th1.test that need a repository (takes longer to test) * fixed tests that had wrong result expectations * finally: implemented test for new th1-dir-cmd |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | ckol-th1-dir-cmd |
Files: | files | file ages | folders |
SHA1: |
484d7d8ea70ebe9b6dbf804daece8754 |
User & Date: | ckolumbus 2015-08-15 13:22:06.102 |
Context
2015-08-15
| ||
13:37 | added copyright header to test file ... (check-in: a0d01050 user: ckolumbus tags: ckol-th1-dir-cmd) | |
13:22 | * factored out th1 tests from th1.test that need a repository (takes longer to test) * fixed tests that had wrong result expectations * finally: implemented test for new th1-dir-cmd ... (check-in: 484d7d8e user: ckolumbus tags: ckol-th1-dir-cmd) | |
2015-08-14
| ||
19:40 | added documentation for new th1 command 'dir' ... (check-in: 00e634fe user: ckolumbus tags: ckol-th1-dir-cmd) | |
Changes
Added test/th1-repo.test.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | ############################################################################ # # TH1-repo # catch {exec $::fossilexe info} res puts res=$res if {![regexp {use --repository} $res]} { puts stderr "Cannot run this test within an open checkout" return } ######################################## # Setup: Add Files and Commit # ######################################## set rootDir [file normalize [pwd]] set undoMsg "\n \"fossil undo\" is\ available to undo changes to the\ working checkout." repo_init write_file f1.md "f1" write_file f2.md "f2" write_file f3.txt "f3" write_file f4.md "f4" file mkdir [file join $rootDir test] write_file [file join $rootDir test th1.test] "th1.test" file mkdir [file join $rootDir subdirA] # NOTE: There are no files in subdirA. file mkdir [file join $rootDir subdirB] write_file [file join $rootDir subdirB f5.md] "f5" write_file [file join $rootDir subdirB f6.md] "f6" write_file [file join $rootDir subdirB f7.txt] "f7" write_file [file join $rootDir subdirB f8.md] "f8" write_file [file join $rootDir subdirB f9.wiki] "f9" file mkdir [file join $rootDir subdirC] write_file [file join $rootDir subdirC f10.md] "f10" write_file [file join $rootDir subdirC f11t.xt] "f11" set files_md [list subdirB/f5.md subdirB/f6.md subdirB/f8.md subdirC/f10.md] fossil add $rootDir fossil commit -m "c1" set dir [file dirname [info script]] ############################################################################### fossil test-th-eval "checkout 1"; # NOTE: Assumes running "in tree". test th1-checkout-1 {[string length $RESULT] > 0} ############################################################################### fossil test-th-eval "checkout"; # NOTE: Assumes running "in tree". test th1-checkout-2 {[string length $RESULT] > 0} ############################################################################### set savedPwd [pwd]; cd / fossil test-th-eval "checkout 1" cd $savedPwd; unset savedPwd test th1-checkout-3 {[string length $RESULT] == 0} ############################################################################### set savedPwd [pwd]; cd / fossil test-th-eval "checkout" cd $savedPwd; unset savedPwd test th1-checkout-4 {[string length $RESULT] == 0} ############################################################################### fossil test-th-eval "styleHeader {Page Title Here}" test th1-header-1 {$RESULT eq {TH_ERROR: repository unavailable}} ############################################################################### fossil test-th-eval --open-config "styleHeader {Page Title Here}" test th1-header-2 {[regexp -- {<title>Unnamed Fossil Project: Page Title Here</title>} $RESULT]} ############################################################################### fossil test-th-eval "styleFooter" test th1-footer-1 {$RESULT eq {TH_ERROR: repository unavailable}} ############################################################################### fossil test-th-eval --open-config "styleFooter" test th1-footer-2 {$RESULT eq {}} ############################################################################### fossil test-th-eval --open-config --cgi "styleHeader {}; styleFooter" test th1-footer-3 {[regexp -- {</body></html>} $RESULT]} ############################################################################### fossil test-th-eval "artifact" test th1-artifact-1 {$RESULT eq \ {TH_ERROR: wrong # args: should be "artifact ID ?FILENAME?"}} ############################################################################### fossil test-th-eval "artifact tip" test th1-artifact-2 {$RESULT eq {TH_ERROR: repository unavailable}} ############################################################################### fossil test-th-eval --open-config "artifact tip" test th1-artifact-3 {[regexp -- {F test/th1\.test [0-9a-f]{40}} $RESULT]} ############################################################################### fossil test-th-eval "artifact 0000000000" test th1-artifact-4 {$RESULT eq {TH_ERROR: repository unavailable}} ############################################################################### fossil test-th-eval --open-config "artifact 0000000000" test th1-artifact-5 {$RESULT eq {TH_ERROR: name not found}} ############################################################################### fossil test-th-eval "artifact tip test/th1.test" test th1-artifact-6 {$RESULT eq {TH_ERROR: repository unavailable}} ############################################################################### fossil test-th-eval --open-config "artifact tip test/th1.test" test th1-artifact-7 {[regexp -- {th1\.test} $RESULT]} ############################################################################### fossil test-th-eval "artifact 0000000000 test/th1.test" test th1-artifact-8 {$RESULT eq {TH_ERROR: repository unavailable}} ############################################################################### fossil test-th-eval --open-config "artifact 0000000000 test/th1.test" test th1-artifact-9 {$RESULT eq {TH_ERROR: manifest not found}} ############################################################################### fossil test-th-eval "globalState checkout" test th1-globalState-repo-1 {[string length $RESULT] > 0} ############################################################################### fossil test-th-eval "globalState repository" test th1-globalState-repo-2 {[string length $RESULT] > 0} ############################################################################### fossil test-th-eval --open-config "dir trunk subdir*/*.md" set l [llength $RESULT ] test th1-dir-1 { $l eq [llength $files_md] } set n 1 foreach i $RESULT j $files_md { test th1-dir-2-$n { $i eq $j } set n [expr $n + 1] } |
Changes to test/th1.test.
︙ | ︙ | |||
550 551 552 553 554 555 556 | test th1-expr-48 {$RESULT eq {TH_ERROR: expected integer, got: "+0x"}} ############################################################################### fossil test-th-eval "lindex list -0x" test th1-expr-49 {$RESULT eq {TH_ERROR: expected integer, got: "-0x"}} | < < < < < < < < < < < < < < < < < < < < < < < | 550 551 552 553 554 555 556 557 558 559 560 561 562 563 | test th1-expr-48 {$RESULT eq {TH_ERROR: expected integer, got: "+0x"}} ############################################################################### fossil test-th-eval "lindex list -0x" test th1-expr-49 {$RESULT eq {TH_ERROR: expected integer, got: "-0x"}} ############################################################################### fossil test-th-eval "render {}" test th1-render-1 {$RESULT eq {}} ############################################################################### |
︙ | ︙ | |||
632 633 634 635 636 637 638 | th1-setup {} => TH_OK<br /> this is a trace message. ------------------- END TRACE LOG -------------------}} } ############################################################################### | < < < < < < < < < < < < < < < < < < < < < < < < < | 609 610 611 612 613 614 615 616 617 618 619 620 621 622 | th1-setup {} => TH_OK<br /> this is a trace message. ------------------- END TRACE LOG -------------------}} } ############################################################################### fossil test-th-eval "getParameter" test th1-get-parameter-1 {$RESULT eq \ {TH_ERROR: wrong # args: should be "getParameter NAME ?DEFAULT?"}} ############################################################################### fossil test-th-eval "getParameter test1" |
︙ | ︙ | |||
709 710 711 712 713 714 715 | ############################################################################### fossil test-th-eval "setParameter test4 value4; setParameter test4 value5; getParameter test4 defValue4" test th1-set-parameter-7 {$RESULT eq {value5}} ############################################################################### | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | | | | | | < < < < < | | | | | | | | | | | | | | | | 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 | ############################################################################### fossil test-th-eval "setParameter test4 value4; setParameter test4 value5; getParameter test4 defValue4" test th1-set-parameter-7 {$RESULT eq {value5}} ############################################################################### fossil test-th-eval "globalState checkout" test th1-globalState-1 {$RESULT eq [fossil test-th-eval checkout]} ############################################################################### fossil test-th-eval "globalState configuration" test th1-globalState-2 {[string length $RESULT] == 0} ############################################################################### fossil test-th-eval --open-config "globalState configuration" test th1-globalState-3 {[string length $RESULT] > 0} ############################################################################### fossil test-th-eval "globalState executable" test th1-globalState-4 {[file rootname [file tail $RESULT]] eq "fossil"} ############################################################################### fossil test-th-eval "globalState log" test th1-globalState-5 {[string length $RESULT] == 0} ############################################################################### fossil test-th-eval --errorlog foserrors.log "globalState log" test th1-globalState-6 {$RESULT eq "foserrors.log"} ############################################################################### fossil test-th-eval "globalState repository" test th1-globalState-7 {$RESULT eq [fossil test-th-eval repository]} ############################################################################### fossil test-th-eval "globalState top" test th1-globalState-8 {[string length $RESULT] == 0} ############################################################################### fossil test-th-eval "globalState user" test th1-globalState-9 {[string length $RESULT] == 0} ############################################################################### fossil test-th-eval --user fossil-th1-test "globalState user" test th1-globalState-10 {$RESULT eq "fossil-th1-test"} ############################################################################### fossil test-th-eval "globalState vfs" test th1-globalState-11 {[string length $RESULT] == 0} ############################################################################### fossil test-th-eval "globalState vfs" test th1-globalState-12 {[string length $RESULT] == 0} ############################################################################### if {$tcl_platform(platform) eq "windows"} then { set altVfs win32-longpath } else { set altVfs unix-dotfile } ############################################################################### fossil test-th-eval --vfs $altVfs "globalState vfs" test th1-globalState-13 {$RESULT eq $altVfs} ############################################################################### fossil test-th-eval "globalState flags" test th1-globalState-14 {$RESULT eq "0"} ############################################################################### fossil test-th-eval "reinitialize; globalState configuration" test th1-reinitialize-1 {$RESULT eq ""} ############################################################################### fossil test-th-eval "reinitialize 1; globalState configuration" test th1-reinitialize-2 {$RESULT ne ""} ############################################################################### # # NOTE: This test may fail if the command names do not always come # out in a deterministic order from TH1. # #fossil test-th-eval "info commands" #test th1-info-commands-1 {$RESULT eq {linecount htmlize date stime\ #enable_output uplevel http expr glob_match utime styleFooter catch if\ #tclReady searchable reinitialize combobox lindex query html anoncap randhex\ #llength for set break regexp markdown styleHeader puts return checkout\ #decorate artifact trace wiki proc hascap globalState continue getParameter\ #hasfeature setting lsearch breakpoint upvar render repository string unset\ #setParameter list error info rename anycap httpize}} ############################################################################### fossil test-th-eval "info vars" test th1-info-vars-1 {$RESULT eq ""} ############################################################################### |
︙ | ︙ |