mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
s/CodePoint/CodePt/g
This commit is contained in:
parent
69b1497907
commit
267836226c
25 changed files with 69 additions and 69 deletions
|
@ -88,7 +88,7 @@ comptime {
|
|||
exportStrFn(str.countSegments, "count_segments");
|
||||
exportStrFn(str.countGraphemeClusters, "count_grapheme_clusters");
|
||||
exportStrFn(str.startsWith, "starts_with");
|
||||
exportStrFn(str.startsWithCodePoint, "starts_with_code_point");
|
||||
exportStrFn(str.startsWithCodePt, "starts_with_code_point");
|
||||
exportStrFn(str.endsWith, "ends_with");
|
||||
exportStrFn(str.strConcatC, "concat");
|
||||
exportStrFn(str.strJoinWithC, "joinWith");
|
||||
|
|
|
@ -865,8 +865,8 @@ pub fn startsWith(string: RocStr, prefix: RocStr) callconv(.C) bool {
|
|||
return true;
|
||||
}
|
||||
|
||||
// Str.startsWithCodePoint
|
||||
pub fn startsWithCodePoint(string: RocStr, prefix: u32) callconv(.C) bool {
|
||||
// Str.startsWithCodePt
|
||||
pub fn startsWithCodePt(string: RocStr, prefix: u32) callconv(.C) bool {
|
||||
const bytes_len = string.len();
|
||||
const bytes_ptr = string.asU8ptr();
|
||||
|
||||
|
@ -886,18 +886,18 @@ pub fn startsWithCodePoint(string: RocStr, prefix: u32) callconv(.C) bool {
|
|||
return true;
|
||||
}
|
||||
|
||||
test "startsWithCodePoint: ascii char" {
|
||||
test "startsWithCodePt: ascii char" {
|
||||
const whole = RocStr.init("foobar", 6);
|
||||
const prefix = 'f';
|
||||
try expect(startsWithCodePoint(whole, prefix));
|
||||
try expect(startsWithCodePt(whole, prefix));
|
||||
}
|
||||
|
||||
test "startsWithCodePoint: emoji" {
|
||||
test "startsWithCodePt: emoji" {
|
||||
const yes = RocStr.init("💖foobar", 10);
|
||||
const no = RocStr.init("foobar", 6);
|
||||
const prefix = '💖';
|
||||
try expect(startsWithCodePoint(yes, prefix));
|
||||
try expect(!startsWithCodePoint(no, prefix));
|
||||
try expect(startsWithCodePt(yes, prefix));
|
||||
try expect(!startsWithCodePt(no, prefix));
|
||||
}
|
||||
|
||||
test "startsWith: foo starts with fo" {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue