octave-patch-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-patch-tracker] [patch #10192] BIST for lin2mu.m file


From: Kai Torben Ohlhus
Subject: [Octave-patch-tracker] [patch #10192] BIST for lin2mu.m file
Date: Sat, 2 Apr 2022 12:55:07 -0400 (EDT)

Follow-up Comment #6, patch #10192 (project octave):

Regarding the test cases themselves this looks already very good.

Now lets make them short and readable.  For example, this is hard to
understand:


%!assert (lin2mu(3,[]) == lin2mu(3,[16]) && lin2mu(3,[])==[255])


Make two test cases out of them:


%!assert (lin2mu (3, []), 255)
%!assert (lin2mu (3, 16), 255)


Same here:


%!test
%! x = -1:1;
%! y = x';
%! assert (lin2mu(x)==lin2mu(y)' && lin2mu(x)==[0,255,128]);


In my opinion this is more readable:


%!test
%! x = -1:1;
%! y = x';
%! assert (lin2mu (x), [0, 255, 128])
%! assert (lin2mu (x), (lin2mu (y))')


And again the test cases themselves look great already.  Lets make them ready
to be pushed.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/patch/?10192>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]