1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00
elinks/test/ecmascript/assert/URLSearchParams.html
2024-06-14 21:28:36 +02:00

16 lines
508 B
HTML

<script>
console.error("URLSearchParams.html");
var empty = new URLSearchParams('');
console.assert(empty.size === 0, 'empty');
var param = new URLSearchParams('?foo=1&bar=2&cc=3');
console.assert(param.size === 3, 'size is 3');
console.assert(param.has('foo'), 'foo');
console.assert(param.has('cc'), 'cc');
console.assert(param.has('bar', '2'), 'bar=2');
console.assert(param.get('bar') === '2', 'bar = 2');
console.assert(param.toString() === 'foo=1&bar=2&cc=3', 'without ?');
console.exit();
</script>