Skip to content

Commit

Permalink
Fixed the Unit Tests per Don Creaven's input:
Browse files Browse the repository at this point in the history
Running ^DMUDT000 in dev reports:

Internal Format to External Format - DD^%DT - <1705> vs <-1> - 5 (invalid value) converted to a unknown date.

The test is

dev>s Y=5 D DD^%DT W Y

1705

I think that is the right answer:  DD^%DT takes any sort of partial input.

---

Another unit test failure that I think is not an error:

NOW^DMUDTC00 - Tests NOW^%DTC - <313> vs <2013> - Year incorrect

This is testing the value returned in %I(3), like this:

dev>D NOW^%DTC

dev>W %

3130221.102141

dev>W %H

62874,37301

dev>F I=1:1:3 W %I(I)_"    "

2    21    313

dev>W X

3130221

dev>

The value 313 is FM’s year.  The test expects the calendar year.  But I think the FM year is the correct return value.  You could argue that the documentation is ambiguous.  In any case, can we validate that 313 is correct and (if so) fix the unit test to not report an error.
  • Loading branch information
Fileman Development committed Mar 4, 2013
1 parent 7814c62 commit 35e30c3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions routines/fileman/DMUDT000.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DMUDT000 ; VEN/SMH - Unit Test Driver for Date Utilities; 26-DEC-2012
DMUDT000 ; VEN/SMH - Unit Test Driver for Date Utilities; 04-MAR-2013
;;22.2;VA FILEMAN;;
;
S IO=$PRINCIPAL
Expand Down Expand Up @@ -205,9 +205,9 @@ D INTWRAP(CMD,.ARR)
. S Y=3130522.22 D DD^%DT
. D CHKEQ^XTMUNIT(Y,"MAY 22, 2013@22:00:00","Seconds not returned when requested")
;
; Test bad Input
; Test bad Input - %DT accepts it anyways.
N Y S Y=5 D DD^%DT
D CHKEQ^XTMUNIT(Y,-1,"5 (invalid value) converted to a unknown date")
D CHKEQ^XTMUNIT(Y,1705,"5 should convert to 1705")
;
; Test l10n
S DUZ("LANG")=2 ; German
Expand Down
4 changes: 2 additions & 2 deletions routines/fileman/DMUDTC00.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DMUDTC00 ; VEN/SMH - Unit Test Driver for %DTC Utilities; 31-DEC-2012
DMUDTC00 ; VEN/SMH - Unit Test Driver for %DTC Utilities; 04-MAR-2013
;;22.2;VA FILEMAN;;
;
S IO=$PRINCIPAL
Expand Down Expand Up @@ -216,7 +216,7 @@
D CHKTF^XTMUNIT($L($P(%,".",2))>2,"Hours and minutes not provided when they should be")
D CHKEQ^XTMUNIT(%I(1),+$E(DT,4,5),"Month incorrect")
D CHKEQ^XTMUNIT(%I(2),+$E(DT,6,7),"Day incorrect")
D CHKEQ^XTMUNIT(%I(3),$E(DT,1,3)+1700,"Year incorrect")
D CHKEQ^XTMUNIT(%I(3),$E(DT,1,3),"Year incorrect")
D CHKEQ^XTMUNIT(X,DT,"VA Fileman date only incorrect")
QUIT
;
Expand Down

0 comments on commit 35e30c3

Please sign in to comment.