1
0
Fork 0
mirror of https://github.com/demostf/demo.js synced 2026-06-04 00:54:14 +02:00

use map for setconvar

This commit is contained in:
Robin Appelman 2017-09-02 16:17:25 +02:00
commit b3e69f1af4
3 changed files with 16 additions and 15 deletions

View file

@ -6,20 +6,20 @@ suite('SetConVar', () => {
test('Parse setConVar', () => {
assertParser(ParseSetConVar, getStream(String.fromCharCode(2) + 'foo\0bar\0second\0value\0'), {
packetType: 'setConVar',
vars: {
foo: 'bar',
second: 'value'
}
vars: new Map([
['foo', 'bar'],
['second', 'value']
])
}, 8 + ('foo\0bar\0second\0value\0'.length * 8));
});
test('Encode setConVar', () => {
assertEncoder(ParseSetConVar, EncodeSetConVar, {
packetType: 'setConVar',
vars: {
foo: 'bar',
second: 'value'
}
vars: new Map([
['foo', 'bar'],
['second', 'value']
])
}, 8 + ('foo\0bar\0second\0value\0'.length * 8));
});
});