@ -10,15 +10,35 @@ internal class UtilsKtTest {
@ContainerTest
@Test
fun printToShell _escapes _ successfully( ) {
fun printToShell _escapes _ String_ successfully( ) {
// given
val a = Prov . defaultInstance ( )
// when
val testString = " test if newline \n and apostrophe's ' \" and special chars !§ $ %[] \\ äöüß \$ variable are handled correctly "
val testString = " test if newline \n and apostrophe's ' \" and special chars $ !§ $ %[] \\ äöüß \$ variable and tabs \t are handled correctly "
val res = a . cmd ( echoCommandForText ( testString ) ) . out
// then
assertEquals ( testString , res )
}
@ContainerTest
@Test
fun printToShell _escapes _raw _String _successfully ( ) {
// given
val a = Prov . defaultInstance ( )
// when
val testMultiLineString = """
test if newlines
\ n
and apostrophe ' s ' " \" \' and special chars $ {} $ \ {something}!§ $ %[] \\ äöüß $ \n otakotlinvariable ${'$'} notakotlinvariable and tabs \t are handled correctly
"""
val resMl = a . cmd ( echoCommandForText ( testMultiLineString ) ) . out
// then
assertEquals ( testMultiLineString , resMl )
}
}