Skip to content

Commit

Permalink
Additional tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-kulcsar committed Nov 4, 2024
1 parent 0c56e55 commit 8991a5b
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions typedarrays.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,21 +259,25 @@ namespace TypedArraysTests {
game.splash("Type arrays constructor tests II-7c failed.")
allPassed = false
}
if (int8.get(5) != 7) {
if (int8.get(0) != 2) {
game.splash("Type arrays constructor tests II-7d failed.")
allPassed = false
}
if (int8.get(5) != 7) {
game.splash("Type arrays constructor tests II-7e failed.")
allPassed = false
}
int8.setFromArray([112,])
if (int8.get(0) != 112) {
game.splash("Type arrays constructor tests II-7e failed.")
game.splash("Type arrays constructor tests II-7f failed.")
allPassed = false
}
if (int8.get(-1) !== undefined) {
game.splash("Type arrays constructor tests II-7f failed.")
game.splash("Type arrays constructor tests II-7g failed.")
allPassed = false
}
if (int8.get(6) !== undefined) {
game.splash("Type arrays constructor tests II-7g failed.")
game.splash("Type arrays constructor tests II-7h failed.")
allPassed = false
}

Expand Down Expand Up @@ -350,23 +354,23 @@ namespace TypedArraysTests {

try {
int8.fromArrayBuffer(rawbuf, 0, 9)
game.splash("Type arrays constructor tests II-8h failed.")
game.splash("Type arrays constructor tests II-8i failed.")
allPassed = false
} catch {

}

try {
int8.fromArrayBuffer(rawbuf, 8, 1)
game.splash("Type arrays constructor tests II-8i failed.")
game.splash("Type arrays constructor tests II-8j failed.")
allPassed = false
} catch {

}

try {
int8.fromArrayBuffer(rawbuf, 9, -1)
game.splash("Type arrays constructor tests II-8j failed.")
game.splash("Type arrays constructor tests II-8k failed.")
allPassed = false
} catch {

Expand Down

0 comments on commit 8991a5b

Please sign in to comment.