nulib/php/tests/app/launcherTest.php

21 lines
972 B
PHP

<?php
namespace nulib\app;
use nulib\tests\TestCase;
class launcherTest extends TestCase {
function testVerifix_args() {
self::assertSame([], launcher::verifix_args([]));
self::assertSame(["a"], launcher::verifix_args(["a"]));
self::assertSame(["a", "--b"], launcher::verifix_args(["a", "--b"]));
self::assertSame([], launcher::verifix_args(["a" => false]));
self::assertSame(["--a"], launcher::verifix_args(["a" => true]));
self::assertSame(["--a", "value"], launcher::verifix_args(["a" => "value"]));
self::assertSame(["--a", "52"], launcher::verifix_args(["a" => 52]));
self::assertSame(["--aa-bb", "value"], launcher::verifix_args(["aaBb" => "value"]));
self::assertSame(["--aa-bb", "value"], launcher::verifix_args(["aa-Bb" => "value"]));
self::assertSame(["--aa-bb", "value"], launcher::verifix_args(["aa_Bb" => "value"]));
self::assertSame(["---aa-bb", "value"], launcher::verifix_args(["_aa_Bb" => "value"]));
}
}