MCPcopy
hub / github.com/zxing-js/library / testEncode

Function testEncode

src/test/core/aztec/encoder/EncoderTest.spec.ts:622–637  ·  view source on GitHub ↗
(
    data: string,
    compact: boolean,
    layers: number,
    expected: string
  )

Source from the content-addressed store, hash-verified

620 // Helper routines
621
622 function testEncode(
623 data: string,
624 compact: boolean,
625 layers: number,
626 expected: string
627 ) {
628 const aztec: AztecCode = AztecEncoder.encode(
629 StringUtils.getBytes(data, ZXingStandardCharsets.ISO_8859_1),
630 33,
631 AztecEncoder.DEFAULT_AZTEC_LAYERS
632 );
633 assertEquals(compact, aztec.isCompact());
634 assertEquals(layers, aztec.getLayers());
635 const matrix: BitMatrix = aztec.getMatrix();
636 assertEquals(expected, matrix.toString());
637 }
638
639 function testEncodeDecode(data: string, compact: boolean, layers: number) {
640 const aztec = AztecEncoder.encode(

Callers 1

Calls 7

assertEqualsFunction · 0.90
getLayersMethod · 0.80
encodeMethod · 0.65
getBytesMethod · 0.45
isCompactMethod · 0.45
getMatrixMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected