Mercurial > hg > octave-nkf
comparison test/fntests.m @ 8423:869e4213d5d9
fntests.m: use fread instead of fscanf to preserve whitespace
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 24 Dec 2008 15:42:45 -0500 |
parents | 9c24ca8761f7 |
children | 6e764b7317bd |
comparison
equal
deleted
inserted
replaced
8422:20cbb0fdab48 | 8423:869e4213d5d9 |
---|---|
66 endif | 66 endif |
67 endif | 67 endif |
68 puts ("\n"); | 68 puts ("\n"); |
69 endfunction | 69 endfunction |
70 | 70 |
71 ## FIXME -- should we only try match the keyword at the start of a line? | |
71 function y = hastests (f) | 72 function y = hastests (f) |
72 fid = fopen (f); | 73 fid = fopen (f); |
73 str = fscanf (fid, "%s"); | 74 str = fread (fid, "*char")'; |
74 fclose (fid); | 75 fclose (fid); |
75 y = (findstr (str, "%!test") || findstr (str, "%!assert") | 76 y = (findstr (str, "%!test") || findstr (str, "%!assert") |
76 || findstr (str, "%!error") || findstr (str, "%!warning")); | 77 || findstr (str, "%!error") || findstr (str, "%!warning")); |
77 endfunction | 78 endfunction |
78 | 79 |