diff --git a/src/Ganeti/Utils.hs b/src/Ganeti/Utils.hs index cfaaaab2faee2e2ea73ae5c5b071cf26536e4a49..74377aa43450091dc63bacb534021715235b28b0 100644 --- a/src/Ganeti/Utils.hs +++ b/src/Ganeti/Utils.hs @@ -318,19 +318,19 @@ clockTimeToString (TOD t _) = show t (which is assumed to be a separator) to be absent from the string if the string terminates there. ->>> chompPrefix "foo:bar:" "a:b:c" +\>>> chompPrefix \"foo:bar:\" \"a:b:c\" Nothing ->>> chompPrefix "foo:bar:" "foo:bar:baz" -Just "baz" +\>>> chompPrefix \"foo:bar:\" \"foo:bar:baz\" +Just \"baz\" ->>> chompPrefix "foo:bar:" "foo:bar:" -Just "" +\>>> chompPrefix \"foo:bar:\" \"foo:bar:\" +Just \"\" ->>> chompPrefix "foo:bar:" "foo:bar" -Just "" +\>>> chompPrefix \"foo:bar:\" \"foo:bar\" +Just \"\" ->>> chompPrefix "foo:bar:" "foo:barbaz" +\>>> chompPrefix \"foo:bar:\" \"foo:barbaz\" Nothing -} chompPrefix :: String -> String -> Maybe String