@@ -4,29 +4,29 @@ import (
44 "reflect"
55 "testing"
66
7- "github.com/codeshelldev/secured-signal-api/utils/safestrings "
7+ stringutils "github.com/codeshelldev/secured-signal-api/utils/stringutils "
88)
99
1010func TestStringEscaping (t * testing.T ) {
1111 str1 := `\#`
1212
13- res1 := safestrings .IsEscaped (str1 , "#" )
13+ res1 := stringutils .IsEscaped (str1 , "#" )
1414
1515 if ! res1 {
1616 t .Error ("Expected: " , str1 , " == true" , "; Got: " , str1 , " == " , res1 )
1717 }
1818
1919 str2 := "#"
2020
21- res2 := safestrings .IsEscaped (str2 , "#" )
21+ res2 := stringutils .IsEscaped (str2 , "#" )
2222
2323 if res2 {
2424 t .Error ("Expected: " , str2 , " == false" , "; Got: " , str2 , " == " , res2 )
2525 }
2626
2727 str3 := `#\#`
2828
29- res3 := safestrings .Contains (str3 , "#" )
29+ res3 := stringutils .Contains (str3 , "#" )
3030
3131 if ! res3 {
3232 t .Error ("Expected: " , str3 , " == true" , "; Got: " , str3 , " == " , res3 )
@@ -36,15 +36,15 @@ func TestStringEscaping(t *testing.T) {
3636func TestStringEnclosement (t * testing.T ) {
3737 str1 := "[enclosed]"
3838
39- res1 := safestrings .IsEnclosedBy (str1 , `[` , `]` )
39+ res1 := stringutils .IsEnclosedBy (str1 , `[` , `]` )
4040
4141 if ! res1 {
4242 t .Error ("Expected: " , str1 , " == true" , "; Got: " , str1 , " == " , res1 )
4343 }
4444
4545 str2 := `\[enclosed]`
4646
47- res2 := safestrings .IsEnclosedBy (str2 , `[` , `]` )
47+ res2 := stringutils .IsEnclosedBy (str2 , `[` , `]` )
4848
4949 if res2 {
5050 t .Error ("Expected: " , str2 , " == false" , "; Got: " , str2 , " == " , res2 )
@@ -54,23 +54,23 @@ func TestStringEnclosement(t *testing.T) {
5454func TestStringToType (t * testing.T ) {
5555 str1 := `[item1,item2]`
5656
57- res1 := safestrings .ToType (str1 )
57+ res1 := stringutils .ToType (str1 )
5858
5959 if reflect .TypeOf (res1 ) != reflect .TypeFor [[]string ]() {
6060 t .Error ("Expected: " , str1 , " == []string" , "; Got: " , str1 , " == " , reflect .TypeOf (res1 ))
6161 }
6262
6363 str2 := `1`
6464
65- res2 := safestrings .ToType (str2 )
65+ res2 := stringutils .ToType (str2 )
6666
6767 if reflect .TypeOf (res2 ) != reflect .TypeFor [int ]() {
6868 t .Error ("Expected: " , str2 , " == int" , "; Got: " , str2 , " == " , reflect .TypeOf (res2 ))
6969 }
7070
7171 str3 := `{ "key": "value" }`
7272
73- res3 := safestrings .ToType (str3 )
73+ res3 := stringutils .ToType (str3 )
7474
7575 if reflect .TypeOf (res3 ) != reflect .TypeFor [map [string ]any ]() {
7676 t .Error ("Expected: " , str3 , " == map[string]any" , "; Got: " , str3 , " == " , reflect .TypeOf (res3 ))
0 commit comments