Uname:Linux mail.sarafai.ru 6.1.0-43-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.162-1 (2026-02-08) x86_64

403WebShell
403Webshell
Server IP : 82.148.16.210  /  Your IP : 216.73.216.169
Web Server : nginx/1.29.5
System : Linux mail.sarafai.ru 6.1.0-43-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.162-1 (2026-02-08) x86_64
User : www-data ( 33)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /srv/projects/env4/src/dev/frontend3/node_modules/table/node_modules/multimap/test/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /srv/projects/env4/src/dev/frontend3/node_modules/table/node_modules/multimap/test/test.html
<html>
  <head>
    <title>MultiMap Tests</title>
    <script src="../node_modules/chai/chai.js"></script>
    <script src="../index.js"></script>
    <script type="text/javascript">
var assert = chai.assert;
var map = new Multimap([
  ['a', 'one'],
  ['b', 1],
  ['a', 'two'],
  ['b', 2]
]);

assert.equal(map.size, 4);

assert.equal(map.get('a').length, 2);
assert.equal(map.get('a')[0], 'one'); // ['one', 'two']
assert.equal(map.get('a')[1], 'two'); // ['one', 'two']

assert.equal(map.get('b').length, 2);
assert.equal(map.get('b')[0], 1); // [1, 2]
assert.equal(map.get('b')[1], 2); // [1, 2]


assert(map.has('a'), "map contains key 'a'");
assert(!map.has('foo'), "map does not contain key 'foo'");

assert(map.has('a', 'one'), "map contains entry 'a'=>'one'");
assert(!map.has('b', 3), "map does not contain entry 'b'=>3");

map.set('a', 'three');

assert.equal(map.size, 5);
assert.equal(map.get('a').length, 3); // ['one', 'two', 'three']

map.set('b', 3, 4);
assert.equal(map.size, 7);

assert(map.delete('a', 'three'), "delete 'a'=>'three'");
assert.equal(map.size, 6);
assert(!map.delete('x'), "empty 'x' for delete");
assert(!map.delete('a', 'four'), "no such entry 'a'=>'four'");
assert(map.delete('b'), "delete all 'b'");

assert.equal(map.size, 2);

map.set('b', 1, 2);
assert.equal(map.size, 4); // 4

var cnt = 0;
map.forEach(function(value, key) {
  // iterates { 'a', 'one' }, { 'a', 'two' }, { 'b', 1 }, { 'b', 2 } 
  cnt++;
  assert(key == 'a' || key == 'b', "key must be either 'a' or 'b'");
});

assert.equal(cnt, 4);

cnt = 0;
map.forEachEntry(function(entry, key) {
  // iterates { 'a', ['one', 'two'] }, { 'b', [1, 2] } 
  cnt++;
  assert(key == 'a' || key == 'b', "key must be either 'a' or 'b'");
  assert.equal(entry.length, 2);
});

assert.equal(cnt, 2);


var keys = map.keys(); // ['a', 'b']
assert.equal(keys.next().value, 'a');
assert.equal(keys.next().value, 'b');
assert(keys.next().done);

var values = map.values(); // ['one', 'two', 1, 2]
assert.equal(values.next().value, 'one');
assert.equal(values.next().value, 'two');
assert.equal(values.next().value, 1);
assert.equal(values.next().value, 2);
assert(values.next().done);


map.clear();

assert.equal(map.size, 0);

    </script>
  </head>
  <body>
  </body>
</html>

Youez - 2016 - github.com/yon3zu
LinuXploit