File:  [parser3project] / parser3 / tests / 341.html
Revision 1.6: download - view: text, annotated - select for diffs - revision graph
Mon May 20 23:02:35 2024 UTC (2 years, 1 month ago) by moko
Branches: MAIN
CVS tags: release_3_5_1, release_3_5_0, HEAD
more tests are updated to prepare for apostrophe escaping in HTML tainting

@main[]

I. named

$id[id]
$price[price]
$t[^table::create{id	price
1	6.50
2	70.00		more data
3	60.85
_default	0
}]

$n[^table::create{name
id
price}]

^core[]

II. nameless

$id[0]
$price[1]
$t[^table::create[nameless]{1	6.50
2	70.00		more data
3	60.85
_default	0
}]

$n[^table::create{name
0
1}]

^core[]

@core[]

Code coverage tests:

^try-catch{^t.hash[$id][ $.type[wrong] ]}
^try-catch{^t.hash[$id][ $.type[ $.not_string[] ] ]}
^try-catch{^t.hash[$id][ $.wrong[option] ]}
^try-catch{^t.hash[$id][$price][ not hash ]}
^try-catch{^t.hash[$id][ $.wrong[] ][ $.type[string] ]}
^try-catch{^t.hash[$id][$n][ $.type[string] ]}
^try-catch{^t.hash[$id]{code}[ $.type[string] ]}
^try-catch{^t.hash[ups;$price]}
^try-catch{^t.hash[$id;ups]}

Valid calls tests:

1. ^json:string[^t.hash[$id]]
2. ^json:string[^t.hash[$id][ $.type[table] ]]
3. ^json:string[^t.hash[$id][$price]]
4. ^json:string[^t.hash{$id}[$price][ $.distinct(true) ]]
5. ^json:string[^t.hash[$id][$n]]
6. ^json:string[^t.hash{$id}[$n][ $.distinct(true) ]]

New functionality tests:

n1. ^json:string[^t.hash{=$t.$id=}{$t.$id - $t.$price}]
n2. ^json:string[^t.hash[$id]{$t.$id - $t.$price}]

n3. ^json:string[^t.hash{$id}{code}[ $.distinct(true) ]]
n4. ^json:string[^t.hash[$id]{ $h[$.key[$t.$price]] $h }]

n5. ^json:string[^t.hash[$id;]]
n6. ^json:string[^t.hash[$id;; $.type[string] ]]

E-mail: