Skip to content

Commit

Permalink
I am dum
Browse files Browse the repository at this point in the history
  • Loading branch information
amylizzle committed Jan 7, 2024
1 parent 2b08ef7 commit b16f156
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Content.Tests/DMProject/Tests/Text/Splittext.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,33 @@
var/test_text = "The average of 1, 2, 3, 4, 5 is: 3"
var/list/test1 = splittext(test_text, " ")
var/list/test1_expected = list("The","average","of","1,","2,","3,","4,","5","is:","3")
test1 ~= test1_expected
ASSERT(test1 ~= test1_expected)

var/list/test2 = splittext(test_text, " ", 5)
var/test2_expected = list("average","of","1,","2,","3,","4,","5","is:","3")
test2 ~= test2_expected
ASSERT(test2 ~= test2_expected)

var/list/test3 = splittext(test_text, " ", 5, 10)
var/test3_expected = list("avera")
test3 ~= test3_expected
ASSERT(test3 ~= test3_expected)

var/list/test4 = splittext(test_text, " ", 10, 20)
var/test4_expected = list("ge","of","1,","2")
test4 ~= test4_expected
ASSERT(test4 ~= test4_expected)

var/list/test5 = splittext(test_text, " ", 10, 20, 1)
var/test5_expected = list("ge"," ","of"," ","1,"," ","2")
test5 ~= test5_expected
ASSERT(test5 ~= test5_expected)

//it's regex time
var/test6 = splittext(test_text, regex(@"\d"))
var/test6_expected = list("The average of ",", ",", ",", ",", "," is: ","")
test6 ~= test6_expected
ASSERT(test6 ~= test6_expected)

var/test7 = splittext(test_text, regex(@"\d"), 5, 30)
var/test7_expected = list("average of ",", ",", ",", ",", "," ")
test7 ~= test7_expected
ASSERT(test7 ~= test7_expected)

var/test8 = splittext(test_text, regex(@"\d"), 5, 30, 1)
var/test8_expected = list("average of ","1",", ","2",", ","3",", ","4",", ","5"," ")
test8 ~= test8_expected
ASSERT(test8 ~= test8_expected)

0 comments on commit b16f156

Please sign in to comment.