-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(hgetall): handle unsafe integer in deserialization (#664)
* fix(hgetall): handle unsafe integer in deserialization * test: add test for randomUnsafeIntegerString() * fix(test-utils): Fix randomUnsafeIntegerString implementation * Format changes with fmt --------- Co-authored-by: ogzhanolguncu <ogzhan11@gmail.com>
- Loading branch information
1 parent
6460921
commit bf6288e
Showing
5 changed files
with
96 additions
and
3 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { | ||
assertEquals, | ||
assertFalse, | ||
} from "https://deno.land/std@0.177.0/testing/asserts.ts"; | ||
import { randomUnsafeIntegerString } from "./test-utils.ts"; | ||
|
||
Deno.test("randomUnsafeIntegerString() should return a string", () => { | ||
const result = randomUnsafeIntegerString(); | ||
assertEquals(typeof result, "string"); | ||
}); | ||
Deno.test("randomUnsafeIntegerString() should return different values", () => { | ||
const result1 = randomUnsafeIntegerString(); | ||
const result2 = randomUnsafeIntegerString(); | ||
assertEquals(result1 !== result2, true); | ||
}); | ||
Deno.test( | ||
"randomUnsafeIntegerString() should return a string with unsafe integer", | ||
() => { | ||
const result = randomUnsafeIntegerString(); | ||
assertFalse(Number.isSafeInteger(Number(result))); | ||
}, | ||
); |
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