PageRenderTime 41ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Examples/test-suite/octave/types_directive_runme.m

#
MATLAB | 15 lines | 11 code | 4 blank | 0 comment | 2 complexity | 3972447ee1873ae60d6937e11f574673 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. types_directive
  2. d1 = Time1(2001, 2, 3, 60);
  3. newDate = add(d1, 7); # check that a Time1 instance is accepted where Date is expected
  4. if (newDate.day != 10)
  5. error
  6. endif
  7. d2 = Time2(1999, 8, 7, 60);
  8. newDate = add(d2, 7); # check that a Time2 instance is accepted where Date is expected
  9. if (newDate.day != 14)
  10. error
  11. endif