mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-18 15:33:12 +09:00
Ignore BOM in locale files
Ignore BOM at the start of Factorio locale files as this is a thing Factorio also does. Fixes #507
This commit is contained in:
1 parent
6eda1f78d5
commit
f23e442c4c
3 files changed
+14
No files matched your search
@@ -0,0 +1,2 @@
|
||||
[spam]
|
||||
foo=bar
|
||||
@@ -1,5 +1,6 @@
|
||||
"use strict";
|
||||
const assert = require("assert").strict;
|
||||
const fs = require("fs-extra");
|
||||
const lib = require("@clusterio/lib");
|
||||
|
||||
describe("lib/ini", function() {
|
||||
@@ -58,6 +59,12 @@ describe("lib/ini", function() {
|
||||
new Error("Duplicated key key on line 2")
|
||||
);
|
||||
});
|
||||
it("should parse a file with BOM", async function() {
|
||||
assert.deepEqual(
|
||||
lib.parse(await fs.readFile("test/file/bom.cfg", "utf8")),
|
||||
{ spam: { foo: "bar" }},
|
||||
);
|
||||
});
|
||||
});
|
||||
describe("stringify()", function() {
|
||||
it("should serialize to reference output", function() {
|
||||
|
||||
Reference in new issue
Block a user