From 67ba610be9b061ec972c3f246fd58df3a7dd1057 Mon Sep 17 00:00:00 2001 From: Zamralik Date: Wed, 10 Dec 2025 15:12:28 +0100 Subject: [PATCH 1/2] feat: integer type cast --- packages/ts-predicate/package.json | 2 +- .../src/extended/integer/predicate/_index.mts | 1 + .../integer/predicate/type-cast/_index.mts | 6 ++ .../integer/predicate/type-cast/int16.mts | 11 +++ .../integer/predicate/type-cast/int32.mts | 11 +++ .../integer/predicate/type-cast/int8.mts | 11 +++ .../integer/predicate/type-cast/uint16.mts | 11 +++ .../integer/predicate/type-cast/uint32.mts | 11 +++ .../integer/predicate/type-cast/uint8.mts | 11 +++ .../predicate/type-cast/int16.spec.mts | 83 +++++++++++++++++++ .../predicate/type-cast/int32.spec.mts | 83 +++++++++++++++++++ .../integer/predicate/type-cast/int8.spec.mts | 83 +++++++++++++++++++ .../predicate/type-cast/uint16.spec.mts | 77 +++++++++++++++++ .../predicate/type-cast/uint32.spec.mts | 77 +++++++++++++++++ .../predicate/type-cast/uint8.spec.mts | 77 +++++++++++++++++ 15 files changed, 554 insertions(+), 1 deletion(-) create mode 100644 packages/ts-predicate/src/extended/integer/predicate/type-cast/_index.mts create mode 100644 packages/ts-predicate/src/extended/integer/predicate/type-cast/int16.mts create mode 100644 packages/ts-predicate/src/extended/integer/predicate/type-cast/int32.mts create mode 100644 packages/ts-predicate/src/extended/integer/predicate/type-cast/int8.mts create mode 100644 packages/ts-predicate/src/extended/integer/predicate/type-cast/uint16.mts create mode 100644 packages/ts-predicate/src/extended/integer/predicate/type-cast/uint32.mts create mode 100644 packages/ts-predicate/src/extended/integer/predicate/type-cast/uint8.mts create mode 100644 packages/ts-predicate/test/extended/integer/predicate/type-cast/int16.spec.mts create mode 100644 packages/ts-predicate/test/extended/integer/predicate/type-cast/int32.spec.mts create mode 100644 packages/ts-predicate/test/extended/integer/predicate/type-cast/int8.spec.mts create mode 100644 packages/ts-predicate/test/extended/integer/predicate/type-cast/uint16.spec.mts create mode 100644 packages/ts-predicate/test/extended/integer/predicate/type-cast/uint32.spec.mts create mode 100644 packages/ts-predicate/test/extended/integer/predicate/type-cast/uint8.spec.mts diff --git a/packages/ts-predicate/package.json b/packages/ts-predicate/package.json index 8800aa86..d7bb9183 100644 --- a/packages/ts-predicate/package.json +++ b/packages/ts-predicate/package.json @@ -1,6 +1,6 @@ { "name": "@vitruvius-labs/ts-predicate", - "version": "7.0.0", + "version": "7.1.0", "description": "TypeScript predicates library", "author": { "name": "VitruviusLabs" diff --git a/packages/ts-predicate/src/extended/integer/predicate/_index.mts b/packages/ts-predicate/src/extended/integer/predicate/_index.mts index 8de366a2..9ee9807b 100644 --- a/packages/ts-predicate/src/extended/integer/predicate/_index.mts +++ b/packages/ts-predicate/src/extended/integer/predicate/_index.mts @@ -1,2 +1,3 @@ export * from "./type-assertion/_index.mjs"; +export * from "./type-cast/_index.mjs"; export * from "./type-guard/_index.mjs"; diff --git a/packages/ts-predicate/src/extended/integer/predicate/type-cast/_index.mts b/packages/ts-predicate/src/extended/integer/predicate/type-cast/_index.mts new file mode 100644 index 00000000..b0fe6e19 --- /dev/null +++ b/packages/ts-predicate/src/extended/integer/predicate/type-cast/_index.mts @@ -0,0 +1,6 @@ +export * from "./int8.mjs"; +export * from "./int16.mjs"; +export * from "./int32.mjs"; +export * from "./uint8.mjs"; +export * from "./uint16.mjs"; +export * from "./uint32.mjs"; diff --git a/packages/ts-predicate/src/extended/integer/predicate/type-cast/int16.mts b/packages/ts-predicate/src/extended/integer/predicate/type-cast/int16.mts new file mode 100644 index 00000000..532610f9 --- /dev/null +++ b/packages/ts-predicate/src/extended/integer/predicate/type-cast/int16.mts @@ -0,0 +1,11 @@ +import type { Int16 } from "../../definition/type/integers.mjs"; +import { assertInt16 } from "../type-assertion/assert-int16.mjs"; + +function int16(value: unknown): Int16 +{ + assertInt16(value); + + return value; +} + +export { int16 }; diff --git a/packages/ts-predicate/src/extended/integer/predicate/type-cast/int32.mts b/packages/ts-predicate/src/extended/integer/predicate/type-cast/int32.mts new file mode 100644 index 00000000..b506f174 --- /dev/null +++ b/packages/ts-predicate/src/extended/integer/predicate/type-cast/int32.mts @@ -0,0 +1,11 @@ +import type { Int32 } from "../../definition/type/integers.mjs"; +import { assertInt32 } from "../type-assertion/assert-int32.mjs"; + +function int32(value: unknown): Int32 +{ + assertInt32(value); + + return value; +} + +export { int32 }; diff --git a/packages/ts-predicate/src/extended/integer/predicate/type-cast/int8.mts b/packages/ts-predicate/src/extended/integer/predicate/type-cast/int8.mts new file mode 100644 index 00000000..0e353dcf --- /dev/null +++ b/packages/ts-predicate/src/extended/integer/predicate/type-cast/int8.mts @@ -0,0 +1,11 @@ +import type { Int8 } from "../../definition/type/integers.mjs"; +import { assertInt8 } from "../type-assertion/assert-int8.mjs"; + +function int8(value: unknown): Int8 +{ + assertInt8(value); + + return value; +} + +export { int8 }; diff --git a/packages/ts-predicate/src/extended/integer/predicate/type-cast/uint16.mts b/packages/ts-predicate/src/extended/integer/predicate/type-cast/uint16.mts new file mode 100644 index 00000000..a63b94b0 --- /dev/null +++ b/packages/ts-predicate/src/extended/integer/predicate/type-cast/uint16.mts @@ -0,0 +1,11 @@ +import type { UInt16 } from "../../definition/type/integers.mjs"; +import { assertUInt16 } from "../type-assertion/assert-uint16.mjs"; + +function uInt16(value: unknown): UInt16 +{ + assertUInt16(value); + + return value; +} + +export { uInt16 }; diff --git a/packages/ts-predicate/src/extended/integer/predicate/type-cast/uint32.mts b/packages/ts-predicate/src/extended/integer/predicate/type-cast/uint32.mts new file mode 100644 index 00000000..6a3b99dc --- /dev/null +++ b/packages/ts-predicate/src/extended/integer/predicate/type-cast/uint32.mts @@ -0,0 +1,11 @@ +import type { UInt32 } from "../../definition/type/integers.mjs"; +import { assertUInt32 } from "../type-assertion/assert-uint32.mjs"; + +function uInt32(value: unknown): UInt32 +{ + assertUInt32(value); + + return value; +} + +export { uInt32 }; diff --git a/packages/ts-predicate/src/extended/integer/predicate/type-cast/uint8.mts b/packages/ts-predicate/src/extended/integer/predicate/type-cast/uint8.mts new file mode 100644 index 00000000..e692f90e --- /dev/null +++ b/packages/ts-predicate/src/extended/integer/predicate/type-cast/uint8.mts @@ -0,0 +1,11 @@ +import type { UInt8 } from "../../definition/type/integers.mjs"; +import { assertUInt8 } from "../type-assertion/assert-uint8.mjs"; + +function uInt8(value: unknown): UInt8 +{ + assertUInt8(value); + + return value; +} + +export { uInt8 }; diff --git a/packages/ts-predicate/test/extended/integer/predicate/type-cast/int16.spec.mts b/packages/ts-predicate/test/extended/integer/predicate/type-cast/int16.spec.mts new file mode 100644 index 00000000..f55faa08 --- /dev/null +++ b/packages/ts-predicate/test/extended/integer/predicate/type-cast/int16.spec.mts @@ -0,0 +1,83 @@ +import { doesNotThrow, strictEqual, throws } from "node:assert"; +import { describe, it } from "node:test"; +import { GroupType, consumeValue, getInvertedValues, getValues } from "@vitruvius-labs/testing-ground"; +import { type Int16, NoValue, int16 } from "../../../../../src/_index.mjs"; +import { IntegerBoundaryEnum } from "../../../../../src/extended/integer/definition/enum/integer-boundary.enum.mjs"; + +describe("int16", (): void => { + it("should return true when given an integer with the boundaries", (): void => { + const VALUES: Array = [ + IntegerBoundaryEnum.INT16_MIN, + IntegerBoundaryEnum.INT16_MIN + 1, + -1, + 0, + 1, + IntegerBoundaryEnum.INT16_MAX - 1, + IntegerBoundaryEnum.INT16_MAX, + ]; + + for (const ITEM of VALUES) + { + let result: unknown = NoValue; + + const WRAPPER = (): void => { + result = int16(ITEM); + }; + + doesNotThrow(WRAPPER); + + strictEqual(result, ITEM); + } + }); + + it("should throw when given an integer outside the boundaries", (): void => { + const VALUES: Array = [ + IntegerBoundaryEnum.INT16_MIN - 1, + IntegerBoundaryEnum.INT16_MAX + 1, + ]; + + for (const ITEM of VALUES) + { + const WRAPPER = (): void => { + int16(ITEM); + }; + + throws(WRAPPER); + } + }); + + it("should throw when given a non-integer number", (): void => { + const VALUES: Array = getValues(GroupType.REAL, GroupType.INFINITY); + + for (const ITEM of VALUES) + { + const WRAPPER = (): void => { + int16(ITEM); + }; + + throws(WRAPPER); + } + }); + + it("should throw when given anything else", (): void => { + const VALUES: Array = getInvertedValues(GroupType.NUMBER); + + for (const ITEM of VALUES) + { + const WRAPPER = (): void => { + int16(ITEM); + }; + + throws(WRAPPER); + } + }); + + it("should narrow the type to an Int16", (): void => { + const WRAPPER = (): void => + { + consumeValue(int16(NoValue)); + }; + + throws(WRAPPER); + }); +}); diff --git a/packages/ts-predicate/test/extended/integer/predicate/type-cast/int32.spec.mts b/packages/ts-predicate/test/extended/integer/predicate/type-cast/int32.spec.mts new file mode 100644 index 00000000..4348659b --- /dev/null +++ b/packages/ts-predicate/test/extended/integer/predicate/type-cast/int32.spec.mts @@ -0,0 +1,83 @@ +import { doesNotThrow, strictEqual, throws } from "node:assert"; +import { describe, it } from "node:test"; +import { GroupType, consumeValue, getInvertedValues, getValues } from "@vitruvius-labs/testing-ground"; +import { type Int32, NoValue, int32 } from "../../../../../src/_index.mjs"; +import { IntegerBoundaryEnum } from "../../../../../src/extended/integer/definition/enum/integer-boundary.enum.mjs"; + +describe("int32", (): void => { + it("should return true when given an integer with the boundaries", (): void => { + const VALUES: Array = [ + IntegerBoundaryEnum.INT32_MIN, + IntegerBoundaryEnum.INT32_MIN + 1, + -1, + 0, + 1, + IntegerBoundaryEnum.INT32_MAX - 1, + IntegerBoundaryEnum.INT32_MAX, + ]; + + for (const ITEM of VALUES) + { + let result: unknown = NoValue; + + const WRAPPER = (): void => { + result = int32(ITEM); + }; + + doesNotThrow(WRAPPER); + + strictEqual(result, ITEM); + } + }); + + it("should throw when given an integer outside the boundaries", (): void => { + const VALUES: Array = [ + IntegerBoundaryEnum.INT32_MIN - 1, + IntegerBoundaryEnum.INT32_MAX + 1, + ]; + + for (const ITEM of VALUES) + { + const WRAPPER = (): void => { + int32(ITEM); + }; + + throws(WRAPPER); + } + }); + + it("should throw when given a non-integer number", (): void => { + const VALUES: Array = getValues(GroupType.REAL, GroupType.INFINITY); + + for (const ITEM of VALUES) + { + const WRAPPER = (): void => { + int32(ITEM); + }; + + throws(WRAPPER); + } + }); + + it("should throw when given anything else", (): void => { + const VALUES: Array = getInvertedValues(GroupType.NUMBER); + + for (const ITEM of VALUES) + { + const WRAPPER = (): void => { + int32(ITEM); + }; + + throws(WRAPPER); + } + }); + + it("should narrow the type to an Int32", (): void => { + const WRAPPER = (): void => + { + consumeValue(int32(NoValue)); + }; + + throws(WRAPPER); + }); +}); diff --git a/packages/ts-predicate/test/extended/integer/predicate/type-cast/int8.spec.mts b/packages/ts-predicate/test/extended/integer/predicate/type-cast/int8.spec.mts new file mode 100644 index 00000000..1e99e626 --- /dev/null +++ b/packages/ts-predicate/test/extended/integer/predicate/type-cast/int8.spec.mts @@ -0,0 +1,83 @@ +import { doesNotThrow, strictEqual, throws } from "node:assert"; +import { describe, it } from "node:test"; +import { GroupType, consumeValue, getInvertedValues, getValues } from "@vitruvius-labs/testing-ground"; +import { type Int8, NoValue, int8 } from "../../../../../src/_index.mjs"; +import { IntegerBoundaryEnum } from "../../../../../src/extended/integer/definition/enum/integer-boundary.enum.mjs"; + +describe("int8", (): void => { + it("should return true when given an integer with the boundaries", (): void => { + const VALUES: Array = [ + IntegerBoundaryEnum.INT8_MIN, + IntegerBoundaryEnum.INT8_MIN + 1, + -1, + 0, + 1, + IntegerBoundaryEnum.INT8_MAX - 1, + IntegerBoundaryEnum.INT8_MAX, + ]; + + for (const ITEM of VALUES) + { + let result: unknown = NoValue; + + const WRAPPER = (): void => { + result = int8(ITEM); + }; + + doesNotThrow(WRAPPER); + + strictEqual(result, ITEM); + } + }); + + it("should throw when given an integer outside the boundaries", (): void => { + const VALUES: Array = [ + IntegerBoundaryEnum.INT8_MIN - 1, + IntegerBoundaryEnum.INT8_MAX + 1, + ]; + + for (const ITEM of VALUES) + { + const WRAPPER = (): void => { + int8(ITEM); + }; + + throws(WRAPPER); + } + }); + + it("should throw when given a non-integer number", (): void => { + const VALUES: Array = getValues(GroupType.REAL, GroupType.INFINITY); + + for (const ITEM of VALUES) + { + const WRAPPER = (): void => { + int8(ITEM); + }; + + throws(WRAPPER); + } + }); + + it("should throw when given anything else", (): void => { + const VALUES: Array = getInvertedValues(GroupType.NUMBER); + + for (const ITEM of VALUES) + { + const WRAPPER = (): void => { + int8(ITEM); + }; + + throws(WRAPPER); + } + }); + + it("should narrow the type to an Int8", (): void => { + const WRAPPER = (): void => + { + consumeValue(int8(NoValue)); + }; + + throws(WRAPPER); + }); +}); diff --git a/packages/ts-predicate/test/extended/integer/predicate/type-cast/uint16.spec.mts b/packages/ts-predicate/test/extended/integer/predicate/type-cast/uint16.spec.mts new file mode 100644 index 00000000..8f435f9a --- /dev/null +++ b/packages/ts-predicate/test/extended/integer/predicate/type-cast/uint16.spec.mts @@ -0,0 +1,77 @@ +import { doesNotThrow, strictEqual, throws } from "node:assert"; +import { describe, it } from "node:test"; +import { GroupType, consumeValue, getInvertedValues, getValues } from "@vitruvius-labs/testing-ground"; +import { NoValue, type UInt16, uInt16 } from "../../../../../src/_index.mjs"; +import { IntegerBoundaryEnum } from "../../../../../src/extended/integer/definition/enum/integer-boundary.enum.mjs"; + +describe("uInt16", (): void => { + it("should return true when given an integer with the boundaries", (): void => { + const VALUES: Array = [ + 0, + 1, + IntegerBoundaryEnum.UINT16_MAX - 1, + IntegerBoundaryEnum.UINT16_MAX, + ]; + + for (const ITEM of VALUES) + { + let result: unknown = NoValue; + + const WRAPPER = (): void => { + result = uInt16(ITEM); + }; + + doesNotThrow(WRAPPER); + + strictEqual(result, ITEM); + } + }); + + it("should throw when given an integer outside the boundaries", (): void => { + const VALUES: Array = [-1, IntegerBoundaryEnum.UINT16_MAX + 1]; + + for (const ITEM of VALUES) + { + const WRAPPER = (): void => { + uInt16(ITEM); + }; + + throws(WRAPPER); + } + }); + + it("should throw when given a non-integer number", (): void => { + const VALUES: Array = getValues(GroupType.REAL, GroupType.INFINITY); + + for (const ITEM of VALUES) + { + const WRAPPER = (): void => { + uInt16(ITEM); + }; + + throws(WRAPPER); + } + }); + + it("should throw when given anything else", (): void => { + const VALUES: Array = getInvertedValues(GroupType.NUMBER); + + for (const ITEM of VALUES) + { + const WRAPPER = (): void => { + uInt16(ITEM); + }; + + throws(WRAPPER); + } + }); + + it("should narrow the type to an UInt16", (): void => { + const WRAPPER = (): void => + { + consumeValue(uInt16(NoValue)); + }; + + throws(WRAPPER); + }); +}); diff --git a/packages/ts-predicate/test/extended/integer/predicate/type-cast/uint32.spec.mts b/packages/ts-predicate/test/extended/integer/predicate/type-cast/uint32.spec.mts new file mode 100644 index 00000000..27c73abf --- /dev/null +++ b/packages/ts-predicate/test/extended/integer/predicate/type-cast/uint32.spec.mts @@ -0,0 +1,77 @@ +import { doesNotThrow, strictEqual, throws } from "node:assert"; +import { describe, it } from "node:test"; +import { GroupType, consumeValue, getInvertedValues, getValues } from "@vitruvius-labs/testing-ground"; +import { NoValue, type UInt32, uInt32 } from "../../../../../src/_index.mjs"; +import { IntegerBoundaryEnum } from "../../../../../src/extended/integer/definition/enum/integer-boundary.enum.mjs"; + +describe("uInt32", (): void => { + it("should return true when given an integer with the boundaries", (): void => { + const VALUES: Array = [ + 0, + 1, + IntegerBoundaryEnum.UINT32_MAX - 1, + IntegerBoundaryEnum.UINT32_MAX, + ]; + + for (const ITEM of VALUES) + { + let result: unknown = NoValue; + + const WRAPPER = (): void => { + result = uInt32(ITEM); + }; + + doesNotThrow(WRAPPER); + + strictEqual(result, ITEM); + } + }); + + it("should throw when given an integer outside the boundaries", (): void => { + const VALUES: Array = [-1, IntegerBoundaryEnum.UINT32_MAX + 1]; + + for (const ITEM of VALUES) + { + const WRAPPER = (): void => { + uInt32(ITEM); + }; + + throws(WRAPPER); + } + }); + + it("should throw when given a non-integer number", (): void => { + const VALUES: Array = getValues(GroupType.REAL, GroupType.INFINITY); + + for (const ITEM of VALUES) + { + const WRAPPER = (): void => { + uInt32(ITEM); + }; + + throws(WRAPPER); + } + }); + + it("should throw when given anything else", (): void => { + const VALUES: Array = getInvertedValues(GroupType.NUMBER); + + for (const ITEM of VALUES) + { + const WRAPPER = (): void => { + uInt32(ITEM); + }; + + throws(WRAPPER); + } + }); + + it("should narrow the type to an UInt32", (): void => { + const WRAPPER = (): void => + { + consumeValue(uInt32(NoValue)); + }; + + throws(WRAPPER); + }); +}); diff --git a/packages/ts-predicate/test/extended/integer/predicate/type-cast/uint8.spec.mts b/packages/ts-predicate/test/extended/integer/predicate/type-cast/uint8.spec.mts new file mode 100644 index 00000000..381bec2a --- /dev/null +++ b/packages/ts-predicate/test/extended/integer/predicate/type-cast/uint8.spec.mts @@ -0,0 +1,77 @@ +import { doesNotThrow, strictEqual, throws } from "node:assert"; +import { describe, it } from "node:test"; +import { GroupType, consumeValue, getInvertedValues, getValues } from "@vitruvius-labs/testing-ground"; +import { NoValue, type UInt8, uInt8 } from "../../../../../src/_index.mjs"; +import { IntegerBoundaryEnum } from "../../../../../src/extended/integer/definition/enum/integer-boundary.enum.mjs"; + +describe("uInt8", (): void => { + it("should return true when given an integer with the boundaries", (): void => { + const VALUES: Array = [ + 0, + 1, + IntegerBoundaryEnum.UINT8_MAX - 1, + IntegerBoundaryEnum.UINT8_MAX, + ]; + + for (const ITEM of VALUES) + { + let result: unknown = NoValue; + + const WRAPPER = (): void => { + result = uInt8(ITEM); + }; + + doesNotThrow(WRAPPER); + + strictEqual(result, ITEM); + } + }); + + it("should throw when given an integer outside the boundaries", (): void => { + const VALUES: Array = [-1, IntegerBoundaryEnum.UINT8_MAX + 1]; + + for (const ITEM of VALUES) + { + const WRAPPER = (): void => { + uInt8(ITEM); + }; + + throws(WRAPPER); + } + }); + + it("should throw when given a non-integer number", (): void => { + const VALUES: Array = getValues(GroupType.REAL, GroupType.INFINITY); + + for (const ITEM of VALUES) + { + const WRAPPER = (): void => { + uInt8(ITEM); + }; + + throws(WRAPPER); + } + }); + + it("should throw when given anything else", (): void => { + const VALUES: Array = getInvertedValues(GroupType.NUMBER); + + for (const ITEM of VALUES) + { + const WRAPPER = (): void => { + uInt8(ITEM); + }; + + throws(WRAPPER); + } + }); + + it("should narrow the type to an UInt8", (): void => { + const WRAPPER = (): void => + { + consumeValue(uInt8(NoValue)); + }; + + throws(WRAPPER); + }); +}); From 7cd2e328bdd7043ce835d1f9090ae685059bf461 Mon Sep 17 00:00:00 2001 From: Zamralik Date: Wed, 10 Dec 2025 15:15:13 +0100 Subject: [PATCH 2/2] fix: spec happy case description --- .../test/extended/integer/predicate/type-cast/int16.spec.mts | 2 +- .../test/extended/integer/predicate/type-cast/int32.spec.mts | 2 +- .../test/extended/integer/predicate/type-cast/int8.spec.mts | 2 +- .../test/extended/integer/predicate/type-cast/uint16.spec.mts | 2 +- .../test/extended/integer/predicate/type-cast/uint32.spec.mts | 2 +- .../test/extended/integer/predicate/type-cast/uint8.spec.mts | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/ts-predicate/test/extended/integer/predicate/type-cast/int16.spec.mts b/packages/ts-predicate/test/extended/integer/predicate/type-cast/int16.spec.mts index f55faa08..ee2ab2d7 100644 --- a/packages/ts-predicate/test/extended/integer/predicate/type-cast/int16.spec.mts +++ b/packages/ts-predicate/test/extended/integer/predicate/type-cast/int16.spec.mts @@ -5,7 +5,7 @@ import { type Int16, NoValue, int16 } from "../../../../../src/_index.mjs"; import { IntegerBoundaryEnum } from "../../../../../src/extended/integer/definition/enum/integer-boundary.enum.mjs"; describe("int16", (): void => { - it("should return true when given an integer with the boundaries", (): void => { + it("should return the provided value when given an integer with the boundaries", (): void => { const VALUES: Array = [ IntegerBoundaryEnum.INT16_MIN, IntegerBoundaryEnum.INT16_MIN + 1, diff --git a/packages/ts-predicate/test/extended/integer/predicate/type-cast/int32.spec.mts b/packages/ts-predicate/test/extended/integer/predicate/type-cast/int32.spec.mts index 4348659b..fb92d56c 100644 --- a/packages/ts-predicate/test/extended/integer/predicate/type-cast/int32.spec.mts +++ b/packages/ts-predicate/test/extended/integer/predicate/type-cast/int32.spec.mts @@ -5,7 +5,7 @@ import { type Int32, NoValue, int32 } from "../../../../../src/_index.mjs"; import { IntegerBoundaryEnum } from "../../../../../src/extended/integer/definition/enum/integer-boundary.enum.mjs"; describe("int32", (): void => { - it("should return true when given an integer with the boundaries", (): void => { + it("should return the provided value when given an integer with the boundaries", (): void => { const VALUES: Array = [ IntegerBoundaryEnum.INT32_MIN, IntegerBoundaryEnum.INT32_MIN + 1, diff --git a/packages/ts-predicate/test/extended/integer/predicate/type-cast/int8.spec.mts b/packages/ts-predicate/test/extended/integer/predicate/type-cast/int8.spec.mts index 1e99e626..f8c2441a 100644 --- a/packages/ts-predicate/test/extended/integer/predicate/type-cast/int8.spec.mts +++ b/packages/ts-predicate/test/extended/integer/predicate/type-cast/int8.spec.mts @@ -5,7 +5,7 @@ import { type Int8, NoValue, int8 } from "../../../../../src/_index.mjs"; import { IntegerBoundaryEnum } from "../../../../../src/extended/integer/definition/enum/integer-boundary.enum.mjs"; describe("int8", (): void => { - it("should return true when given an integer with the boundaries", (): void => { + it("should return the provided value when given an integer with the boundaries", (): void => { const VALUES: Array = [ IntegerBoundaryEnum.INT8_MIN, IntegerBoundaryEnum.INT8_MIN + 1, diff --git a/packages/ts-predicate/test/extended/integer/predicate/type-cast/uint16.spec.mts b/packages/ts-predicate/test/extended/integer/predicate/type-cast/uint16.spec.mts index 8f435f9a..3a713dd0 100644 --- a/packages/ts-predicate/test/extended/integer/predicate/type-cast/uint16.spec.mts +++ b/packages/ts-predicate/test/extended/integer/predicate/type-cast/uint16.spec.mts @@ -5,7 +5,7 @@ import { NoValue, type UInt16, uInt16 } from "../../../../../src/_index.mjs"; import { IntegerBoundaryEnum } from "../../../../../src/extended/integer/definition/enum/integer-boundary.enum.mjs"; describe("uInt16", (): void => { - it("should return true when given an integer with the boundaries", (): void => { + it("should return the provided value when given an integer with the boundaries", (): void => { const VALUES: Array = [ 0, 1, diff --git a/packages/ts-predicate/test/extended/integer/predicate/type-cast/uint32.spec.mts b/packages/ts-predicate/test/extended/integer/predicate/type-cast/uint32.spec.mts index 27c73abf..c9280efd 100644 --- a/packages/ts-predicate/test/extended/integer/predicate/type-cast/uint32.spec.mts +++ b/packages/ts-predicate/test/extended/integer/predicate/type-cast/uint32.spec.mts @@ -5,7 +5,7 @@ import { NoValue, type UInt32, uInt32 } from "../../../../../src/_index.mjs"; import { IntegerBoundaryEnum } from "../../../../../src/extended/integer/definition/enum/integer-boundary.enum.mjs"; describe("uInt32", (): void => { - it("should return true when given an integer with the boundaries", (): void => { + it("should return the provided value when given an integer with the boundaries", (): void => { const VALUES: Array = [ 0, 1, diff --git a/packages/ts-predicate/test/extended/integer/predicate/type-cast/uint8.spec.mts b/packages/ts-predicate/test/extended/integer/predicate/type-cast/uint8.spec.mts index 381bec2a..36826fb7 100644 --- a/packages/ts-predicate/test/extended/integer/predicate/type-cast/uint8.spec.mts +++ b/packages/ts-predicate/test/extended/integer/predicate/type-cast/uint8.spec.mts @@ -5,7 +5,7 @@ import { NoValue, type UInt8, uInt8 } from "../../../../../src/_index.mjs"; import { IntegerBoundaryEnum } from "../../../../../src/extended/integer/definition/enum/integer-boundary.enum.mjs"; describe("uInt8", (): void => { - it("should return true when given an integer with the boundaries", (): void => { + it("should return the provided value when given an integer with the boundaries", (): void => { const VALUES: Array = [ 0, 1,