Skip to content
Closed
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
2 changes: 0 additions & 2 deletions wurst/_handles/DestructableTests.wurst
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package DestructableTests
import Destructable
import Wurstunit

@Test function testDestructables()
let destr = createDestructable(0, ZERO2, 0 .fromDeg(), 1, -1)
Expand Down
1 change: 0 additions & 1 deletion wurst/_handles/DialogTests.wurst
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package DialogTests
import Dialog
import Wurstunit

@Test function testDialog()
let dia = createDialog()
Expand Down
2 changes: 0 additions & 2 deletions wurst/_handles/EffectTests.wurst
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package EffectTests
import Effect
import Wurstunit

@Test function testEffect()
let eff = addEffect("testPath", vec2(12,32))
Expand Down
2 changes: 0 additions & 2 deletions wurst/_handles/PlayerTests.wurst
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package PlayerTests
import Player
import Wurstunit

@Test function testPlayer()
let p = Player(0)
Expand Down
2 changes: 0 additions & 2 deletions wurst/_handles/PlayercolorTests.wurst
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package PlayercolorTests
import Playercolor
import Wurstunit

@Test public function testToInt()
PLAYER_COLOR_RED.toInt().assertEquals(0)
Expand Down
3 changes: 0 additions & 3 deletions wurst/_handles/RectTests.wurst
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package RectTests
import Rect
import Wurstunit


@Test
Expand All @@ -25,4 +23,3 @@ function rectTest()

rekt.getCenterX().assertEquals(2)
rekt.getCenterY().assertEquals(2)

1 change: 0 additions & 1 deletion wurst/closures/ClosureTimersTests.wurst
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package ClosureTimersTests
import ClosureTimers
import Wurstunit

var x = 200

Expand Down
1 change: 0 additions & 1 deletion wurst/data/BitSetTests.wurst
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package BitSetTests
import BitSet
import Wurstunit

@Test function testGet()
let set = bitset(45)
Expand Down
2 changes: 0 additions & 2 deletions wurst/file/ByteBufferTests.wurst
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package ByteBufferTests
import ByteBuffer
import Wurstunit


@Test
Expand Down Expand Up @@ -110,4 +109,3 @@ function byteBufferEndiannessTest()
byteBuffer.readByte().assertEquals(0x02)
byteBuffer.readByte().assertEquals(0x01)
destroy byteBuffer

2 changes: 0 additions & 2 deletions wurst/file/ChunkedStringTests.wurst
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package ChunkedStringTests
import ChunkedString
import Wurstunit


@Test
Expand Down Expand Up @@ -41,4 +40,3 @@ function chunkedStringIteration()
result += cstring.readChunk()

result.assertEquals("abcdef")

3 changes: 0 additions & 3 deletions wurst/math/AngleTests.wurst
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package AngleTests
import Angle
import Wurstunit


@Test function testAngle()
Expand All @@ -17,4 +15,3 @@ import Wurstunit
halfTurn.fromRad().degrees().assertEquals(180., 0.001)
let three = 3
three.fromRad().radians().assertEquals(3., 0.0001)

2 changes: 0 additions & 2 deletions wurst/math/InterpolationTests.wurst
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package InterpolationTests
import Interpolation
import Wurstunit


@Test
Expand Down Expand Up @@ -120,4 +119,3 @@ function linearVecTest()

let atStop = (hermite(start, stop, t1, t2, 1.) - hermite(start, stop, t1, t2, 1. - h)) / h
atStop.assertEquals(t2, 0.05)

1 change: 0 additions & 1 deletion wurst/math/LineGeometryTests.wurst
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package LineGeometryTests
import LineGeometry
import Wurstunit

@Test function testLineFormular()
let p1 = vec2(0, 2)
Expand Down
2 changes: 0 additions & 2 deletions wurst/math/MathsTests.wurst
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package MathsTests
import Maths
import Wurstunit

@Test function minmax()
let three = 3
Expand Down
1 change: 0 additions & 1 deletion wurst/math/RaycastTests.wurst
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package RaycastTests
import Raycast
import Wurstunit

constant EPSILON = 0.0001

