-
Notifications
You must be signed in to change notification settings - Fork 3
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
Kota Mizushima
committed
Aug 24, 2023
1 parent
1af688a
commit 8c2115b
Showing
3 changed files
with
48 additions
and
19 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,28 @@ | ||
package onion.compiler.tools | ||
|
||
import onion.tools.Shell | ||
|
||
class ImportSpec extends AbstractShellSpec { | ||
describe("Import a class") { | ||
it("import java.util.*") { | ||
val result = shell.run( | ||
""" | ||
| import { | ||
| java.util.*; | ||
| } | ||
| class Increment { | ||
| public: | ||
| static def main(args: String[]): Int { | ||
| xs = new ArrayList(); | ||
| xs.add(new Integer(2)); | ||
| return xs.get(0)$Integer.intValue(); | ||
| } | ||
| } | ||
""".stripMargin, | ||
"None", | ||
Array() | ||
) | ||
assert(Shell.Success(2) == result) | ||
} | ||
} | ||
} |