Browse Source

Fix HTML test generator; clean up

span
J. King 6 years ago
parent
commit
32d7fc47b0
  1. 1
      tests/cases/Encoding/TestGB18030.php
  2. 1
      tests/cases/Encoding/TestSingleByte.php
  3. 1
      tests/cases/Encoding/TestUTF8.php
  4. 1
      tests/cases/Encoding/TestXUserDefined.php
  5. 1
      tests/lib/DecoderTest.php
  6. 3
      tools/test.js

1
tests/cases/Encoding/TestGB18030.php

@ -28,7 +28,6 @@ class TestGB18030 extends \MensBeam\Intl\Test\CoderDecoderTest {
protected $seekOffsets = [0, 1, 5, 7, 11, 15, 19, 23];
/* This string contains an invalid character sequence sandwiched between two null characters */
protected $brokenChar = "00 FF 00";
protected $lowerA = "a";
public function tearDown() {
$this->testedClass = GB18030::class;

1
tests/cases/Encoding/TestSingleByte.php

@ -80,7 +80,6 @@ class TestSingleByte extends \MensBeam\Intl\Test\CoderDecoderTest {
protected $seekOffsets = [0, 1, 2, 3, 4, 5, 6, 7];
/* This string is supposed to contain an invalid character sequence sandwiched between two null characters; this is different for each single-byte encoding (and many do not have invalid characters) */
protected $brokenChar = "";
protected $lowerA = "a";
/**
* @dataProvider provideCodePoints

1
tests/cases/Encoding/TestUTF8.php

@ -27,7 +27,6 @@ class TestUTF8 extends \MensBeam\Intl\Test\CoderDecoderTest {
protected $seekOffsets = [0, 1, 3, 6, 10, 13, 17, 20];
/* This string contains an invalid character sequence sandwiched between two null characters */
protected $brokenChar = "00 FF 00";
protected $lowerA = "a";
/**
* @dataProvider provideCodePoints

1
tests/cases/Encoding/TestXUserDefined.php

@ -16,7 +16,6 @@ class TestXUserDefined extends \MensBeam\Intl\Test\DecoderTest {
protected $seekOffsets = [0, 1, 2, 3, 4, 5, 6, 7];
/* This string is supposed to contain an invalid character sequence sandwiched between two null characters, but x-user-defined has no invalid characters */
protected $brokenChar = "";
protected $lowerA = "a";
/**
* @dataProvider provideStrings

1
tests/lib/DecoderTest.php

@ -9,6 +9,7 @@ namespace MensBeam\Intl\Test;
use MensBeam\Intl\Encoding\DecoderException;
abstract class DecoderTest extends \PHPUnit\Framework\TestCase {
protected $lowerA = "a";
public function testDecodeMultipleCharactersAsCodePoints(string $input, array $exp) {
$class = $this->testedClass;

3
tools/test.js

@ -3,7 +3,7 @@
window.out = document.createElement("pre");
document.documentElement.appendChild(out);
var encoding = document.getElementsByTagName("meta").charset;
var encoding = document.getElementsByTagName("meta")[0].getAttribute("charset");
function encodeCodePoint(code, fatal) {
if (code < 0 || code > 0x10FFFF) {
@ -132,6 +132,7 @@ if(typeof seekCodePoints != 'undefined') {
for (let char of stats) {
offs.push(char.offset);
}
offs.push(end[1]);
offs = 'protected $seekOffsets = [' + offs.join(", ") + "];\n";
// output the results
out.appendChild(document.createTextNode(comment));

Loading…
Cancel
Save