comparison test/io.tst @ 21634:96518f623c91

Backed out changeset dcf8922b724b
author Mike Miller <mtmiller@octave.org>
date Wed, 20 Apr 2016 11:06:03 -0700
parents dcf8922b724b
children f07d6f579214
comparison
equal deleted inserted replaced
21633:dcf8922b724b 21634:96518f623c91
260 %! 260 %!
261 %! delete (matrix_ascii); 261 %! delete (matrix_ascii);
262 262
263 %!error <unable to find file> load ("") 263 %!error <unable to find file> load ("")
264 264
265 %% FIXME: This test is disabled as it writes to stdout and there is no easy
266 %% way to recover output. Need to spawn new octave process and pipe stdout
267 %% somewhere to treat this case.
268 %!#test
269 %! puts ("foo\n");
270
271 %!assert (puts (1),-1)
272
273 %!error <Invalid call to puts> puts ()
274 %!error <Invalid call to puts> puts (1, 2)
275
265 %!assert (sscanf ('123456', '%10c'), '123456') 276 %!assert (sscanf ('123456', '%10c'), '123456')
266 %!assert (sscanf ('123456', '%10s'), '123456') 277 %!assert (sscanf ('123456', '%10s'), '123456')
267 278
268 %!assert (sscanf (['ab'; 'cd'], '%s'), 'acbd') 279 %!assert (sscanf (['ab'; 'cd'], '%s'), 'acbd')
269 280
322 %! fclose (fid2); 333 %! fclose (fid2);
323 %! unlink (nm); 334 %! unlink (nm);
324 %! assert (x, 8); 335 %! assert (x, 8);
325 %! assert (str, "test:1"); 336 %! assert (str, "test:1");
326 337
327 %!error fprintf (1) 338 %!error printf (1)
328 %!error <Invalid call to fprintf> fprintf () 339 %!error <Invalid call to printf> printf ()
329 340
330 %!test 341 %!test
331 %! [s, msg, status] = sprintf ("%s: %d\n", "test", 1); 342 %! [s, msg, status] = sprintf ("%s: %d\n", "test", 1);
332 %! assert (s == "test: 1\n" && ischar (msg) && status == 8); 343 %! assert (s == "test: 1\n" && ischar (msg) && status == 8);
333 344
503 %! endif 514 %! endif
504 %! endif 515 %! endif
505 %! endif 516 %! endif
506 %! unlink (nm); 517 %! unlink (nm);
507 518
519 %!assert (fputs (1, 1),-1)
520
521 %!error <Invalid call to fputs> fputs ()
522 %!error <Invalid call to fputs> fputs (1, "foo", 1)
523
508 %!error fgetl ("foo", 1) 524 %!error fgetl ("foo", 1)
509 525
510 %!error <Invalid call to fgetl> fgetl () 526 %!error <Invalid call to fgetl> fgetl ()
511 %!error <Invalid call to fgetl> fgetl (1, 2, 3) 527 %!error <Invalid call to fgetl> fgetl (1, 2, 3)
512 528