Skip to content

Commit

Permalink
🐛 reorganize code, tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfram77 committed Nov 23, 2022
1 parent d8b13f6 commit 6edb598
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 13 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "extra-integer",
"version": "2.1.11",
"version": "2.1.12",
"description": "Common operations for 32-bit integers.",
"main": "index.js",
"module": "index.mjs",
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export function is(v: any): boolean {
}




// SIGN
// ----

Expand Down
35 changes: 25 additions & 10 deletions tests/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import * as integer from "../src"
import {is} from "../src";
import {abs} from "../src";
import {signEqual} from "../src";
import {isPow2} from "../src";
import {prevPow2} from "../src";
import {nextPow2} from "../src";
import {pow2} from "../src";
import {pow10} from "../src";
import {log2} from "../src";
import {log10} from "../src";
import {
is,
abs,
signEqual,
isPow2,
prevPow2,
nextPow2,
pow2,
pow10,
log2,
log10,
} from "../src";



Expand All @@ -31,6 +33,9 @@ test("example1", () => {



// ABOUT
// -----

test("is", () => {
var a = is(95);
expect(a).toBe(true);
Expand All @@ -41,6 +46,11 @@ test("is", () => {
});




// SIGN
// ----

test("abs", () => {
var a = abs(-92);
expect(a).toBe(92);
Expand All @@ -61,6 +71,11 @@ test("signEqual", () => {
});




// POWER / LOGARITHM
// -----------------

test("isPow2", () => {
var a = isPow2(1024);
expect(a).toBe(true);
Expand Down

0 comments on commit 6edb598

Please sign in to comment.