bugGNU Octave - Bugs: bug #53160, display of integer and logical...

 
 

bug #53160: display of integer and logical scalars is now padded with way too much space

Submitter:  Mike Miller <mtmiller>
Submitted:  Wed 14 Feb 2018 11:38:47 PM UTC
   
 
Category:  Interpreter Severity:  4 - Important
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Fri 16 Feb 2018 12:46:35 AM UTC, comment #8: 

I'm closing this report.  While writing the BIST tests I have discovered a number of inconsistencies which I will report as separate issues.

Rik <rik5>
Group administrator
Thu 15 Feb 2018 07:46:42 PM UTC, comment #7: 

I documented the second form of disp here (http://hg.savannah.gnu.org/hgweb/octave/rev/36ca11f78553).

I should have some BIST tests written by the end of the day.

Rik <rik5>
Group administrator
Thu 15 Feb 2018 07:40:48 PM UTC, comment #6: 

Oh, so we already have sdisp.  LOL.

John W. Eaton <jwe>
Group administrator
Thu 15 Feb 2018 07:23:23 PM UTC, comment #5: 

Yes, disp() should be adequate for testing.  It's a separate issue that the second form of disp isn't show in the list of calling syntaxes at the top of the documentation, although it is described in the text body itself.

Rik <rik5>
Group administrator
Thu 15 Feb 2018 07:05:06 PM UTC, comment #4: 

But our disp function returns a string if nargout > 0. So this


assert (disp (false), "0\n")
assert (disp (true), "1\n")
assert (disp (int8 (1), "1\n")
assert (disp (int16 (1), "1\n")
...


should work, right?

Mike Miller <mtmiller>
Group Member
Thu 15 Feb 2018 05:12:57 AM UTC, comment #3: 

I checked in a changeset that should fix the printing problem:

  http://hg.savannah.gnu.org/hgweb/octave/rev/b784d68f7c44

Yeah, I'm not sure how best to test this.  I can't think of anything better than fdisp and a file.  Unless you want to define sdisp (like sprintf).



John W. Eaton <jwe>
Group administrator
Thu 15 Feb 2018 05:04:12 AM UTC, comment #2: 

Is there a way to craft a BIST test for this sort of thing?  It would be nice to have something in the test suite to prevent regressions.

A clumsy way would be to open a temporary file and write to a file descriptor using fdisp() which uses the display routines in pr-output.cc.  I just checked that this approach works, but there is probably something better.

Rik <rik5>
Group administrator
Thu 15 Feb 2018 12:53:42 AM UTC, comment #1: 

This is caused by d2467914ce33 (https://hg.savannah.gnu.org/hgweb/octave/rev/d2467914ce33) which does say it has to do with the variable editor.

Before this change, displaying an integer value in the intepreter called pr_int with fw=0, so no padding was done.

Now it calls pr_int with fw=10 (or whatever output_max_field_width is set to), which explains the padding.

Mike Miller <mtmiller>
Group Member
Wed 14 Feb 2018 11:38:47 PM UTC, original submission:  

I'm guessing this has to do with some ongoing variable editor work, but I just noticed that integer and logical scalars are padded with way too much whitespace in the normal interpreter result display.


>> false
ans =          0
>> true
ans =          1
>> int8(1)
ans =          1
>> int64(1)
ans =          1
>> true (2, 1)
ans =

  1
  1



Mike Miller <mtmiller>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by mtmiller (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-02-16 rik5 StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2018-02-15 rik5 StatusConfirmed In Progress
    2018-02-15 rik5 StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code