Created
March 27, 2026 14:25
-
-
Save hugoarnal/c0cd97e61792a356e6bd563d49bd7dfe to your computer and use it in GitHub Desktop.
Cuddle student tester
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "dataframe.h" | |
| #include <string.h> | |
| #include <stdio.h> | |
| int main(int argc, char **argv) | |
| { | |
| dataframe_t *df = df_read_csv(argv[1], ";"); | |
| if (df == NULL) { | |
| printf("df data is NULL.\n"); | |
| return 84; | |
| } | |
| printf("df data isn't NULL!\n"); | |
| df_write_csv(df, "result.csv"); | |
| return 0; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| cc -o cuddle ~/aer/cuddle.c -I include/ -L ./ -lcuddle -lm | |
| # $1: file | |
| # $2: check diff | |
| check_file() { | |
| rm result.csv | |
| echo $1 | |
| CSV_FILE=~/code/aer/cuddle-csv-generator/generated/$1 | |
| ./cuddle $CSV_FILE | |
| if [ -z $2 ]; then | |
| diff --color $CSV_FILE result.csv | |
| fi | |
| } | |
| check_file basic1.csv | |
| check_file basic2.csv | |
| check_file basic3.csv | |
| check_file basic4.csv | |
| check_file basic5.csv | |
| check_file empty.csv no | |
| check_file huge_cols.csv no | |
| check_file huge_rows.csv no | |
| check_file inconsistent_row_length.csv | |
| check_file inconsistent_types.csv | |
| check_file inconsistent_types_7.csv | |
| check_file missing_header.csv | |
| check_file non_ascii.csv |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To use coupled with https://github.com/hugoschool/cuddle-csv-generator