mirror of
https://github.com/m1ngsama/TNT.git
synced 2026-02-08 08:54:05 +00:00
Add 31 unit tests covering core functionality: - UTF-8 byte length detection - UTF-8 character decoding (1-4 byte sequences) - Character width calculation (ASCII, CJK, Hangul, Hiragana, Katakana) - String width calculation - Character/word removal functions - UTF-8 validation - Message formatting and edge cases Test results: 31/31 passed ✓ Files: - tests/unit/test_utf8.c (20 tests) - tests/unit/test_message.c (11 tests) - tests/unit/Makefile (build configuration)
30 lines
584 B
Makefile
30 lines
584 B
Makefile
# Unit Tests Makefile
|
|
CC = gcc
|
|
CFLAGS = -Wall -Wextra -std=c11 -I../../include
|
|
LDFLAGS = -pthread
|
|
|
|
# Source files
|
|
UTF8_SRC = ../../src/utf8.c
|
|
MESSAGE_SRC = ../../src/message.c
|
|
|
|
TESTS = test_utf8 test_message
|
|
|
|
.PHONY: all clean run
|
|
|
|
all: $(TESTS)
|
|
|
|
test_utf8: test_utf8.c $(UTF8_SRC)
|
|
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
|
|
|
|
test_message: test_message.c $(MESSAGE_SRC) $(UTF8_SRC)
|
|
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
|
|
|
|
run: all
|
|
@echo "=== Running UTF-8 Tests ==="
|
|
./test_utf8
|
|
@echo ""
|
|
@echo "=== Running Message Tests ==="
|
|
./test_message
|
|
|
|
clean:
|
|
rm -f $(TESTS) *.o test_messages.log
|