comparison src/DLD-FUNCTIONS/dispatch.cc @ 5832:5e41e06f6a78

[project @ 2006-05-26 21:41:32 by jwe]
author jwe
date Fri, 26 May 2006 21:42:22 +0000
parents 080c08b192d8
children 221611b173e8
comparison
equal deleted inserted replaced
5831:b0d4ff99a0c5 5832:5e41e06f6a78
535 %!test # replace base m-file 535 %!test # replace base m-file
536 %! system("echo 'function a=dispatch_x(a)'>dispatch_x.m"); 536 %! system("echo 'function a=dispatch_x(a)'>dispatch_x.m");
537 %! dispatch('dispatch_x','length','string') 537 %! dispatch('dispatch_x','length','string')
538 %! assert(dispatch_x(3),3) 538 %! assert(dispatch_x(3),3)
539 %! assert(dispatch_x("a"),1) 539 %! assert(dispatch_x("a"),1)
540 %! pause(1); 540 %! sleep (2);
541 %! system("echo 'function a=dispatch_x(a),++a;'>dispatch_x.m"); 541 %! system("echo 'function a=dispatch_x(a),++a;'>dispatch_x.m");
542 %! rehash();
542 %! assert(dispatch_x(3),4) 543 %! assert(dispatch_x(3),4)
543 %! assert(dispatch_x("a"),1) 544 %! assert(dispatch_x("a"),1)
544 %!test 545 %!test
545 %! system("rm dispatch_x.m"); 546 %! unlink("dispatch_x.m");
546 547
547 %!test # replace dispatch m-file 548 %!test # replace dispatch m-file
548 %! system("echo 'function a=dispatch_y(a)'>dispatch_y.m"); 549 %! system("echo 'function a=dispatch_y(a)'>dispatch_y.m");
549 %! dispatch('hello','dispatch_y','complex scalar') 550 %! dispatch('hello','dispatch_y','complex scalar')
550 %! assert(hello(3i),3i) 551 %! assert(hello(3i),3i)
551 %! pause(1); 552 %! sleep (2);
552 %! system("echo 'function a=dispatch_y(a),++a;'>dispatch_y.m"); 553 %! system("echo 'function a=dispatch_y(a),++a;'>dispatch_y.m");
554 %! rehash();
553 %! assert(hello(3i),1+3i) 555 %! assert(hello(3i),1+3i)
554 %!test 556 %!test
555 %! system("rm dispatch_y.m"); 557 %! unlink("dispatch_y.m");
556 558
557 FIXME add tests for preservation of mark_as_command status. 559 FIXME add tests for preservation of mark_as_command status.
558 560
559 */ 561 */