-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Move AABB, Matrix3, and Vector2 modules from lib to models * Add tests for AABB * remove dead code
- Loading branch information
Robert Austin
authored
Jun 29, 2020
1 parent
752fa6e
commit ad9d3dc
Showing
18 changed files
with
59 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
x-pack/plugins/security_solution/public/resolver/models/aabb.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
import { isEqual } from './aabb'; | ||
import { AABB } from '../types'; | ||
|
||
describe('AABB', () => { | ||
const minimumX = 0; | ||
const minimumY = 0; | ||
const maximumX = 0; | ||
const maximumY = 0; | ||
|
||
let aabb: AABB; | ||
|
||
beforeEach(() => { | ||
aabb = { minimum: [minimumX, minimumY], maximum: [maximumX, maximumY] }; | ||
}); | ||
it('should be equal to an AABB with the same values', () => { | ||
expect(isEqual(aabb, { minimum: [minimumX, minimumY], maximum: [maximumX, maximumY] })).toBe( | ||
true | ||
); | ||
}); | ||
|
||
it('should not be equal to an AABB with a different minimum X value', () => { | ||
expect( | ||
isEqual(aabb, { minimum: [minimumX + 1, minimumY], maximum: [maximumX, maximumY] }) | ||
).toBe(false); | ||
}); | ||
it('should not be equal to an AABB with a different minimum Y value', () => { | ||
expect( | ||
isEqual(aabb, { minimum: [minimumX, minimumY + 1], maximum: [maximumX, maximumY] }) | ||
).toBe(false); | ||
}); | ||
it('should not be equal to an AABB with a different maximum X value', () => { | ||
expect( | ||
isEqual(aabb, { minimum: [minimumX, minimumY], maximum: [maximumX + 1, maximumY] }) | ||
).toBe(false); | ||
}); | ||
it('should not be equal to an AABB with a different maximum Y value', () => { | ||
expect( | ||
isEqual(aabb, { minimum: [minimumX, minimumY], maximum: [maximumX, maximumY + 1] }) | ||
).toBe(false); | ||
}); | ||
}); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters