Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

//# issue 697

// TODO: A lot of macros seem to also be in global.vars in BYOND but this isn't implemented in OD yet

/proc/RunTest()
ASSERT(global.vars["TRUE"] == 1)
1 change: 1 addition & 0 deletions Content.Tests/DMProject/Tests/Arg/AmbiguousArgsVar.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// NOBYOND
#pragma SoftReservedKeyword warning

//global src def
Expand Down
2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/Arg/DefaultArgument.dm
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/proc/RunTest(datum/arg = new())
/proc/RunTest(datum/arg = new())
ASSERT(istype(arg, /datum))
1 change: 1 addition & 0 deletions Content.Tests/DMProject/Tests/Arg/SoftReservedKeyword1.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//COMPILE ERROR OD2000
// NOBYOND
var/src = 321

/proc/RunTest()
Expand Down
1 change: 1 addition & 0 deletions Content.Tests/DMProject/Tests/Arg/SoftReservedKeyword2.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//COMPILE ERROR OD2000
// NOBYOND
/proc/test(args)
return 1

Expand Down
1 change: 1 addition & 0 deletions Content.Tests/DMProject/Tests/Arg/SoftReservedKeyword3.dm
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"
Expand Down
2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/Builtins/AssertFail.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUNTIME ERROR
// RUNTIME ERROR

/proc/RunTest()
ASSERT(FALSE)
2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/Builtins/AssertPass.dm
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/proc/RunTest()
/proc/RunTest()
ASSERT(TRUE)
2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/Builtins/Clamp.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/proc/RunTest()
/proc/RunTest()
var/out1 = clamp(10, 1, 5)
ASSERT(out1 == 5)
var/out2 = clamp(-10, 1, 5)
Expand Down
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")

2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/Builtins/JsonEncode.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@


/datum/proc/foo()

/proc/RunTest()
Expand Down
2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/Builtins/MD5.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/proc/RunTest()
/proc/RunTest()
ASSERT(md5("md5_test") == "c74318b61a3024520c466f828c043c79")
ASSERT(md5(file('turf.dmi')) == "0ce21a42eed3205f5e22eabac6f02eaa")
2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/Builtins/Matrix/MatrixNew.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/proc/RunTest()
/proc/RunTest()
var/matrix/M = matrix(1,2,3,4,5,6)
var/matrix/N = matrix()
var/matrix/B = matrix(M)
Expand Down
2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/Builtins/Max.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/proc/RunTest()
/proc/RunTest()
// Single arg returns that arg
ASSERT(max(1) == 1)

Expand Down
2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/Builtins/Nonspantext.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/proc/RunTest()
/proc/RunTest()
ASSERT(nonspantext("Hello, World!", ", ", -1) == 1)
ASSERT(nonspantext("Hello, World!", ", ", 3) == 3)
ASSERT(nonspantext("Hello, World!", ", ", 7) == 0)
Expand Down
2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/Builtins/SHA1.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/proc/RunTest()
/proc/RunTest()
ASSERT(sha1("ABCDEF") == "970093678b182127f60bb51b8af2c94d539eca3a")
ASSERT(sha1("abcdef") == "1f8ac10f23c5b5bc1167bda84b833e5c057a77d2")
ASSERT(sha1(file('turf.dmi')) == "513e55e301c44636c3e9cf6162cf896107c1d984")
2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/Builtins/gradient.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// We do HSV gradients our own way
// We do HSV gradients our own way

