80127: Function test xfi:period-end
Documentation
Owners
Name | Affiliation | Start | End | |
---|---|---|---|---|
Herm Fischer |
|
fischer@markv.com | 19-02-2008 at 00:00:00 |
References
http://www.xbrl.org/Specification/XF-PWD-2006-12-07.htm#_Toc152670682
http://www.xbrl.org/Specification/XF-PWD-2006-12-07.htm
Test Case Variations
V-01
xfi:period-end returns correct dateTime for an instant context with date only
Documentation
Inputs
- schema: period-end-tests.xsd
- instance: hello-worlds-instance.xml (DTS Discovery starting point) (ID=V01)
-
Function Call:
xfi:period-end( /xbrli:xbrl/xbrli:context[@id eq 'context-earth']/xbrli:period )
(against file V01)
Outputs
-
Result test:
($result instance of element(*,xs:dateTime) or $result instance of xs:dateTime) and count( $result ) eq 1 and $result eq xs:dateTime("2008-01-01T00:00:00")
V-02
Returns correct dateTime for concept whose context is instant date (only)
Documentation
Inputs
- schema: period-end-tests.xsd
- instance: hello-worlds-instance.xml (DTS Discovery starting point) (ID=V02)
-
Function Call:
xfi:period-end( xfi:period( /xbrli:xbrl/concept:cI[1] ) )
(against file V02)
Outputs
-
Result test:
($result instance of element(*,xs:dateTime) or $result instance of xs:dateTime) and count( $result ) eq 1 and $result eq xs:dateTime("2008-01-01T00:00:00")
V-03
End instant for start-end duration context with date only
Documentation
Inputs
- schema: period-end-tests.xsd
- instance: hello-worlds-instance.xml (DTS Discovery starting point) (ID=V03)
-
Function Call:
xfi:period-end( xfi:period( /xbrli:xbrl/concept:cD[1] ) )
(against file V03)
Outputs
-
Result test:
($result instance of element(*,xs:dateTime) or $result instance of xs:dateTime) and count( $result ) eq 1 and $result eq xs:dateTime("2008-02-29T00:00:00")
V-04
End instant for start-end duration context with time not midnight
Documentation
Inputs
- schema: period-end-tests.xsd
- instance: hello-worlds-instance.xml (DTS Discovery starting point) (ID=V04)
-
Function Call:
xfi:period-end( xfi:period( /xbrli:xbrl/concept:cD[3] ) )
(against file V04)
Outputs
-
Result test:
($result instance of element(*,xs:dateTime) or $result instance of xs:dateTime) and count( $result ) eq 1 and $result eq xs:dateTime("2008-02-28T23:59:59")
V-04a
End instant for start-end duration context with time at preceeding midnight
Documentation
Inputs
- schema: period-end-tests.xsd
- instance: hello-worlds-instance.xml (DTS Discovery starting point) (ID=V04a)
-
Function Call:
xfi:period-end( xfi:period( /xbrli:xbrl/concept:cD[4] ) )
(against file V04a)
Outputs
-
Result test:
($result instance of element(*,xs:dateTime) or $result instance of xs:dateTime) and count( $result ) eq 1 and $result eq xs:dateTime("2008-02-28T00:00:00")
V-04b
End instant for start-end duration context with time at following midnight
Documentation
Inputs
- schema: period-end-tests.xsd
- instance: hello-worlds-instance.xml (DTS Discovery starting point) (ID=V04b)
-
Function Call:
xfi:period-end( xfi:period( /xbrli:xbrl/concept:cD[5] ) )
(against file V04b)
Outputs
-
Result test:
($result instance of element(*,xs:dateTime) or $result instance of xs:dateTime) and count( $result ) eq 1 and $result eq xs:dateTime("2008-02-28T24:00:00") (: note this dateTime may be parsed same as 2008-02-29T00:00:00 and both instants are eq xs:dateTime's anyway :)
V-05
Error for forever context
Documentation
Inputs
- schema: period-end-tests.xsd
- instance: hello-worlds-instance.xml (DTS Discovery starting point) (ID=V05)
-
Function Call:
xfi:period-end( xfi:period( /xbrli:xbrl/concept:cD[2] ) )
(against file V05)
Outputs
- Error code: xfie:PeriodIsForever
V-06
Wrong node to function
Documentation
Inputs
- schema: period-end-tests.xsd
- instance: hello-worlds-instance.xml (DTS Discovery starting point) (ID=V06)
-
Function Call:
xfi:period-end( /xbrli:xbrl/concept:cD[2] )
(against file V06)
Outputs
- Error code: xqt-err:XPTY0004
V-07
A sequence of periods as argument
Documentation
Inputs
- schema: period-end-tests.xsd
- instance: hello-worlds-instance.xml (DTS Discovery starting point) (ID=V07)
-
Function Call:
xfi:period-end( /xbrli:xbrl/xbrli:context[@id ne 'planet-earth']/xbrli:period )
(against file V07)
Outputs
- Error code: xqt-err:XPTY0004
Revisions
Name | On | Details |
---|---|---|
Herm Fischer | 19-02-2008 at 00:00:00 |
|
Herm Fischer | 14-04-2008 at 00:00:00 |
|