80209: Function test xfi:u-equal-set

Documentation

Tests of function xfi:u-equal-set($left as node()*, $right as node()*) as xs:boolean

Owners

Name Affiliation Email Start End
Herm Fischer UBMatrix / Mark V Systems fischer@markv.com 19-02-2008 at 00:00:00
Richard Ashby CoreFiling Ltd rna@corefiling.com 30-11-2012 at 00:00:00

References

http://www.xbrl.org/Specification/XF-PWD-2006-12-07.htm#_Toc152670711

Test Case Variations


V-01 Returns u-equality of numeric items equal

Documentation

Inputs

  • schema: unit-test-concepts.xsd
  • instance: unit-test-instance.xml (DTS Discovery starting point) (ID=V01)
  • Function Call: xfi:u-equal-set( (//c:a[./text() eq '1001'],//c:a[./text() eq '1002']), (//c:a[./text() eq '2002'],//c:a[./text() eq '2001']) )

    (against file V01)

Outputs

  • Result test: $result instance of xs:boolean and count( $result ) eq 1 and $result eq true()

V-02 Same as V-01 but numeric items not u-equal

Documentation

Inputs

  • schema: unit-test-concepts.xsd
  • instance: unit-test-instance.xml (DTS Discovery starting point) (ID=V02)
  • Function Call: xfi:u-equal-set( (//c:a[./text() eq '1001'],//c:a[./text() eq '1002']), (//c:a[./text() eq '3001'],//c:a[./text() eq '2002']))

    (against file V02)

Outputs

  • Result test: $result instance of xs:boolean and count( $result ) eq 1 and $result eq false()

V-03 Same as V-01 but arguments are sequences

Documentation

Inputs

Outputs

  • Result test: $result instance of xs:boolean and count( $result ) eq 1 and $result eq true()

V-04 Same as V-01 but arguments are sequences not same length

Documentation

Inputs

Outputs

  • Result test: $result instance of xs:boolean and count( $result ) eq 1 and $result eq false()

V-05 Not a node argument to function

Documentation

XPath-defined error for node type incorrect.

Inputs

  • schema: unit-test-concepts.xsd
  • instance: unit-test-instance.xml (DTS Discovery starting point) (ID=V05)
  • Function Call: xfi:u-equal-set( ( (/xbrli:xbrl/c:a)[2],(//c:a)[1]), ( 'just a string',(//c:a)[1]) )

    (against file V05)

Outputs

  • Error code: xqt-err:XPTY0004

V-06 A sequence of concepts as argument

Documentation

XPath-defined error for node type incorrect number of arguments.

Inputs

Outputs

  • Error code: xqt-err:XPST0017

V-07 Wrong node to function

Documentation

Functions spec error for non-item node type.

Inputs

  • schema: unit-test-concepts.xsd
  • instance: unit-test-instance.xml (DTS Discovery starting point) (ID=V07)
  • Function Call: xfi:u-equal-set( ( (/xbrli:xbrl/c:a)[1],(//c:a)[4]), ( /xbrli:xbrl/xbrli:context[2],(//c:a)[5]) )

    (against file V07)

Outputs

  • Error code: xfie:NodeIsNotXbrlItem

V-08 Returns u-equality of non-numeric items

Documentation

Inputs

  • schema: unit-test-concepts.xsd
  • instance: unit-test-instance.xml (DTS Discovery starting point) (ID=V08)
  • Function Call: xfi:u-equal-set( (//c:b[./text() eq 'foo'],(//c:a)[1]), (//c:b[./text() eq 'bar'],(//c:a)[2]) )

    (against file V08)

Outputs

  • Result test: $result instance of xs:boolean and count( $result ) eq 1 and $result eq true()

V-09 Returns u-equality of equal text numeric and non-numeric items

Documentation

Inputs

  • schema: unit-test-concepts.xsd
  • instance: unit-test-instance.xml (DTS Discovery starting point) (ID=V09)
  • Function Call: xfi:u-equal-set( (//c:a[./text() eq '1001'],//c:a[./text() eq '1003']), (//c:b[./text() eq '1001'],//c:a[./text() eq '2003']) )

    (against file V09)

Outputs

  • Result test: $result instance of xs:boolean and count( $result ) eq 1 and $result eq false()

V-10 Performs set de-duplication of sequences

Documentation

Works for sequences containing duplicate entries, which are equal when compared as sets

Inputs

  • schema: unit-test-concepts.xsd
  • instance: unit-test-instance.xml (DTS Discovery starting point) (ID=V10)
  • Function Call: xfi:u-equal-set( ( //c:a[@unitRef='unit-wacky-force1']), ( //c:a[@unitRef='unit-wacky-force1'], //c:a[./text() eq '1001']) )

    (against file V10)

Outputs

  • Result test: $result eq true()

Revisions

Name On Details
Herm Fischer 19-02-2008 at 00:00:00 Created the test case.
Richard Ashby 30-11-2012 at 00:00:00 Added variation confirming de-duplication of sequences into sets.