Skip to content

Commit

Permalink
Fix regression caused by moving old jsh.shell.jsh tests around
Browse files Browse the repository at this point in the history
  • Loading branch information
davidpcaldwell committed Oct 18, 2024
1 parent bc9c78f commit 390ef8b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
File renamed without changes.
9 changes: 5 additions & 4 deletions jrunscript/jsh/shell/test/jsh.shell.jsh.suite.jsh.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,20 @@
var module = jsh.shell;

var unforked = module.jsh({
script: jsh.script.file.parent.getFile("jsh.jsh.js"),
script: jsh.script.file.parent.getFile("test.jsh.js"),
arguments: [],
evaluate: function(result) {
return result;
}
});
debugger;
test(unforked.status == 2);
test(typeof(unforked.command) == "undefined");
test(typeof(unforked.arguments) == "undefined");
test(Boolean(unforked.jsh) && Boolean(unforked.jsh.script));

var forked = module.jsh({
script: jsh.script.file.parent.getFile("jsh.jsh.js"),
script: jsh.script.file.parent.getFile("test.jsh.js"),
arguments: [],
evaluate: function(result) {
return result;
Expand All @@ -52,7 +53,7 @@
test(Boolean(forked.jsh) && Boolean(forked.jsh.script));

var issue82 = module.jsh({
script: jsh.script.file.parent.getFile("jsh.jsh.js"),
script: jsh.script.file.parent.getFile("test.jsh.js"),
evaluate: function(result) {
return (result.status == 2) ? "worked" : "did not work";
}
Expand All @@ -76,7 +77,7 @@
name: "http",
run: jsh.shell.jsh,
fork: true,
script: jsh.script.file.parent.getFile("jsh.jsh.js"),
script: jsh.script.file.parent.getFile("test.jsh.js"),
arguments: ["-scenario","-view","stdio"]
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
if (!jsh.test || !jsh.test.integration) {
// TODO can this be implemented for URL-based launches?
if (jsh.script.file) {
jsh.loader.plugins(jsh.script.file.parent.parent.parent.parent.getRelativePath("loader/api"));
jsh.loader.plugins(jsh.script.file.parent.parent.parent.parent.getRelativePath("jsh/unit"));
jsh.loader.plugins(jsh.script.file.parent.parent.parent.parent.getRelativePath("jsh/test"));
jsh.loader.plugins(jsh.script.file.parent.parent.parent.parent.parent.getRelativePath("loader/api"));
jsh.loader.plugins(jsh.script.file.parent.parent.parent.parent.parent.getRelativePath("jsh/unit"));
jsh.loader.plugins(jsh.script.file.parent.parent.parent.parent.parent.getRelativePath("jsh/test"));
} else {
// URL-based launch, just mock it, essentially
if (!jsh.test) jsh.test = {};
Expand All @@ -22,13 +22,13 @@ if (!jsh.test || !jsh.test.integration) {
jsh.test.integration({
scenario: function() {
var server = jsh.httpd.Tomcat.serve({ directory: jsh.script.file.parent });
var url = "http://127.0.0.1:" + server.port + "/jsh.jsh.js";
var url = "http://127.0.0.1:" + server.port + "/test.jsh.js";
this.part("1", {
name: "HTTP unforked",
execute: function(scope,verify) {
jsh.shell.jsh({
script: jsh.web.Url.parse(
"http://127.0.0.1:" + server.port + "/jsh.jsh.js"
"http://127.0.0.1:" + server.port + "/test.jsh.js"
),
stdio: {
output: String,
Expand Down

0 comments on commit 390ef8b

Please sign in to comment.