From a8bcf5201d730083c7be8fdfd4629a1c4b810800 Mon Sep 17 00:00:00 2001 From: lalgarra Date: Tue, 30 Sep 2025 18:53:31 +0200 Subject: [PATCH] =?UTF-8?q?Desde=20vogsphere=20250929=5F1801,=20probando?= =?UTF-8?q?=20adaptaci=C3=B3n=20a=20tener=20tests=20en=20repo=20aparte?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 71 ++++++++++++++++++++++++++++++++++++++++ isalnum_expected.output | Bin 0 -> 6546 bytes isalnum_test.c | 13 ++++++++ isalpha_expected.output | Bin 0 -> 6702 bytes isalpha_test.c | 13 ++++++++ isascii_expected.output | Bin 0 -> 6546 bytes isascii_test.c | 16 +++++++++ isdigit_expected.output | Bin 0 -> 6576 bytes isdigit_test.c | 13 ++++++++ 9 files changed, 126 insertions(+) create mode 100644 Makefile create mode 100644 isalnum_expected.output create mode 100644 isalnum_test.c create mode 100644 isalpha_expected.output create mode 100644 isalpha_test.c create mode 100644 isascii_expected.output create mode 100644 isascii_test.c create mode 100644 isdigit_expected.output create mode 100644 isdigit_test.c diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..3558a82 --- /dev/null +++ b/Makefile @@ -0,0 +1,71 @@ +# **************************************************************************** # +# # +# ::: :::::::: # +# Makefile :+: :+: :+: # +# +:+ +:+ +:+ # +# By: lalgarra +#+ +:+ +#+ # +# +#+#+#+#+#+ +#+ # +# Created: 2025/09/29 11:35:48 by lalgarra #+# #+# # +# Updated: 2025/09/29 17:42:30 by lalgarra ### ########.fr # +# # +# **************************************************************************** # + +LIBDIR = ../repo_libft_algarra +#CFLAGS += -Wall -Wextra -Werror -g3 -fsanitize=address +CFLAGS += -Wall -Wextra -Werror -g3 -iquote $(LIBDIR) -L$(LIBDIR) -lft + +TESTS:= isalpha_test isdigit_test isalnum_test isascii_test + +all: $(TESTS) + +run: + for i in $(TESTS); do \ + echo ./$$i; \ + done + +foo: + $(foreach E, $(TESTS), \ + $(eval X = $(subst _test,_expected.output,$(E))) \ + $(eval A = $(subst _test,_actual.output,$(E))) \ + echo ./$(E) redir $(A); \ + echo less diff -a $(X) $(A); \ + ) +# +# +#OBJECTS = $(SOURCES:.c=.o) +# +#build: $(OBJECTS) +# ar rcs $(NAME) $(OBJECTS) +# +#clean: +##removes objects (.o)# +# @echo "Deleting '.o' files..." +# @rm -f $(OBJECTS) +# @echo "Files '.o' deleted" +# +#fclean: clean +##removes objects (.o) and library# +# @echo "Deleting lib..." +# @rm -f $(NAME) +# @echo "Lib deleted" +# +#all: $(NAME) +## builds all +# +#re: clean all +## cleans and rebuild all +# +#isalpha_test: isalpha_test.c $(NAME) +# $(CC) -o isalpha_test.out isalpha_test.c $(CFLAGS) -L. -lft +# +#isdigit_test: isdigit_test.c $(NAME) +# $(CC) -o isdigit_test.out isdigit_test.c $(CFLAGS) -L. -lft +# +#isalnum_test: isalnum_test.c $(NAME) +# $(CC) -o isalnum_test.out isalnum_test.c $(CFLAGS) -L. -lft +# +#isascii_test: isascii_test.c $(NAME) +# $(CC) -o isascii_test.out isascii_test.c $(CFLAGS) -L. -lft +# +#clean_tests: +# @rm -f *_test.out *_test.o diff --git a/isalnum_expected.output b/isalnum_expected.output new file mode 100644 index 0000000000000000000000000000000000000000..e9f7254461cfb4752233a68e17dc05655bf00402 GIT binary patch literal 6546 zcmZwJW02oh97gdPX;Yh9?ryn8QrouERB4kGY3eq$ZQHhO+qP}D_dGA}|GfQvW@qO) z`gB+41$yh{!16%799RLUmjf#T^>Sb(pk5BF4A}Bj09(E)V9QqnZ29Vd zEnlNRpDkY#u;pt3wtQ{CmahZY@^t}Qz8+x9*9UC*27oQ!5U}MN73jC+8w2%nKG98p zdO5HuP%j5I1M20#=0Lq1*aE1R1495?z9nGGhXS^Is{-w9Hht?zy`7JAn@Bw#*)~$I zN4AU9^O0eZdOxy#qz-`W5U~QoBbH!9#2So58lH3fo*g6BV5f*R*g0Yic8OSnQ4wpf zYs4Cij#z`;BGzE{h&9*)X?WPtV9$s(*ehZU_KwsI_;mM))D4h*BXt90zewEx855}+ zAp1w^2FL-Cx&d+^qEEboB6S0P=HN)(068RL4GxW1gTo@$;P8kwI3i*Vj*M7?qaxPe zXha`-$3(2bu@P%T##2TC&u?D9^tih>B!?TaS>1h#baC*cV zoDs1GXGW~SSrKb+cElQ-6R`&8My$bk5o>Thq7T3eBG%x-h&8wT=#2Q>5u?9Cptig>DYj9J< z8r+ODJPK)WOT-%78nFhqMXbT?5o>Tq#2VZgu?BZVtijz8Yj97*8r+LCJP&DbU&I>R zAF&1xM6AJs5o_>J#2P#tu?CMstihuZYw%da8a!U4qv4%MgC`=^;K_(Jcq(EIo{m_9 zXCl_%*@!iGE@BOyk642jBG%wVq~V=NgO?)K;N^%lcqL*DUX56T*CN*7^@ufiBVrBS zj97!WBG%w-q~V=NgLfj<;N6HdcrRiN-j7&=48#2S1Vu?Am7tijh2Yw%6P8hjhE2H!=j!S{&16Mu+UgC8T-;HQW+_&H(? veu-FvUnADww}>_PJz@?1h**O^5q&5A6|n|?N36j=5o_>o#2Wk;kp}+*3JY#| literal 0 HcmV?d00001 diff --git a/isalnum_test.c b/isalnum_test.c new file mode 100644 index 0000000..b1c44a1 --- /dev/null +++ b/isalnum_test.c @@ -0,0 +1,13 @@ +#include "libft.h" +#include + +int main(void) +{ + int c; + + for (c = 0; c < 256; c++) + { + printf("'%c' (%i); isalnum(c): %i\r\n", c, c, isalnum(c)); + } + return (0); +} diff --git a/isalpha_expected.output b/isalpha_expected.output new file mode 100644 index 0000000000000000000000000000000000000000..b5949dc18ac9b9e2af33f88a1b116ff2ef058bbf GIT binary patch literal 6702 zcmZ|RWt0?D7{+lsQ0&gd+Ff&Iwm}8EJFs!Z07XQx8*H(=!S29rMZs>t0D~hO8PdHK?lY!)8{B6~_jb6?obDZPpC#Qp;XZ4+cfq|!x>srNYyw(5yMQM56wu~5 z1T=b10j-`(K(pr-(C&EzG<;qGEuSwzjh4?Zpydk)X!(KyTE38gmM<)z<%vY^X0vY^YhvY<%t8$=w@`yCEYx7Mg&K^J;N$d4 z3pKdPLJh9AP=jkM)ZkhRHMq_~4X(FPgBvW=;6@8IxJgp?F4b@QW(zgA#X=2kwNQiG zEY#q33pKdILJh`RsKK2UYH*i@8r&_ZdxNUMJr-(kuZ0@iXQ2l7Td2VU7HaUIg&I6$ zp#~3IsKFx^YVfF}?!Bo7k6Ea};}&W#&O!~Iuuy|1E!1GVg&It-P=lu|)Zl3gHFzdT zt?sd@2G3fk!E+XB@Vtc@ykMaQFIuRWg Pu~375E!5yY3pDs2oI7+i literal 0 HcmV?d00001 diff --git a/isalpha_test.c b/isalpha_test.c new file mode 100644 index 0000000..56ebd0f --- /dev/null +++ b/isalpha_test.c @@ -0,0 +1,13 @@ +#include "libft.h" +#include + +int main(void) +{ + int c; + + for (c = 0; c < 256; c++) + { + printf("'%c' (%i); isalpha(c): %i\r\n", c, c, isalpha(c)); + } + return (0); +} diff --git a/isascii_expected.output b/isascii_expected.output new file mode 100644 index 0000000000000000000000000000000000000000..432a9149b530a2b2767cf09f7561dc3899ab3b35 GIT binary patch literal 6546 zcmZwKQ*>r$97gdP(@t%sOj72HGgI5Pr>Ro6sWr8&ncB8(+qP}H@3Sw@*|-1ST4$|i zU%jV!jOM16w$|ZI1A`+5`v(SE`df!JHHHpp9<$sVav!VQ+vPrXxp&BYoO17!`?%%a zCHL{ly<6_%mwS)gCn)z`xldT`eR3aC?hP9}QNR{Y9I(kl1GagRfQ_CsV5=t!*zCyz zwtI?z4WBY#%cm;PZp)_**z#!twtU)vEuSu6%cl?6@)-iQe8zw+pDAF=XAao%SqgO6 z@>v76yeVMIXA9W!*#owGj({znGhoZ-3fS_w1Gc<5V9Q$yblURPfGwXVV9VzX*z)-T zwtW78EngsD%NGpT^0t62Zv1`%tp8)6N1N36jfh&9*~u?BlZ^kKI*Vh#2|tiisBHP{ca2Kyt{-~hxL zj6|%#fk?GMTlptB2&p!R92}`V@gj#H)drD6k!pj;VMw(>S`VhzqktigGRH8?*~djO`v1&B4c5U~aq zA=cnx#2Q?JSc6LuYj7E24K7El!4-%#xH3|E3Z}tTh&8wxu?E*5*5F#i8eE51gX?uB5o_=oVhvtL ztic +*/ +#include "libft.h" +#include + +int main(void) +{ + int c; + + for (c = 0; c < 256; c++) + { + printf("'%c' (%i); isascii(c): %i\r\n", c, c, isascii(c)); + } + return (0); +} diff --git a/isdigit_expected.output b/isdigit_expected.output new file mode 100644 index 0000000000000000000000000000000000000000..94b80ff141bc63f45e9cc172be3c0b29827dd7f8 GIT binary patch literal 6576 zcmZwJQzK4{9F0+}q_oM!9#$eav$2l>1oa-X-_3%e`Cf z*z(x|wtV)0EuSM`%jXQ(^5%doZz<4a%Uc7se6D~kpF3d7=Ly*I zc>}h5zJM*CKVZw-0`>BawywVNQnknG@eS)J)?M#!SZAzG(6FvpU7=y!u{uP)kPZCAFHD@Y)Gu`lIMG9ppFt)pg>PuB(Pwh&JkEBP`3yy9H>JC775f9 z0*eOf1cAi@_5Q%(fqHykiGVF%GGNP>D$r}omk!wSWdgQ**?=uyE?~=-57_b*0=9g` zfGuAsV9Qqy*z#2h^x5)N1Gap%fGuA=V9VDC*zz?4wtTICEnhoe%hw6m@^u5Ye7yqw zwtW47E#Dwu%QpuT3SiqJKFVNm*(>F(K`xc0eAA#8V zEfJePfY|=65DTz1VgQVeQHV9z8LhY)Mg;2*>q{EJ9~{{YkX BX0-qS literal 0 HcmV?d00001 diff --git a/isdigit_test.c b/isdigit_test.c new file mode 100644 index 0000000..ec85e97 --- /dev/null +++ b/isdigit_test.c @@ -0,0 +1,13 @@ +#include "libft.h" +#include + +int main(void) +{ + int c; + + for (c = 0; c < 256; c++) + { + printf("'%c' (%i); isdigit(c): %i\r\n", c, c, isdigit(c)); + } + return (0); +}