mirror of
https://github.com/sorenisanerd/gotty.git
synced 2024-11-09 23:34:26 +00:00
c66ae7b2e4
Launch an Xspice and run: echo -ne "\033]844;127.0.0.1;9876\007" This will launch a SPiCE client connecting to 127.0.0.1:9876. Still need to add all the security stuff and generally be more defensive in the implementation.
64 lines
995 B
JavaScript
64 lines
995 B
JavaScript
suite('CollisionDetector', function() {
|
|
|
|
var testData = [
|
|
{
|
|
base:{
|
|
top:0,
|
|
left:0,
|
|
right:3,
|
|
bottom:3
|
|
},
|
|
queue:{
|
|
top:0,
|
|
left:2,
|
|
right:4,
|
|
bottom:2
|
|
},
|
|
collides:true
|
|
},
|
|
{
|
|
base:{
|
|
top:0,
|
|
left:0,
|
|
right:5,
|
|
bottom:5
|
|
},
|
|
queue:{
|
|
top:3,
|
|
left:-3,
|
|
right:3,
|
|
bottom:6
|
|
},
|
|
collides:true
|
|
},
|
|
{
|
|
base:{
|
|
top:0,
|
|
left:0,
|
|
right:5,
|
|
bottom:5
|
|
},
|
|
queue:{
|
|
top:3,
|
|
left:6,
|
|
right:8,
|
|
bottom:4
|
|
},
|
|
collides:false
|
|
}
|
|
];
|
|
var thereIsBoxCollision = function(){
|
|
var data = thereIsBoxCollision.data;
|
|
var actual = wdi.CollisionDetector.thereIsBoxCollision(data.base, data.queue);
|
|
assert.equal(data.collides, actual);
|
|
};
|
|
thereIsBoxCollision.data = null;
|
|
var setCounter=0;
|
|
for(var i=0; i < testData.length; i++) {
|
|
thereIsBoxCollision.data = testData[i];
|
|
test('thereIsBoxCollision will return correctData with set '+setCounter, thereIsBoxCollision);
|
|
setCounter++;
|
|
}
|
|
|
|
});
|