-
Notifications
You must be signed in to change notification settings - Fork 125
Clean and tag unit tests for use with BYOND unit test framework #2426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
e4758d6
c57c27d
412108b
070ac66
72cf5ed
494c578
7bfe2b1
21a22fe
d58b337
1e86092
7cfe9b5
f58cfe1
bde6714
3c1170e
e7dff89
d95dafb
2d7dcc0
bcead00
1dba0f9
208076f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,24 +1,26 @@ | ||
| // TODO: This test needs some more work for it to be usable, as the log in aproc() is sometimes null and sometimes 5 | ||
| var/count = 0 | ||
|
|
||
| /proc/veryfalse() | ||
| return 0 == 1 | ||
|
|
||
| /proc/aproc() | ||
| var/static/a = bproc() | ||
| world.log << (a) | ||
| count += a | ||
| if (veryfalse()) | ||
| return a | ||
| else | ||
| return 5 | ||
|
|
||
| /proc/bproc() | ||
| var/static/b = aproc() | ||
| world.log << (b) | ||
| count += b | ||
| if (veryfalse()) | ||
| return b | ||
| else | ||
| return 5 | ||
|
|
||
| /proc/main() | ||
| world.log << (aproc()) | ||
| world.log << (bproc()) | ||
| /proc/RunTest() | ||
| ASSERT(aproc() == 5) | ||
| ASSERT(bproc() == 5) | ||
| ASSERT(count == 15) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
|
|
||
| // NOBYOND | ||
| // TODO This test doesn't work in BYOND but I'm not sure why. | ||
| var/x = 1 | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| // NOBYOND | ||
| #pragma SoftReservedKeyword warning | ||
|
|
||
| //global src def | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| //COMPILE ERROR OD2000 | ||
| // NOBYOND | ||
| var/src = 321 | ||
|
|
||
| /proc/RunTest() | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| //COMPILE ERROR OD2000 | ||
| // NOBYOND | ||
| /proc/test(args) | ||
| return 1 | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| //COMPILE ERROR OD2000 | ||
| // NOBYOND | ||
| /proc/RunTest() | ||
| var/usr = 123 | ||
| world.log << "fail" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| // COMPILE ERROR OD0100 | ||
|
|
||
| // NOBYOND | ||
| /proc/RunTest() | ||
| var/foo = log("e") | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| // COMPILE ERROR OD0100 | ||
|
|
||
| // NOBYOND | ||
| /proc/RunTest() | ||
| var/foo = log(2,"e") | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| // COMPILE ERROR OD0100 | ||
| // NOBYOND | ||
| /proc/RunTest() | ||
| var/foo | ||
| initial(issaved(foo)) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
|
|
||
| // NOBYOND | ||
| /proc/RunTest() | ||
| ASSERT(isnum(world.opendream_topic_port)) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| // NOBYOND | ||
| #pragma PointlessParentCall error | ||
|
|
||
| // don't emit the pragma if lateral overrides exist | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| // RUNTIME ERROR | ||
| // NOBYOND - compile error in byond | ||
|
|
||
| /proc/RunTest() | ||
| world:nonexistent_proc() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,4 +13,3 @@ | |
| ASSERT(L[b] == 2) | ||
| ASSERT(L["c"] == 3) | ||
| ASSERT(L[c] == null) | ||
| ASSERT(L.len == 3) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this removed? Works in BYOND. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,15 +9,3 @@ | |
| ASSERT(A ~= list("b" = 20)) | ||
| ASSERT(A["a"] == null) | ||
| ASSERT(A["b"] == 20) | ||
|
|
||
| A = list(a = 10) | ||
| A += A | ||
| A.Cut(1, 2) | ||
| ASSERT(A ~= list("a")) | ||
| ASSERT(A["a"] == null) | ||
|
|
||
| A = list(a = 10) | ||
| A += A | ||
| A.Cut(2, 0) | ||
| ASSERT(A ~= list("a")) | ||
| ASSERT(A["a"] == null) | ||
|
Comment on lines
-12
to
-23
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This also works in BYOND. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| // RUNTIME ERROR | ||
| // NOBYOND | ||
| #pragma ListNegativeSizeException error | ||
|
|
||
| /proc/DecrementList() | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| //COMPILE ERROR OD1201 | ||
| // NOBYOND | ||
|
|
||
| #pragma WarningDirective error | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| // RUNTIME ERROR | ||
| // NOBYOND | ||
| #pragma InitialVarOnPrimitiveException error | ||
|
|
||
| /proc/initial_test(obj/A) | ||
|
|
||
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.
This too