2014-02-19 22:19:16 +01:00
|
|
|
var hashchange = require('js/hashchange.js');
|
|
|
|
|
|
|
|
(function test_basics() {
|
|
|
|
var operators;
|
|
|
|
var hash;
|
|
|
|
|
|
|
|
operators = [
|
|
|
|
{operator: 'stream', operand: 'devel'},
|
2016-12-03 23:17:57 +01:00
|
|
|
{operator: 'topic', operand: 'algol'},
|
2014-02-19 22:19:16 +01:00
|
|
|
];
|
|
|
|
hash = hashchange.operators_to_hash(operators);
|
|
|
|
assert.equal(hash, '#narrow/stream/devel/topic/algol');
|
|
|
|
|
|
|
|
operators = [
|
|
|
|
{operator: 'stream', operand: 'devel'},
|
2016-12-03 23:17:57 +01:00
|
|
|
{operator: 'topic', operand: 'visual c++', negated: true},
|
2014-02-19 22:19:16 +01:00
|
|
|
];
|
|
|
|
hash = hashchange.operators_to_hash(operators);
|
|
|
|
assert.equal(hash, '#narrow/stream/devel/-topic/visual.20c.2B.2B');
|
|
|
|
}());
|