Display single or double quotes to help understand output in assert.m?

I have some failing BIST tests which are comparing two char vectors. The result is

ASSERT errors for:  assert (msg,'')

  Location  |  Observed  |  Expected  |  Reason
     []      sscanf: format failed to match                Strings don't match

This is hard to decipher, and I think it would be improved by wrapping single or double quotes around each of the output values. My proposed output would be

ASSERT errors for:  assert (msg,'')

  Location  |  Observed  |  Expected  |  Reason
     []      'sscanf: format failed to match'       ''       Strings don't match

In Matlab this is not an issue because disp() on a char vector or string automatically would include quotation characters. Having Octave do that universally throughout the program is a bigger change than what I want to make right now.

Does anyone object to this change?

1 Like

I had to read this about 5 times to understand what is happening here, so it case it helps someone else… msg is 'scanf: format failed to match'. That is the “Observed”. '' is the “Expected”. And Strings don't match is the “Reason”. Hope that helps someone!

(No objection)

1 Like

Thank you. I think it helps point out how awkward this is. I had trouble even writing a problem description that others would understand. The core issue for me is that I expect to see Observed and Expected and thereby understand what failed. With numerical inputs, this is easy:

assert (1, 2)
error: ASSERT errors for:  assert (1,2)

  Location  |  Observed  |  Expected  |  Reason
     ()           1            2         Abs err 1 exceeds tol 0 by 1

for character inputs, particularly with an empty string, there is nothing printed.

assert ("string", "")
error: ASSERT errors for:  assert ("string","")

  Location  |  Observed  |  Expected  |  Reason
     []         string                   Strings don't match