3 /* fputs( const char *, FILE * )
5 This file is part of the Public Domain C Library (PDCLib).
6 Permission is granted to use, modify, and / or redistribute at will.
12 #include <_PDCLIB_glue.h>
14 int fputs( const char * _PDCLIB_restrict s, struct _PDCLIB_file_t * _PDCLIB_restrict stream )
19 if (putc(stream, c) != c)
26 #include <_PDCLIB_test.h>
30 char const * const message = "SUCCESS testing fputs()";
32 TESTCASE( ( fh = tmpfile() ) != NULL );
33 TESTCASE( fputs( message, fh ) >= 0 );
35 for ( size_t i = 0; i < 23; ++i )
37 TESTCASE( fgetc( fh ) == message[i] );
39 TESTCASE( fclose( fh ) == 0 );