Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
rask24 committed Apr 15, 2024
1 parent 16e9a1d commit c2fe6a8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/unit/test_type.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright 2024, reasuke.

#include "gtest/gtest.h"

extern "C" {
#include "ft_type.h"
}

TEST(ft_isblank, test) {
EXPECT_TRUE(ft_isblank(' '));
EXPECT_TRUE(ft_isblank('\t'));

EXPECT_FALSE(ft_isblank('a'));
EXPECT_FALSE(ft_isblank('0'));
EXPECT_FALSE(ft_isblank('\0'));
EXPECT_FALSE(ft_isblank('<'));
}
1 change: 1 addition & 0 deletions unit_test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ TEST_SRC = $(TEST_DIR)/test_strcmp.cpp \
$(TEST_DIR)/test_strndup.cpp \
$(TEST_DIR)/test_strtol.cpp \
$(TEST_DIR)/test_math.cpp \
$(TEST_DIR)/test_type.cpp \
$(TEST_DIR)/test_lst_before.cpp \
$(TEST_DIR)/test_file_to_lines.cpp
TEST_OBJ = $(patsubst $(TEST_DIR)/%.cpp, $(TEST_BUILD_DIR)/%.o, $(TEST_SRC))
Expand Down

0 comments on commit c2fe6a8

Please sign in to comment.