Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
21 changes: 0 additions & 21 deletions Content.Tests/DMProject/BrokenTests/Const/ConstSort.dm

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
var/\justident = "justident"

/proc/RunTest()
var/list/expected = list("6*6", "37", "38", " ", " 3", " ", "improper", "justident")
var/list/expected = list("6*6", "37", "38", " ", " 3", " ", "improper", "justident")
var/newtype/o = new
for(var/i in 1 to expected.len)
ASSERT(expected[i] == o.vars[i])
12 changes: 0 additions & 12 deletions Content.Tests/DMProject/BrokenTests/Indent/closing_brace.dm

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@

// TODO: BYOND allows var/null, OpenDream does not. Revisit when errors can be selectively disabled by pragmas
// COMPILE ERROR
// NOBYOND
// TODO: BYOND allows var/null, OpenDream should not. Revisit when errors can be selectively disabled by pragmas

/proc/nullproc(null, a, b)
ASSERT(null == 4)
ASSERT(null != 4)
ASSERT(a == 5)
ASSERT(b == 6)

Expand Down

This file was deleted.

This file was deleted.

34 changes: 0 additions & 34 deletions Content.Tests/DMProject/BrokenTests/Statements/For/var_only_as.dm

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

Expand Down
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
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
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")

4 changes: 3 additions & 1 deletion Content.Tests/DMProject/Tests/Builtins/Spantext.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
ASSERT(spantext("aaa","a",-4) == 3)
//spantext_char tests
ASSERT(spantext_char("apples, oranges",", ",7) == 2)
#ifdef OPENDREAM
ASSERT(spantext("aa𐀀𐀀bb", "b", 5) == 0)
ASSERT(spantext_char("aaa","a",-4) == 3)
ASSERT(spantext("aa𐀀𐀀bb", "𐀀",3) == 4) //DM evaluates this as 8 and the next as 4. Because it mangles
ASSERT(spantext_char("aa𐀀𐀀bb", "𐀀",3) == 2) //the chars. We instead want 4 and 2 respectively.
ASSERT(spantext_char("aa𐀀𐀀bb", "𐀀",3) == 2) //the chars. We instead want 4 and 2 respectively.
#endif
2 changes: 1 addition & 1 deletion Content.Tests/DMProject/Tests/Builtins/callee.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/proc/RunTest()
ASSERT(callee.name == "RunTest")
ASSERT(callee.file == "callee.dm")
ASSERT(copytext(callee.file, -9) == "callee.dm")

var/callee/expired_callee = bar()
var/failed = FALSE
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))
4 changes: 3 additions & 1 deletion Content.Tests/DMProject/Tests/Builtins/rgb/rgb2num.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
COLORCOMPARE(rgb2num("#0000ff"), 0, 0, 255)
COLORCOMPARE(rgb2num("#12f5e6"), 18, 245, 230)
COLORCOMPARE(rgb2num("#ca60db", COLORSPACE_RGB), 202, 96, 219)
#ifdef OPENDREAM
COLORCOMPARE(rgb2num("#ca60db", COLORSPACE_HSV), 291.70734, 56.164383, 85.882355)
COLORCOMPARE(rgb2num("#ca60db", COLORSPACE_HSL), 291.70734, 63.07692, 61.764706)
//COLORCOMPARE(rgb2num("#ca60db", COLORSPACE_HCY), 291.70734, 68.2215, 55.423534) // TODO Support HCY
//COLORCOMPARE(rgb2num("#ca60db", COLORSPACE_HCY), 291.70734, 68.2215, 55.423534) // TODO Support HCY
#endif
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))
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
1 change: 1 addition & 0 deletions Content.Tests/DMProject/Tests/Call/NonexistantProc.dm
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()
6 changes: 0 additions & 6 deletions Content.Tests/DMProject/Tests/List/AssocListAdd.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,3 @@

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

Original file line number Diff line number Diff line change
Expand Up @@ -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.

12 changes: 0 additions & 12 deletions Content.Tests/DMProject/Tests/List/ListCut.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUNTIME ERROR
// NOBYOND
#pragma ListNegativeSizeException error

/proc/DecrementList()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
proc/operator|(datum/complex/C)
//nonsense, used for testing
src.a = C.a
return src

proc/operator[](index)
switch(index)
Expand Down
1 change: 1 addition & 0 deletions Content.Tests/DMProject/Tests/Operators/modulo_modulo.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// NOBYOND
// BREAKING CHANGE: The floating point precision is slightly different between OD and BYOND, giving slightly different values
/proc/RunTest()
ASSERT(5.89254 %% 2.3462 == 1.2001398)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//COMPILE ERROR OD1201
// NOBYOND

#pragma WarningDirective error

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//COMPILE ERROR OD0010
// COMPILE ERROR OD0010

#define DAMN(what...,the...,hockeysticks...) world << list(##what)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/datum/var/name
/datum/var/icon_state

#define DEFINE_FLOORS(_PATH, _VARS) \
/datum/simulated/floor/_PATH{_VARS};\
Expand Down
3 changes: 2 additions & 1 deletion Content.Tests/DMProject/Tests/Savefile/BasicReadAndWrite.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
ASSERT(S["pie2"] ~= assoc)

// Shouldn't evaluate CRASH
S2?["ABC"] << CRASH("rhs should not evaluate due to null-conditional")
//NB: using = rather than << here because << *does* evaluate the RHS regardless of the nullness of the LHS
S2?["ABC"] = CRASH("rhs should not evaluate due to null-conditional")

// Test EOF
S.cd = "DEF"
Expand Down
5 changes: 4 additions & 1 deletion Content.Tests/DMProject/Tests/Savefile/ExportText.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
F["dirIcon"] = new /icon()
F["list"] << list("1",2,"three"=3,4, new /datum(), new /datum(), list(1,2,3, new /datum()))

ASSERT(F.dir ~= list("dir","dir2","dir3","dir4","dir5","dir6","dir7","dirIcon","list"))
var/list/match = list("dir","dir2","dir3","dir4","dir5","dir6","dir7","dirIcon","list")
ASSERT(length(F.dir) == length(match))
for(var/d in F.dir)
ASSERT(d in match)
ASSERT(F.ExportText("dir6/subdir6") == ". = 321\n")
ASSERT(F.ExportText("dir6/subdir6/") == ". = 321\n")
ASSERT(F.ExportText("dir6") == "\nsubdir6 = 321\n")
Expand Down
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)
Expand Down
Loading
Loading