Browse Source

Temporarily fix tests.

pull/50/head
Rafal Kupiec 3 years ago
parent
commit
08296110fb
Signed by: belliash GPG Key ID: 4E829243E0CFE6B4
  1. 9
      tests/arab_to_roman.aer
  2. 2
      tests/debug_backtrace.aer
  3. 4
      tests/singleton_test.aer
  4. 1
      tests/type_juggle.aer
  5. 5
      tests/unicode_characters.aer
  6. 10
      tests/utf8_variables.aer

9
tests/arab_to_roman.aer

@ -1,14 +1,15 @@
class Program {
private function num2Roman(int $num) {
$n = intval($num);
$result = '';
$lookup = array('M' => 1000, 'CM' => 900, 'D' => 500, 'CD' => 400,
int $n = intval($num);
int $result = '';
mixed $lookup = array('M' => 1000, 'CM' => 900, 'D' => 500, 'CD' => 400,
'C' => 100, 'XC' => 90, 'L' => 50, 'XL' => 40,
'X' => 10, 'IX' => 9, 'V' => 5, 'IV' => 4, 'I' => 1);
int $matches;
foreach($lookup as $roman => $value) {
$matches = intval($n / $value);
$matches = intval($n / $value);
$result += str_repeat($roman, $matches);
$n = $n % $value;
}

2
tests/debug_backtrace.aer

@ -5,7 +5,7 @@ class Program {
}
function a(string $p) {
$backtrace = debug_backtrace();
mixed $backtrace = debug_backtrace();
if(isset($backtrace[0]['args'])) {
var_export($backtrace[0]['args']);
} else {

4
tests/singleton_test.aer

@ -24,9 +24,9 @@ final class Test {
final class Program {
public function main() {
$testA = Test::getInstance();
object $testA = Test::getInstance();
$testA->set(5);
$testB = Test::getInstance();
object $testB = Test::getInstance();
var_dump($testB->get());
}
} /* class */

1
tests/type_juggle.aer

@ -1,6 +1,7 @@
class Program {
function main() {
mixed $foo;
$foo = '0';
var_dump($foo);
$foo += 2;

5
tests/unicode_characters.aer

@ -1,7 +1,8 @@
class Unicode {
public function unicon(string $str, bool $to_uni = true) {
$cp = array('А' => 'А', 'а' => 'а',
mixed $cpp;
mixed $cp = array('А' => 'А', 'а' => 'а',
"Б" => "Б", "б" => "б",
"В" => "В", "в" => "в",
"Г" => "Г", "г" => "г",
@ -50,7 +51,7 @@ class Unicode {
final class Program {
public function main() {
$unicode = new Unicode();
object $unicode = new Unicode();
var_dump($unicode->unicon("ИфйжБЦ"));
}

10
tests/utf8_variables.aer

@ -13,11 +13,11 @@ class Program {
}
private function isUTF8(string $str) {
$b = 0;
$c = 0;
$bits = 0;
$len = strlen($str);
for($i = 0; $i < $len; $i++) {
int $b = 0;
int $c = 0;
int $bits = 0;
int $len = strlen($str);
for(int $i = 0; $i < $len; $i++) {
$c = ord($str[$i]);
if($c >= 128) {
if(($c >= 254)) return false;

Loading…
Cancel
Save