1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-07-08 01:54:21 +03:00
inform7/inform6/Tests/Test Cases/dict-size-v3test.inf
2022-03-06 11:13:00 +00:00

106 lines
2.5 KiB
INI
Executable file

Constant Story "Dict-Size-V3 Test";
Constant Headline "Not a game.^";
Release 1;
Constant HDR_GAMERELEASE = $02; ! word
Constant HDR_GAMESERIAL = $12; ! six ASCII characters
Global failures;
[ Main;
Banner();
new_line;
RunTest();
];
[ Banner ix;
if (Story ~= 0) {
#ifdef TARGET_ZCODE;
#ifV5; style bold; #Endif;
print (string) Story;
#ifV5; style roman; #Endif;
#ifnot; ! TARGET_GLULX;
glk($0086, 3); ! set header style
print (string) Story;
glk($0086, 0); ! set normal style
#Endif; ! TARGET_
}
if (Headline ~= 0) print ": ", (string) Headline;
#ifdef TARGET_ZCODE;
print "Release ", (HDR_GAMERELEASE-->0) & $03ff, " / Serial number ";
for (ix=0 : ix<6 : ix++) print (char) HDR_GAMESERIAL->ix;
#ifnot; ! TARGET_GLULX;
print "Release ";
@aloads ROM_GAMERELEASE 0 ix;
print ix;
print " / Serial number ";
for (ix=0 : ix<6 : ix++) print (char) ROM_GAMESERIAL->ix;
#Endif; ! TARGET_
print " / Inform v"; inversion;
print ", compiler options ";
ix = false;
#ifdef STRICT_MODE;
print "S"; ix++;
#Endif; ! STRICT_MODE
#ifdef INFIX;
print "X"; ix++;
#ifnot;
#ifdef DEBUG;
print "D"; ix++;
#Endif; ! DEBUG
#Endif; ! INFIX
if (~~ix) print "(none)";
new_line;
#ifdef TARGET_GLULX;
@gestalt 1 0 ix;
print "Interpreter version ", ix / $10000, ".", (ix & $FF00) / $100,
".", ix & $FF, " / ";
@gestalt 0 0 ix;
print "VM ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, " / ";
ix = HDR_GLULXVERSION-->0;
print "game file format ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, "^";
#Endif; ! TARGET_GLULX
];
[ error msg;
print "Error: ", (string) msg, "^";
failures++;
];
Constant w1 = 'elevators';
Constant w2 = 'elevatorsx';
Constant w3 = 'elevatorsxyzzy';
Constant w4 = 'elevat';
Constant w5 = 'elevaz';
Constant w6 = 'elevati';
[ RunTest;
if (w1 ~= w2) error("w1 != w2");
if (w1 ~= w3) error("w1 != w3");
if (w2 ~= w3) error("w2 != w3");
if (w4 == w5) error("w4 == w5");
if (w5 == w6) error("w5 == w6");
#IFV3;
! In V3, w4 and w6 should be the same.
if (w4 ~= w6) error("w4 != w6");
if (w4 ~= w1) error("w4 != w1");
if (w4 ~= w2) error("w4 != w2");
#IFNOT;
! In V4+, w4 and w6 should be different.
if (w4 == w6) error("w4 == w6");
if (w4 == w1) error("w4 == w1");
if (w4 == w2) error("w4 == w2");
#ENDIF;
new_line;
if (failures == 0)
print "All passed.^";
else
print failures, " errors!^";
];