add more tests (#26)

* added more tests

* (fix) no cpu profile.
This commit is contained in:
2021-04-29 21:42:51 +02:00
committed by GitHub
parent 23418bbc60
commit 924fca5b90
14 changed files with 196 additions and 39 deletions

View File

@ -1,13 +1,14 @@
const Random = {int, use};
const Random = { int, use };
function int (min, max) {
if (!min || !max) { return; }
//return Math.floor(Math.random() * (Math.floor(max) - Math.ceil(min))) + min;
return Math.floor(Math.random() * (Math.floor(max) - Math.ceil(min) + 1)) + min;
function int(min, max) {
if (!min || !max) {
return;
}
return Math.floor(Math.random() * (Math.floor(max) - Math.ceil(min) + 1)) + min;
}
function use (str) {
function use(str) {
return true;
}
module.exports = { Random };
module.exports = { Random };