diff options
Diffstat (limited to 'src/test/scala/xyz/driver/core')
-rw-r--r-- | src/test/scala/xyz/driver/core/RestTest.scala | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/scala/xyz/driver/core/RestTest.scala b/src/test/scala/xyz/driver/core/RestTest.scala new file mode 100644 index 0000000..efb9d07 --- /dev/null +++ b/src/test/scala/xyz/driver/core/RestTest.scala @@ -0,0 +1,16 @@ +package xyz.driver.core.rest + +import org.scalatest.{FlatSpec, Matchers} + +import akka.util.ByteString + +class RestTest extends FlatSpec with Matchers { + "`escapeScriptTags` function" should "escap script tags properly" in { + val dirtyString = "</sc----</sc----</sc" + val cleanString = "--------------------" + + (escapeScriptTags(ByteString(dirtyString)).utf8String) should be(dirtyString.replace("</sc", "< /sc")) + + (escapeScriptTags(ByteString(cleanString)).utf8String) should be(cleanString) + } +} |