Fixes https://gitlab.gnome.org/GNOME/vala/issues/179
r = s.slice (-7, -5);
assert (r == "my");
+
+ r = s.slice (-7, 0);
+ assert (r == "myworld");
+
+ r = s.slice (5, 0);
+ assert (r == "myworld");
}
void test_string_splice () {
s = s.splice (-14, -5);
assert (s == "helloworld");
+
+ s = s.splice (-5, 0, "wide");
+ assert (s == "hellowide");
+
+ s = s.splice (5, 0, "world");
+ assert (s == "helloworld");
}
void test_string_substring () {
}
if (end < 0) {
end = string_length + end;
+ } else if (end == 0) {
+ end = string_length;
}
GLib.return_val_if_fail (start >= 0 && start <= string_length, null);
GLib.return_val_if_fail (end >= 0 && end <= string_length, null);
}
if (end < 0) {
end = string_length + end;
+ } else if (end == 0) {
+ end = string_length;
}
GLib.return_val_if_fail (start >= 0 && start <= string_length, null);
GLib.return_val_if_fail (end >= 0 && end <= string_length, null);