mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 04:08:19 +00:00
Add strToScalars empty string test
This commit is contained in:
parent
1b872022bb
commit
9c9577c084
1 changed files with 11 additions and 0 deletions
|
@ -567,6 +567,17 @@ fn strToScalars(string: RocStr) callconv(.C) RocList {
|
|||
return answer;
|
||||
}
|
||||
|
||||
test "strToScalars: empty string" {
|
||||
const str = RocStr.fromSlice("");
|
||||
defer RocStr.deinit(str);
|
||||
|
||||
const expected = RocList.empty();
|
||||
const actual = strToScalars(str);
|
||||
defer RocList.deinit(actual, u32);
|
||||
|
||||
try expect(RocList.eql(actual, expected));
|
||||
}
|
||||
|
||||
test "strToScalars: One ASCII char" {
|
||||
const str = RocStr.fromSlice("R");
|
||||
defer RocStr.deinit(str);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue