forked from bonzini/smalltalk
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix ConcatenatedStream for real and add testcase
2012-10-09 Paolo Bonzini <bonzini@gnu.org> Holger Freyther <holger@freyther.de> * kernel/StreamOps.st: Fix previous changeset. * tests/streams.st: New. * tests/streams.ok: New.
- Loading branch information
Showing
5 changed files
with
81 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
Execution begins... | ||
$1 | ||
$2 | ||
$3 | ||
'123' | ||
$4 | ||
$5 | ||
'456' | ||
$6 | ||
true | ||
'456' | ||
nil | ||
returned value is nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
|
||
"====================================================================== | ||
| | ||
| Regression tests for Streams | ||
| | ||
| | ||
======================================================================" | ||
|
||
|
||
"====================================================================== | ||
| | ||
| Copyright (C) 2012 Free Software Foundation. | ||
| Written by Holger Hans Peter Freyther. | ||
| | ||
| This file is part of GNU Smalltalk. | ||
| | ||
| GNU Smalltalk is free software; you can redistribute it and/or modify it | ||
| under the terms of the GNU General Public License as published by the Free | ||
| Software Foundation; either version 2, or (at your option) any later version. | ||
| | ||
| GNU Smalltalk is distributed in the hope that it will be useful, but WITHOUT | ||
| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
| FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | ||
| details. | ||
| | ||
| You should have received a copy of the GNU General Public License along with | ||
| GNU Smalltalk; see the file COPYING. If not, write to the Free Software | ||
| Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
| | ||
======================================================================" | ||
|
||
Eval [ | ||
| concat streamA streamB | | ||
streamA := '123' readStream. | ||
streamB := '456' readStream. | ||
concat := streamA, streamB. | ||
|
||
"Should print 123" | ||
concat next printNl. | ||
concat next printNl. | ||
concat next printNl. | ||
(concat copyFrom: 0 to: 2) printNl. | ||
|
||
"Should print 45" | ||
concat next printNl. | ||
concat next printNl. | ||
(concat copyFrom: 3 to: 5) printNl. | ||
|
||
"Should print 6" | ||
concat next printNl. | ||
concat atEnd printNl. | ||
(concat copyFrom: 3 to: 5) printNl. | ||
|
||
concat stream printNl. | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters