Test script text case changed

I want to write a test script that adds a response to an NPC. However, whenever I add that response to the test script, it sends it to the parser in all lower cases letters, which is wrong when used later.
My test script is

test getName with "salute major/ Clyde Falsoon".

The major asks the player’s name after being saluted.
The response is

Note the case difference in the text script vs. what the major receives (hears?), and note that when it is used in the following paragraph, it is still in lower case.
My question is [1] Why does it recast the type case; and more importantly [2] how can I fix it to keep the case I enter in the test?

In Inform7 v10.2, “the topic understood” seems to preserve capitalization. Are you trying to massage the text? Example (you may need to use the scroll bars to see the important details):

"Discussion" by Eric Conrad

The Century Bar is a room.  The grizzly old bartender is a man in the Century Bar.

Instead of asking the bartender about:
	say "[The noun] scratches his chin and thinks a moment. '[the topic understood]?  Was that a sketch on the Milton Berle Show?'".

Here are test results:

Century Bar
You can see a grizzly old bartender here.

>ask bartender about Captain Kangaroo
The grizzly old bartender scratches his chin and thinks a moment. "Captain Kangaroo?  Was that a sketch on the Milton Berle Show?"

>ask bartender about Greek hoplite warriors
The grizzly old bartender scratches his chin and thinks a moment. "Greek hoplite warriors?  Was that a sketch on the Milton Berle Show?"


The Inform 7 compiler itself downcases your test command string; by the time the I6 compiler is doing its thing, case distinctions have been destroyed. So there isn’t a great way to preserve case for use with the test command.

One could roll one’s own test command, but it wouldn’t be simple.


Yes, it works fine when entered to the keyboard, but not in a test script.

1 Like

Since only you will see/use the test command, does it really matter whether it’s capitalized?

Since it only supports the walkthrough test cases for the contest, I’ll let it pass as is. That is probably not a major judging distinction. If the judges PLAY the game, then case distinctions disappear. Thanks.

As said above, contest judges require a walkthru command for testing, in addition to actually playing the game. I appreciate your look at the bigger picture though.

Replacing the test code isn’t that bad:

Lab is room.

the command-list-pointer is initially 0.
the command-list-texts is a list of texts that varies.

Testing is an action applying to one topic.
understand "test [text]" as testing.
Report testing: say "Test [topic understood] is not defined."

Understand "test" as a mistake ("Please specify a test.")

After reading a command when command-list-pointer is 0 (this is the test-me rule):
  let command be "[the player's command]";
  if word number 1 in command is "test" begin;
    replace the regular expression "^test\s+" in command with "";
    if command is "", continue the activity;
    repeat with x running through the test-cases begin;
      if the description of x is command begin;
        now the command-list-texts is the command-list of x;
        now command-list-pointer is 1;
        change command to test command;
       end if;
    end repeat;
  end if;

To change command to test command:
 say "[command prompt][bracket][command-list-pointer][close bracket] [entry command-list-pointer in command-list-texts][line break]";
 change the text of the player's command to entry command-list-pointer in the command-list-texts;
 increment command-list-pointer;
 if command-list-pointer > number of entries in command-list-texts, now command-list-pointer is 0;

For reading a command when command-list-pointer > 0 (this is the text-mung rule): change command to test command.

A test-case is a kind of object.
A test-case has a text called description.
A test-case has a list of texts called the command-list.
The verb to expand to means the command-list property.

Test1 is a test-case. "me".
It expands to { "x self", "x XYZZY" }.

This version, as written, does not support tests invoking other tests.

1 Like

I think I’ll stay with the minor annoyance of my test script shifting into lower case, especially since my test scripts do call other test scripts.

1 Like

Be aware that test scripts are meant for, well, testing—they’re not available in release versions of the game. If you “release for testing” to keep the test scripts intact, you’ll also be giving players access to all the special debugging commands and debugging output that you generally don’t want them to see.

If you really want to go this route, though, you can add a special case to the logic that reads the player’s name. Check if it matches “clyde falsoon” in lowercase, and if so, replace it with “Clyde Falsoon” in proper casing.

Understood. No, I want to remove the testing scaffolding for release. At the least, so it speeds up the narrative. When I release it to a webpage, the speed is as expected. Currently, in development mode, each command input take about 5-10 seconds for a response. What a drag!

Try deleting all the nodes from the Skein.

I want to try deleting all the nodes in the Skein. How do I do that? I cannot find anything about that in the documentation.

Right-click (or equivalent) on the topmost skein (should be your title) and choose “delete threads from here”

I see no skein at all. I noticed that in looking online, some versions of Inform show a tab called Skein. I have not tab with that name.
At one time I did see a tree of nodes under a Skein option. Nowhere to be found currently. I cannot find the Skein panel to which the Docs refer (1.7). (I am on a Mac, using Inform 7 1.82. How do I find the Skein panel to delete nodes to speed up play?

It should be under the “Testing” tab.

When I click the Testing tab, the system freezes. I must reboot the computer to get control back. Force Quit doesn’t even work. 8-|

Maybe your skein is really big. Try copying and pasting all the code into a new project and deleting the old one. That should reset the skein. Then, in the future, periodically delete the skein as you test the game.

Experiment status:
I am using MacOS Monterrey 12.7 and Inform version 1.82.

I created a new project, only one page of code. The new project runs as fast as it should. The Skein tab is found under the Testing tab.

For the old project, whenever I select the Test tab, the computer hangs, consistent with too large of a Skein file…
I deleted the big story after copying it to a new project. The speed of the story is now where it should be. I also have a Skein panel under Testing for that long story.

Thanks Hidnook, I never would have thought of that solution.

1 Like

If you’re confident, you can delete the skein file out of the project using the command line:

rm project.inform/Skein.skein

Quit Inform before doing this. This does not affect anything but the Testing panel.

(You want to back up your project before you mess with it like this. But then you want to back up your project regularly anyway.)

1 Like