Skip to content

Commit

Permalink
chore(common/web): add test case for empty string for setString()
Browse files Browse the repository at this point in the history
  • Loading branch information
markcsinclair committed Dec 5, 2024
1 parent 4b46643 commit 27b7fc3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions common/web/types/tests/kvk/kvk-file-writer.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@ describe('Test of KVK-File-Writer', () => {
assert.equal(bks.len, str.length + 1);
assert.deepEqual(bks.str, str);
});
it('can handle an empty string', () => {
const bks: BUILDER_KVK_STRING = { len: 0, str: null };
const writer = new KvkFileWriter;
const str = "";
writer['setString'](bks, str);
assert.equal(bks.len, str.length + 1);
assert.deepEqual(bks.str, str);
});
it('throws TypeError for a null BUILDER_KVK_STRING', () => {
assert.throws(() => {
const writer = new KvkFileWriter;
Expand Down

0 comments on commit 27b7fc3

Please sign in to comment.