-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fully implement splittext and add test #1560
Merged
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
2010c9b
fully implement splittext and add test
amylizzle 634b245
Merge branch 'master' into splittext
amylizzle 3f4ac13
Merge branch 'master' into splittext
amylizzle 55d2cd8
test list comparison
amylizzle 1f61892
fix include_delimiters
amylizzle 422bfeb
array instead of linq
amylizzle 834e327
Update OpenDreamRuntime/Procs/Native/DreamProcNativeRoot.cs
amylizzle 2e721e8
duh
amylizzle 2b08ef7
Merge branch 'master' into splittext
amylizzle b16f156
I am dum
amylizzle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/proc/RunTest() | ||
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 | ||
|
||
var/list/test2 = splittext(test_text, " ", 5) | ||
var/test2_expected = list("average","of","1,","2,","3,","4,","5","is:","3") | ||
test2 ~= test2_expected | ||
|
||
var/list/test3 = splittext(test_text, " ", 5, 10) | ||
var/test3_expected = list("avera") | ||
test3 ~= test3_expected | ||
|
||
var/list/test4 = splittext(test_text, " ", 10, 20) | ||
var/test4_expected = list("ge","of","1,","2") | ||
test4 ~= test4_expected | ||
|
||
var/list/test5 = splittext(test_text, " ", 10, 20, 1) | ||
var/test5_expected = list("ge"," ","of"," ","1,"," ","2") | ||
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 | ||
|
||
var/test7 = splittext(test_text, regex(@"\d"), 5, 30) | ||
var/test7_expected = list("average of ",", ",", ",", ",", "," ") | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These need to
ASSERT()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm an idiot