unrecognized-event-bug #5
@ -39,4 +39,4 @@ test:
|
||||
@echo
|
||||
./$(EXECUTABLE) -h
|
||||
@echo
|
||||
./$(EXECUTABLE) -f ../tests/calendar.ics
|
||||
../tests/run_tests.sh
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
char *ics_path = "";
|
||||
@ -38,6 +39,8 @@ int main(int argc, char **argv) {
|
||||
|
||||
while(read_until_nl(myfd, my_event)) {
|
||||
if (strncmp(my_event, "BEGIN:VEVENT", 12) == 0) {
|
||||
// include the BEGIN:EVENT to not loose the new line of first field
|
||||
lseek(myfd, -12, SEEK_CUR);
|
||||
memset(my_event, '\0', sizeof(my_event));
|
||||
read_until_string(myfd, my_event, "END:VEVENT");
|
||||
unfolding_string(my_event, unfolded_event);
|
||||
|
15
tests/run_tests.sh
Executable file
15
tests/run_tests.sh
Executable file
@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
mapfile -t files < <(find ../tests/. -name "*.ics")
|
||||
|
||||
i=1
|
||||
for file in ${files[@]}; do
|
||||
echo "TEST ${i}: ${file}"
|
||||
echo "===================================================="
|
||||
../src/icscli -f "${file}"
|
||||
echo "===================================================="
|
||||
echo
|
||||
((i++))
|
||||
done
|
||||
|
||||
exit 0
|
12
tests/start_date_is_first_field.ics
Normal file
12
tests/start_date_is_first_field.ics
Normal file
@ -0,0 +1,12 @@
|
||||
BEGIN:VCALENDAR
|
||||
BEGIN:VEVENT
|
||||
DTSTART:20240413T070000Z
|
||||
DTEND:20240413T083000Z
|
||||
DTSTAMP:20240229T171200Z
|
||||
SUMMARY:XYZ Exam (XYZ)
|
||||
DESCRIPTION:XYZ Exam (XYZ)
|
||||
UID:61792
|
||||
CREATED:20240229T171308Z
|
||||
LAST-MODIFIED:20240229T171308Z
|
||||
END:VEVENT
|
||||
END:VCALENDAR
|
Loading…
Reference in New Issue
Block a user