pb-parser/test/internals.js
2023-05-15 16:24:41 +02:00

28 lines
765 B
JavaScript

import {deepStrictEqual} from "assert";
import {parse_value} from "../index.js";
describe("Internal", () => {
describe("#parse_value()", () => {
it("parses number", () => {
deepStrictEqual({
key: "example_key",
value: 123,
}, parse_value("example_key: 123"))
})
it("parses string", () => {
deepStrictEqual({
key: "example_key",
value: "this is 1 value",
}, parse_value("example_key: \"this is 1 value\""))
})
it("parses value with number key", () => {
deepStrictEqual({
key: "123",
value: "123v"
}, parse_value("123: \"123v\""))
})
})
})