test leftover string printing
This commit is contained in:
+8
-1
@@ -2,9 +2,10 @@ import "../shim.ts";
|
||||
|
||||
import assert from "assert";
|
||||
|
||||
import { placeholderTypes, sprintf } from "../utils.js";
|
||||
import { XqBytesDec, XqBytesEnc } from "../func_replacements.js";
|
||||
import { SendUsrChk } from "../impl.ts";
|
||||
import { placeholderTypes, sprintf } from "../utils.js";
|
||||
import { hexdump } from "../hexdump.js";
|
||||
|
||||
describe("debug_tools", () => {
|
||||
it("parses printed data", () => {
|
||||
@@ -19,6 +20,12 @@ describe("debug_tools", () => {
|
||||
const expected_string = "string: potato, int: 5, float: 3.5, hexint: 0x20, newline: \n\n last int: 999";
|
||||
assert.deepEqual(sprintf(fmt, in_values), expected_string);
|
||||
});
|
||||
it("prints leftover after last formatter", () => {
|
||||
const fmt = "string: %s and this bit is also printed";
|
||||
const in_values = ["potato"];
|
||||
const expected_string = "string: potato and this bit is also printed";
|
||||
assert.deepEqual(sprintf(fmt, in_values), expected_string);
|
||||
});
|
||||
});
|
||||
|
||||
describe("module", () => {
|
||||
|
||||
Reference in New Issue
Block a user