(Test) Style (BasicLooks) AttachStyle (TestParam) (test) StyleParam (Type1) () { printstack DoTests ( Type1) .print Helvetica family regular face caps+lowercase alphabets none underlined 10 pt size 12 pt leading flush left line formatting 2 pt top indent 3 pt bottom indent 12 pt first indent 0 body indent 20 pt left indent 21 pt right indent 22 pt top leading 25 pt bottom leading 1 pt min line gaps 0 vshift printstack } StyleRule (Type2) () { printstack ( Type2) .print TimesRoman family bold face caps+smallcaps alphabets letters+digits underlined 36 pt size 42 pt leading centered formatting 40 pt top indent 42 pt bottom indent 0 first indent 0 body indent 50 pt left indent 55 pt right indent 45 pt top leading 48 pt bottom leading 5 pt min line gaps 0 vshift printstack } StyleRule (TestError1) () { ( Test error recovery. Illegal value... ) .print 10 pt family } StyleRule (TestError2) () { ( Test error recovery. Undef key... ) .print foobar } StyleRule (DoTests) { TestFace printstack TestAlphabets printstack TestUnderlining printstack TestFormatting printstack TestStyle printstack TestFamily printstack TestSize printstack TestTopIndent printstack TestBottomIndent printstack TestFirstIndent printstack TestBodyIndent printstack TestLeftIndent printstack TestRightIndent printstack TestLeading printstack TestTopLeading printstack TestBottomLeading printstack TestVShift printstack TestMinGaps printstack TestDimensions printstack TestArith TestStyleParam printstack} .cvx .def (TestFace) () { ( TestFace) .print regular face the face regular .eq .not (0 error) .cvx .if bold face the face bold .eq .not (1 error) .cvx .if -bold face the face regular .eq .not (2 error) .cvx .if italic face the face italic .eq .not (3 error) .cvx .if -italic face the face regular .eq .not (4 error) .cvx .if bold+italic face the face bold+italic .eq .not (5 error) .cvx .if -italic face the face bold .eq .not (6 error) .cvx .if +italic face the face bold+italic .eq .not (7 error) .cvx .if -bold face the face italic .eq .not (8 error) .cvx .if +bold face the face bold+italic .eq .not (9 error) .cvx .if regular face the face regular .eq .not (10 error) .cvx .if } StyleRule (TestAlphabets) () { ( TestAlphabets) .print caps+lowercase alphabets the alphabets caps+lowercase .eq .not (11 error) .cvx .if caps+smallcaps alphabets the alphabets caps+smallcaps .eq .not (12 error) .cvx .if caps alphabet the alphabets caps .eq .not (13 error) .cvx .if lowercase alphabet the alphabets lowercase .eq .not (14 error) .cvx .if } StyleRule (TestUnderlining) () { ( TestUnderlining) .print none underlined the underlining none .eq .not (15 error) .cvx .if all underlined the underlining all .eq .not (16 error) .cvx .if visible underlined the underlining visible .eq .not (17 error) .cvx .if letters+digits underlined the underlining letters+digits .eq .not (18 error) .cvx .if } StyleRule (TestFormatting) () { ( TestFormatting).print flush left line formatting the line formatting flushLeft .eq .not (19 error) .cvx .if flush right formatting the line formatting flushRight .eq .not (20 error) .cvx .if ragged right line formatting the formatting flushLeft .eq .not (21 error) .cvx .if ragged left formatting the line formatting flushRight .eq .not (22 error) .cvx .if flushLeft line formatting the line formatting flushLeft .eq .not (23 error) .cvx .if flushRight formatting the line formatting flushRight .eq .not (24 error) .cvx .if justified line formatting the formatting justified .eq .not (25 error) .cvx .if centered line formatting the line formatting centered .eq .not (26 error) .cvx .if } StyleRule (TestStyle) () { ( TestStyle) .print (Test1) style the style (Test1) .eq .not (27 error) .cvx .if (New) style the style (New) .eq .not (28 error) .cvx .if (Test) style the style (Test) .eq .not (29 error) .cvx .if } StyleRule (TestFamily) () { ( TestFamily) .print TimesRoman family the family TimesRoman .eq .not (30 error) .cvx .if Helvetica family the family Helvetica .eq .not (31 error) .cvx .if } StyleRule (TestSize) () { ( TestSize) .print 13 pt size the size 13 pt .eq .not (32 error) .cvx .if } StyleRule (TestTopIndent) () { ( TestTopIndent) .print 3 pt top indent the top indent 3 pt .eq .not (32 error) .cvx .if } StyleRule (TestBottomIndent) () { ( TestBottomIndent) .print 5 pt bottom indent the bottom indent 5 pt .eq .not (33 error) .cvx .if } StyleRule (TestFirstIndent) () { ( TestFirstIndent) .print 12 pt first indent the first indent 12 pt .eq .not (34 error) .cvx .if } StyleRule (TestBodyIndent) () { ( TestBodyIndent) .print 1 pt body indent the body indent 1 pt .eq .not (35 error) .cvx .if } StyleRule (TestLeftIndent) () { ( TestLeftIndent) .print 25 pt left indent the left indent 25 pt .eq .not (36 error) .cvx .if } StyleRule (TestRightIndent) () { ( TestRightIndent) .print 30 pt right indent the right indent 30 pt .eq .not (37 error) .cvx .if } StyleRule (TestLeading) () { ( TestLeading) .print 14 pt line leading the line leading 14 pt .eq .not (38 error) .cvx .if 12 pt leading the leading 12 pt .eq .not (39 error) .cvx .if } StyleRule (TestTopLeading) () { ( TestTopLeading) .print 22 pt top leading the top leading 22 pt .eq .not (40 error) .cvx .if } StyleRule (TestBottomLeading) () { ( TestBottomLeading) .print 24 pt bottom leading the bottom leading 24 pt .eq .not (41 error) .cvx .if } StyleRule (TestVShift) () { ( TestVShift) .print 3 pt vshift the vshift 3 pt .eq .not (42 error) .cvx .if } StyleRule (TestMinGaps) () { ( TestMinGaps) .print 1 pt gaps the gaps 1 pt .eq .not (43 error) .cvx .if 2 pt line gaps the line gaps 2 pt .eq .not (44 error) .cvx .if 3 pt min gaps the min gaps 3 pt .eq .not (45 error) .cvx .if 4 pt min line gaps the min line gaps 4 pt .eq .not (46 error) .cvx .if } StyleRule (TestDimensions) () { ( TestDimensions) .print ( pc) .print 1 pc leading the leading 12 pt .eq .not (47 error) .cvx .if ( in) .print 1.0 0.013870 .div leading the leading 1.05 in .gt (48 error) .cvx .if the leading .95 in .lt (49 error) .cvx .if ( cm) .print 1 cm leading the leading 1 in 2.54 .div same .not (50 error) .cvx .if ( mm) .print 1 mm leading the leading 0.1 cm same .not (51 error) .cvx .if ( dd) .print 1 dd leading the leading 1 cm 26.6 .div same .not (52 error) .cvx .if } StyleRule (same) {.sub abs 0.001 .lt} .cvx .def (abs) {.dup 0.0 .lt (.neg) .cvx .if} .cvx .def (TestArith) () { ( TestArith) .print 10 pt leading the leading 10 pt .eq .not (53 error) .cvx .if 5 pt bigger leading the leading 15 pt .eq .not (54 error) .cvx .if 5 pt smaller leading the leading 10 pt .eq .not (55 error) .cvx .if 50 percent bigger leading the leading 15 pt .eq .not (56 error) .cvx .if 50 percent smaller leading the leading 7.5 pt .eq .not (57 error) .cvx .if } StyleRule (TestStyleParam) () { ( TestStyleParam) .print the TestParam (test) .eq .not (58 error) .cvx .if 10 pt TestParam the TestParam 10 pt .eq .not (59 error) .cvx .if 5 pt bigger TestParam the TestParam 15 pt .eq .not (60 error) .cvx .if 1 pt smaller TestParam the TestParam 14 pt .eq .not (61 error) .cvx .if (foo) TestParam the TestParam (foo) .eq .not (62 error) .cvx .if .true TestParam the TestParam .true .eq .not (63 error) .cvx .if } StyleRule (printstack) { .cntstk (.dup == ( ).print ) .cvx .rept } .cvx .def (error) { = ( error ) .print } .cvx .def EndStyle