I won't call them fixes because I think the standard does not specify these behaviors for $Text.
I fixed the following:
@tag+offset from within a routine now works correctly.
@tag[+offset]^@rtn now works correctly
Here's the code I used to test this:
Code:
%UT ; SMH - Unit Test Suite for MV1
;;
AEQ (C1,C2) ; Assert that C1 and C2 are equal
I C1'=C2 S $EC=",U1,"
Q
ANE (C1) ; Assert that C1 is not empty
I '$L(C1) S $EC=",U2,"
Q
DTEXT ; $Text
W $T(+2^%UT),! ; Routine Name
W $T(+0),! ; ditto
W $T(^%UT),! ; Routine Identity
W $T(+1),! ; First Line
W $T(AEQ),! ; Label Test
W $T(AEQ^%UT),! ; ditto
W $T(AEQ+1),! ; next line
W $T(AEQ+1^%UT),! ; ditto
W $T(AEQ+2^%UT),! ; next line
W $T(AEQ+3^%UT),! ; next line yet
;
; Indirection Tests - Part 1
S X="+0^%UT" W $T(@X),! ; Normal indirection
S X="+0" W $T(@X),! ; Ditto
S X="^%UT" W $T(@X),! ; More
S X="+1" W $T(@X),! ; More
S X="AEQ" W $T(@X),! ; More
S X="AEQ+1" W $T(@X),! ; More
S X="AEQ+1^%UT" W $T(@X),! ; More
S X="AEQ+2^%UT" W $T(@X),! ; More
S X="AEQ+3^%UT" W $T(@X),! ; More
;
; Indirection Tests - Part 2 - most fail
W $T(@""),! ; Not supposed to work!!
S X="ANE" W $T(@X+1),! ; Sam fixed this one
S X="ANE" W $T(@X+2),! ; Sam fixed this one
S X="+0",Y="%UT" W $T(@X^@Y),! ; Works
S X="AEQ",Y="%UT" W $T(@X^@Y),! ; Sam fixed this one
S X="AEQ+1",Y="%UT" W $T(@X^@Y),! ; ditto
W "---",!
S X="AEQ" W $T(@X^%UT),! ; Sam fixed this one
S X="AEQ+1" W $T(@X^%UT),! ; Sam fixed this one
S Y="%UT" w $T(AEQ^@Y),! ; Works
S Y="%UT" w $T(AEQ+1^@Y),! ; Works
QUIT
Here's the output:
Code:
MCL> D DTEXT^%UT
;;
%UT
%UT ; SMH - Unit Test Suite for MV1
%UT ; SMH - Unit Test Suite for MV1
AEQ(C1,C2) ; Assert that C1 and C2 are equal
AEQ(C1,C2) ; Assert that C1 and C2 are equal
I C1'=C2 S $EC=",U1,"
I C1'=C2 S $EC=",U1,"
Q
ANE(C1) ; Assert that C1 is not empty
%UT
%UT
%UT ; SMH - Unit Test Suite for MV1
%UT ; SMH - Unit Test Suite for MV1
AEQ(C1,C2) ; Assert that C1 and C2 are equal
I C1'=C2 S $EC=",U1,"
I C1'=C2 S $EC=",U1,"
Q
ANE(C1) ; Assert that C1 is not empty
%UT
I '$L(C1) S $EC=",U2,"
Q
%UT
AEQ(C1,C2) ; Assert that C1 and C2 are equal
I C1'=C2 S $EC=",U1,"
---
AEQ(C1,C2) ; Assert that C1 and C2 are equal
I C1'=C2 S $EC=",U1,"
AEQ(C1,C2) ; Assert that C1 and C2 are equal
I C1'=C2 S $EC=",U1,"
How do I contribute back the source code? I modified just routine.c.
Sam