not implementing those

This commit is contained in:
2025-05-21 20:49:17 +02:00
parent 5b4a3f84e5
commit d31bc73884
3 changed files with 0 additions and 47 deletions

View File

@ -185,16 +185,6 @@ char* strops_remove_at_pos_char(const char* string, ull_t pos) {
return result;
}
char* strops_remove_at_pos_string(const char* string, const char* string_to_remove, ull_t pos) {
char* result = strops_copy(string);
return result;
}
char* strops_replace_at_pos_string(const char* string, const char* string_to_remove, const char* string_to_insert, ull_t pos) {
char* result = strops_copy(string);
return result;
}
char* strops_trim_right_whitespace(const char* string) {
char* result = strops_copy(string);
while (strops_contains_char("\t\n\v\f\r ", result[strops_length(result) - 1])) {

View File

@ -23,8 +23,6 @@ int strops_is_uppercase(const char* string);
char* strops_insert_at_pos_string(const char* string, const char* string_to_insert, ull_t pos);
char* strops_remove_at_pos_char(const char* string, ull_t pos);
char* strops_remove_at_pos_string(const char* string, const char* string_to_remove, ull_t pos);
char* strops_replace_at_pos_string(const char* string, const char* string_to_remove, const char* string_to_insert, ull_t pos);
char* strops_trim_right_whitespace(const char* string);
char* strops_trim_left_whitespace(const char* string);

35
tests.c
View File

@ -1,7 +1,6 @@
#include "strops.h"
#include <stdio.h>
#include <stdlib.h>
#include <execinfo.h>
/* https://gist.githubusercontent.com/rexim/b5b0c38f53157037923e7cdd77ce685d/raw/86c3db57f485f3b6f7958f308ba7126fa81282d8/da_append.c */
#define da_append(xs, x) \
@ -217,38 +216,6 @@ int test_remove_at_pos_char() {
return ret;
}
int test_remove_at_pos_string() {
int ret = 1;
char* input;
char* expected;
char* result;
input = "NULL BRUH NULL";
expected = "NULL NULL";
result = strops_remove_at_pos_string(input, " BRUH", 4);
if (strcmp(result, expected) != 0) {
printf("test_remove_at_pos_string failed\n");
printf("Got = '%s'\nExpected = '%s'\n", result, expected);
ret = 0;
}
return ret;
}
int test_replace_at_pos_string() {
int ret = 1;
char* input;
char* expected;
char* result;
input = "What happened in Tiananmen Square in 1989";
expected = "Nothing happened in Tiananmen Square in 1989";
result = strops_replace_at_pos_string(input, "What", "Nothing", 0);
if (strcmp(result, expected) != 0) {
printf("test_replace_at_pos_string failed\n");
printf("Got = '%s'\nExpected = '%s'\n", result, expected);
ret = 0;
}
return ret;
}
int test_trim_right_whitespace() {
int ret = 1;
char* input;
@ -454,8 +421,6 @@ int main() {
da_append(&tests, test_insert_at_pos_string);
da_append(&tests, test_remove_at_pos_char);
da_append(&tests, test_remove_at_pos_string);
da_append(&tests, test_replace_at_pos_string);
da_append(&tests, test_trim_right_whitespace);
da_append(&tests, test_trim_left_whitespace);