Skip to content

Commit

Permalink
Align PrintString for empty lists with PrintObj, ViewString and ViewO…
Browse files Browse the repository at this point in the history
…bj (#5418)

PrintObj, ViewString and ViewObj all return/print two spaces.
  • Loading branch information
zickgraf authored Feb 15, 2024
1 parent 7174ee5 commit ad49199
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/string.g
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ InstallMethod( String,
[ IsString ],
function(s)
if Length(s) = 0 and not IsStringRep(s) then
return "[ ]";
return "[ ]";
else
return s;
fi;
Expand Down
4 changes: 2 additions & 2 deletions tst/testinstall/strings.tst
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ gap> DisplayString(x);
gap> ViewString(x);
"[ ]"
gap> PrintString(x);
"[ ]"
"[ ]"
gap> String(x);
"[ ]"
"[ ]"

# Dense list
gap> x:=[1,2,3];
Expand Down

0 comments on commit ad49199

Please sign in to comment.