-
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.
tests: updated tests for raise and radiation features.
- Loading branch information
Showing
5 changed files
with
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import radiation | ||
|
||
errors = radiation.errors | ||
|
||
# print(radiation.errors[0]) | ||
|
||
# print(errors[0]("ValueError: " + "This is a test error message")) | ||
|
||
assert arr_len(errors) == 17, "Error length is not 17" | ||
|
||
try { | ||
raise errors[1]("This is error message!") | ||
} | ||
catch as err { | ||
print(err) | ||
} |
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 @@ | ||
{"code": 0, "stdout": "TypeError: This is error message!\n", "stderr": ""} |
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 |
---|---|---|
@@ -1 +1 @@ | ||
{"code": 1, "stdout": "test1\ntest2\n\u001b[38;5;208mRadiation (most recent call last):\n\u001b[0m File \u001b[38;5;117mtests/raise.rn\u001b[0m, line \u001b[38;5;117m7\u001b[0m\n\u001b[1m\u001b[31mArgError\u001b[0m: \u001b[38;5;203mArgument `arg1` not found\u001b[0m\n\nraise \u001b[1m\u001b[31mArgError(\"arg1\"\u001b[0m)\n \u001b[1m\u001b[31m^^^^^^^^^^^^^^^\u001b[0m\n", "stderr": ""} | ||
{"code": 1, "stdout": "test1\ntest2\n\u001b[38;5;208mRadiation (most recent call last):\n\u001b[0m File \u001b[38;5;117mtests/raise.rn\u001b[0m, line \u001b[38;5;117m7\u001b[0m\n\u001b[1m\u001b[31mArgError\u001b[0m: \u001b[38;5;203mArgument `arg1` not found\u001b[0m\n\nraise\u001b[1m\u001b[31m ArgError(\"arg1\"\u001b[0m)\n \u001b[1m\u001b[31m^^^^^^^^^^^^^^^\u001b[0m\n", "stderr": ""} |
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 |
---|---|---|
@@ -1 +1 @@ | ||
{"code": 1, "stdout": "\u001b[38;5;208mRadiation (most recent call last):\n\u001b[0m File \u001b[38;5;117mtests/raise2.rn\u001b[0m, line \u001b[38;5;117m4\u001b[0m\n\u001b[1m\u001b[31mSomeError\u001b[0m: \u001b[38;5;203mThe massage: AAAAAAAAAAAAAAAAA\u001b[0m\n\nraise \u001b[1m\u001b[31mraise2_lib.SomeError(\"AAAAAAAAAAAAAAAAA\"\u001b[0m)\n \u001b[1m\u001b[31m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\u001b[0m\n", "stderr": ""} | ||
{"code": 1, "stdout": "\u001b[38;5;208mRadiation (most recent call last):\n\u001b[0m File \u001b[38;5;117mtests/raise2.rn\u001b[0m, line \u001b[38;5;117m4\u001b[0m\n\u001b[1m\u001b[31mSomeError\u001b[0m: \u001b[38;5;203mThe massage: AAAAAAAAAAAAAAAAA\u001b[0m\n\nraise\u001b[1m\u001b[31m raise2_lib.SomeError(\"AAAAAAAAAAAAAAAAA\"\u001b[0m)\n \u001b[1m\u001b[31m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\u001b[0m\n", "stderr": ""} |
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 |
---|---|---|
@@ -1 +1 @@ | ||
{"code": 1, "stdout": "\u001b[38;5;208mRadiation (most recent call last):\n\u001b[0m File \u001b[38;5;117mtests/raise3.rn\u001b[0m, line \u001b[38;5;117m4\u001b[0m\n\u001b[1m\u001b[31mSomeError\u001b[0m: \u001b[38;5;203mThe massage: default massage\u001b[0m\n\nraise \u001b[1m\u001b[31mraise2_lib.SomeError\u001b[0m\n \u001b[1m\u001b[31m^^^^^^^^^^^^^^^^^^^^\u001b[0m\n", "stderr": ""} | ||
{"code": 1, "stdout": "\u001b[38;5;208mRadiation (most recent call last):\n\u001b[0m File \u001b[38;5;117mtests/raise3.rn\u001b[0m, line \u001b[38;5;117m4\u001b[0m\n\u001b[1m\u001b[31mSomeError\u001b[0m: \u001b[38;5;203mThe massage: default massage\u001b[0m\n\nraise\u001b[1m\u001b[31m raise2_lib.SomeError\u001b[0m\n \u001b[1m\u001b[31m^^^^^^^^^^^^^^^^^^^^\u001b[0m\n", "stderr": ""} |