From acfb4f24c57dfd14e7212e99de3d4883fe40efbd Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Sun, 14 Jan 2024 08:00:29 +0100 Subject: [PATCH] ts: add test to improve getInterpVar proc coverage --- testsuite/example/siteconfig.tcl-1 | 9 +++++++++ testsuite/modules.00-init/120-siteconfig.exp | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/testsuite/example/siteconfig.tcl-1 b/testsuite/example/siteconfig.tcl-1 index b02efad7..c935bf27 100644 --- a/testsuite/example/siteconfig.tcl-1 +++ b/testsuite/example/siteconfig.tcl-1 @@ -584,4 +584,13 @@ if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_MKDIR_COLLDIR)]} { } } +# specific test to improve getInterpVar proc coverage +if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_GETINTERPVAR)]} { + interp create foo + report [getInterpVar foo bar undef] + foo eval {set bar value} + report [getInterpVar foo bar undef] + interp delete foo +} + } diff --git a/testsuite/modules.00-init/120-siteconfig.exp b/testsuite/modules.00-init/120-siteconfig.exp index d689ccfb..ae4d1fd2 100644 --- a/testsuite/modules.00-init/120-siteconfig.exp +++ b/testsuite/modules.00-init/120-siteconfig.exp @@ -608,6 +608,15 @@ set tserr "$error_msgs: Collection unk cannot be read.\n couldn't open \"/path/ testouterr_cmd_re sh -V ERR $tserr unsetenv_var TESTSUITE_ENABLE_SITECONFIG_READCOLLCONTENT +# getInterpVar coverage test +setenv_var TESTSUITE_ENABLE_SITECONFIG_GETINTERPVAR 1 +set ans [list] +lappend ans undef +lappend ans value +lappend ans $vers_reportre +testouterr_cmd_re sh -V OK [join $ans \n] +unsetenv_var TESTSUITE_ENABLE_SITECONFIG_GETINTERPVAR + } elseif {$verbose} { send_user "\tSkip tests relying on an excepted siteconfig file installed\n" }