Refuse an empty list for a repeatable TLV
Mirror / push (push) Successful in 6s
Test / lint (pull_request) Successful in 19s
Test / test (18) (pull_request) Successful in 30s
Test / test (20) (pull_request) Successful in 28s
Test / test (22) (pull_request) Successful in 30s
Test / test (24) (pull_request) Successful in 28s
Test / test (26) (pull_request) Successful in 30s
Mirror / push (push) Successful in 6s
Test / lint (pull_request) Successful in 19s
Test / test (18) (pull_request) Successful in 30s
Test / test (20) (pull_request) Successful in 28s
Test / test (22) (pull_request) Successful in 30s
Test / test (24) (pull_request) Successful in 28s
Test / test (26) (pull_request) Successful in 30s
This commit is contained in:
+3
-1
@@ -432,16 +432,18 @@ describe('TLVs', () => {
|
||||
assert.deepEqual(pduObj.tlvs.callback_num_pres_ind?.tagValue, [1]);
|
||||
});
|
||||
|
||||
test('refuses a single value for a tag SMPP lets repeat, and a list for one it does not', () => {
|
||||
test('refuses a single value or an empty list for a tag SMPP lets repeat, and a list for one it does not', () => {
|
||||
const params = { destination_addr: '46709771337', short_message: 'hi', source_addr: '46701113311' };
|
||||
const single = objToPdu({
|
||||
cmdName: 'submit_sm',
|
||||
params,
|
||||
tlvs: { callback_num: { tagValue: Buffer.from('46701113311', 'latin1') } },
|
||||
});
|
||||
const empty = objToPdu({ cmdName: 'submit_sm', params, tlvs: { callback_num: { tagValue: [] } } });
|
||||
const list = objToPdu({ cmdName: 'submit_sm', params, tlvs: { source_port: { tagValue: [1234] } } });
|
||||
|
||||
assert.match(single.err?.message ?? '', /TLV "callback_num": .*list/);
|
||||
assert.match(empty.err?.message ?? '', /TLV "callback_num": .*leave the tag out/);
|
||||
assert.match(list.err?.message ?? '', /TLV "source_port": .*list/);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user