Skip to content

Instantly share code, notes, and snippets.

@hugoarnal
Created March 27, 2026 14:25
Show Gist options
  • Select an option

  • Save hugoarnal/c0cd97e61792a356e6bd563d49bd7dfe to your computer and use it in GitHub Desktop.

Select an option

Save hugoarnal/c0cd97e61792a356e6bd563d49bd7dfe to your computer and use it in GitHub Desktop.
Cuddle student tester
#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;
}
#!/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
@hugoarnal

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment