s/CodePoint/CodePt/g

This commit is contained in:
Richard Feldman 2021-08-07 15:18:51 -04:00
parent 69b1497907
commit 267836226c
25 changed files with 69 additions and 69 deletions

View file

@ -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");

View file

@ -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" {