Skip to content

Commit 8aee5ea

Browse files
committed
add tests for removing ssh key comment
1 parent 2ccc1d0 commit 8aee5ea

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/unit/UtilsTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,21 @@ public function testTestValidSSHKey(bool $expected, string $key, string $explana
9292
$this->assertEquals($expected, $is_valid);
9393
}
9494

95+
public static function sshKeyCommentProvider()
96+
{
97+
return [
98+
["foo bar", "foo bar"],
99+
["foo bar baz", "foo bar"],
100+
["foo bar baz baz bam", "foo bar"],
101+
];
102+
}
103+
104+
#[DataProvider("sshKeyCommentProvider")]
105+
public function testRemoveSSHKeyOptionalCommentSuffix(string $input, string $expected_output)
106+
{
107+
$this->assertEquals(removeSSHKeyOptionalCommentSuffix($input), $expected_output);
108+
}
109+
95110
public static function URLComponentProvider()
96111
{
97112
if (CONFIG["site"]["url"] != "http://127.0.0.1:8000/") {

0 commit comments

Comments
 (0)