File:  [parser3project] / parser3 / tests / 435.html
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Mon Oct 28 00:45:27 2024 UTC (19 months ago) by moko
Branches: MAIN
CVS tags: release_3_5_1, release_3_5_0, HEAD
tests for ^hash.set[first|last;value], ^hash.set([-+]index)[value] and same for array added (related to feature #1253)

@main[]

1.  $a[v1;v2;$void;v5]
    $a.8[v6] $a.10[v7]

    $h[^hash::create[$a]]

2.  ^test[$a]
3.  ^test[$h]

4.  $a[^array::create[]]
    ^try-catch{ ^a.set(0)[bug] }

5.  $h[^hash::create[]]
    ^try-catch{ ^h.set(0)[bug] }

@test[a]
a.  $a.CLASS_NAME
    ^a.set[first;first]
    ^a.set[last;last]
    ^a.set(3)[set3]
    ^a.set(-2)[set-2]
    ^show[$a]

    ^try-catch{ ^a.set(-20)[bug] }
    ^try-catch{ ^a.set(20)[bug] }

b.  ^a.delete(0)
    ^a.set[first;new first]
    ^show[$a]

c.  ^try-catch{ ^a.at[ $.1[1] ;bug] }
d.  ^try-catch{ ^a.set[ $.1[1] ;bug] }

@show[v]
^json:string[$v; $.array[object] ]

E-mail: