Fossil SCM

Coding style, removing superfluous 'then' clauses from tester.tcl.

mistachkin 2016-10-15 05:02 trunk
Commit 4946b5b186cdd2f24a37bd5a8a273c7f9f8a7bbf
1 file changed +6 -6
+6 -6
--- test/tester.tcl
+++ test/tester.tcl
@@ -793,25 +793,25 @@
793793
# NOTE: On Windows, the "stop argument" must be the name of a file
794794
# that does NOT already exist.
795795
#
796796
if {[string length $stopArg] > 0 && \
797797
![file exists $stopArg] && \
798
- [catch {write_file $stopArg [clock seconds]}] == 0} then {
798
+ [catch {write_file $stopArg [clock seconds]}] == 0} {
799799
while {1} {
800800
if {[catch {
801801
#
802802
# NOTE: Using the TaskList utility requires Windows XP or
803803
# later.
804804
#
805805
exec tasklist.exe /FI "PID eq $pid"
806
- } result] != 0 || ![regexp -- " $pid " $result]} then {
806
+ } result] != 0 || ![regexp -- " $pid " $result]} {
807807
break
808808
}
809809
after 1000; # wait a bit...
810810
}
811811
file delete $stopArg
812
- if {[string length $fileName] > 0} then {
812
+ if {[string length $fileName] > 0} {
813813
file delete $fileName
814814
}
815815
return true
816816
}
817817
} else {
@@ -818,24 +818,24 @@
818818
#
819819
# NOTE: On Unix, the "stop argument" must be an integer identifier
820820
# that refers to an existing process.
821821
#
822822
if {[regexp {^(?:-)?\d+$} $stopArg] && \
823
- [catch {exec kill -TERM $stopArg}] == 0} then {
823
+ [catch {exec kill -TERM $stopArg}] == 0} {
824824
while {1} {
825825
if {[catch {
826826
#
827827
# TODO: Is this portable to all the supported variants of
828828
# Unix? It should be, it's POSIX.
829829
#
830830
exec ps -p $pid
831
- } result] != 0 || ![regexp -- "(?:^$pid| $pid) " $result]} then {
831
+ } result] != 0 || ![regexp -- "(?:^$pid| $pid) " $result]} {
832832
break
833833
}
834834
after 1000; # wait a bit...
835835
}
836
- if {[string length $fileName] > 0} then {
836
+ if {[string length $fileName] > 0} {
837837
file delete $fileName
838838
}
839839
return true
840840
}
841841
}
842842
--- test/tester.tcl
+++ test/tester.tcl
@@ -793,25 +793,25 @@
793 # NOTE: On Windows, the "stop argument" must be the name of a file
794 # that does NOT already exist.
795 #
796 if {[string length $stopArg] > 0 && \
797 ![file exists $stopArg] && \
798 [catch {write_file $stopArg [clock seconds]}] == 0} then {
799 while {1} {
800 if {[catch {
801 #
802 # NOTE: Using the TaskList utility requires Windows XP or
803 # later.
804 #
805 exec tasklist.exe /FI "PID eq $pid"
806 } result] != 0 || ![regexp -- " $pid " $result]} then {
807 break
808 }
809 after 1000; # wait a bit...
810 }
811 file delete $stopArg
812 if {[string length $fileName] > 0} then {
813 file delete $fileName
814 }
815 return true
816 }
817 } else {
@@ -818,24 +818,24 @@
818 #
819 # NOTE: On Unix, the "stop argument" must be an integer identifier
820 # that refers to an existing process.
821 #
822 if {[regexp {^(?:-)?\d+$} $stopArg] && \
823 [catch {exec kill -TERM $stopArg}] == 0} then {
824 while {1} {
825 if {[catch {
826 #
827 # TODO: Is this portable to all the supported variants of
828 # Unix? It should be, it's POSIX.
829 #
830 exec ps -p $pid
831 } result] != 0 || ![regexp -- "(?:^$pid| $pid) " $result]} then {
832 break
833 }
834 after 1000; # wait a bit...
835 }
836 if {[string length $fileName] > 0} then {
837 file delete $fileName
838 }
839 return true
840 }
841 }
842
--- test/tester.tcl
+++ test/tester.tcl
@@ -793,25 +793,25 @@
793 # NOTE: On Windows, the "stop argument" must be the name of a file
794 # that does NOT already exist.
795 #
796 if {[string length $stopArg] > 0 && \
797 ![file exists $stopArg] && \
798 [catch {write_file $stopArg [clock seconds]}] == 0} {
799 while {1} {
800 if {[catch {
801 #
802 # NOTE: Using the TaskList utility requires Windows XP or
803 # later.
804 #
805 exec tasklist.exe /FI "PID eq $pid"
806 } result] != 0 || ![regexp -- " $pid " $result]} {
807 break
808 }
809 after 1000; # wait a bit...
810 }
811 file delete $stopArg
812 if {[string length $fileName] > 0} {
813 file delete $fileName
814 }
815 return true
816 }
817 } else {
@@ -818,24 +818,24 @@
818 #
819 # NOTE: On Unix, the "stop argument" must be an integer identifier
820 # that refers to an existing process.
821 #
822 if {[regexp {^(?:-)?\d+$} $stopArg] && \
823 [catch {exec kill -TERM $stopArg}] == 0} {
824 while {1} {
825 if {[catch {
826 #
827 # TODO: Is this portable to all the supported variants of
828 # Unix? It should be, it's POSIX.
829 #
830 exec ps -p $pid
831 } result] != 0 || ![regexp -- "(?:^$pid| $pid) " $result]} {
832 break
833 }
834 after 1000; # wait a bit...
835 }
836 if {[string length $fileName] > 0} {
837 file delete $fileName
838 }
839 return true
840 }
841 }
842

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button