[education/rkward] /: Update tests, minor fix

Thomas Friedrichsmeier null at kde.org
Sat Apr 9 21:45:16 BST 2022


Git commit a3b3289e3e559816225b607fb892143dcd23bac8 by Thomas Friedrichsmeier.
Committed on 09/04/2022 at 20:45.
Pushed by tfry into branch 'master'.

Update tests, minor fix

M  +2    -2    README
M  +1    -1    rkward/plugins/plots/histogram.js
M  +8    -7    tests/all_tests.R
M  +11   -4    tests/import_export_plugins.R
M  +1    -2    tests/import_export_plugins/import_csv_overwrite.messages.txt
M  +1    -2    tests/import_export_plugins/import_spss.messages.txt
M  +2    -2    tests/import_export_plugins/import_spss.rkout
M  +1    -1    tests/import_export_plugins/setworkdir.rkcommands.R

https://invent.kde.org/education/rkward/commit/a3b3289e3e559816225b607fb892143dcd23bac8

diff --git a/README b/README
index 8d8d46ff..e7bc0686 100644
--- a/README
+++ b/README
@@ -8,5 +8,5 @@ Please see INSTALL for details.
 Getting help / getting involved
 ==================
 
-For contact information, please refer to the rkward website: http://rkward.kde.org
-You may also post all sorts of questions to the main mailing list: rkward-devel AT lists DOT sourceforge DOT net
+For contact information, please refer to the rkward website: https://rkward.kde.org
+You may also post all sorts of questions to the main mailing list: rkward-devel at kde.org
diff --git a/rkward/plugins/plots/histogram.js b/rkward/plugins/plots/histogram.js
index 23348430..f210b31d 100644
--- a/rkward/plugins/plots/histogram.js
+++ b/rkward/plugins/plots/histogram.js
@@ -18,7 +18,7 @@ function doPrintout (full) {
 	if (full) {
 		echo ('rk.header (' + i18n ("Histogram") + ', list (' + i18n ("Variable") + '=rk.get.description (' + x + ')' + getValue ("histogram_opt.code.preprocess") + '))\n');
 		if ((densityscaled) && getValue ("density")) {
-			new Header (i18n ("Density curve", 3)).addFromUI ("bw").addFromUI ("adjust").addFromUI ("n").addFromUI ("narm").print ();
+			new Header (i18n ("Density curve"), 3).addFromUI ("bw").addFromUI ("adjust").addFromUI ("n").addFromUI ("narm").print ();
 		}
 		echo ('\n');
 		echo ('rk.graph.on ()\n');
diff --git a/tests/all_tests.R b/tests/all_tests.R
index eb40d544..82788f04 100644
--- a/tests/all_tests.R
+++ b/tests/all_tests.R
@@ -2,12 +2,13 @@ require (rkwardtests)
 
 ## add your test suite files, to this vector:
 testsuites <- c (
-	"rkward_application_tests.R",
-	"import_export_plugins.R",
-	"item_response_theory.R",
-	"analysis_plugins.R",
-	"distributions.R",
-	"plots.R",
-	"data_plugin_tests.R")
+#	"rkward_application_tests.R",
+	"import_export_plugins.R"
+#	"item_response_theory.R",
+#	"analysis_plugins.R",
+#	"distributions.R",
+#	"plots.R",
+#	"data_plugin_tests.R"
+)
 
 rktest.makeplugintests (testsuites=testsuites, outfile="make_plugintests.txt")
diff --git a/tests/import_export_plugins.R b/tests/import_export_plugins.R
index 60b0d0c1..690361af 100644
--- a/tests/import_export_plugins.R
+++ b/tests/import_export_plugins.R
@@ -36,11 +36,14 @@ suite <- new ("RKTestSuite", id="import_export_plugins",
 			oldwd <- getwd ()
 			on.exit (setwd (oldwd))
 
-			rk.call.plugin ("rkward::setworkdir", dir.selection=file.path (getwd(), ".."), submit.mode="submit")
+			newwd = file.path (getwd(), "testdir")
+			dir.create(newwd)
+			rk.call.plugin ("rkward::setworkdir", dir.selection=newwd, submit.mode="submit")
 			stopifnot (oldwd != getwd ())
 
-			rk.call.plugin ("rkward::setworkdir", dir.selection=file.path (getwd(), "import_export_plugins"), submit.mode="submit")
+			rk.call.plugin ("rkward::setworkdir", dir.selection=oldwd, submit.mode="submit")
 			stopifnot (oldwd == getwd ())
+			unlink(newwd)
 		}),
 		new ("RKTest", id="import_spss", call=function () {
 # NOTE: read.spss currently failing when run in non iso8859-1 locale. See http://r.789695.n4.nabble.com/read-spss-locale-and-encodings-td881149.html
@@ -102,20 +105,24 @@ suite <- new ("RKTestSuite", id="import_export_plugins",
 		new ("RKTest", id="write_vector_matrix", call=function () {
 			assign ("testx", c (1:10), globalenv())
 			rk.sync.global()
+			file <- file.path (getwd(), "data")
 
-			rk.call.plugin ("rkward::save_variables", append.state="FALSE", data.available="testx", file.selection=file.path (getwd(), "data"), ncolumns.real="2.", sep.string=",", submit.mode="submit")
+			rk.call.plugin ("rkward::save_variables", append.state="FALSE", data.available="testx", file.selection=file, ncolumns.real="2.", sep.string=",", submit.mode="submit")
 
 			x <- readLines ("data")
 			for (line in x) rk.print (line)
+			unlink(file)
 		}),
 		new ("RKTest", id="write_csv", call=function () {
 			assign ("women", datasets::women, globalenv())
 			rk.sync.global()
+			file <- file.path (getwd(), "data")
 
-			rk.call.plugin ("rkward::save_csv", dec.string=".", encoding.string="", eol.string="\\n", file.selection=file.path (getwd(), "data"), na.text="NA", qmethod.string="double", quick.string="csv", quote.state="1", rowname.string="TRUE", sep.string=",", x.available="women", submit.mode="submit")
+			rk.call.plugin ("rkward::save_csv", dec.string=".", encoding.string="", eol.string="\\n", file.selection=file, na.text="NA", qmethod.string="double", quick.string="csv", quote.state="1", rowname.string="TRUE", sep.string=",", x.available="women", submit.mode="submit")
 
 			x <- readLines ("data")
 			for (line in x) rk.print (line)
+			unlink(file)
 		}),
 		new ("RKTest", id="package_skeleton", call=function () {
 			# create two functions to use
diff --git a/tests/import_export_plugins/import_csv_overwrite.messages.txt b/tests/import_export_plugins/import_csv_overwrite.messages.txt
index 7f5252db..cded24f6 100644
--- a/tests/import_export_plugins/import_csv_overwrite.messages.txt
+++ b/tests/import_export_plugins/import_csv_overwrite.messages.txt
@@ -1,3 +1,2 @@
-Error in rk.call.plugin("rkward::import_csv", allow_escapes.state = "0",  : 
-  
+Error in .rk.do.call("doPlugin", callstrings) : 
 The plugin could not be auto-submitted with these settings.
diff --git a/tests/import_export_plugins/import_spss.messages.txt b/tests/import_export_plugins/import_spss.messages.txt
index c0a09751..5d60d65c 100644
--- a/tests/import_export_plugins/import_spss.messages.txt
+++ b/tests/import_export_plugins/import_spss.messages.txt
@@ -1,2 +1 @@
-Warning in read.spss("import_export_plugins_testfile.sav", to.data.frame = TRUE,  :
-  import_export_plugins_testfile.sav: position 1: Variable name character 4 is lowercase letter �
+re-encoding from CP1252
diff --git a/tests/import_export_plugins/import_spss.rkout b/tests/import_export_plugins/import_spss.rkout
index 8d42faff..56fe4992 100644
--- a/tests/import_export_plugins/import_spss.rkout
+++ b/tests/import_export_plugins/import_spss.rkout
@@ -1,6 +1,6 @@
 <h1>Import SPSS data</h1>
 <h2>Parameters</h2>
-<ul><li>File name: import_export_plugins_testfile.sav</li>
+<ul><li>File name: PATH/import_export_plugins_testfile.sav</li>
 <li>Object to save to: my.spss.data</li>
 </ul>
 DATE<br />
@@ -15,7 +15,7 @@ DATE<br />
 	<tr class= firstline > 
 		<th>   </th>
 		<th>A_long_variable_name  </th>
-		<th>������  </th>
+		<th>äöüßéÈ  </th>
 		<th>Value_labels</th> 
 	</tr> 
 <tr> 
diff --git a/tests/import_export_plugins/setworkdir.rkcommands.R b/tests/import_export_plugins/setworkdir.rkcommands.R
index d4774fe1..a1599ba5 100644
--- a/tests/import_export_plugins/setworkdir.rkcommands.R
+++ b/tests/import_export_plugins/setworkdir.rkcommands.R
@@ -1,6 +1,6 @@
 local({
 ## Compute
-setwd("PATH/..")
+setwd("PATH/testdir")
 })
 local({
 ## Compute


More information about the rkward-tracker mailing list