/proc/RunTest()
var/list/gradlist = list(0, "#ff0000", 1, "#00ff00")
Expand Down
1 change: 1 addition & 0 deletions Content.Tests/DMProject/Tests/Builtins/initial_bad_arg.dm
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))
2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/Builtins/params2list.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/proc/RunTest()
/proc/RunTest()
ASSERT(params2list("a;b;c") ~= list(a="", b="", c=""))
ASSERT(json_encode(params2list("a;a;a")) == @#{"a":["","",""]}#)

Expand Down
2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/Builtins/rgb/rgb.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/proc/RunTest()
/proc/RunTest()
ASSERT(rgb(255, 255, 255) =="#ffffff")
ASSERT(rgb(255, 0, 0) == "#ff0000" )
ASSERT(rgb(0, 0, 255) == "#0000ff")
Expand Down
2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/Builtins/rgb/rgb2num.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#define COLORCOMPARE(rgb, r, g, b) ASSERT((rgb[1] == r) && (rgb[2] == g) && (rgb[3] == b))
#define COLORCOMPARE(rgb, r, g, b) ASSERT((rgb[1] == r) && (rgb[2] == g) && (rgb[3] == b))

/proc/RunTest()
COLORCOMPARE(rgb2num(null), 255, 255, 255)
Expand Down
2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/Builtins/text2ascii2text.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/proc/RunTest()
/proc/RunTest()
ASSERT(text2ascii_char("abcdéfg",6) == 102) //102 is f
ASSERT(ascii2text(text2ascii("a")) == "a")
var/list/values = list(
Expand Down
2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/Builtins/trimtext.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/proc/RunTest()
/proc/RunTest()
ASSERT(trimtext(" test") == "test")
ASSERT(trimtext("test ") == "test")
ASSERT(trimtext(" test ") == "test")
2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/Builtins/turn.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/proc/RunTest()
/proc/RunTest()
// Note byond goes counterclockwise (why) (unlike every other turn proc also)

// Handle the testable invalid case
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//RUNTIME ERROR, RETURN TRUE
// NOBYOND -- this test won't work in the byond testing framework because it writes out runtimes
var/error_loop_count = 0

/world/Error()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

// NOBYOND
/proc/RunTest()
ASSERT(isnum(world.opendream_topic_port))
2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/Call/AsyncReturn.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/proc/async_return()
/proc/async_return()
. = 420
sleep(0)
return 1337
Expand Down
2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/Call/CallProcName.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/datum/proc/call_target()
/datum/proc/call_target()
return 13

/proc/RunTest()
Expand Down
2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/Call/Crash.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUNTIME ERROR, RETURN TRUE
// RUNTIME ERROR, RETURN TRUE

/proc/RunTest()
. = TRUE
Expand Down
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
Expand Down
3 changes: 2 additions & 1 deletion Content.Tests/DMProject/Tests/Call/NonexistantProc.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUNTIME ERROR
// RUNTIME ERROR
// NOBYOND - compile error in byond

/proc/RunTest()
world:nonexistent_proc()
2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/Call/StackOverflow.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUNTIME ERROR, NO RETURN
// RUNTIME ERROR, NO RETURN

/proc/RunTest()
. = TRUE
Expand Down
2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/Call/Super.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/datum/parent
/datum/parent
proc/f(a)
return a

Expand Down
2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/Call/Synchronous.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/proc/sync_test()
/proc/sync_test()
return 1992

/proc/RunTest()
Expand Down
2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/Const/Const6.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/proc/RunTest()
/proc/RunTest()
var/a = 137
switch(a)
if(20)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "Shared/Recursive.dm"
#include "Shared/Recursive.dm"

/proc/RunTest()
var/datum/recursive/R = new()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUNTIME ERROR
// RUNTIME ERROR
#include "Shared/Recursive.dm"

/proc/RunTest()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// IGNORE
// IGNORE
// This test case is currently broken
#include "Shared/Recursive.dm"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUNTIME ERROR
// RUNTIME ERROR
#include "Shared/Recursive.dm"

/proc/RunTest()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "Shared/Recursive.dm"
#include "Shared/Recursive.dm"

/proc/RunTest()
var/datum/recursive/R = null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// IGNORE
// IGNORE

/datum/recursive
var/datum/recursive/inner
Expand Down
2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/Dereference/SrcAssignment.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/datum/A/var/TestSrcVar = "A"
/datum/A/var/TestSrcVar = "A"
/datum/A/proc/TestSrcProc()
return "A"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@


/proc/RunTest()
// null violates the holy trichotomy here, with how it compares to an empty string.
ASSERT( (null > "") == 0 )
Expand Down
8 changes: 1 addition & 7 deletions Content.Tests/DMProject/Tests/List/AssocListAdd.dm
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
/proc/RunTest()
/proc/RunTest()
var/list/L1 = list("A" = 1)
var/list/L2 = list("B" = 2)

ASSERT( (L1 + L2)["B"] == 2 )

L1 += L2
ASSERT(L1["B"] == 2)
ASSERT(L1.len == 2)

// Lists are fun
L1 += L2
ASSERT(L1[3] == "B")
ASSERT(L1.len == 3)
Comment on lines -9 to -14
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This too

2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/List/AssocListCombine.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/proc/RunTest()
/proc/RunTest()
var/list/L = list("A")
L |= list("B" = 1)
ASSERT(L ~= list("A", "B" = 1))
Expand Down
3 changes: 1 addition & 2 deletions Content.Tests/DMProject/Tests/List/CreateAssociativeList.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/proc/RunTest()
/proc/RunTest()
var/a = "World"
var/b = "Hello"
var/c = "Goodbye"
Expand All @@ -13,4 +13,3 @@
ASSERT(L[b] == 2)
ASSERT(L["c"] == 3)
ASSERT(L[c] == null)
ASSERT(L.len == 3)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this removed? Works in BYOND.

14 changes: 1 addition & 13 deletions Content.Tests/DMProject/Tests/List/ListCut.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/proc/RunTest()
/proc/RunTest()
var/list/A = list(1,2,3)
ASSERT(A.len == 3)
A.Cut()
Expand All @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also works in BYOND.

2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/List/ListEmptyCut.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/proc/RunTest()
/proc/RunTest()
var/list/L = list()
L.Cut()
// Incase of weird proc issues
Expand Down
2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/List/ListJoin.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/proc/RunTest()
/proc/RunTest()
var/list/L = list(1, 2, 3, 4, 5)

ASSERT(L.Join(";") == "1;2;3;4;5")
Expand Down
2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/List/ListMutation.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/proc/RunTest()
/proc/RunTest()
var/list/L = list(1, 2, 3)
L[2] *= 15
L[3] *= 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUNTIME ERROR
// NOBYOND
#pragma ListNegativeSizeException error

/proc/DecrementList()
Expand Down
2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/List/RemoveKey.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/proc/RunTest()
/proc/RunTest()
var/list/L = list("foo" = "bar")

// Removing the key should remove the associated value as well
Expand Down
2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/List/ValueInList.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/proc/RunTest()
/proc/RunTest()
var/list/L = list(1, 2, 3)
ASSERT(!(4 in L))
ASSERT(3 in L)
4 changes: 1 addition & 3 deletions Content.Tests/DMProject/Tests/List/alist/AListAdd.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
AL.Add("c", "d")
ASSERT(AL["c"] == -4)
ASSERT(AL["d"] == null)
ASSERT(length(AL) == 4)

AL.Add(list("c", "d"))
ASSERT(AL["c"] == -4)
ASSERT(AL["d"] == null)
ASSERT(length(AL) == 4)
ASSERT(AL["d"] == null)
2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/Loop/For.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/proc/RunTest()
/proc/RunTest()
var/counter = 0
for(var/i in 1 to 3)
counter++
Expand Down
2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/Loop/ForShortCircuit.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/proc/RunTest()
/proc/RunTest()
var/i = 0
var/j = 0
var/list/L1 = null
Expand Down
2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/Loop/GlobalLoop.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/datum/a
/datum/a
/datum/b

/proc/RunTest()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/proc/RunTest()
/proc/RunTest()
var/i = 1

i++
Expand Down
Loading
Loading