#include "ANTbin.h"
#include "moroz.h"

int ANTbin_ptest(char **args) {
    (void)args;
    prt(stderr, TXT_RED "TEST\n");
    prt(stderr, TXT_BLUE "TEST\n");
    prt(stderr, TXT_YELLOW "TEST\n");
    prt(stderr, TXT_GREEN "TEST\n\n");

    MRZ_CFILE("test.mrz");
    MRZ_CDIR("test");

    MRZ_PFILE("test.mrz", "test = ptest.txt")

    char *val = MRZ_RFILE("test.txt", "test");

    if (val && strcmp(val, "ptest!") == 0) {
        prt(stderr, TXT_GREEN "TEST! (Config read success)\n" TXT_RESET);
    } else {
        prt(stderr, TXT_RED "ERORR: Tag not found or value mismatch\n" TXT_RESET);
        return 1;
    }

    bool byrn = "true";

    while (byrn) { 
     prt(stderr, "rm \"test.mrz\" file ?");
     prt(stderr, "Y/N = ");
     char yrn = getchar();
     if (yrn == y || yrn == Y) {
       system("rm test.mrz");
       byrn = "false";
     } if else (yrn == n || yrn == N) {
       byrn = "false";
       } else {
       continue;
     }
    }
      
    prt(stderr, "\n");
    return 0;
}
