-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
107 additions
and
10 deletions.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
eo-runtime/src/test/eo/org/eolang/io/tupled-stdout-test.eo
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,54 @@ | ||
# The MIT License (MIT) | ||
# | ||
# Copyright (c) 2016-2023 Objectionary.com | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included | ||
# in all copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
# SOFTWARE. | ||
|
||
+alias org.eolang.io.tupled-stdout | ||
+architect yegor256@gmail.com | ||
+home https://github.com/objectionary/eo | ||
+tests | ||
+package org.eolang.io | ||
+version 0.0.0 | ||
|
||
[] > tupled-stdout-single | ||
tupled-stdout > @ | ||
* | ||
"Hello, world! Single tupled.\n" | ||
|
||
[] > tupled-stdout-several | ||
tupled-stdout > @ | ||
* | ||
"Hello" | ||
", " | ||
"world" | ||
"! " | ||
"Several " | ||
"tupled.\n" | ||
|
||
[] > tupled-stdout-empty | ||
eq. > @ | ||
try | ||
[] | ||
tupled-stdout > @ | ||
* | ||
[e] | ||
e > @ | ||
nop | ||
"tuple of arguments must contain at least one element" |
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,51 @@ | ||
# The MIT License (MIT) | ||
# | ||
# 2016-2022 Objectionary.com | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included | ||
# in all copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
# SOFTWARE. | ||
|
||
+alias org.eolang.io.stdout | ||
+architect yegor256@gmail.com | ||
+home https://github.com/objectionary/eo | ||
+package org.eolang.io | ||
+version 0.0.0 | ||
|
||
# An object for testing entire applications that accepts arguments in the form of a tuple. | ||
[args] > tupled-stdout | ||
memory 0 > iter | ||
args.length.minus 1 > max | ||
if. > @ | ||
max.lt 0 | ||
error "tuple of arguments must contain at least one element" | ||
if. | ||
max.eq 0 | ||
stdout | ||
args.at | ||
0 | ||
while. | ||
iter.as-int.lt max | ||
[i] | ||
seq > @ | ||
* | ||
stdout | ||
args.at | ||
i | ||
iter.write | ||
iter.as-int.plus 1 | ||
TRUE |
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
a2a2038
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Puzzle
2718-833aa636
disappeared fromeo-runtime/src/test/java/org/eolang/MainTest.java
), that's why I closed #2723. Please, remember that the puzzle was not necessarily removed in this particular commit. Maybe it happened earlier, but we discovered this fact only now.