Expand Down
20 changes: 11 additions & 9 deletions wurst/math/VectorsTests.wurst
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package VectorsTests
import Vectors
import Wurstunit
import Polygon


@Test
Expand Down Expand Up @@ -55,10 +54,13 @@ function vectorTests()
let test2 = vec2(-4, -6)
let test3 = vec2(-2, 2)
let points = [vec2(-3, -6), vec2(4, 5), vec2(-4, 5), vec2(3, -2)]
test1.isInPolygon(points[0], points[1], points[2], points[3]).assertTrue()
test2.isInPolygon(points[0], points[1], points[2], points[3]).assertFalse()
test3.isInPolygon(points[0], points[1], points[2]).assertTrue()
test1.toVec3().isInPolygon2d(points[0].toVec3(), points[1].toVec3(), points[2].toVec3(), points[3].toVec3()).assertTrue()
test2.toVec3().isInPolygon2d(points[0].toVec3(), points[1].toVec3(), points[2].toVec3(), points[3].toVec3()).assertFalse()
test3.toVec3().isInPolygon2d(points[0].toVec3(), points[1].toVec3(), points[2].toVec3()).assertTrue()

let polygon = new Polygon(points[0], points[1], points[2], points[3])
let triangle = new Polygon(points[0], points[1], points[2])
polygon.contains(test1).assertTrue()
polygon.contains(test2).assertFalse()
triangle.contains(test3).assertTrue()
polygon.contains(test1.toVec3().toVec2()).assertTrue()
polygon.contains(test2.toVec3().toVec2()).assertFalse()
triangle.contains(test3.toVec3().toVec2()).assertTrue()
destroy polygon
destroy triangle
7 changes: 5 additions & 2 deletions wurst/objediting/ObjectIds.wurst
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
package ObjectIds
import NoWurst
import ErrorHandling
import AbilityIds
import LinkedList
// Provides stringToIndex/stringFromIndex for legacy string generic bindings.
import TypeCasting
import ObjEditingCommons

constant CHARMAP = ".................................!.#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[.]^_`abcdefghijklmnopqrstuvwxyz{|}~................................................................................................................................."

init
// LinkedList<string> resolves its generic conversions through TypeCasting.
stringToIndex("")

/** Convert a integer id value into a 4-letter id code. */
public function toRawCode(int value) returns string
var result = ""
Expand Down Expand Up @@ -74,4 +78,3 @@ public function commaList(vararg UnitTargetType tags) returns string
for t in tags
list.add(t.toObjectString())
return commaList(list)

1 change: 0 additions & 1 deletion wurst/objediting/ObjectIdsTests.wurst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package ObjectIdsTests
import ObjectIds
import ObjEditingCommons
import AbilityIds
import Wurstunit

@Test function asListIntTest()
commaList(
Expand Down
2 changes: 0 additions & 2 deletions wurst/util/ColorsTests.wurst
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package ColorsTests
import Colors
import Wurstunit

function colorHSV.assert()
let delta = 0.01
Expand Down
1 change: 0 additions & 1 deletion wurst/util/GameTimerTests.wurst
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package GameTimerTests
import GameTimer
import Wurstunit

@Test function testGameTimer()
assertTrue(getElapsedGameTime() > 0)
1 change: 0 additions & 1 deletion wurst/util/MapBoundsTests.wurst
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package MapBoundsTests
import MapBounds
import Wurstunit

@Test function testMapBounds()
playableMapRect.getMinX().assertEquals(-1024)
Expand Down
1 change: 0 additions & 1 deletion wurst/util/TerrainUtilsTests.wurst
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package TerrainUtilsTests
import TerrainUtils
import MapBounds
import Wurstunit

@Test function testMapCorners()
boundMin.getTile().id.assertEquals(0)
Expand Down
2 changes: 0 additions & 2 deletions wurst/util/TimeTests.wurst
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package TimeTests
import Time
import Wurstunit


@Test function testDisplay()
Expand Down Expand Up @@ -40,4 +39,3 @@ import Wurstunit
(-1.).hours().display().assertEquals("-PT1H0M0S")
(0.).seconds().displayVerbose().assertEquals("0")
(61.).seconds().displayVerbose().assertEquals("1 minutes, and 1 seconds")