bugGNU Octave - Bugs: bug #56068, The echo command goes in action...

 
 

bug #56068: The echo command goes in action only after the SECOND line

Submitter:  None
Submitted:  Wed 03 Apr 2019 11:29:20 PM UTC
   
 
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Naftali Kidron Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * dev
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sat 30 Jan 2021 01:46:23 PM UTC, comment #9: 

Markus:  Thanks for adding the test.

John W. Eaton <jwe>
Group administrator
Sat 30 Jan 2021 01:20:19 PM UTC, comment #8: 

I added a BIST based on "tst_echo.m" here:
https://hg.savannah.gnu.org/hgweb/octave/rev/3c6e3556fac4

Closing report. (Already marked as fixed.)

Markus Mützel <mmuetzel>
Group administrator
Thu 28 Jan 2021 05:27:02 PM UTC, comment #7: 

I tested the changeset and it works for me.  Markus's suggestion about evalc looks like it will work.  I ran 'obs = evalc ("tst_echo.m")' and got the expected output.

Rik <rik5>
Group administrator
Thu 28 Jan 2021 07:46:38 AM UTC, comment #6: 

Could we use the output captured by "evalc" for a built-in self test?

Markus Mützel <mmuetzel>
Group administrator
Thu 28 Jan 2021 06:19:04 AM UTC, comment #5: 

I pushed the following change:

http://hg.savannah.gnu.org/hgweb/octave/rev/93530bb4bd6f

It would be great to have a test for this, but I'm not sure how best to write it.

John W. Eaton <jwe>
Group administrator
Sat 06 Apr 2019 04:08:54 AM UTC, comment #4: 

The issue is bound up with the way the parser is processing the echo command.  Any lines between the issuance of "echo on" and the first valid command are not echo'ed appropriately.

I used a slightly different test file (tst_ps42.m which is attached)


echo on
# comment 1
a = 1
# comment 2
b = 2
c = 3


I then turned on echo before running the script. 


echo on
tst_ps42
+ echo on
a =  1
+ # comment 2
+ b = 2
b =  2
+ c = 3
c =  3
+


In this case, the line "# comment 1" and the line "a = 1" are not echo'ed.  After that, things proceed as they should until the end where there is an extra blank line that is echo'ed.



(file #46726)

Rik <rik5>
Group administrator
Thu 04 Apr 2019 09:33:11 PM UTC, comment #3: 

This may be related.  Running tst_ps4 in the CLI there is an echo of an empty line after the last line in tst_ps4.m.  There is no valid Octave code line there and thus there should not be an empty echo statement.


octave:1> tst_ps4
a =  1
+ b = 2
b =  2
+ c = 3
c =  3
+
octave:2>




(file #46722)

Rik <rik5>
Group administrator
Thu 04 Apr 2019 09:29:57 PM UTC, comment #2: 

I filed a separate bug report (bug #56065) about the fact that "+ " does not prefix echo'ed lines in the GUI.

Rik <rik5>
Group administrator
Thu 04 Apr 2019 04:33:28 AM UTC, comment #1: 

There is a difference between the GUI and the CLI, and between versions.  The CLI in version 4.2.1 gets this right.  The output of the script is


a =  2
+ b = 2 + 1
b =  3
+ B = 2 + 1
B =  3
+ echo
c =  4
C =  4
+ d = 4 + 1
d =  5
+ D = 4 + 1
D =  5
+ echo


Already in version 4.4.1 of the CLI it is broken and the echo starts on the second line.

echo doesn't seem to work correctly at all in the GUI.  The line that is about to be executed should be prefixed with '+ ' but is not.

I've attached the script used for testing to this report.


(file #46716)

Rik <rik5>
Group administrator
Wed 03 Apr 2019 11:29:20 PM UTC, original submission:  

the script:

a = 1 + 1
echo on
b = 2 + 1
B = 2 + 1
echo
c = 3 + 1
C = 3 + 1
echo
d = 4 + 1
D = 4 + 1
echo

resulting in

>> ECHO
a =  2
b =  3
B = 2 + 1
B =  3
echo
c =  4
C =  4
d =  5
D = 4 + 1
D =  5
echo
>>


Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #46726:  tst_ps42.m added by rik5 (50B - text/x-matlab)
file #46722:  tst_ps4.m added by rik5 (26B - text/x-matlab)
file #46716:  tst_echo.m added by rik5 (93B - text/x-matlab)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by None (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 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-01-30 mmuetzel Open/ClosedOpen Closed
    2021-01-28 rik5 StatusReady For Test Fixed
        Release5.1.0 dev
    2021-01-28 jwe StatusConfirmed Ready For Test
    2019-04-06 rik5 Attached File- Added tst_ps42.m, #46726
    2019-04-04 rik5 Attached File- Added tst_ps4.m, #46722
    2019-04-04 rik5 Attached File- Added tst_echo.m, #46716
        Item GroupOther Regression
        StatusNone Confirmed
        Operating SystemMicrosoft Windows Any

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code