Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
springmeyer committed Jun 17, 2024
1 parent ae056b9 commit ab5a066
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions js/test/unit/decoder/MltDecoder.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ describe("MltDecoder", () => {
const mltTile = fs.readFileSync(tile.mlt);
const mltMetadataPbf = fs.readFileSync(tile.meta);
const tilesetMetadata = TileSetMetadata.fromBinary(mltMetadataPbf);
const decoded = MltDecoder.decodeMlTile(mltTile, tilesetMetadata);
const featureTables = MltDecoder.generateFeatureTables(tilesetMetadata);
const decoded = MltDecoder.decodeMlTile(mltTile, featureTables);
expect(decoded).toBeDefined();
expect(decoded.layers.length).toEqual(1);
expect(decoded.layers[0].features.length).toEqual(1);
Expand All @@ -27,7 +28,8 @@ describe("MltDecoder", () => {
const mltTile = fs.readFileSync(tile.mlt);
const mltMetadataPbf = fs.readFileSync(tile.meta);
const tilesetMetadata = TileSetMetadata.fromBinary(mltMetadataPbf);
const decoded = MltDecoder.decodeMlTile(mltTile, tilesetMetadata);
const featureTables = MltDecoder.generateFeatureTables(tilesetMetadata);
const decoded = MltDecoder.decodeMlTile(mltTile, featureTables);
expect(decoded).toBeDefined();
expect(decoded.layers.length).toEqual(1);
expect(decoded.layers[0].features.length).toEqual(1);
Expand All @@ -41,7 +43,8 @@ describe("MltDecoder", () => {
const mltTile = fs.readFileSync(tile.mlt);
const mltMetadataPbf = fs.readFileSync(tile.meta);
const tilesetMetadata = TileSetMetadata.fromBinary(mltMetadataPbf);
const decoded = MltDecoder.decodeMlTile(mltTile, tilesetMetadata);
const featureTables = MltDecoder.generateFeatureTables(tilesetMetadata);
const decoded = MltDecoder.decodeMlTile(mltTile, featureTables);
expect(decoded).toBeDefined();
expect(decoded.layers.length).toEqual(1);
expect(decoded.layers[0].features.length).toEqual(1);
Expand All @@ -56,7 +59,8 @@ describe("MltDecoder", () => {
const mltTile = fs.readFileSync(tile.mlt);
const mltMetadataPbf = fs.readFileSync(tile.meta);
const tilesetMetadata = TileSetMetadata.fromBinary(mltMetadataPbf);
const decoded = MltDecoder.decodeMlTile(mltTile, tilesetMetadata);
const featureTables = MltDecoder.generateFeatureTables(tilesetMetadata);
const decoded = MltDecoder.decodeMlTile(mltTile, featureTables);
expect(decoded).toBeDefined();
expect(decoded.layers.length).toEqual(1);
expect(decoded.layers[0].features.length).toEqual(1);
Expand All @@ -71,7 +75,8 @@ describe("MltDecoder", () => {
const mltTile = fs.readFileSync(tile.mlt);
const mltMetadataPbf = fs.readFileSync(tile.meta);
const tilesetMetadata = TileSetMetadata.fromBinary(mltMetadataPbf);
const decoded = MltDecoder.decodeMlTile(mltTile, tilesetMetadata);
const featureTables = MltDecoder.generateFeatureTables(tilesetMetadata);
const decoded = MltDecoder.decodeMlTile(mltTile, featureTables);
expect(decoded).toBeDefined();
expect(decoded.layers.length).toEqual(1);
expect(decoded.layers[0].features.length).toEqual(1);
Expand All @@ -86,7 +91,8 @@ describe("MltDecoder", () => {
const mltTile = fs.readFileSync(tile.mlt);
const mltMetadataPbf = fs.readFileSync(tile.meta);
const tilesetMetadata = TileSetMetadata.fromBinary(mltMetadataPbf);
const decoded = MltDecoder.decodeMlTile(mltTile, tilesetMetadata);
const featureTables = MltDecoder.generateFeatureTables(tilesetMetadata);
const decoded = MltDecoder.decodeMlTile(mltTile, featureTables);
expect(decoded).toBeDefined();
expect(decoded.layers.length).toEqual(1);
expect(decoded.layers[0].features.length).toEqual(1);
Expand All @@ -102,7 +108,8 @@ describe("MltDecoder", () => {
const mltTile = fs.readFileSync(tile.mlt);
const mltMetadataPbf = fs.readFileSync(tile.meta);
const tilesetMetadata = TileSetMetadata.fromBinary(mltMetadataPbf);
const decoded = MltDecoder.decodeMlTile(mltTile, tilesetMetadata);
const featureTables = MltDecoder.generateFeatureTables(tilesetMetadata);
const decoded = MltDecoder.decodeMlTile(mltTile, featureTables);
expect(decoded).toBeDefined();
expect(decoded.layers.length).toEqual(9);
// vtzero-stats reports:
Expand Down Expand Up @@ -145,7 +152,8 @@ describe("MltDecoder", () => {
const mltTile = fs.readFileSync(tile.mlt);
const mltMetadataPbf = fs.readFileSync(tile.meta);
const tilesetMetadata = TileSetMetadata.fromBinary(mltMetadataPbf);
const decoded = MltDecoder.decodeMlTile(mltTile, tilesetMetadata);
const featureTables = MltDecoder.generateFeatureTables(tilesetMetadata);
const decoded = MltDecoder.decodeMlTile(mltTile, featureTables);
expect(decoded).toBeDefined();
expect(decoded.layers.length).toEqual(5);
// Note: these feature counts match what vtzero-stats reports
Expand Down

0 comments on commit ab5a066

Please sign in to comment.