Fossil

Check-in [a9dc33d4]
Login

Check-in [a9dc33d4]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Allow the 'th1' test file to fully pass with or without the 'tcl' and 'th1-hooks' settings enabled.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a9dc33d415730a64ba4dde7c38e6c750bdc2fec7
User & Date: mistachkin 2016-01-11 21:09:29
Context
2016-01-11
22:16
Remove superfluous use of 'file join' from 'auto.def'. ... (check-in: 3728aa62 user: mistachkin tags: trunk)
21:09
Allow the 'th1' test file to fully pass with or without the 'tcl' and 'th1-hooks' settings enabled. ... (check-in: a9dc33d4 user: mistachkin tags: trunk)
21:08
Skip test 'th1-tcl2' if the SQLite package for Tcl is not available. ... (check-in: 2fbbd4f6 user: mistachkin tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/th1.test.
18
19
20
21
22
23
24





25
26
27
28
29
30
31
32
33
# TH1 Commands
#

set dir [file dirname [info script]]; repo_init

###############################################################################






fossil test-th-eval --open-config "setting th1-hooks"
set th1Hooks [expr {$RESULT eq "1"}]

###############################################################################

fossil test-th-eval --open-config "setting abc"
test th1-setting-1 {$RESULT eq ""}

###############################################################################







>
>
>
>
>

|







18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# TH1 Commands
#

set dir [file dirname [info script]]; repo_init

###############################################################################

fossil test-th-eval --open-config "setting tcl"
set th1Tcl [expr {$RESULT eq "1" || [info exists ::env(TH1_ENABLE_TCL)]}]

###############################################################################

fossil test-th-eval --open-config "setting th1-hooks"
set th1Hooks [expr {$RESULT eq "1" || [info exists ::env(TH1_ENABLE_HOOKS)]}]

###############################################################################

fossil test-th-eval --open-config "setting abc"
test th1-setting-1 {$RESULT eq ""}

###############################################################################
883
884
885
886
887
888
889


890
891
892









893
894
895
896

897

898
899
900





901

902
903
904
905





906

907
908
909
910





911

912
913
914
915
916
917
918
919
920





921

922
923
924
925
926
927
928
###############################################################################

#
# 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 dir http expr glob_match utime styleFooter encode64\
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 ""}


###############################################################################

fossil test-th-eval "set x 1; info vars"





test th1-info-vars-2 {$RESULT eq "x"}


###############################################################################

fossil test-th-eval "set x 1; unset x; info vars"





test th1-info-vars-3 {$RESULT eq ""}


###############################################################################

fossil test-th-eval "proc foo {} {set x 1; info vars}; foo"
test th1-info-vars-4 {$RESULT eq "x"}

###############################################################################

fossil test-th-eval "set y 1; proc foo {} {set x 1; uplevel 1 {info vars}}; foo"





test th1-info-vars-5 {$RESULT eq "y"}


###############################################################################

fossil test-th-eval "lsearch"
test th1-lsearch-1 {$RESULT eq \
    {TH_ERROR: wrong # args: should be "lsearch list string"}}








>
>
|
|
|
>
>
>
>
>
>
>
>
>
|
|
|
|
>
|
>



>
>
>
>
>
|
>




>
>
>
>
>
|
>




>
>
>
>
>
|
>









>
>
>
>
>
|
>







888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
###############################################################################

#
# 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"

if {$th1Tcl} {
  test th1-info-commands-1 {$RESULT eq {linecount htmlize date stime\
      enable_output uplevel dir http expr glob_match utime styleFooter encode64\
      catch if tclReady searchable reinitialize combobox lindex tclIsSafe query\
      html anoncap randhex llength for set break regexp markdown styleHeader\
      puts return checkout decorate artifact trace wiki proc tclInvoke hascap\
      globalState continue getParameter hasfeature setting lsearch breakpoint\
      upvar render repository string unset setParameter list error info rename\
      tclExpr anycap tclEval httpize tclMakeSafe}}
} else {
  test th1-info-commands-1 {$RESULT eq {linecount htmlize date stime\
      enable_output uplevel dir http expr glob_match utime styleFooter encode64\
      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"

if {$th1Hooks} {
  test th1-info-vars-1 {$RESULT eq \
      "th_stack_trace cmd_flags cmd_name cmd_args"}
} else {
  test th1-info-vars-1 {$RESULT eq ""}
}

###############################################################################

fossil test-th-eval "set x 1; info vars"

if {$th1Hooks} {
  test th1-info-vars-2 {$RESULT eq \
      "x th_stack_trace cmd_flags cmd_name cmd_args"}
} else {
  test th1-info-vars-2 {$RESULT eq "x"}
}

###############################################################################

fossil test-th-eval "set x 1; unset x; info vars"

if {$th1Hooks} {
  test th1-info-vars-3 {$RESULT eq \
      "th_stack_trace cmd_flags cmd_name cmd_args"}
} else {
  test th1-info-vars-3 {$RESULT eq ""}
}

###############################################################################

fossil test-th-eval "proc foo {} {set x 1; info vars}; foo"
test th1-info-vars-4 {$RESULT eq "x"}

###############################################################################

fossil test-th-eval "set y 1; proc foo {} {set x 1; uplevel 1 {info vars}}; foo"

if {$th1Hooks} {
  test th1-info-vars-5 {$RESULT eq \
      "th_stack_trace y cmd_flags cmd_name cmd_args"}
} else {
  test th1-info-vars-5 {$RESULT eq "y"}
}

###############################################################################

fossil test-th-eval "lsearch"
test th1-lsearch-1 {$RESULT eq \
    {TH_ERROR: wrong # args: should be "lsearch list string"}}