@flighthq/bitmapfont-formats 0.3.1-next.847.2e6f8bf → 0.3.1-next.887.9f59a84

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flighthq/bitmapfont-formats",
3
- "version": "0.3.1-next.847.2e6f8bf",
3
+ "version": "0.3.1-next.887.9f59a84",
4
4
  "author": "Joshua Granick and other contributors",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -38,10 +38,10 @@
38
38
  "clean:dist": "tsx ../../scripts/clean-package-dist.ts"
39
39
  },
40
40
  "dependencies": {
41
- "@flighthq/bitmapfont": "0.3.1-next.847.2e6f8bf",
42
- "@flighthq/importdiagnostics": "0.3.1-next.847.2e6f8bf",
43
- "@flighthq/types": "0.3.1-next.847.2e6f8bf",
44
- "@flighthq/xml": "0.3.1-next.847.2e6f8bf"
41
+ "@flighthq/bitmapfont": "0.3.1-next.887.9f59a84",
42
+ "@flighthq/importdiagnostics": "0.3.1-next.887.9f59a84",
43
+ "@flighthq/types": "0.3.1-next.887.9f59a84",
44
+ "@flighthq/xml": "0.3.1-next.887.9f59a84"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@flighthq/textureatlas": "*",
@@ -79,6 +79,20 @@ describe('formatBitmapFontFnt', () => {
79
79
  });
80
80
 
81
81
  describe('parseBitmapFontFnt', () => {
82
+ // A clean parse is two claims: the values are right AND THE PARSER IS NOT COMPLAINING. Every other test
83
+ // here checks the first. This checks the second — the one that catches a walk that desynchronised and
84
+ // still left the asserted fields looking plausible. Asserted as an EMPTY list rather than a filter over
85
+ // truncation-shaped kind names: a pattern built from expected vocabulary silently exempts every kind
86
+ // whose name nobody guessed, and this importer has kinds like that.
87
+ it('raises no diagnostic at all for a well-formed file', () => {
88
+ const diagnostics: ImportDiagnostic[] = [];
89
+
90
+ parseBitmapFontFnt(FNT_TEXT, { resolvePage: () => createTextureAtlas() }, diagnostics);
91
+
92
+ const complaints = diagnostics.map((diagnostic) => diagnostic.kind);
93
+ expect(complaints, `a good fnt file made the parser complain: ${complaints.join(', ')}`).toEqual([]);
94
+ });
95
+
82
96
  it('parses glyphs, kerning, and line metrics with the resolved atlas', () => {
83
97
  const atlas = createTextureAtlas();
84
98
  const font = parseBitmapFontFnt(FNT_TEXT, { resolvePage: () => atlas });
@@ -5,6 +5,7 @@ import {
5
5
  getBitmapFontPage,
6
6
  } from '@flighthq/bitmapfont/contract';
7
7
  import { createTextureAtlas } from '@flighthq/textureatlas/contract';
8
+ import type { ImportDiagnostic } from '@flighthq/types/contract';
8
9
  import type { BitmapFont } from '@flighthq/types/contract';
9
10
  import { describe, expect, it } from 'vitest';
10
11
 
@@ -46,6 +47,20 @@ const FNT_XML = [
46
47
  ].join('\n');
47
48
 
48
49
  describe('parseBitmapFontJson', () => {
50
+ // A clean parse is two claims: the values are right AND THE PARSER IS NOT COMPLAINING. Every other test
51
+ // here checks the first. This checks the second — the one that catches a walk that desynchronised and
52
+ // still left the asserted fields looking plausible. Asserted as an EMPTY list rather than a filter over
53
+ // truncation-shaped kind names: a pattern built from expected vocabulary silently exempts every kind
54
+ // whose name nobody guessed, and this importer has kinds like that.
55
+ it('raises no diagnostic at all for a well-formed file', () => {
56
+ const diagnostics: ImportDiagnostic[] = [];
57
+
58
+ parseBitmapFontJson(FNT_JSON, { resolvePage: () => createTextureAtlas() }, diagnostics);
59
+
60
+ const complaints = diagnostics.map((diagnostic) => diagnostic.kind);
61
+ expect(complaints, `a good fnt-json file made the parser complain: ${complaints.join(', ')}`).toEqual([]);
62
+ });
63
+
49
64
  it('parses glyphs, kerning, and line metrics with the resolved atlas', () => {
50
65
  const atlas = createTextureAtlas();
51
66
  const font = parseBitmapFontJson(FNT_JSON, { resolvePage: () => atlas });
@@ -5,6 +5,7 @@ import {
5
5
  getBitmapFontPage,
6
6
  } from '@flighthq/bitmapfont/contract';
7
7
  import { createTextureAtlas } from '@flighthq/textureatlas/contract';
8
+ import type { ImportDiagnostic } from '@flighthq/types/contract';
8
9
  import { describe, expect, it } from 'vitest';
9
10
 
10
11
  import { parseBitmapFontXml } from './bitmapFontXml';
@@ -26,6 +27,20 @@ const FNT_XML = [
26
27
  ].join('\n');
27
28
 
28
29
  describe('parseBitmapFontXml', () => {
30
+ // A clean parse is two claims: the values are right AND THE PARSER IS NOT COMPLAINING. Every other test
31
+ // here checks the first. This checks the second — the one that catches a walk that desynchronised and
32
+ // still left the asserted fields looking plausible. Asserted as an EMPTY list rather than a filter over
33
+ // truncation-shaped kind names: a pattern built from expected vocabulary silently exempts every kind
34
+ // whose name nobody guessed, and this importer has kinds like that.
35
+ it('raises no diagnostic at all for a well-formed file', () => {
36
+ const diagnostics: ImportDiagnostic[] = [];
37
+
38
+ parseBitmapFontXml(FNT_XML, { resolvePage: () => createTextureAtlas() }, diagnostics);
39
+
40
+ const complaints = diagnostics.map((diagnostic) => diagnostic.kind);
41
+ expect(complaints, `a good fnt-xml file made the parser complain: ${complaints.join(', ')}`).toEqual([]);
42
+ });
43
+
29
44
  it('parses glyphs, kerning, and line metrics with the resolved atlas', () => {
30
45
  const atlas = createTextureAtlas();
31
46
  const font = parseBitmapFontXml(FNT_XML, { resolvePage: () => atlas });