{"id": 55990, "name": "unknown", "code": "it('ensureTrailing endsWith', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(),\n (s, suffix) => Strings.endsWith(Strings.ensureTrailing(s, suffix), suffix)\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/str/EnsureTrailingTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Strings.ensureTrailing` ensures that a string ends with a specified suffix by verifying that the result satisfies `Strings.endsWith`.", "mode": "fast-check"} {"id": 55991, "name": "unknown", "code": "it('startsWith a prefix', () => {\n fc.assert(fc.property(fc.string(), fc.string(),\n (prefix, suffix) => Strings.startsWith(prefix + suffix, prefix)\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/str/EnsureLeadingTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Concatenating a prefix with a suffix should result in a string that starts with the prefix.", "mode": "fast-check"} {"id": 55992, "name": "unknown", "code": "it('A string added to a string (at the end) must have endsWith as true', () => {\n fc.assert(fc.property(\n fc.asciiString(),\n fc.asciiString(),\n (str, contents) => Strings.endsWith(str + contents, contents)\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/str/EndsWithTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Appending a string to another string should result in `endsWith` returning true for the appended string.", "mode": "fast-check"} {"id": 55993, "name": "unknown", "code": "it('A string with length 1 or larger should never be empty', () => {\n fc.assert(fc.property(fc.string(1, 40), (str) => {\n assert.isFalse(Strings.isEmpty(str));\n assert.isTrue(Strings.isNotEmpty(str));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/str/EmptyTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "A string with length of 1 or more should never be considered empty, and `Strings.isEmpty` should return false while `Strings.isNotEmpty` should return true for such strings.", "mode": "fast-check"} {"id": 55994, "name": "unknown", "code": "it('A string added to a string (at the end) must be contained within it', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(1, 40),\n (str, contents) => {\n const r = str + contents;\n assert.isTrue(Strings.contains(r, contents));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/str/ContainsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Concatenating a string to another string at the end should result in the second string being contained within the concatenated result.", "mode": "fast-check"} {"id": 55995, "name": "unknown", "code": "it('A string added to a string (at the start) must be contained within it', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(1, 40),\n (str, contents) => {\n const r = contents = str;\n assert.isTrue(Strings.contains(r, contents));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/str/ContainsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "A string appended to the start of another string should be recognized as contained within it.", "mode": "fast-check"} {"id": 54418, "name": "unknown", "code": "it('should be able to compute a dependency tree for any package of the registry', async () => {\n await fc.assert(\n fc.asyncProperty(AllPackagesArbitrary, fc.scheduler(), async (packages, s) => {\n // Arrange\n const selectedPackage = Object.keys(packages)[0];\n const fetch: (name: string) => Promise = s.scheduleFunction(function fetch(packageName) {\n return Promise.resolve(packages[packageName]);\n });\n\n // Act\n dependencyTree(selectedPackage, fetch); // without bugs\n // dependencyTree(selectedPackage, fetch, true); // or with bugs\n\n // Assert\n let numQueries = 0;\n while (s.count() !== 0) {\n if (++numQueries > 2 * Object.keys(packages).length) {\n throw new Error(`Too many queries`);\n }\n await s.waitOne();\n }\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/005-race/dependencyTree/main.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The function `dependencyTree` should correctly compute a dependency tree for any package from a given registry, ensuring the number of queries does not exceed twice the number of packages.", "mode": "fast-check"} {"id": 55998, "name": "unknown", "code": "it('head is uppercase', () => {\n fc.assert(fc.property(fc.ascii(), fc.asciiString(30), (h, t) => {\n const actualH = Strings.capitalize(h + t).charAt(0);\n assert.equal(actualH, h.toUpperCase());\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/str/CapitalizeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Strings.capitalize` should transform the first character of a string to uppercase.", "mode": "fast-check"} {"id": 55999, "name": "unknown", "code": "it('someIf(false) is none', () => {\n fc.assert(fc.property(fc.integer(), (n) => {\n assertNone(Optionals.someIf(false, n));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalsSomeIfTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Optionals.someIf(false, n)` should always return none.", "mode": "fast-check"} {"id": 56000, "name": "unknown", "code": "it('someIf(true) is some', () => {\n fc.assert(fc.property(fc.integer(), (n) => {\n assertSome(Optionals.someIf(true, n), n);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalsSomeIfTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Optionals.someIf` returns a 'some' containing the given number when the condition is true.", "mode": "fast-check"} {"id": 56003, "name": "unknown", "code": "it('delta is max', () => {\n fc.assert(fc.property(fc.nat(), fc.nat(), (value, delta) => {\n const max = value + delta;\n const actual = Num.cycleBy(value, delta, value, max);\n assert.equal(actual, max);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/num/NumCycleByTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Num.cycleBy` should return `max` when the initial and maximum values are respectively `value` and `value + delta`.", "mode": "fast-check"} {"id": 56004, "name": "unknown", "code": "it('Num.clamp', () => {\n fc.assert(fc.property(\n fc.nat(1000),\n fc.nat(1000),\n fc.nat(1000),\n (a, b, c) => {\n const low = a;\n const med = low + b;\n const high = med + c;\n // low <= med <= high\n assert.equal(Num.clamp(med, low, high), med);\n assert.equal(Num.clamp(med, low, high), med);\n assert.equal(Num.clamp(high, low, med), med);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/num/NumClampTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Num.clamp` returns the middle value when tested with constraints `low <= med <= high` and ensures bounds are maintained.", "mode": "fast-check"} {"id": 56006, "name": "unknown", "code": "it('allows creating \"Just\" maybes', () => {\n fc.assert(fc.property(fc.anything(), (thing) => {\n const item = Maybes.just(thing);\n assert.isTrue(Maybes.isJust(item));\n assert.isFalse(Maybes.isNothing(item));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/maybe/IdentityTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Creating a \"Just\" maybe with any input should result in `isJust` returning true and `isNothing` returning false.", "mode": "fast-check"} {"id": 54778, "name": "unknown", "code": "it('should handle BigInt with maxSafeInteger', () => {\n return fc.assert(\n fc.property(\n fc.maxSafeInteger().map(value => [BigInt(value), value]),\n ([value, expectedValue]) => {\n const stats = {\n [rawField]: value\n }\n\n const queryStatistics = new QueryStatistics(stats)\n\n return queryStatistics.updates()[field] === expectedValue\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/result-summary.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "`QueryStatistics` updates should return the expected numeric value when initialized with a `BigInt` within the `maxSafeInteger` range.", "mode": "fast-check"} {"id": 56007, "name": "unknown", "code": "it('allows folding on \"Just\" maybes', () => {\n // Simple value, complex assertions\n Fun.pipe(\n Maybes.just('test'),\n Maybes.fold(\n Fun.die('Should call other branch'),\n (test) => {\n assert.equal(test, 'test');\n return 'other-test';\n }\n ),\n (result) => assert.equal(result, 'other-test')\n );\n\n // Complex values, simple assertions\n fc.assert(fc.property(fc.anything(), (thing) => {\n Fun.pipe(\n Maybes.just(thing),\n Maybes.fold(Fun.die('Should call other branch'), Fun.noop)\n );\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/maybe/IdentityTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Folding on \"Just\" instances should result in calling the function associated with the \"Just\" branch, leading to expected outcomes.", "mode": "fast-check"} {"id": 56008, "name": "unknown", "code": "it('gets the value on \"Just\"', () => {\n fc.assert(fc.property(fc.string(), (s) => {\n const val = Fun.pipe(\n Maybes.just(s),\n Maybes.getOrDie\n );\n assert.equal(val, s);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/maybe/GetterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Maybes.getOrDie` retrieves the value from a `Just` instance correctly, matching the original string.", "mode": "fast-check"} {"id": 56009, "name": "unknown", "code": "it('never turns Just to Nothing (or vice versa)', () => {\n const mapper = Maybes.map(Fun.identity);\n\n const nothing = mapper(Maybes.nothing());\n assert.isTrue(Maybes.isNothing(nothing));\n\n fc.assert(fc.property(fc.anything(), (thing) => {\n const just = mapper(Maybes.just(thing));\n assert.isTrue(Maybes.isJust(just));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/maybe/FunctorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Mapping with the identity function retains the original `Just` or `Nothing` state in a `Maybe`.", "mode": "fast-check"} {"id": 56013, "name": "unknown", "code": "it('is correct for \"Just\"', () => {\n fc.assert(fc.property(fc.string(), (thing) => {\n const matches = Fun.pipe(\n Maybes.just(thing),\n Maybes.is(thing)\n );\n\n assert.isTrue(matches);\n }));\n\n fc.assert(fc.property(fc.string(), (thing) => {\n const matches = Fun.pipe(\n Maybes.just(thing),\n Maybes.is(thing + 'foo')\n );\n\n assert.isFalse(matches);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/maybe/ComparatorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Maybes.is` returns true for a `Just` containing a value matching the input, and false otherwise.", "mode": "fast-check"} {"id": 56017, "name": "unknown", "code": "it('compares normally for two \"Just\"s', () => {\n const different = fc.tuple(fc.anything(), fc.anything()).filter(([ lhs, rhs ]) => lhs !== rhs);\n fc.assert(fc.property(different, ([ lhs, rhs ]) => {\n assert.isFalse(Maybes.equals(Maybes.just(lhs), Maybes.just(rhs)));\n }));\n\n const theSame = fc.string().map((x) => [ x, x ]);\n fc.assert(fc.property(theSame, ([ lhs, rhs ]) => {\n assert.isTrue(Maybes.equals(Maybes.just(lhs), Maybes.just(rhs)));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/maybe/ComparatorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Maybes.equals` returns false for different `Just` values and true for identical `Just` values.", "mode": "fast-check"} {"id": 56018, "name": "unknown", "code": "it('compares normally for two \"Just\"s', () => {\n const different = fc.tuple(fc.anything(), fc.anything()).filter(([ lhs, rhs ]) => lhs !== rhs);\n fc.assert(fc.property(different, ([ lhs, rhs ]) => {\n assert.isFalse(Maybes.equals(Maybes.just(lhs), Maybes.just(rhs)));\n }));\n\n const theSame = fc.string().map((x) => [ x, x ]);\n fc.assert(fc.property(theSame, ([ lhs, rhs ]) => {\n assert.isTrue(Maybes.equals(Maybes.just(lhs), Maybes.just(rhs)));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/maybe/ComparatorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Maybes.equals` returns false for two `Just` objects with different values and true for two `Just` objects with the same value.", "mode": "fast-check"} {"id": 56019, "name": "unknown", "code": "it('is false for one \"Nothing\"', () => {\n fc.assert(fc.property(fc.anything(), (thing) => {\n assert.isFalse(Maybes.equals(Maybes.nothing(), Maybes.just(thing), unusedComparator));\n assert.isFalse(Maybes.equals(Maybes.just(thing), Maybes.nothing(), unusedComparator));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/maybe/ComparatorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Maybes.equals` returns false when comparing a `Nothing` with a `Just` of any value.", "mode": "fast-check"} {"id": 56020, "name": "unknown", "code": "it('Thunk.cached counter', () => {\n fc.assert(fc.property(fc.json(), fc.func(fc.json()), fc.json(), (a, f, b) => {\n let counter = 0;\n const thunk = Thunk.cached((x) => {\n counter++;\n return {\n counter,\n output: f(x)\n };\n });\n const value = thunk(a);\n const other = thunk(b);\n assert.deepEqual(other, value);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/fun/ThunkTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Thunk.cached` ensures that the function invocation count remains identical for subsequent inputs, confirming consistent output from a cached function call.", "mode": "fast-check"} {"id": 56021, "name": "unknown", "code": "it('Check compose :: compose(f, g)(x) = f(g(x))', () => {\n fc.assert(fc.property(fc.string(), fc.func(fc.string()), fc.func(fc.string()), (x, f, g) => {\n const h = Fun.compose(f, g);\n assert.deepEqual(h(x), f(g(x)));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The composition of two functions `f` and `g` applied to a value `x` should equal applying `f` to the result of `g(x)`.", "mode": "fast-check"} {"id": 56022, "name": "unknown", "code": "it('Check compose1 :: compose1(f, g)(x) = f(g(x))', () => {\n fc.assert(fc.property(fc.string(), fc.func(fc.string()), fc.func(fc.string()), (x, f, g) => {\n const h = Fun.compose1(f, g);\n assert.deepEqual(h(x), f(g(x)));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`compose1` applies two functions sequentially such that `compose1(f, g)(x)` equals `f(g(x))`.", "mode": "fast-check"} {"id": 56026, "name": "unknown", "code": "it('Check never :: f(x) === false', () => {\n fc.assert(fc.property(fc.json(), (json) => {\n assert.isFalse(Fun.never(json));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Fun.never` should return false for any given JSON input.", "mode": "fast-check"} {"id": 56028, "name": "unknown", "code": "it('Check not :: not(f(x)) === !f(x)', () => {\n fc.assert(fc.property(fc.json(), fc.func(fc.boolean()), (x, f) => {\n const g = Fun.not(f);\n assert.deepEqual(!g(x), f(x));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The `Fun.not` function transforms `f(x)` such that `not(f(x))` equals `!f(x)`, ensuring logical negation is applied correctly.", "mode": "fast-check"} {"id": 56029, "name": "unknown", "code": "it('Check not :: not(not(f(x))) === f(x)', () => {\n fc.assert(fc.property(fc.json(), fc.func(fc.boolean()), (x, f) => {\n const g = Fun.not(Fun.not(f));\n assert.deepEqual(g(x), f(x));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Applying `not` twice to a function should return the original function's result for any input.", "mode": "fast-check"} {"id": 56031, "name": "unknown", "code": "it('Check call :: apply(constant(a)) === undefined', () => {\n fc.assert(fc.property(fc.json(), (x) => {\n let hack: any = null;\n const output = Fun.call(() => {\n hack = x;\n });\n\n assert.isUndefined(output);\n assert.deepEqual(hack, x);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The function `Fun.call` should return `undefined`, while executing a callback that assigns its argument to a variable, which should then match the input JSON.", "mode": "fast-check"} {"id": 56034, "name": "unknown", "code": "it('Check that the total number of values and errors matches the input size', () => {\n fc.assert(fc.property(\n fc.array(arbResult(fc.integer(), fc.string())),\n (results) => {\n const actual = Results.partition(results);\n assert.equal(actual.errors.length + actual.values.length, results.length);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The total number of partitioned values and errors should equal the input size from `Results.partition`.", "mode": "fast-check"} {"id": 56035, "name": "unknown", "code": "it('Check that two errors always equal comparison.bothErrors', () => {\n fc.assert(fc.property(\n arbResultError(fc.integer()),\n arbResultError(fc.integer()),\n (r1, r2) => {\n const comparison = Results.compare(r1, r2);\n return comparison.match({\n bothErrors: Fun.always,\n firstError: Fun.never,\n secondError: Fun.never,\n bothValues: Fun.never\n });\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Comparing two error results should always yield `comparison.bothErrors` in `Results.compare`.", "mode": "fast-check"} {"id": 56037, "name": "unknown", "code": "it('Check that value, error always equal comparison.secondError', () => {\n fc.assert(fc.property(\n arbResultValue(fc.integer()),\n arbResultError(fc.string()),\n (r1, r2) => {\n const comparison = Results.compare(r1, r2);\n return comparison.match({\n bothErrors: Fun.never,\n firstError: Fun.never,\n secondError: Fun.always,\n bothValues: Fun.never\n });\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The comparison between two results should always match the condition where the second result is an error.", "mode": "fast-check"} {"id": 56038, "name": "unknown", "code": "it('Check that value, value always equal comparison.bothValues', () => {\n fc.assert(fc.property(\n arbResultValue(fc.integer()),\n arbResultValue(fc.integer()),\n (r1, r2) => {\n const comparison = Results.compare(r1, r2);\n return comparison.match({\n bothErrors: Fun.never,\n firstError: Fun.never,\n secondError: Fun.never,\n bothValues: Fun.always\n });\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Results.compare` should result in `bothValues` when comparing two valid `Result` values.", "mode": "fast-check"} {"id": 56039, "name": "unknown", "code": "it('Results.unite', () => {\n fc.assert(fc.property(fc.integer(), (a) => {\n assert.equal(Results.unite(Result.error(a)), a);\n assert.equal(Results.unite(Result.value(a)), a);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Results.unite` returns the integer value contained in both `Result.error` and `Result.value`.", "mode": "fast-check"} {"id": 56040, "name": "unknown", "code": "it('Checking value.is(value.getOrDie()) === true', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), (res) => {\n assert.isTrue(Results.is(res, res.getOrDie()));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Results.is` should return true for a result when comparing it with the value obtained via `getOrDie()`.", "mode": "fast-check"} {"id": 54420, "name": "unknown", "code": "it('should handle concurrent calls to \"inc\"', async () => {\n await fc.assert(\n fc.asyncProperty(fc.scheduler(), fc.nat(64), async (s, numCalls) => {\n // Arrange\n let dbValue = 0;\n const db = {\n read: s.scheduleFunction(async function read() {\n return dbValue;\n }),\n write: s.scheduleFunction(async function write(newValue: number, oldValue?: number) {\n if (oldValue !== undefined && dbValue !== oldValue) return false;\n dbValue = newValue;\n return true;\n }),\n };\n const counter = new Counter(db);\n\n // Act\n for (let callId = 0; callId < numCalls; ++callId) {\n s.schedule(Promise.resolve(`inc${callId + 1}`)).then(() => counter.inc());\n }\n await s.waitAll();\n\n // Assert\n expect(dbValue).toBe(numCalls);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/005-race/counter/main.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Concurrent calls to `inc` on a shared data resource should accurately reflect the expected number of increments in the database value.", "mode": "fast-check"} {"id": 56041, "name": "unknown", "code": "it('Checking value.isValue === true', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), (res) => {\n assert.isTrue(res.isValue());\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`isValue` should return true for any generated `ResultValue` instances.", "mode": "fast-check"} {"id": 56042, "name": "unknown", "code": "it('Checking value.isError === false', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), (res) => {\n assert.isFalse(res.isError());\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The property ensures that `isError` returns false for values generated by `arbResultValue` with integers.", "mode": "fast-check"} {"id": 56043, "name": "unknown", "code": "it('Checking value.getOr(v) === value.value', () => {\n fc.assert(fc.property(fc.integer(), (a) => {\n assert.equal(Result.value(a).getOr(a), a);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Result.value(a).getOr(a)` should equal `a`.", "mode": "fast-check"} {"id": 56044, "name": "unknown", "code": "it('Checking value.getOrDie() does not throw', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), (res) => {\n res.getOrDie();\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`getOrDie` method on `ResultValue` should not throw an exception.", "mode": "fast-check"} {"id": 56045, "name": "unknown", "code": "it('Checking value.or(oValue) === value', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), (a, b) => {\n assertResult(Result.value(a).or(Result.value(b)), Result.value(a));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The property should hold that calling `or` on `Result.value(a)` with `Result.value(b)` results in `Result.value(a)`.", "mode": "fast-check"} {"id": 56046, "name": "unknown", "code": "it('Checking error.or(value) === value', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), (a, b) => {\n assertResult(Result.error(a).or(Result.value(b)), Result.value(b));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Result.error(a).or(Result.value(b))` should equal `Result.value(b)`.", "mode": "fast-check"} {"id": 56047, "name": "unknown", "code": "it('Checking value.orThunk(die) does not throw', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), (res) => {\n res.orThunk(Fun.die('dies'));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Calling `value.orThunk(die)` should not throw an exception.", "mode": "fast-check"} {"id": 56051, "name": "unknown", "code": "it('Given f :: s -> RV, checking value.bind(f).getOrDie() === f(value.getOrDie()).getOrDie()', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), fc.func(arbResultValue(fc.integer())), (res, f) => {\n assert.equal(f(res.getOrDie()).getOrDie(), res.bind(f).getOrDie());\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The property should hold that applying a function to a value retrieved from `ResultValue` directly yields the same result as binding the function to `ResultValue` and then retrieving the value.", "mode": "fast-check"} {"id": 56053, "name": "unknown", "code": "it('Checking value.forall is true iff. f(value.getOrDie() === true)', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), fc.func(fc.boolean()), (res, f) => {\n assert.equal(res.forall(f), f(res.getOrDie()));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`forall` returns true if and only if applying the function `f` to `getOrDie` of a result value is true.", "mode": "fast-check"} {"id": 56054, "name": "unknown", "code": "it('Checking value.exists is true iff. f(value.getOrDie() === true)', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), fc.func(fc.boolean()), (res, f) => {\n assert.equal(res.exists(f), f(res.getOrDie()));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The property ensures that `res.exists(f)` returns true if and only if `f(res.getOrDie())` is true.", "mode": "fast-check"} {"id": 56055, "name": "unknown", "code": "it('Checking value.toOptional is always Optional.some(value.getOrDie())', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), (res) => {\n assert.equal(res.toOptional().getOrDie(), res.getOrDie());\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`value.toOptional` should always result in `Optional.some(value.getOrDie())`.", "mode": "fast-check"} {"id": 56056, "name": "unknown", "code": "it('error.is === false', () => {\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n assert.isFalse(Results.is(Result.error(s), i));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Verifies that `Results.is` returns false when checking if an error result matches any integer.", "mode": "fast-check"} {"id": 56057, "name": "unknown", "code": "it('error.isValue === false', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), (res) => {\n assert.isFalse(res.isValue());\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`isValue` should return false for `ResultError` objects generated with integer errors.", "mode": "fast-check"} {"id": 56058, "name": "unknown", "code": "it('error.isError === true', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), (res) => {\n assert.isTrue(res.isError());\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The property ensures that every `ResultError` generated marks `isError` as true.", "mode": "fast-check"} {"id": 59909, "name": "unknown", "code": "test('Gen.array(gen).ofMinLength(x) *produces* arrays that shrink to length = x', () => {\n fc.assert(\n fc.property(domainGen.minimalConfig(), domainGen.gen(), genArrayLength(), (config, gen, x) => {\n const genArray = dev.Gen.array(gen).ofMinLength(x);\n\n const min = dev.minimalValue(genArray, config);\n\n expect(min).toHaveLength(x);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Gen/Gen.Array.test.ts", "start_line": null, "end_line": null, "dependencies": ["genArrayLength"], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Gen.array(gen).ofMinLength(x)` produces arrays that shrink to the minimum length `x`.", "mode": "fast-check"} {"id": 56059, "name": "unknown", "code": "it('error.getOr(v) === v', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), fc.json(), (res, json) => {\n assert.deepEqual(res.getOr(json), json);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`getOr` should return the provided default value for `ResultError` instances.", "mode": "fast-check"} {"id": 56060, "name": "unknown", "code": "it('error.getOrDie() always throws', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), (res) => {\n assert.throws(() => {\n res.getOrDie();\n });\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`res.getOrDie()` always throws an error for `ResultError` instances.", "mode": "fast-check"} {"id": 56062, "name": "unknown", "code": "it('error.orThunk(_ -> v) === v', () => {\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n assertResult(Result.error(s).orThunk(() => Result.value(i)), Result.value(i));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Result.error` with `orThunk` should yield the provided fallback value wrapped in `Result.value`.", "mode": "fast-check"} {"id": 56063, "name": "unknown", "code": "it('error.fold(_ -> x, die) === x', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), fc.json(), (res, json) => {\n const actual = res.fold(Fun.constant(json), Fun.die('Should not die'));\n assert.deepEqual(actual, json);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The `fold` operation on `ResultError` should return the first provided value when the first function is applied, without triggering the second function.", "mode": "fast-check"} {"id": 56064, "name": "unknown", "code": "it('error.map returns an error', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n assertResult(Result.error(i).map(Fun.die('should not be called')), Result.error(i));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Result.error(i).map` should return an identical `Result.error(i)`.", "mode": "fast-check"} {"id": 56068, "name": "unknown", "code": "it('Given f :: s -> RE, error.bind(f) === error', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), fc.func(arbResultError(fc.integer())), (res, f) => {\n const actual = res.bind(f);\n assert.deepEqual(getErrorOrDie(actual), getErrorOrDie(res));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Binding a function to a `ResultError` instance results in the same `ResultError` instance.", "mode": "fast-check"} {"id": 56070, "name": "unknown", "code": "it('error.exists === false', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n assert.isFalse(Result.error(i).exists(Fun.die('should not be called')));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Result.error` always returns an object where `exists` returns false for any integer input.", "mode": "fast-check"} {"id": 56071, "name": "unknown", "code": "it('error.toOptional is always none', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), (res) => {\n assertNone(res.toOptional());\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`toOptional` called on a `ResultError` always returns `none`.", "mode": "fast-check"} {"id": 56072, "name": "unknown", "code": "it('should not generate identical IDs', () => {\n const arbId = fc.string(1, 30).map(Id.generate);\n fc.assert(fc.property(arbId, arbId, (id1, id2) => id1 !== id2));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/IdTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Id.generate` should not produce identical IDs for two different runs using string inputs.", "mode": "fast-check"} {"id": 56074, "name": "unknown", "code": "it('pure, map', () =>\n fc.assert(fc.asyncProperty(fc.integer(), fc.func(fc.string()), (i, f) => new Promise((resolve, reject) => {\n LazyValue.pure(i).map(f).get((v) => {\n eqAsync('LazyValue.map', f(i), v, reject);\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/async/LazyValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`LazyValue.pure(i).map(f).get` should apply function `f` to integer `i`, with the result matching the expected mapped value.", "mode": "fast-check"} {"id": 56075, "name": "unknown", "code": "it('delayed, map', () =>\n fc.assert(fc.asyncProperty(fc.integer(), fc.func(fc.string()), (i, f) => new Promise((resolve, reject) => {\n LazyValue.nu((c) => {\n setTimeout(() => {\n c(i);\n }, 2);\n }).map(f).get((v) => {\n eqAsync('LazyValue.map', f(i), v, reject);\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/async/LazyValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`LazyValue.map` correctly applies a function to asynchronously resolved integer values.", "mode": "fast-check"} {"id": 56076, "name": "unknown", "code": "it('parallel spec', () => fc.assert(fc.asyncProperty(fc.array(fc.integer(), 0, 20), (vals) => new Promise((resolve, reject) => {\n const lazyVals = Arr.map(vals, LazyValue.pure);\n LazyValues.par(lazyVals).get((actual) => {\n eqAsync('pars', vals, actual, reject);\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/async/LazyValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`LazyValues.par` correctly processes an array of `LazyValue.pure` instances by returning the expected parallel results matching the input integer array.", "mode": "fast-check"} {"id": 56077, "name": "unknown", "code": "it('map id obj = obj', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.integer()), (obj) => {\n const actual = Obj.map(obj, Fun.identity);\n assert.deepEqual(actual, obj);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/obj/ObjMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Mapping an object with the identity function should return the original object unchanged.", "mode": "fast-check"} {"id": 56080, "name": "unknown", "code": "it('mapToArray is symmetric with tupleMap', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.integer()), (obj) => {\n const array = Obj.mapToArray(obj, (x, i) => ({ k: i, v: x }));\n\n const aKeys = Arr.map(array, (x) => x.k);\n const aValues = Arr.map(array, (x) => x.v);\n\n const keys = Obj.keys(obj);\n const values = Obj.values(obj);\n\n assert.deepEqual(Arr.sort(aKeys), Arr.sort(keys));\n assert.deepEqual(Arr.sort(aValues), Arr.sort(values));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/obj/ObjMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`mapToArray` and `tupleMap` maintain symmetry by ensuring the mapped array's keys and values match the original object's keys and values when sorted.", "mode": "fast-check"} {"id": 56081, "name": "unknown", "code": "it('single key/value', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.json(),\n (k: string, v: any) => {\n const o = { [k]: v };\n assert.isFalse(Obj.isEmpty(o));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/obj/ObjIsEmptyTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Verifies that an object with a single key-value pair is not considered empty by `Obj.isEmpty`.", "mode": "fast-check"} {"id": 56082, "name": "unknown", "code": "it('the value found by find always passes predicate', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(), fc.json()),\n fc.func(fc.boolean()),\n (obj, pred) => {\n // It looks like the way that fc.fun works is it cares about all of its arguments, so therefore\n // we have to only pass in one if we want it to be deterministic. Just an assumption\n const value = Obj.find(obj, (v) => {\n return pred(v);\n });\n return value.fold(() => {\n const values = Obj.values(obj);\n return !Arr.exists(values, (v) => {\n return pred(v);\n });\n }, (v) => {\n return pred(v);\n });\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/obj/ObjFindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The value found by `Obj.find` from a dictionary should satisfy the given predicate, and if no value is found, no value in the dictionary should satisfy the predicate.", "mode": "fast-check"} {"id": 56083, "name": "unknown", "code": "it('If predicate is always false, then find is always none', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(), fc.json()),\n (obj) => {\n const value = Obj.find(obj, Fun.never);\n return value.isNone();\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/obj/ObjFindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Obj.find` returns `None` when using a predicate that is always false on any dictionary of string keys and JSON values.", "mode": "fast-check"} {"id": 56084, "name": "unknown", "code": "it('If object is empty, find is always none', () => {\n fc.assert(fc.property(\n fc.func(fc.boolean()),\n (pred) => {\n const value = Obj.find({}, pred);\n return value.isNone();\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/obj/ObjFindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Obj.find` returns none when called with an empty object, regardless of the predicate.", "mode": "fast-check"} {"id": 56086, "name": "unknown", "code": "it('Each + set should equal the same object', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(), fc.json()),\n (obj) => {\n const values: Record = {};\n const output = Obj.each(obj, (x, i) => {\n values[i] = x;\n });\n assert.deepEqual(values, obj);\n assert.isUndefined(output);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/obj/ObjEachTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The test checks that iterating over an object with `Obj.each` and collecting its properties into a new object results in an identical object to the original, and that `Obj.each` returns `undefined`.", "mode": "fast-check"} {"id": 56089, "name": "unknown", "code": "it('Merged with itself is itself', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), (obj) => {\n assert.deepEqual(Merger.merge(obj, obj), obj);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Merging an object with itself should result in the original object.", "mode": "fast-check"} {"id": 56091, "name": "unknown", "code": "it('Merge(a, b) contains all the keys of b', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), fc.dictionary(fc.asciiString(), fc.json()), (a, b) => {\n const output = Merger.merge(a, b);\n const keys = Obj.keys(b);\n const oKeys = Obj.keys(output);\n return Arr.forall(keys, (k) => {\n return Arr.contains(oKeys, k);\n });\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Merger.merge` ensures the output object includes all keys from the second input object.", "mode": "fast-check"} {"id": 56092, "name": "unknown", "code": "it('Deep-merged with identity on left', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), (obj) => {\n assert.deepEqual(Merger.deepMerge({}, obj), obj);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Deep merging an empty object with another object should return the other object unchanged.", "mode": "fast-check"} {"id": 56094, "name": "unknown", "code": "it('Deep-merged with itself is itself', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), (obj) => {\n assert.deepEqual(Merger.deepMerge(obj, obj), obj);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Deep merging an object with itself should return the original object unchanged.", "mode": "fast-check"} {"id": 56095, "name": "unknown", "code": "it('Deep-merge(a, Deep-merge(b, c)) === Deep-merge(Deep-merge(a, b), c)', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), fc.dictionary(fc.asciiString(), fc.json()), fc.dictionary(fc.asciiString(), fc.json()), (a, b, c) => {\n const one = Merger.merge(a, Merger.merge(b, c));\n const other = Merger.merge(Merger.merge(a, b), c);\n assert.deepEqual(other, one);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Deep merging of objects is associative, meaning `Deep-merge(a, Deep-merge(b, c))` should equal `Deep-merge(Deep-merge(a, b), c)`.", "mode": "fast-check"} {"id": 59908, "name": "unknown", "code": "test('Gen.array(gen).ofMaxLength(x), x < 0 *produces* error; maximum must be at least 0', () => {\n fc.assert(\n fc.property(domainGen.sampleConfig(), domainGen.gen(), domainGen.integer({ max: -1 }), (config, gen, x) => {\n const genArray = dev.Gen.array(gen).ofMaxLength(x);\n\n expect(() => dev.sample(genArray, config)).toThrow('Maximum must be at least 0');\n }),\n );\n })", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Gen/Gen.Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Generating an array with a maximum length less than 0 should produce an error stating that the maximum must be at least 0.", "mode": "fast-check"} {"id": 56097, "name": "unknown", "code": "it('Checking that creating a namespace (forge) from an obj will enable that value to be retrieved by resolving (path)', () => {\n fc.assert(fc.property(\n // NOTE: This value is being modified, so it cannot be shrunk.\n fc.dictionary(fc.asciiString(),\n // We want to make sure every path in the object is an object\n // also, because that is a limitation of forge.\n fc.dictionary(fc.asciiString(),\n fc.dictionary(fc.asciiString(), fc.constant({}))\n )\n ),\n fc.array(fc.asciiString(1, 30), 1, 40),\n fc.asciiString(1, 30),\n fc.asciiString(1, 30),\n (dict, parts, field, newValue) => {\n const created = Resolve.forge(parts, dict);\n created[field] = newValue;\n const resolved = Resolve.path(parts.concat([ field ]), dict);\n assert.deepEqual(resolved, newValue);\n }\n ), { endOnFailure: true });\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/obj/ResolveTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Creating a namespace with `Resolve.forge` from an object should allow values to be correctly retrieved using `Resolve.path`.", "mode": "fast-check"} {"id": 56101, "name": "unknown", "code": "it('nu', () => fc.assert(fc.asyncProperty(arbResult(fc.integer(), fc.integer()), (r) => new Promise((resolve, reject) => {\n FutureResult.nu((completer) => {\n completer(r);\n }).get((ii) => {\n eqAsync('eq', r, ii, reject, tResult());\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`FutureResult.nu` processes a result using a completer and retrieves an equivalent result asynchronously.", "mode": "fast-check"} {"id": 56102, "name": "unknown", "code": "it('fromFuture', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.fromFuture(Future.pure(i)).get((ii) => {\n eqAsync('eq', Result.value(i), ii, reject, tResult());\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`FutureResult.fromFuture` correctly wraps a resolved future and provides the expected result when accessed.", "mode": "fast-check"} {"id": 56104, "name": "unknown", "code": "it('fromResult get', () => fc.assert(fc.asyncProperty(arbResult(fc.integer(), fc.integer()), (r) => new Promise((resolve, reject) => {\n FutureResult.fromResult(r).get((ii) => {\n eqAsync('eq', r, ii, reject, tResult());\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`FutureResult.fromResult` should retrieve a result that is equivalent to the original result using asynchronous equality verification.", "mode": "fast-check"} {"id": 56105, "name": "unknown", "code": "it('pure get', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.pure(i).get((ii) => {\n eqAsync('eq', Result.value(i), ii, reject, tResult());\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Calls to `FutureResult.pure` with an integer should return a `Result` containing that integer upon retrieval.", "mode": "fast-check"} {"id": 56107, "name": "unknown", "code": "it('error get', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.error(i).get((ii) => {\n eqAsync('eq', Result.error(i), ii, reject, tResult());\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The `FutureResult.error` method returns an error containing the provided integer, and `get` correctly retrieves it, ensuring it matches `Result.error`.", "mode": "fast-check"} {"id": 56109, "name": "unknown", "code": "it('error mapResult', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.error(i).mapResult(Fun.die('should not be called')).get((ii) => {\n eqAsync('eq', Result.error(i), ii, reject, tResult());\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Mapping on a `FutureResult` in an error state should not invoke the mapping function, and the result should remain an error with the same value.", "mode": "fast-check"} {"id": 56110, "name": "unknown", "code": "it('value mapError', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.value(i).mapError(Fun.die('should not be called')).get((ii) => {\n eqAsync('eq', Result.value(i), ii, reject, tResult());\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`FutureResult.value(i)` processes without invoking `mapError`, ensuring error mapping is bypassed for valid values.", "mode": "fast-check"} {"id": 56111, "name": "unknown", "code": "it('err mapError', () => {\n const f = (x: number) => x + 3;\n return fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.error(i).mapError(f).get((ii) => {\n eqAsync('eq', Result.error(f(i)), ii, reject, tResult());\n resolve();\n });\n })));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`FutureResult.error(i).mapError(f)` transforms an error using function `f` to verify that the resulting error is correctly mapped to `Result.error(f(i))`.", "mode": "fast-check"} {"id": 56112, "name": "unknown", "code": "it('value bindFuture value', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n const f = (x: number) => x % 4;\n FutureResult.value(i).bindFuture((x) => FutureResult.value(f(x))).get((actual) => {\n eqAsync('bind result', Result.value(f(i)), actual, reject, tResult(tNumber));\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`bindFuture` correctly applies a function to a `FutureResult` and returns a new `FutureResult` with the expected value based on the given integer.", "mode": "fast-check"} {"id": 56113, "name": "unknown", "code": "it('bindFuture: value bindFuture error', () => fc.assert(fc.asyncProperty(fc.integer(), fc.string(), (i, s) => new Promise((resolve, reject) => {\n FutureResult.value(i).bindFuture(() => FutureResult.error(s)).get((actual) => {\n eqAsync('bind result', Result.error(s), actual, reject, tResult(tNumber));\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`bindFuture` applied to a value should result in an error when binding to a future that produces an error.", "mode": "fast-check"} {"id": 56114, "name": "unknown", "code": "it('error bindFuture', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.error(i).bindFuture(Fun.die('should not be called')).get((actual) => {\n eqAsync('bind result', Result.error(i), actual, reject, tResult(tNumber));\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`bindFuture` should not invoke the provided function when called on a `FutureResult.error`.", "mode": "fast-check"} {"id": 56115, "name": "unknown", "code": "it('returns matching keys and values', () => {\n fc.assert(fc.property(\n fc.array(fc.asciiString(1, 30)),\n (rawValues: string[]) => {\n const values = Unique.stringArray(rawValues);\n\n const keys = Arr.map(values, (v, i) => i);\n\n const output = Zip.zipToObject(keys, values);\n\n const oKeys = Obj.keys(output);\n assert.deepEqual(values.length, oKeys.length);\n\n assert.deepEqual(Arr.forall(oKeys, (oKey) => {\n const index = parseInt(oKey, 10);\n const expected = values[index];\n return output[oKey] === expected;\n }), true);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/ZipTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Zip.zipToObject` should produce an object where keys correspond to indices and values match the specified inputs, ensuring they have matching lengths.", "mode": "fast-check"} {"id": 56118, "name": "unknown", "code": "it('reversing a one element array is identity', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (a) => {\n assert.deepEqual(Arr.reverse([ a ]), [ a ]);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/ReverseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Reversing a single-element array should return the array unchanged.", "mode": "fast-check"} {"id": 56188, "name": "unknown", "code": "UnitTest.test('KAssert.eqOption: success (reflexivity)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.some(i));\n KAssert.eqOptional('eq', Optional.some(i), Optional.some(i), tNumber);\n }));\n KAssert.eqOptional('eq', Optional.none(), Optional.none());\n})", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`KAssert.eqOptional` should confirm reflexivity by verifying that two identical `Optional` objects, both containing the same integer or both being empty, are considered equal.", "mode": "fast-check"} {"id": 54419, "name": "unknown", "code": "it('should handle two concurrent calls to \"inc\"', async () => {\n await fc.assert(\n fc.asyncProperty(fc.scheduler(), async (s) => {\n // Arrange\n let dbValue = 0;\n const db = {\n read: s.scheduleFunction(async function read() {\n return dbValue;\n }),\n write: s.scheduleFunction(async function write(newValue: number, oldValue?: number) {\n if (oldValue !== undefined && dbValue !== oldValue) return false;\n dbValue = newValue;\n return true;\n }),\n };\n const counter = new Counter(db);\n\n // Act\n s.schedule(Promise.resolve('inc1')).then(() => counter.inc());\n s.schedule(Promise.resolve('inc2')).then(() => counter.inc());\n await s.waitAll();\n\n // Assert\n expect(dbValue).toBe(2);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/005-race/counter/main.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Concurrently calling `inc` on a `Counter` should correctly increment the database value to 2.", "mode": "fast-check"} {"id": 56189, "name": "unknown", "code": "UnitTest.test('KAssert.eqOption: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #1', () => {\n KAssert.eqOptional('eq', Optional.some(a), Optional.some(b));\n });\n }));\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #2', () => {\n KAssert.eqOptional('eq', Optional.some(a), Optional.some(b), tNumber);\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('none != some(i) #1', () => {\n KAssert.eqOptional('eq', Optional.none(), Optional.some(i));\n });\n Assert.throws('none != some(i) #2', () => {\n KAssert.eqOptional('eq', Optional.none(), Optional.some(i), tBoom());\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('some(i) != none #1', () => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.none());\n });\n Assert.throws('some(i) != none #2', () => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.none(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`KAssert.eqOptional` should throw an error when comparing `Optional` objects that are either different values or one is `none` and the other is `some`.", "mode": "fast-check"} {"id": 56190, "name": "unknown", "code": "UnitTest.test('KAssert.eqOption: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #1', () => {\n KAssert.eqOptional('eq', Optional.some(a), Optional.some(b));\n });\n }));\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #2', () => {\n KAssert.eqOptional('eq', Optional.some(a), Optional.some(b), tNumber);\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('none != some(i) #1', () => {\n KAssert.eqOptional('eq', Optional.none(), Optional.some(i));\n });\n Assert.throws('none != some(i) #2', () => {\n KAssert.eqOptional('eq', Optional.none(), Optional.some(i), tBoom());\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('some(i) != none #1', () => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.none());\n });\n Assert.throws('some(i) != none #2', () => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.none(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`KAssert.eqOptional` throws exceptions for unequal `Optional` values, whether comparing two different `Some` values, `None` to `Some`, or `Some` to `None`.", "mode": "fast-check"} {"id": 56191, "name": "unknown", "code": "UnitTest.test('KAssert.eqOption: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #1', () => {\n KAssert.eqOptional('eq', Optional.some(a), Optional.some(b));\n });\n }));\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #2', () => {\n KAssert.eqOptional('eq', Optional.some(a), Optional.some(b), tNumber);\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('none != some(i) #1', () => {\n KAssert.eqOptional('eq', Optional.none(), Optional.some(i));\n });\n Assert.throws('none != some(i) #2', () => {\n KAssert.eqOptional('eq', Optional.none(), Optional.some(i), tBoom());\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('some(i) != none #1', () => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.none());\n });\n Assert.throws('some(i) != none #2', () => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.none(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`KAssert.eqOptional` throws an error when comparing two different `Optional` values, one being `Optional.some` with differing elements or `Optional.none` against `Optional.some`, and vice versa.", "mode": "fast-check"} {"id": 56192, "name": "unknown", "code": "UnitTest.test('KAssert.eqOption: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #1', () => {\n KAssert.eqOptional('eq', Optional.some(a), Optional.some(b));\n });\n }));\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #2', () => {\n KAssert.eqOptional('eq', Optional.some(a), Optional.some(b), tNumber);\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('none != some(i) #1', () => {\n KAssert.eqOptional('eq', Optional.none(), Optional.some(i));\n });\n Assert.throws('none != some(i) #2', () => {\n KAssert.eqOptional('eq', Optional.none(), Optional.some(i), tBoom());\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('some(i) != none #1', () => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.none());\n });\n Assert.throws('some(i) != none #2', () => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.none(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`KAssert.eqOptional` throws errors when comparing `Optional.some(a)` and `Optional.some(b)` with different values, or when comparing `Optional.some(i)` and `Optional.none()` or vice versa.", "mode": "fast-check"} {"id": 56193, "name": "unknown", "code": "it('pure get', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) =>\n Future.pure(i).get((ii) => {\n eqAsync('pure get', i, ii, reject, tNumber);\n resolve();\n })))))", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/async/FutureTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Calling `Future.pure` with an integer should result in `get` returning the same integer, verified asynchronously with `eqAsync`.", "mode": "fast-check"} {"id": 56194, "name": "unknown", "code": "it('future soon get', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) =>\n Future.nu((cb) => setTimeout(() => cb(i), 3)).get((ii) => {\n eqAsync('get', i, ii, reject, tNumber);\n resolve();\n })))))", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/async/FutureTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "A `Future` retrieves and returns a provided integer using an asynchronous callback after a delay.", "mode": "fast-check"} {"id": 56195, "name": "unknown", "code": "it('map', () => fc.assert(fc.asyncProperty(fc.integer(), fc.func(fc.string()), (i, f) => new Promise((resolve, reject) =>\n Future.pure(i).map(f).get((ii) => {\n eqAsync('get', f(i), ii, reject, tString);\n resolve();\n })))))", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/async/FutureTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "A `Future` object created with an integer applies a mapping function returning a string, and ensures the mapped result is consistent with the function's output.", "mode": "fast-check"} {"id": 56196, "name": "unknown", "code": "it('bind', () => fc.assert(fc.asyncProperty(fc.integer(), fc.func(fc.string()), (i, f) => new Promise((resolve, reject) =>\n Future.pure(i).bind(Fun.compose(Future.pure, f)).get((ii) => {\n eqAsync('get', f(i), ii, reject, tString);\n resolve();\n })))))", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/async/FutureTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The property ensures that `Future.pure` bound with a composed function, which returns `Future.pure` of a function result, retrieves a value equivalent to applying the function to the input integer.", "mode": "fast-check"} {"id": 56197, "name": "unknown", "code": "it('anonBind', () => fc.assert(fc.asyncProperty(fc.integer(), fc.string(), (i, s) => new Promise((resolve, reject) =>\n Future.pure(i).anonBind(Future.pure(s)).get((ii) => {\n eqAsync('get', s, ii, reject, tString);\n resolve();\n })))))", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/async/FutureTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The property should hold that binding an integer future to a string future using `anonBind` results in the second future's value being returned.", "mode": "fast-check"} {"id": 56198, "name": "unknown", "code": "it('parallel spec', () => fc.assert(fc.asyncProperty(fc.array(fc.tuple(fc.integer(1, 10), fc.integer())), (tuples) => new Promise((resolve, reject) =>\n Futures.par(Arr.map(tuples, ([ timeout, value ]) => Future.nu((cb) => setTimeout(() => cb(value), timeout)))).get((ii) => {\n eqAsync('pars', tuples.map(([ _, i ]) => i), ii, reject, tArray(tNumber));\n resolve();\n }))))\n )", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/async/FutureTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Futures.par` processes an array of asynchronous operations and confirms they resolve to the expected values in parallel, based on an array of integer tuples representing timeouts and values.", "mode": "fast-check"} {"id": 56199, "name": "unknown", "code": "it('mapM spec', () =>\n fc.assert(fc.asyncProperty(fc.array(fc.tuple(fc.integer(1, 10), fc.integer())), (tuples) => new Promise((resolve, reject) =>\n Futures.mapM(tuples, ([ timeout, value ]) => Future.nu((cb) => setTimeout(() => cb(value), timeout))).get((ii) => {\n eqAsync('pars', tuples.map(([ _, i ]) => i), ii, reject, tArray(tNumber));\n resolve();\n }))))\n )", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/async/FutureTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Futures.mapM` processes an array of tuples asynchronously, verifying that the output matches the sequence of values extracted from the input tuples.", "mode": "fast-check"} {"id": 56200, "name": "unknown", "code": "it('TINY-6891: Should be able to convert to and from numbers/list numbering', () => {\n const arbitrary = Arr.map([\n fc.mapToConstant({ num: 26, build: (v) => String.fromCharCode(65 + v) }),\n fc.mapToConstant({ num: 26, build: (v) => String.fromCharCode(97 + v) }),\n fc.mapToConstant({ num: 10, build: (v) => v.toString() })\n ], (c) => fc.stringOf(c, 1, 5));\n\n fc.assert(fc.property(\n fc.oneof(...arbitrary),\n (start) => {\n assert.equal(\n start,\n parseStartValue(start).map(parseDetail).getOrDie(),\n 'Should be initial start value'\n );\n }\n ), { endOnFailure: true });\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/hugerte/src/plugins/lists/test/ts/atomic/ListNumberingTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The test verifies that converting a string representation of letters or numbers to a parsed value and back results in the original string.", "mode": "fast-check"} {"id": 56201, "name": "unknown", "code": "it('no initial data', () => {\n const dialogChange = DialogChanges.init({ title: '', text: '' } as LinkDialogData, { } as LinkDialogCatalog);\n\n fc.assert(fc.property(fc.webUrl(), fc.asciiString(), fc.asciiString(), (url, title, text) => {\n const data = Fun.constant({ url: {\n value: url,\n meta: { title, text }\n }} as LinkDialogData);\n const dataNoMeta = Fun.constant({ url: {\n value: url,\n meta: { }\n }} as LinkDialogData);\n\n Assert.eq('on url change should include url title and text',\n Optional.some>({ title, text }),\n dialogChange.onChange(data, { name: 'url' }),\n tOptional()\n );\n\n Assert.eq('on url change should fallback to url for text',\n Optional.some>({ title: '', text: url }),\n dialogChange.onChange(dataNoMeta, { name: 'url' }),\n tOptional()\n );\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/hugerte/src/plugins/link/test/ts/atomic/DialogChangesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Verifies that when `DialogChanges` is initialized with no initial data, changing the URL with meta data includes the title and text, and changing the URL without meta data defaults the text to the URL itself.", "mode": "fast-check"} {"id": 56202, "name": "unknown", "code": "it('with original data', () => {\n const dialogChange = DialogChanges.init({ title: 'orig title', text: 'orig text' } as LinkDialogData, { } as LinkDialogCatalog);\n const dialogChangeNoTitle = DialogChanges.init({ title: '', text: 'orig text' } as LinkDialogData, { } as LinkDialogCatalog);\n const dialogChangeNoText = DialogChanges.init({ title: 'orig title', text: '' } as LinkDialogData, { } as LinkDialogCatalog);\n\n fc.assert(fc.property(fc.webUrl(), fc.asciiString(), fc.asciiString(), (url, title, text) => {\n const data = Fun.constant({ url: {\n value: url,\n meta: { title, text }\n }} as LinkDialogData);\n\n Assert.eq('on url change should not try to change title and text',\n Optional.none(),\n dialogChange.onChange(data, { name: 'url' }),\n tOptional()\n );\n\n Assert.eq('No Title - on url change should only try to change title',\n Optional.some>({ title }),\n dialogChangeNoTitle.onChange(data, { name: 'url' }),\n tOptional()\n );\n\n Assert.eq('No Text - on url change should only try to change text',\n Optional.some>({ text }),\n dialogChangeNoText.onChange(data, { name: 'url' }),\n tOptional()\n );\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/hugerte/src/plugins/link/test/ts/atomic/DialogChangesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "DialogChanges should not alter both title and text on a URL change if both are originally present, should only alter the title if absent, and should only alter the text if absent.", "mode": "fast-check"} {"id": 56203, "name": "unknown", "code": "it('TINY-4773: multiple @ characters', () => {\n const editor = hook.editor();\n fc.assert(fc.property(fc.hexaString(0, 30), fc.hexaString(0, 30), fc.hexaString(0, 30), (s1, s2, s3) => {\n assertNoLink(editor, `${s1}@@${s2}@.@${s3}`, `${s1}@@${s2}@.@${s3}`);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/hugerte/src/plugins/autolink/test/ts/browser/AutoLinkPluginTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Ensures no links are created in the editor for strings composed of multiple '@' characters.", "mode": "fast-check"} {"id": 56205, "name": "unknown", "code": "it('TINY-9226: basic property - no outside constraints', () => {\n fc.assert(\n fc.property(arbBounds, arbBounds, (original, constraint) => {\n const actual = Boxes.constrain(original, constraint);\n assert.isAtLeast(actual.x, constraint.x);\n assert.isAtMost(actual.right, constraint.right);\n assert.isAtLeast(actual.y, constraint.y);\n assert.isAtMost(actual.bottom, constraint.bottom);\n })\n );\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/alloy/src/test/ts/atomic/alien/BoxesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Boxes.constrain` adjusts a box's boundaries to fit within specified constraints by ensuring the box's coordinates are at least and at most the constraint values for each side.", "mode": "fast-check"} {"id": 54422, "name": "unknown", "code": "it('should be able to call multiple /drop-deactivated at the same time', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.uniqueArray(\n fc.record({\n id: fc.uuid({ version: 4 }),\n name: fc.string(),\n deactivated: fc.boolean(),\n }),\n { selector: (u) => u.id },\n ),\n fc.integer({ min: 1, max: 5 }),\n fc.scheduler({\n // In the case of supertest, as a user you MUST define a custom `act` function\n // if you want to run multiple queries at the same time. The following one adds\n // some extra timers so that supertest can push promises in the queue in time.\n // Second test is the very same test but outside of supertest.\n act: async (f) => {\n await new Promise((r) => setTimeout(r, 0));\n await f();\n },\n }),\n async (allUsers, num, s) => {\n // Arrange\n let knownUsers = allUsers;\n const getAllUsers = DbMock.getAllUsers as MockedFunction;\n const removeUsers = DbMock.removeUsers as MockedFunction;\n getAllUsers.mockImplementation(\n s.scheduleFunction(async function getAllUsers() {\n return knownUsers;\n }),\n );\n removeUsers.mockImplementation(\n s.scheduleFunction(async function removeUsers(ids) {\n const sizeBefore = knownUsers.length;\n knownUsers = knownUsers.filter((u) => !ids.includes(u.id));\n return sizeBefore - knownUsers.length;\n }),\n );\n\n // Act\n const r = request(app);\n const queries = [];\n for (let index = 0; index !== num; ++index) {\n queries.push(r.get('/drop-deactivated?id=' + index).send());\n }\n const out = await s.waitFor(Promise.all(queries));\n\n // Assert\n for (const outQuery of out) {\n expect(outQuery.body.status).toBe('success');\n }\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/005-race/supertest/app.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Multiple `/drop-deactivated` API calls should succeed simultaneously when invoked with unique user records.", "mode": "fast-check"} {"id": 56207, "name": "unknown", "code": "it('TINY-9226: basic property', () => {\n fc.assert(\n fc.property(arbBounds, arbBounds, fc.array(arbBounds), (original, first, rest) => {\n const constraints = [ first ].concat(rest);\n const all = [ original ].concat(constraints);\n const actual = Boxes.constrainByMany(original, constraints);\n const optLargestLeft = Arr.last(sortNumbers(Arr.map(all, (c) => c.x)));\n const optLargestTop = Arr.last(sortNumbers(Arr.map(all, (c) => c.y)));\n const optSmallestRight = Arr.head(sortNumbers(Arr.map(all, (c) => c.right)));\n const optSmallestBottom = Arr.head(sortNumbers(Arr.map(all, (c) => c.bottom)));\n\n const assertOpt = (label: string, optValue: Optional, actualValue: number): void => {\n optValue.fold(\n () => assert.fail('There were no candidates. Actual value: ' + actualValue),\n (v) => assert.equal(\n actualValue,\n v,\n `Property ${label}. Expected: ${v}, Actual: ${actualValue}, \\n\n All: ${JSON.stringify(all, null, 2)}`\n )\n );\n };\n\n assertOpt('left', optLargestLeft, actual.x);\n assertOpt('right', optSmallestRight, actual.right);\n assertOpt('top', optLargestTop, actual.y);\n assertOpt('bottom', optSmallestBottom, actual.bottom);\n })\n );\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/alloy/src/test/ts/atomic/alien/BoxesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Boxes.constrainByMany` adjusts the `original` box's edges to match expected constraints from the largest left, largest top, smallest right, and smallest bottom derived from a collection of bounding boxes.", "mode": "fast-check"} {"id": 56208, "name": "unknown", "code": "test(\n 'Typical usage - enqueue 0-1000 tasks & process them (with manual polling)',\n { timeout: seconds(30) },\n async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.scheduler(),\n fc.array( \n fc.record({\n taskId: fc.uuid({ version: 4 }),\n payload: fc.jsonValue(),\n }),\n { minLength: 0, maxLength: 1000 },\n ),\n fc.constantFrom(...executorStrategies()),\n fc.integer({min: 1, max: 10 }),\n async (scheduler, tasksToRun, executorStrategy, concurrency) => {\n // TODO: Move this check + error handling to workhorse.queue() and verify payload can be stringified and read back to itself\n tasksToRun = tasksToRun.filter(isValidTask);\n const taskResults: TaskResult[] = [];\n\n const runTask: RunTask = async (taskId, payload) => {\n taskResults.push({ taskId, payload });\n return Promise.resolve(undefined);\n };\n\n const workhorse = await createWorkhorse(runTask, {\n taskExecution: executorStrategy,\n concurrency,\n });\n\n tasksToRun.forEach((task) => {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n scheduler.schedule(workhorse.queue(task.taskId, task.payload));\n });\n \n expect(scheduler.count()).toBe(tasksToRun.length);\n\n await scheduler.waitAll();\n\n expect(scheduler.count()).toBe(0);\n\n const taskMonitor = { remaining: tasksToRun.length };\n workhorse.subscribe(Subscriptions.TaskMonitor.Updated, (monitor) => {\n taskMonitor.remaining = monitor.remaining;\n });\n\n while (taskMonitor.remaining !== 0) {\n await workhorse.poll();\n }\n const status = await workhorse.getStatus();\n expect(status).toEqual({ queued: 0, failed: 0, executing: 0, successful: tasksToRun.length});\n // We do this because since we transforms the payload of each task to JSON there's\n // a small chance that when parsed it will differ from the original \n // (eg JSON.parse(JSON.stringify({\"\": -0})) !== JSON.parse(JSON.stringify({\"\": 0})))\n expect(JSON.stringify(taskResults)).toEqual(JSON.stringify(tasksToRun));\n }\n ),\n { verbose: 2, numRuns: 500 }\n );\n }\n )", "language": "typescript", "source_file": "./repos/hyrfilm/workhorse/test/workhorse.test.ts", "start_line": null, "end_line": null, "dependencies": ["executorStrategies"], "repo": {"name": "hyrfilm/workhorse", "url": "https://github.com/hyrfilm/workhorse.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Enqueuing and processing 0-1000 tasks with manual polling should result in all tasks being successfully executed with correct task status and payload integrity across different execution strategies and concurrency levels.", "mode": "fast-check"} {"id": 56209, "name": "unknown", "code": "test('Tasks are processed atomically in the order they were added (high concurrency)', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.scheduler(),\n\n fc.uniqueArray(fc.nat(), { minLength: 1, maxLength: 36 }),\n fc.integer({ min: 20, max: 100 }),\n async (scheduler, taskIds, concurrency) => {\n const executedTasks: string[] = [];\n const runTaskPromises: Promise[] = [];\n const expectedIds = [...taskIds].map((id) => `${id}`);\n\n // Wrap `runTask` with scheduler and promise tracking\n const runTask = async (taskId: string, _payload: Payload): Promise => {\n const taskPromise = scheduler.schedule(\n new Promise((resolve) => {\n executedTasks.push(taskId);\n resolve(undefined);\n })\n );\n runTaskPromises.push(taskPromise); // Track each task's promise\n return await taskPromise;\n };\n\n const workhorse = await createWorkhorseFixture(runTask, { concurrency });\n\n // Queue tasks\n const queuePromises = taskIds.map((id) =>\n scheduler.schedule(workhorse.queue(`${id}`, {}))\n );\n await scheduler.waitFor(Promise.all(queuePromises));\n\n // Poll tasks\n const pollPromises = Array.from({ length: taskIds.length }, () =>\n scheduler.schedule(workhorse.poll())\n );\n await scheduler.waitFor(Promise.all(pollPromises));\n\n // Wait for all `runTask` promises\n await scheduler.waitFor(Promise.all(runTaskPromises));\n\n //console.log('expected: ', [...expectedIds]);\n //console.log('actual: ', [...executedTasks]);\n // Validate the results\n expect(expectedIds).toEqual(executedTasks);\n }\n ),\n { verbose: 2, numRuns: 100 }\n );\n })", "language": "typescript", "source_file": "./repos/hyrfilm/workhorse/test/fuzzing.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hyrfilm/workhorse", "url": "https://github.com/hyrfilm/workhorse.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Tasks should be executed atomically in the exact order they were added, even under high concurrency.", "mode": "fast-check"} {"id": 56210, "name": "unknown", "code": "test('Tasks are processed atomically in the order they were added (low concurrency)', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.scheduler(),\n\n fc.uniqueArray(fc.nat(), { minLength: 1, maxLength: 100 }),\n fc.integer({ min: 1, max: 10 }),\n async (scheduler, taskIds, concurrency) => {\n const expectedIds = [...taskIds].map((id) => `${id}`);\n const actualIds: string[] = [];\n\n // Wrap `runTask` with scheduler and promise tracking\n const runTask = async (taskId: string, _payload: Payload): Promise => {\n actualIds.push(taskId);\n return Promise.resolve(undefined);\n };\n\n // Create the workhorse instance\n const workhorse = await createWorkhorseFixture(runTask, {\n concurrency,\n plugins: [new TaskMonitor()],\n });\n\n const status = { remaining: taskIds.length };\n workhorse.subscribe(Subscriptions.TaskMonitor.Updated, ({ remaining }) => {\n status.remaining = remaining;\n });\n\n const addTasksSequence = expectedIds.map((taskId) => () => workhorse.queue(taskId, {}));\n scheduler.scheduleSequence(addTasksSequence);\n\n await scheduler.waitAll();\n\n while (status.remaining > 0) {\n await workhorse.poll();\n }\n\n const expectedStatus = { queued: 0, executing: 0, successful: taskIds.length, failed: 0 };\n const finalStatus = await workhorse.getStatus();\n\n expect(expectedStatus).toEqual(finalStatus);\n expect(expectedIds).toEqual(actualIds);\n }\n ),\n { verbose: 2, numRuns: 100 }\n );\n })", "language": "typescript", "source_file": "./repos/hyrfilm/workhorse/test/fuzzing.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hyrfilm/workhorse", "url": "https://github.com/hyrfilm/workhorse.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Tasks should be processed atomically and in the order they were added, even under low concurrency conditions.", "mode": "fast-check"} {"id": 56211, "name": "unknown", "code": "it('Fuzzing - tasks are processed atomically with retries until all succeed', async () => {\n // Helper to create a deterministic task runner using an infinite stream of probabilities\n const createTaskFunction = (taskProbStream: IterableIterator) => {\n const executedTaskSet = new Set();\n return async (taskId: string, _payload: Payload): Promise => {\n // Use the next value from the probability stream\n const taskFailureProb = taskProbStream.next().value * 1.0;\n const currentFailureProb = taskProbStream.next().value * 2.0; // make the task have a slight bias towards success\n const shouldFail = taskFailureProb > currentFailureProb; // Fail if probability is lower\n if (shouldFail) {\n //console.log(`${taskId}`, 'failure: ', taskFailureProb, currentFailureProb);\n throw new Error(`Task ${taskId} failed`);\n } else {\n if (executedTaskSet.has(taskId)) {\n //console.log(`Task ${taskId} has already been executed`);\n throw new Error(`Task ${taskId} has already been executed`);\n }\n\n //console.log(`${taskId}`, 'succcess: ', taskFailureProb, currentFailureProb);\n }\n executedTaskSet.add(taskId);\n return Promise.resolve(undefined);\n };\n };\n\n await fc.assert(\n fc.asyncProperty(\n fc.uniqueArray(fc.uuid(), { minLength: 1, maxLength: 36 }), // Unique task IDs\n fc.noShrink(fc.infiniteStream(fc.integer({ min: 0, max: 100 }))), // Infinite stream of probabilities\n fc.integer({ min: 30, max: 30 }), // Concurrency level\n async (taskIds, probabilityStream, concurrency) => {\n const totalTasks = taskIds.map((id) => id);\n const runTask = createTaskFunction(probabilityStream);\n\n const workhorse = await createWorkhorseFixture(runTask, {\n concurrency,\n taskExecution: TaskExecutorStrategy.DETACHED,\n });\n\n // Queue tasks\n const queuePromises = taskIds.map((id) => workhorse.queue(id, {}));\n await Promise.all(queuePromises);\n\n // Poll until all tasks succeed\n let done = false;\n while (!done) {\n await workhorse.poll();\n //console.log('Done polling');\n // Check the task queue status\n //console.log('Check status');\n const status = await workhorse.getStatus();\n //console.log('Status ', status);\n if (status.successful === totalTasks.length) {\n done = true;\n }\n //console.log('Done check status');\n if (status.failed > 0) {\n //console.log('*** requeuing')\n await workhorse.requeue();\n //const status = await workhorse.getStatus();\n //console.log('Status ', status);\n }\n }\n\n // Ensure all tasks were executed successfully\n expect(totalTasks.length).toBe((await workhorse.getStatus()).successful);\n }\n ),\n { verbose: 2, numRuns: 100 }\n );\n })", "language": "typescript", "source_file": "./repos/hyrfilm/workhorse/test/fuzzing.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hyrfilm/workhorse", "url": "https://github.com/hyrfilm/workhorse.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Tasks should be processed atomically with retries until all succeed, ensuring progress despite failures.", "mode": "fast-check"} {"id": 56212, "name": "unknown", "code": "test.concurrent('Fuzzing - start/stop', { timeout: seconds(30) }, async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.uniqueArray(fc.uuid(), { minLength: 1, maxLength: 10 }),\n fc.infiniteStream(fc.boolean()),\n fc.integer({ min: 1, max: 10 }),\n async (taskIds: string[], coinToss: Stream, concurrency: number) => {\n const executedTasks: string[] = [];\n const expectedIds = [...taskIds].map((id) => id);\n\n const runTask = (taskId: string, _payload: Payload): Promise => {\n executedTasks.push(taskId);\n return new Promise((resolve) => {\n resolve(undefined);\n });\n };\n\n const options = defaultOptions();\n options.concurrency = concurrency;\n options.taskExecution = TaskExecutorStrategy.PARALLEL;\n options.poll.auto = true;\n options.poll.interval = millisec(1);\n const workhorse = await createWorkhorseFixture(runTask, options);\n\n // Queue tasks\n for (const taskId of taskIds) {\n await workhorse.queue(taskId, {});\n }\n\n // Randomly start/stop poller\n for (const result of coinToss) {\n if (result) {\n workhorse.startPoller();\n } else {\n workhorse.stopPoller();\n }\n\n const status = await workhorse.getStatus();\n if (status.queued === 0 && status.executing === 0) {\n break;\n }\n //console.log(status);\n }\n // TODO: Should workhorse.shutdown() be removed as part of the interface?\n // TODO: Only reason to keep it would be: freeing resources & removing db entirely?\n const finalStatus = await workhorse.getStatus();\n\n expect(finalStatus).toEqual({\n queued: 0,\n executing: 0,\n successful: taskIds.length,\n failed: 0,\n });\n\n // Ensure all tasks executed successfully\n expect(executedTasks).toEqual(expectedIds);\n }\n ),\n { verbose: 2, numRuns: 100 }\n );\n })", "language": "typescript", "source_file": "./repos/hyrfilm/workhorse/test/fuzzing.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hyrfilm/workhorse", "url": "https://github.com/hyrfilm/workhorse.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures that when tasks are queued and a poller randomly starts and stops, all tasks are executed successfully, and the final status reflects zero queued, executing, and failed tasks, with all tasks marked as successful.", "mode": "fast-check"} {"id": 56213, "name": "unknown", "code": "test.concurrent('workhorse.run', { timeout: seconds(30) }, async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.scheduler(), // param 1 = scheduler\n fc.integer({ min: 1, max: 10 }), // param 2 = concurrency\n fc.integer({ min: 1, max: 50 }), // param 3 = poll interval\n async (scheduler: Scheduler, concurrency: number, sleep) => {\n //console.time('startup');\n const runTask = async (_taskId: string, payload: Payload): Promise => {\n return Promise.resolve(payload);\n };\n const config = defaultOptions();\n config.concurrency = concurrency;\n config.poll.interval = millisec(sleep);\n const workhorse = await createWorkhorseFixture(runTask);\n workhorse.startPoller();\n\n const expectedResults = [\n { taskId: 'task-1' },\n { taskId: 'task-2' },\n { taskId: 'task-3' },\n ];\n const taskIds = ['task-1', 'task-2', 'task-3'];\n const promises = [];\n\n // Note: The current workhorse.run() implementation is quite slow,\n // and you're almost always better of using workhorse.queue()\n // workhorse.run() is only useful when you need to await the return value of the task\n for (const taskId of taskIds) {\n promises.push(scheduler.schedule(workhorse.run(taskId, { taskId })));\n }\n //console.timeEnd('startup');\n //console.time('waiting')\n const actualResults = await scheduler.waitFor(Promise.all(promises));\n //console.timeEnd('waiting');\n expect(actualResults).toEqual(expectedResults);\n }\n ),\n { verbose: 2, numRuns: 20 }\n );\n })", "language": "typescript", "source_file": "./repos/hyrfilm/workhorse/test/fuzzing.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hyrfilm/workhorse", "url": "https://github.com/hyrfilm/workhorse.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`workhorse.run` should return expected results for tasks when executed with varying concurrency and polling intervals using a scheduler.", "mode": "fast-check"} {"id": 56214, "name": "unknown", "code": "it('Timestamp to DateTime', async () => {\n const dateTimeContract = await loadFixture(fixture)\n\n await fc.assert(\n fc.asyncProperty(\n fc.integer().filter((x) => x >= 0),\n async (timestamp) => {\n const dateTime = await dateTimeContract.timestampToDateTime(timestamp)\n const date = new Date(timestamp * 1_000)\n\n expect(dateTime.year.toNumber()).equal(date.getUTCFullYear())\n expect(dateTime.month.toNumber()).equal(date.getUTCMonth() + 1)\n expect(dateTime.day.toNumber()).equal(date.getUTCDate())\n expect(dateTime.hour.toNumber()).equal(date.getUTCHours())\n expect(dateTime.minute.toNumber()).equal(date.getUTCMinutes())\n expect(dateTime.second.toNumber()).equal(date.getUTCSeconds())\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/ZhangZhuoSJTU/Web3Bugs/contracts/96/Timeswap/Convenience/test/convenience/libraries/DateTime.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "ZhangZhuoSJTU/Web3Bugs", "url": "https://github.com/ZhangZhuoSJTU/Web3Bugs.git", "license": "MIT", "stars": 1664, "forks": 219}, "metrics": null, "summary": "Converting a positive integer timestamp to a DateTime object should match the equivalent UTC date and time components.", "mode": "fast-check"} {"id": 56215, "name": "unknown", "code": "it('Timestamp to DateTime', async () => {\n const dateTimeContract = await loadFixture(fixture)\n\n await fc.assert(\n fc.asyncProperty(\n fc.integer().filter((x) => x >= 0),\n async (timestamp) => {\n const dateTime = await dateTimeContract.timestampToDateTime(timestamp)\n const date = new Date(timestamp * 1_000)\n\n expect(dateTime.year.toNumber()).equal(date.getUTCFullYear())\n expect(dateTime.month.toNumber()).equal(date.getUTCMonth() + 1)\n expect(dateTime.day.toNumber()).equal(date.getUTCDate())\n expect(dateTime.hour.toNumber()).equal(date.getUTCHours())\n expect(dateTime.minute.toNumber()).equal(date.getUTCMinutes())\n expect(dateTime.second.toNumber()).equal(date.getUTCSeconds())\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/ZhangZhuoSJTU/Web3Bugs/contracts/74/Timeswap/Timeswap-V1-Convenience/test/convenience/libraries/DateTime.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "ZhangZhuoSJTU/Web3Bugs", "url": "https://github.com/ZhangZhuoSJTU/Web3Bugs.git", "license": "MIT", "stars": 1664, "forks": 219}, "metrics": null, "summary": "The `timestampToDateTime` function should correctly convert a non-negative integer timestamp to its equivalent UTC `DateTime` components (year, month, day, hour, minute, second).", "mode": "fast-check"} {"id": 56216, "name": "unknown", "code": "it(\"should convert Text to a string\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(text, toStringDefinition));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/text.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Converting `Text` to a string maintains the expected properties defined in `toStringDefinition`.", "mode": "fast-check"} {"id": 56217, "name": "unknown", "code": "it(\"should preserve identity morphisms\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(task(fc.anything(), fc.anything()), mapIdentity),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that identity morphisms are preserved for tasks generated with arbitrary inputs.", "mode": "fast-check"} {"id": 56218, "name": "unknown", "code": "it(\"should preserve identity morphisms\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(task(fc.anything(), fc.anything()), mapOkayIdentity),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test verifies that identity morphisms are preserved within asynchronous tasks.", "mode": "fast-check"} {"id": 56219, "name": "unknown", "code": "it(\"should preserve identity morphisms\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(task(fc.anything(), fc.anything()), mapFailIdentity),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Identity morphisms should be preserved in the context of tasks with any input.", "mode": "fast-check"} {"id": 56220, "name": "unknown", "code": "it(\"should agree with map\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n task(fc.anything(), fc.anything()),\n fc.anything(),\n fc.anything(),\n replaceDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property being tested checks that the `task` function behaves consistently with `map`, using varied inputs and the `replaceDefinition` function.", "mode": "fast-check"} {"id": 56221, "name": "unknown", "code": "it(\"should agree with mapOkay\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n task(fc.anything(), fc.anything()),\n fc.anything(),\n replaceOkayDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The properties of tasks should be consistent with `replaceOkayDefinition` when using `mapOkay` with any generated values.", "mode": "fast-check"} {"id": 56222, "name": "unknown", "code": "it(\"should agree with mapFail\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n task(fc.anything(), fc.anything()),\n fc.anything(),\n replaceFailDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that a function behaves consistently with the `mapFail` function using various input tasks and parameters.", "mode": "fast-check"} {"id": 56223, "name": "unknown", "code": "it(\"should have a left identity\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(task(fc.anything(), fc.anything()), andLeftIdentity),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that the `andLeftIdentity` property holds for tasks created with arbitrary inputs.", "mode": "fast-check"} {"id": 56224, "name": "unknown", "code": "it(\"should have a right identity\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(task(fc.anything(), fc.anything()), andRightIdentity),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures that applying the right identity function to a task does not alter the task's result.", "mode": "fast-check"} {"id": 56225, "name": "unknown", "code": "it(\"should be associative\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n task(fc.anything(), fc.anything()),\n task(fc.anything(), fc.anything()),\n task(fc.anything(), fc.anything()),\n andAssociativity,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property validates that the `andAssociativity` function maintains associativity across multiple `task` combinations with arbitrary results.", "mode": "fast-check"} {"id": 56226, "name": "unknown", "code": "it(\"should have a left annihilator\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n task(fc.anything(), fc.anything()),\n andLeftAnnihilation,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that the `andLeftAnnihilation` property holds for tasks generated with any values, ensuring they exhibit a left annihilator behavior.", "mode": "fast-check"} {"id": 56227, "name": "unknown", "code": "it(\"should agree with and\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n task(fc.anything(), fc.anything()),\n task(fc.anything(), fc.anything()),\n andThenDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The agreement between two tasks and the `andThenDefinition` should hold consistently.", "mode": "fast-check"} {"id": 56228, "name": "unknown", "code": "it(\"should agree with and\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n task(fc.anything(), fc.anything()),\n task(fc.anything(), fc.anything()),\n andWhenDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that the combination of two tasks with `andWhenDefinition` behaves consistently with expected results.", "mode": "fast-check"} {"id": 56229, "name": "unknown", "code": "it(\"should have a left identity\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(task(fc.anything(), fc.anything()), orLeftIdentity),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that a task constructed with any value satisfies the left identity property with `orLeftIdentity`.", "mode": "fast-check"} {"id": 56230, "name": "unknown", "code": "it(\"should have a right identity\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(task(fc.anything(), fc.anything()), orRightIdentity),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property checks that a task satisfies the right identity law using the `orRightIdentity` function.", "mode": "fast-check"} {"id": 56231, "name": "unknown", "code": "it(\"should be associative\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n task(fc.anything(), fc.anything()),\n task(fc.anything(), fc.anything()),\n task(fc.anything(), fc.anything()),\n orAssociativity,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property checks that the `orAssociativity` function maintains associativity for tasks created with any values.", "mode": "fast-check"} {"id": 56232, "name": "unknown", "code": "it(\"should have a left annihilator\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n task(fc.anything(), fc.anything()),\n orLeftAnnihilation,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that an unspecified operation or behavior exhibits a left annihilator property across various tasks.", "mode": "fast-check"} {"id": 56233, "name": "unknown", "code": "it(\"should agree with or\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n task(fc.anything(), fc.anything()),\n task(fc.anything(), fc.anything()),\n orElseDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that the behavior of combining tasks with the `orElseDefinition` function is consistent with the logical \"or\" operation.", "mode": "fast-check"} {"id": 56234, "name": "unknown", "code": "it(\"should agree with or\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n task(fc.anything(), fc.anything()),\n task(fc.anything(), fc.anything()),\n orErstDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks if `orErstDefinition` aligns with the behavior of two tasks processed by `task`.", "mode": "fast-check"} {"id": 56235, "name": "unknown", "code": "it(\"should have a left okay identity\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n fc.anything(),\n fc.func(task(fc.anything(), fc.anything())),\n flatMapLeftIdentityOkay,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Verifies the left identity property using a task function and an async computation.", "mode": "fast-check"} {"id": 56236, "name": "unknown", "code": "it(\"should have a left fail identity\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n fc.anything(),\n fc.func(task(fc.anything(), fc.anything())),\n flatMapLeftIdentityFail,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Verifies that the property of having a left fail identity holds for operations involving tasks and functions over arbitrary inputs.", "mode": "fast-check"} {"id": 56237, "name": "unknown", "code": "it(\"should have a right okay identity and a right fail identity\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n task(fc.anything(), fc.anything()),\n flatMapRightIdentity,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function verifies the right identity property for tasks by checking both successful and failing conditions using `flatMapRightIdentity`.", "mode": "fast-check"} {"id": 56238, "name": "unknown", "code": "it(\"should be associative\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n task(fc.anything(), fc.anything()),\n fc.func(task(fc.anything(), fc.anything())),\n fc.func(task(fc.anything(), fc.anything())),\n fc.func(task(fc.anything(), fc.anything())),\n fc.func(task(fc.anything(), fc.anything())),\n flatMapAssociativity,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Associativity is tested by verifying that the order of applying transformations, defined by a series of functions on tasks, does not affect the final result.", "mode": "fast-check"} {"id": 56239, "name": "unknown", "code": "it(\"should agree with flatMap\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n task(fc.anything(), fc.anything()),\n fc.func(task(fc.anything(), fc.anything())),\n flatMapOkayDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The result from applying `flatMap` on tasks should be consistent with a defined specification.", "mode": "fast-check"} {"id": 56240, "name": "unknown", "code": "it(\"should agree with flatMap\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n task(fc.anything(), fc.anything()),\n fc.func(task(fc.anything(), fc.anything())),\n flatMapFailDefnition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test verifies that a task function composed with `flatMap` behaves consistently with the `flatMapFailDefinition`.", "mode": "fast-check"} {"id": 56241, "name": "unknown", "code": "it(\"should agree with flatMap\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n task(\n task(fc.anything(), fc.anything()),\n task(fc.anything(), fc.anything()),\n ),\n flattenDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property being tested is whether a task operation agrees with the behavior of `flatMap`, following the provided `flattenDefinition`.", "mode": "fast-check"} {"id": 56242, "name": "unknown", "code": "it(\"should agree with flatMapOkay\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n task(task(fc.anything(), fc.anything()), fc.anything()),\n flattenOkayDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should hold when using a task with `flattenOkayDefinition`, ensuring it behaves consistently with `flatMapOkay` across diverse inputs.", "mode": "fast-check"} {"id": 56243, "name": "unknown", "code": "it(\"should agree with flatMapFail\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n task(fc.anything(), task(fc.anything(), fc.anything())),\n flattenFailDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that the behavior of a task operation is consistent with `flatMapFail` across randomized task inputs.", "mode": "fast-check"} {"id": 56244, "name": "unknown", "code": "it(\"should be equivalent to multiple flatMap calls\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n task(fc.integer({ min: 1 }), fc.integer({ min: 1 })),\n fc.constant((n: number) => Task.okay(collatz(n))),\n fc.constant((n: number) => Task.fail(collatz(n))),\n flatMapUntilEquivalence,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Multiple `flatMap` calls should produce equivalent results in the context of tasks with `Task.okay` and `Task.fail` transformations, ensuring consistency across transformations applied until a certain equivalence is reached.", "mode": "fast-check"} {"id": 60395, "name": "unknown", "code": "it(\"should fail to cast non-number arrays\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(\n fc.array(\n fc.anything().filter((input) => typeof input !== \"number\"),\n { minLength: 1 }\n ),\n (input) => {\n expect(castNums(input)).toStrictEqual({\n status: \"failure\",\n expected: \"array\",\n items: input.map((actual) => ({\n status: \"failure\",\n expected: \"number\",\n actual\n })),\n actual: input\n });\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Casting non-number arrays should result in a failure status with details about each non-number item.", "mode": "fast-check"} {"id": 56245, "name": "unknown", "code": "it(\"should be equivalent to multiple flatMapOkay calls\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n task(fc.integer({ min: 1 }), fc.anything()),\n fc.constant((n: number) => Task.okay(collatz(n))),\n flatMapOkayUntilEquivalence,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures that a task sequence processed with `flatMapOkayUntilEquivalence` is equivalent to multiple calls to `flatMapOkay`.", "mode": "fast-check"} {"id": 56246, "name": "unknown", "code": "it(\"should be equivalent to multiple flatMapFail calls\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n task(fc.anything(), fc.integer({ min: 1 })),\n fc.constant((n: number) => Task.fail(collatz(n))),\n flatMapFailUntilEquivalence,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`flatMapFailUntilEquivalence` should consistently produce results equivalent to multiple calls of `flatMapFail`.", "mode": "fast-check"} {"id": 56247, "name": "unknown", "code": "it(\"should be its own inverse\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(task(fc.anything(), fc.anything()), commuteInverse),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "A task applied twice with a function should return the original value (commutative inverse property).", "mode": "fast-check"} {"id": 56248, "name": "unknown", "code": "it(\"should agree with effect\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n task(fc.anything(), fc.anything()),\n fc.func(fc.anything()),\n effectMapDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that the behavior of a `task` function with arbitrary inputs and a random function aligns with the `effectMapDefinition`.", "mode": "fast-check"} {"id": 56249, "name": "unknown", "code": "it(\"should be equivalent to multiple flatMap calls\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n task(fc.integer({ min: 1 }), fc.anything()),\n fc.constant(isPowerOfTwo),\n fc.constant((n: number) => Task.okay(hotpo(n))),\n fc.func(task(fc.anything(), fc.anything())),\n fromGeneratorEquivalence,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that a series of `flatMap` calls applied to tasks is equivalent under different functional transformations and conditions.", "mode": "fast-check"} {"id": 56250, "name": "unknown", "code": "it(\"should throw the value when the generator yields Task.fail\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n task(fc.anything(), fc.anything()),\n task(fc.anything(), fc.anything()),\n fromGeneratorThrow,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that when a generator yields `Task.fail`, the value is thrown.", "mode": "fast-check"} {"id": 56251, "name": "unknown", "code": "it(\"should return Fail when the generator throws an Exception\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n result(fc.anything(), fc.anything()),\n fc.anything(),\n fromGeneratorCatch,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should result in \"Fail\" when `fromGeneratorCatch` executes a generator that throws an exception.", "mode": "fast-check"} {"id": 56252, "name": "unknown", "code": "it(\"should return Okay when the generator returns\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n result(fc.anything(), fc.anything()),\n fc.anything(),\n fromGeneratorReturn,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `fromGeneratorReturn` should return `Okay` when the associated generator completes, across a variety of input values.", "mode": "fast-check"} {"id": 56253, "name": "unknown", "code": "it(\"should be associative\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(value, value, value, appendAssociativity));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/semigroup.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property verifies that the `appendAssociativity` function maintains associativity for the `value` type.", "mode": "fast-check"} {"id": 56255, "name": "unknown", "code": "it(\"should convert Fail to a string\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(fc.anything(), toStringFail));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`toStringFail` should correctly convert any input into a string representation of `Fail`.", "mode": "fast-check"} {"id": 56256, "name": "unknown", "code": "it(\"should fold the Result\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), fc.anything()),\n fc.func(fc.anything()),\n fc.func(fc.anything()),\n foldEquivalence,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property validates that folding a `Result` using two arbitrary functions maintains equivalence as defined by `foldEquivalence`.", "mode": "fast-check"} {"id": 56258, "name": "unknown", "code": "it(\"should preserve identity morphisms\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(result(fc.anything(), fc.anything()), mapOkayIdentity),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`mapOkayIdentity` ensures identity morphisms are preserved when applied to result structures.", "mode": "fast-check"} {"id": 56259, "name": "unknown", "code": "it(\"should preserve identity morphisms\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(result(fc.anything(), fc.anything()), mapFailIdentity),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Identity morphisms in `result` should remain unchanged when `mapFailIdentity` is applied.", "mode": "fast-check"} {"id": 56260, "name": "unknown", "code": "it(\"should agree with map\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), fc.anything()),\n fc.anything(),\n fc.anything(),\n replaceDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks if a certain property relating to a custom `result` type operation is consistent with the behavior of a map operation.", "mode": "fast-check"} {"id": 56261, "name": "unknown", "code": "it(\"should agree with mapOkay\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), fc.anything()),\n fc.anything(),\n replaceOkayDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that the `result` function behaves consistently with `mapOkay` when given arbitrary inputs and the `replaceOkayDefinition`.", "mode": "fast-check"} {"id": 56262, "name": "unknown", "code": "it(\"should agree with mapFail\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), fc.anything()),\n fc.anything(),\n replaceFailDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should hold that the result agrees with `mapFail` when given any value and a `replaceFailDefinition`.", "mode": "fast-check"} {"id": 56263, "name": "unknown", "code": "it(\"should have a left identity\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(result(fc.anything(), fc.anything()), andLeftIdentity),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`andLeftIdentity` maintains the left identity property for `result` function across various inputs.", "mode": "fast-check"} {"id": 56264, "name": "unknown", "code": "it(\"should have a right identity\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(result(fc.anything(), fc.anything()), andRightIdentity),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property checks that applying the `andRightIdentity` function to any generated `result` maintains a right identity.", "mode": "fast-check"} {"id": 56265, "name": "unknown", "code": "it(\"should be associative\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), fc.anything()),\n result(fc.anything(), fc.anything()),\n result(fc.anything(), fc.anything()),\n andAssociativity,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`andAssociativity` should hold true for any three `result` instances created from arbitrary values.", "mode": "fast-check"} {"id": 56266, "name": "unknown", "code": "it(\"should have a left annihilator\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(result(fc.anything(), fc.anything()), andLeftAnnihilation),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`andLeftAnnihilation` confirms that applying the operation with a left annihilator on any input results in the annihilator itself.", "mode": "fast-check"} {"id": 56267, "name": "unknown", "code": "it(\"should agree with and\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), fc.anything()),\n result(fc.anything(), fc.anything()),\n andThenDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test verifies that the behavior of combining two `result` values using `andThenDefinition` is consistent with a logical `and` operation.", "mode": "fast-check"} {"id": 56268, "name": "unknown", "code": "it(\"should agree with and\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), fc.anything()),\n result(fc.anything(), fc.anything()),\n andWhenDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that two result instances, combined with a function or condition (`andWhenDefinition`), are in agreement with logical conjunction behavior.", "mode": "fast-check"} {"id": 56269, "name": "unknown", "code": "it(\"should have a left identity\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(result(fc.anything(), fc.anything()), orLeftIdentity),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `orLeftIdentity` function should satisfy the left identity property for any generated result.", "mode": "fast-check"} {"id": 56270, "name": "unknown", "code": "it(\"should have a right identity\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(result(fc.anything(), fc.anything()), orRightIdentity),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`orRightIdentity` function should maintain the right identity property for any `result` containing arbitrary values.", "mode": "fast-check"} {"id": 56271, "name": "unknown", "code": "it(\"should be associative\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), fc.anything()),\n result(fc.anything(), fc.anything()),\n result(fc.anything(), fc.anything()),\n orAssociativity,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`orAssociativity` holds for three `result` objects with arbitrary values.", "mode": "fast-check"} {"id": 60393, "name": "unknown", "code": "it(\"should fail to cast non-undefined\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(\n fc.anything().filter((input) => typeof input !== \"undefined\"),\n (input) => {\n expect(castUndefined(input)).toStrictEqual({\n status: \"failure\",\n expected: \"undefined\",\n actual: input\n });\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Casting a non-undefined value with `castUndefined` should return a failure status, indicating the expected type was \"undefined.\"", "mode": "fast-check"} {"id": 56272, "name": "unknown", "code": "it(\"should have a left annihilator\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(result(fc.anything(), fc.anything()), orLeftAnnihilation),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `orLeftAnnihilation` property should hold for the `result` function applied to any two values, verifying the left annihilator property.", "mode": "fast-check"} {"id": 56273, "name": "unknown", "code": "it(\"should agree with or\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), fc.anything()),\n result(fc.anything(), fc.anything()),\n orElseDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures that two `result` values agree with the `orElseDefinition`.", "mode": "fast-check"} {"id": 56274, "name": "unknown", "code": "it(\"should agree with or\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), fc.anything()),\n result(fc.anything(), fc.anything()),\n orErstDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that the behavior of certain combinations of `result` values matches the expected behavior defined by `orErstDefinition`.", "mode": "fast-check"} {"id": 56275, "name": "unknown", "code": "it(\"should have a left okay identity\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n fc.anything(),\n fc.func(result(fc.anything(), fc.anything())),\n flatMapLeftIdentityOkay,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property verifies that applying `flatMapLeftIdentityOkay` with any value and a function on a `result` type maintains the left identity.", "mode": "fast-check"} {"id": 56276, "name": "unknown", "code": "it(\"should have a left fail identity\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n fc.anything(),\n fc.func(result(fc.anything(), fc.anything())),\n flatMapLeftIdentityFail,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures that applying `flatMapLeftIdentityFail` maintains the identity when a failure is on the left.", "mode": "fast-check"} {"id": 56277, "name": "unknown", "code": "it(\"should have a right okay and a right fail identity\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(result(fc.anything(), fc.anything()), flatMapRightIdentity),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property checks that the `flatMapRightIdentity` function maintains the right identity on result objects for various inputs.", "mode": "fast-check"} {"id": 56278, "name": "unknown", "code": "it(\"should be associative\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), fc.anything()),\n fc.func(result(fc.anything(), fc.anything())),\n fc.func(result(fc.anything(), fc.anything())),\n fc.func(result(fc.anything(), fc.anything())),\n fc.func(result(fc.anything(), fc.anything())),\n flatMapAssociativity,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The associativity property holds for operations involving `result` using functions generated by `flatMapAssociativity`.", "mode": "fast-check"} {"id": 56280, "name": "unknown", "code": "it(\"should agree with flatMap\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), fc.anything()),\n fc.func(result(fc.anything(), fc.anything())),\n flatMapFailDefnition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `flatMapFailDefnition` should produce outcomes consistent with applying `flatMap` to results generated from arbitrary values and functions.", "mode": "fast-check"} {"id": 56281, "name": "unknown", "code": "it(\"should agree with flatMapOkay\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(result(fc.anything(), fc.anything()), fc.anything()),\n flattenOkayDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`flattenOkayDefinition` should produce results that agree with the `flatMapOkay` operation on nested results.", "mode": "fast-check"} {"id": 56282, "name": "unknown", "code": "it(\"should agree with flatMapFail\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), result(fc.anything(), fc.anything())),\n flattenFailDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property asserts agreement between `flatMapFail` and `flattenFailDefinition` when applied to generated result structures.", "mode": "fast-check"} {"id": 56283, "name": "unknown", "code": "it(\"should be equivalent to multiple flatMap calls\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.integer({ min: 1 }), fc.integer({ min: 1 })),\n fc.constant((n: number) => new Okay(collatz(n))),\n fc.constant((n: number) => new Fail(collatz(n))),\n flatMapUntilEquivalence,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The operation should be equivalent to applying multiple `flatMap` calls on a result with a minimum integer constraint.", "mode": "fast-check"} {"id": 56287, "name": "unknown", "code": "it(\"should agree with isSomeAnd\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), fc.anything()),\n fc.func(fc.boolean()),\n isOkayAndDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that a property holds true when comparing results processed by `isSomeAnd` and the `isOkayAndDefinition` function, using random data and boolean functions.", "mode": "fast-check"} {"id": 56290, "name": "unknown", "code": "it(\"should agree with isNoneOr\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), fc.anything()),\n fc.func(fc.boolean()),\n isFailOrDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should ensure that behavior aligns with the `isNoneOr` function when tested with results from `fc.anything()` and a predicate function returning a boolean.", "mode": "fast-check"} {"id": 56296, "name": "unknown", "code": "it(\"should agree with unzipWith\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), fc.anything()),\n fc.func(pair(fc.anything(), fc.anything())),\n unzipWithOkayDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The output from using `result` with arbitrary inputs and a function should match the output from `unzipWithOkayDefinition`.", "mode": "fast-check"} {"id": 56300, "name": "unknown", "code": "it(\"should agree with unzipWith\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), pair(fc.anything(), fc.anything())),\n unzipFailDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property checks that the `unzipFailDefinition` function consistently agrees with the behavior of `unzipWith` for various input pairs.", "mode": "fast-check"} {"id": 56316, "name": "unknown", "code": "it(\"should be the inverse of associateLeft\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), result(fc.anything(), fc.anything())),\n associateRightInverse,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`associateRightInverse` applied to a result is the inverse of `associateLeft`.", "mode": "fast-check"} {"id": 56320, "name": "unknown", "code": "it(\"should agree with gatherMapOkay\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n result(fc.anything(), fc.anything()),\n fc.func(task(fc.anything(), fc.anything())),\n groupMapLeftDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function being tested should be consistent with `gatherMapOkay` when using combinations of `result`, `task`, and `groupMapLeftDefinition` functions.", "mode": "fast-check"} {"id": 56321, "name": "unknown", "code": "it(\"should agree with gatherMapOkay\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n result(\n task(fc.anything(), fc.anything()),\n task(fc.anything(), fc.anything()),\n ),\n gatherOkayDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test confirms that the `result` function aligns with the behavior defined by `gatherMapOkay` using asynchronous properties.", "mode": "fast-check"} {"id": 56322, "name": "unknown", "code": "it(\"should agree with gatherMapOkay\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n result(task(fc.anything(), fc.anything()), fc.anything()),\n swapFailDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test verifies that the outcome of a `result` function, using varying inputs, aligns with the behavior of `swapFailDefinition`.", "mode": "fast-check"} {"id": 56323, "name": "unknown", "code": "it(\"should agree with gatherMapOkay\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n result(fc.anything(), task(fc.anything(), fc.anything())),\n groupLeftDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function being tested should have consistent behavior with `gatherMapOkay` when applied to generated task results using `groupLeftDefinition`.", "mode": "fast-check"} {"id": 56324, "name": "unknown", "code": "it(\"should agree with gatherMapFail\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n result(fc.anything(), fc.anything()),\n fc.func(task(fc.anything(), fc.anything())),\n swapMapOkayDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should ensure that `swapMapOkayDefinition` behaves consistently when compared against the behavior of `gatherMapFail`.", "mode": "fast-check"} {"id": 56325, "name": "unknown", "code": "it(\"should agree with gatherMapFail\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n result(fc.anything(), fc.anything()),\n fc.func(task(fc.anything(), fc.anything())),\n groupMapRightDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should agree with `gatherMapFail` when comparing outputs using `result`, `func`, and `groupMapRightDefinition` functions.", "mode": "fast-check"} {"id": 56326, "name": "unknown", "code": "it(\"should agree with gatherMapFail\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n result(\n task(fc.anything(), fc.anything()),\n task(fc.anything(), fc.anything()),\n ),\n gatherFailDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `result` should behave consistently with `gatherMapFail` when applied to tasks generated with arbitrary inputs.", "mode": "fast-check"} {"id": 56327, "name": "unknown", "code": "it(\"should agree with gatherMapFail\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n result(fc.anything(), task(fc.anything(), fc.anything())),\n swapOkayDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`gatherMapFail` should produce results that agree with those generated by `swapOkayDefinition` when applied to asynchronous tasks and arbitrary values.", "mode": "fast-check"} {"id": 56328, "name": "unknown", "code": "it(\"should agree with gatherMapFail\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n result(task(fc.anything(), fc.anything()), fc.anything()),\n groupRightDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that the behavior of `result` with various tasks and values is consistent with `groupRightDefinition`.", "mode": "fast-check"} {"id": 56329, "name": "unknown", "code": "it(\"should agree with interchangeMap\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n result(\n task(fc.anything(), fc.anything()),\n task(fc.anything(), fc.anything()),\n ),\n interchangeDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that the `result` function aligns with the `interchangeDefinition` for asynchronous tasks using arbitrary input values.", "mode": "fast-check"} {"id": 56332, "name": "unknown", "code": "it(\"should extract the value from Fail\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(fc.anything(), fc.anything(), extractFailFromFail));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`extractFailFromFail` should consistently extract the value from any given `Fail`.", "mode": "fast-check"} {"id": 56333, "name": "unknown", "code": "it(\"should return the default value for Okay\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(fc.anything(), fc.anything(), extractFailFromOkay));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`extractFailFromOkay` returns the default value for `Okay`.", "mode": "fast-check"} {"id": 56334, "name": "unknown", "code": "it(\"should agree with extractOkay\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), fc.anything()),\n fc.anything(),\n extractMapOkayDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that the `result` function agrees with the behavior defined by `extractMapOkayDefinition`. [I AM UNSURE]", "mode": "fast-check"} {"id": 56335, "name": "unknown", "code": "it(\"should agree with extractFail\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), fc.anything()),\n fc.anything(),\n extractMapFailDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures that the behavior of a function or process is consistent with `extractFail` when applied to results generated from arbitrary values.", "mode": "fast-check"} {"id": 56336, "name": "unknown", "code": "it(\"should agree with Task.okay and Task.fail\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n result(fc.anything(), fc.anything()),\n toTaskEquivalence,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`toTaskEquivalence` ensures that the behavior of a `result` matches `Task.okay` and `Task.fail` across various inputs.", "mode": "fast-check"} {"id": 56337, "name": "unknown", "code": "it(\"should agree with okayValues and failValues\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(result(fc.anything(), fc.anything()), valuesDefinition),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should align the outcomes with `okayValues` and `failValues` based on the `result` function evaluated with arbitrary inputs and `valuesDefinition`.", "mode": "fast-check"} {"id": 56338, "name": "unknown", "code": "it(\"should agree with effect\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), fc.anything()),\n fc.func(fc.anything()),\n effectMapDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures consistency between the `result` function and `effectMapDefinition`.", "mode": "fast-check"} {"id": 56339, "name": "unknown", "code": "it(\"should be equivalent to multiple flatMap calls\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.integer({ min: 1 }), fc.anything()),\n fc.constant(isPowerOfTwo),\n fc.constant((n: number) => new Okay(hotpo(n))),\n fc.func(result(fc.anything(), fc.anything())),\n fromGeneratorEquivalence,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property tests the equivalence between multiple `flatMap` calls and the `fromGeneratorEquivalence` function when applied to a `result` with specific transformations.", "mode": "fast-check"} {"id": 56340, "name": "unknown", "code": "it(\"should throw the value when the generator yields Fail\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), fc.anything()),\n result(fc.anything(), fc.anything()),\n fromGeneratorThrow,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that the `fromGeneratorThrow` function throws an error when the generator yields a `Fail` value.", "mode": "fast-check"} {"id": 56341, "name": "unknown", "code": "it(\"should return Fail when the generator throws an Exception\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), fc.anything()),\n fc.anything(),\n fromGeneratorCatch,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "When the generator throws an exception, `fromGeneratorCatch` should return `Fail`.", "mode": "fast-check"} {"id": 56342, "name": "unknown", "code": "it(\"should agree with Pair.of\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(fc.anything(), fromDefinition));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property verifies that the function `fromDefinition` agrees with `Pair.of` across a wide range of arbitrary inputs.", "mode": "fast-check"} {"id": 56343, "name": "unknown", "code": "it(\"should return a pair of the value and undefined\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(fc.anything(), fstDefinition));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that `fstDefinition` returns a pair consisting of the given value and `undefined` for any input.", "mode": "fast-check"} {"id": 56344, "name": "unknown", "code": "it(\"should return a pair of undefined and the value\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(fc.anything(), sndDefinition));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `sndDefinition` function returns a pair consisting of `undefined` and the provided value.", "mode": "fast-check"} {"id": 56346, "name": "unknown", "code": "it(\"should fold the Pair\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n fc.anything(),\n fc.anything(),\n fc.func(fc.anything()),\n foldEquivalence,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Folding a `Pair` with a function should maintain equivalence as defined by `foldEquivalence`.", "mode": "fast-check"} {"id": 56347, "name": "unknown", "code": "it(\"should preserve identity morphisms\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(pair(fc.anything(), fc.anything()), mapIdentity));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Identity morphisms are preserved in `pair` constructions when mapped through `mapIdentity`.", "mode": "fast-check"} {"id": 60406, "name": "unknown", "code": "it(\"should fail to cast non-objects\", () => {\n expect.assertions(101);\n const property = (input: unknown) => {\n expect(castObject(input)).toStrictEqual({\n status: \"failure\",\n expected: \"object\",\n actual: input\n });\n };\n fc.assert(\n fc.property(\n fc.anything().filter((input) => typeof input !== \"object\"),\n property\n )\n );\n // eslint-disable-next-line unicorn/no-null -- testing null\n property(null);\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Casting non-object inputs should result in a failure status, expecting an object but receiving the actual input type instead.", "mode": "fast-check"} {"id": 56348, "name": "unknown", "code": "it(\"should preserve identity morphisms\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(pair(fc.anything(), fc.anything()), mapFstIdentity),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that applying an identity morphism to the first element of a pair does not alter the pair.", "mode": "fast-check"} {"id": 56349, "name": "unknown", "code": "it(\"should preserve identity morphisms\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(pair(fc.anything(), fc.anything()), mapSndIdentity),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test verifies that applying the identity morphism to the second element of a pair preserves the pair's structure.", "mode": "fast-check"} {"id": 56350, "name": "unknown", "code": "it(\"should agree with mapFst\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(fc.anything(), fc.anything()),\n fc.anything(),\n replaceFstDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures that the behavior of the function under test is consistent with `mapFst`, evaluated over randomly generated pairs and values.", "mode": "fast-check"} {"id": 56351, "name": "unknown", "code": "it(\"should agree with mapSnd\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(fc.anything(), fc.anything()),\n fc.anything(),\n replaceSndDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `replaceSndDefinition` applied to pairs should produce results that align with using `mapSnd`.", "mode": "fast-check"} {"id": 56352, "name": "unknown", "code": "it(\"should have a left identity\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(pair(fc.anything(), fc.anything()), andLeftIdentity),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should demonstrate that `andLeftIdentity` maintains a left identity for pairs of any values.", "mode": "fast-check"} {"id": 56353, "name": "unknown", "code": "it(\"should have a right identity\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(pair(fc.anything(), fc.anything()), andRightIdentity),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property validates that a pair satisfies the right identity condition through the `andRightIdentity` function.", "mode": "fast-check"} {"id": 56354, "name": "unknown", "code": "it(\"should be associative\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(fc.anything(), fc.anything()),\n pair(fc.anything(), fc.anything()),\n pair(fc.anything(), fc.anything()),\n andAssociativity,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Associativity is tested for pairs of arbitrary values by verifying that `andAssociativity` holds true for combinations of three pairs.", "mode": "fast-check"} {"id": 56355, "name": "unknown", "code": "it(\"should have a left identity\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(fc.anything(), text),\n fc.constant(new Text(\"\")),\n andFstLeftIdentity,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property asserts that `andFstLeftIdentity` holds true when pairing any value with an empty `Text`.", "mode": "fast-check"} {"id": 56356, "name": "unknown", "code": "it(\"should have a right identity\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(fc.anything(), text),\n fc.constant(new Text(\"\")),\n andFstRightIdentity,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `andFstRightIdentity` function should maintain the right identity when combining a pair of any value with an empty `Text` object.", "mode": "fast-check"} {"id": 56357, "name": "unknown", "code": "it(\"should be associative\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(fc.anything(), text),\n pair(fc.anything(), text),\n pair(fc.anything(), text),\n andFstAssociativity,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `andFstAssociativity` should hold the associativity property across pairs of elements.", "mode": "fast-check"} {"id": 56358, "name": "unknown", "code": "it(\"should agree with andFst\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(fc.anything(), text),\n pair(fc.anything(), text),\n andThenFstDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures that the behavior of a pair function is consistent with the `andFst` function using arbitrary pairs of values.", "mode": "fast-check"} {"id": 56359, "name": "unknown", "code": "it(\"should agree with andFst\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(fc.anything(), text),\n pair(fc.anything(), text),\n andWhenFstDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test verifies that the behavior of two paired elements agrees with the `andFst` function according to `andWhenFstDefinition`.", "mode": "fast-check"} {"id": 56360, "name": "unknown", "code": "it(\"should have a left identity\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(text, fc.anything()),\n fc.constant(new Text(\"\")),\n andSndLeftIdentity,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`andSndLeftIdentity` function should demonstrate left identity when applied to a pair of text and any value, along with an empty `Text`.", "mode": "fast-check"} {"id": 56361, "name": "unknown", "code": "it(\"should have a right identity\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(text, fc.anything()),\n fc.constant(new Text(\"\")),\n andSndRightIdentity,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that applying `andSndRightIdentity` on a pair with an empty `Text` object as the right element results in the original pair.", "mode": "fast-check"} {"id": 56362, "name": "unknown", "code": "it(\"should be associative\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(text, fc.anything()),\n pair(text, fc.anything()),\n pair(text, fc.anything()),\n andSndAssociativity,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `andSndAssociativity` function should hold associativity for operations on pairs.", "mode": "fast-check"} {"id": 56364, "name": "unknown", "code": "it(\"should agree with andSnd\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(text, fc.anything()),\n pair(text, fc.anything()),\n andWhenSndDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Agreement between two pairs and `andSnd` function based on their definitions holds consistently.", "mode": "fast-check"} {"id": 56365, "name": "unknown", "code": "it(\"should have a left identity\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n fc.anything(),\n fc.constant(new Text(\"\")),\n fc.func(pair(fc.anything(), text)),\n flatMapFstLeftIdentity,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`flatMapFstLeftIdentity` maintains a left identity property with randomly generated inputs of various types, using constant empty text and a function applied to paired elements.", "mode": "fast-check"} {"id": 56366, "name": "unknown", "code": "it(\"should have a right identity\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(fc.anything(), text),\n fc.constant(new Text(\"\")),\n flatMapFstRightIdentity,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `flatMapFstRightIdentity` function should maintain a right identity when combined with a `pair` of any value and a `Text` object.", "mode": "fast-check"} {"id": 56367, "name": "unknown", "code": "it(\"should be associative\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(fc.anything(), text),\n fc.func(pair(fc.anything(), text)),\n fc.func(pair(fc.anything(), text)),\n flatMapFstAssociativity,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures the associativity property holds for a function involving pairs and transformations applied to them.", "mode": "fast-check"} {"id": 56368, "name": "unknown", "code": "it(\"should have a left identity\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n fc.constant(new Text(\"\")),\n fc.anything(),\n fc.func(pair(text, fc.anything())),\n flatMapSndLeftIdentity,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `flatMapSndLeftIdentity` function results in a mapping where the left identity property holds for a `Text` object and any other value.", "mode": "fast-check"} {"id": 56369, "name": "unknown", "code": "it(\"should have a right identity\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(text, fc.anything()),\n fc.constant(new Text(\"\")),\n flatMapSndRightIdentity,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `flatMapSndRightIdentity` applied to a pair with a constant empty `Text` results in preserving the original pair.", "mode": "fast-check"} {"id": 56370, "name": "unknown", "code": "it(\"should be associative\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(text, fc.anything()),\n fc.func(pair(text, fc.anything())),\n fc.func(pair(text, fc.anything())),\n flatMapSndAssociativity,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `flatMapSndAssociativity` applied on pairs and functions should demonstrate associativity.", "mode": "fast-check"} {"id": 56371, "name": "unknown", "code": "it(\"should agree with flatMapFst\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(pair(fc.anything(), text), text),\n flattenFstDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`flattenFst` for a pair of pairs should behave consistently with `flatMapFst`.", "mode": "fast-check"} {"id": 56372, "name": "unknown", "code": "it(\"should agree with flatMapSnd\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(text, pair(text, fc.anything())),\n flattenSndDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that the behavior of a pair transformation agrees with the `flatMapSnd` function across multiple inputs.", "mode": "fast-check"} {"id": 56373, "name": "unknown", "code": "it(\"should be equivalent to multiple flatMapFst calls\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(fc.integer({ min: 1 }), text),\n fc.constant(new Text(\"\")),\n fc.func(text).map((f) => (n: number) => new Pair(collatz(n), f(n))),\n flatMapFstUntilEquivalence,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`flatMapFstUntilEquivalence` produces results equivalent to multiple `flatMapFst` calls on integer-text pairs.", "mode": "fast-check"} {"id": 56374, "name": "unknown", "code": "it(\"should be equivalent to multiple flatMapSnd calls\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(text, fc.integer({ min: 1 })),\n fc.constant(new Text(\"\")),\n fc.func(text).map((f) => (n: number) => new Pair(f(n), collatz(n))),\n flatMapSndUntilEquivalence,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`flatMapSndUntilEquivalence` should produce results equivalent to multiple `flatMapSnd` calls when applied to pairs of text and integers.", "mode": "fast-check"} {"id": 56375, "name": "unknown", "code": "it(\"should have a left identity\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(fc.anything(), fc.anything()),\n fc.func(fc.anything()),\n extendMapFstLeftIdentity,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`extendMapFstLeftIdentity` should maintain the left identity property when applied to pairs and functions.", "mode": "fast-check"} {"id": 56376, "name": "unknown", "code": "it(\"should have a right identity\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(fc.anything(), fc.anything()),\n extendMapFstRightIdentity,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `extendMapFstRightIdentity` should demonstrate a right identity property when applied to a pair of arbitrary values.", "mode": "fast-check"} {"id": 56377, "name": "unknown", "code": "it(\"should be associative\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(fc.anything(), fc.anything()),\n fc.func(fc.anything()),\n fc.func(fc.anything()),\n extendMapFstAssociativity,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property verifies the associative behavior of the `extendMapFstAssociativity` function when applied to pairs and functions.", "mode": "fast-check"} {"id": 56378, "name": "unknown", "code": "it(\"should have a left identity\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(fc.anything(), fc.anything()),\n fc.func(fc.anything()),\n extendMapSndLeftIdentity,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `extendMapSndLeftIdentity` maintains a left identity property when applied to pairs and functions over arbitrary values.", "mode": "fast-check"} {"id": 56379, "name": "unknown", "code": "it(\"should have a right identity\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(fc.anything(), fc.anything()),\n extendMapSndRightIdentity,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`extendMapSndRightIdentity` verifies that extending a pair's second element with a right identity does not change the pair.", "mode": "fast-check"} {"id": 56380, "name": "unknown", "code": "it(\"should be associative\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(fc.anything(), fc.anything()),\n fc.func(fc.anything()),\n fc.func(fc.anything()),\n extendMapSndAssociativity,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`extendMapSndAssociativity` maintains associativity for `pair` operations using two functions.", "mode": "fast-check"} {"id": 56381, "name": "unknown", "code": "it(\"should agree with extendMapFst\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(pair(fc.anything(), fc.anything()), extendFstDefinition),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`extendMapFst` should produce results consistent with `extendFstDefinition` when applied to pairs of arbitrary values.", "mode": "fast-check"} {"id": 56382, "name": "unknown", "code": "it(\"should agree with extendMapSnd\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(pair(fc.anything(), fc.anything()), extendSndDefinition),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `extendMapSnd` should be consistent with the behavior defined in `extendSndDefinition` for a pair of arbitrary values.", "mode": "fast-check"} {"id": 56383, "name": "unknown", "code": "it(\"should be its own inverse\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(pair(fc.anything(), fc.anything()), commuteInverse),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`commuteInverse` applied to a `pair` of any values should be its own inverse.", "mode": "fast-check"} {"id": 56384, "name": "unknown", "code": "it(\"should agree with andMapOption\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(fc.anything(), fc.anything()),\n fc.func(option(fc.anything())),\n andMapFstOptionDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `andMapOption` should behave consistently with `andMapFstOptionDefinition` for pairs generated with arbitrary values and a function mapping to options.", "mode": "fast-check"} {"id": 56386, "name": "unknown", "code": "it(\"should agree with andMapOption\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(option(fc.anything()), option(fc.anything())),\n andOptionDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures that the behavior of pairing two optional values agrees with `andMapOption`.", "mode": "fast-check"} {"id": 56387, "name": "unknown", "code": "it(\"should agree with andMapOption\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(option(fc.anything()), fc.anything()),\n andFstOptionDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function verifies that `pair` with options agrees with `andMapOption` by using `andFstOptionDefinition`.", "mode": "fast-check"} {"id": 56389, "name": "unknown", "code": "it(\"should agree with andMapResult\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(fc.anything(), fc.anything()),\n fc.func(result(fc.anything(), fc.anything())),\n andMapFstResultDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks for consistency between a `pair` function and `andMapResult` using a mapping function, ensuring their behavior aligns.", "mode": "fast-check"} {"id": 56390, "name": "unknown", "code": "it(\"should agree with andMapResult\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(fc.anything(), fc.anything()),\n fc.func(result(fc.anything(), fc.anything())),\n andMapSndResultDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should agree between a function applied to a pair of values and the `andMapResult`, using the second value and a result-generating function.", "mode": "fast-check"} {"id": 56391, "name": "unknown", "code": "it(\"should agree with andMapResult\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(\n result(fc.anything(), fc.anything()),\n result(fc.anything(), fc.anything()),\n ),\n andResultDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property checks that an operation using pairs of results is consistent with the behavior defined by `andResultDefinition`.", "mode": "fast-check"} {"id": 56392, "name": "unknown", "code": "it(\"should agree with andMapResult\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(result(fc.anything(), fc.anything()), fc.anything()),\n andFstResultDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`pair` applied with `result` on various data types should produce outcomes that match those defined by `andFstResultDefinition`.", "mode": "fast-check"} {"id": 56393, "name": "unknown", "code": "it(\"should agree with andMapResult\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(fc.anything(), result(fc.anything(), fc.anything())),\n andSndResultDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures consistency between the results of `andMapResult` and a function defined by `andSndResultDefinition` when applied to pairs of arbitrary values and result objects.", "mode": "fast-check"} {"id": 56394, "name": "unknown", "code": "it(\"should agree with orMapResult\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(fc.anything(), fc.anything()),\n fc.func(result(fc.anything(), fc.anything())),\n orMapFstResultDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function being tested should produce results consistent with `orMapResult` when given pairs and a function.", "mode": "fast-check"} {"id": 56395, "name": "unknown", "code": "it(\"should agree with orMapResult\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(fc.anything(), fc.anything()),\n fc.func(result(fc.anything(), fc.anything())),\n orMapSndResultDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that operations involving pairs and functions yield results consistent with `orMapSndResultDefinition`.", "mode": "fast-check"} {"id": 56396, "name": "unknown", "code": "it(\"should agree with orMapResult\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(\n result(fc.anything(), fc.anything()),\n result(fc.anything(), fc.anything()),\n ),\n orResultDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that the `orMapResult` function behaves consistently with the `orResultDefinition` for pairs of result values.", "mode": "fast-check"} {"id": 56397, "name": "unknown", "code": "it(\"should agree with orMapResult\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(result(fc.anything(), fc.anything()), fc.anything()),\n orFstResultDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function being tested should behave consistently with `orMapResult` when applied to pairs containing result objects.", "mode": "fast-check"} {"id": 56398, "name": "unknown", "code": "it(\"should agree with orMapResult\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(fc.anything(), result(fc.anything(), fc.anything())),\n orSndResultDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The outcome of `orMapResult` should match the behavior defined by `orSndResultDefinition` for a pair consisting of any value and a result.", "mode": "fast-check"} {"id": 56399, "name": "unknown", "code": "it(\"should agree with andMapTask\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n pair(fc.anything(), fc.anything()),\n fc.func(task(fc.anything(), fc.anything())),\n andMapFstTaskDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`andMapFstTaskDefinition` should produce results consistent with `andMapTask` when applied to pairs and functions involving asynchronous tasks.", "mode": "fast-check"} {"id": 56400, "name": "unknown", "code": "it(\"should agree with andMapTask\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n pair(fc.anything(), fc.anything()),\n fc.func(task(fc.anything(), fc.anything())),\n andMapSndTaskDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures that `andMapSndTaskDefinition` behaves consistently with `andMapTask` when applied to pairs and tasks.", "mode": "fast-check"} {"id": 56401, "name": "unknown", "code": "it(\"should agree with andMapTask\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n pair(\n task(fc.anything(), fc.anything()),\n task(fc.anything(), fc.anything()),\n ),\n andTaskDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures that paired tasks produced by `pair` conform to the behavior defined by `andTaskDefinition`.", "mode": "fast-check"} {"id": 56402, "name": "unknown", "code": "it(\"should agree with andMapTask\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n pair(task(fc.anything(), fc.anything()), fc.anything()),\n andFstTaskDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The result of applying `andFstTaskDefinition` to a pair and an additional element should be consistent with `andMapTask`.", "mode": "fast-check"} {"id": 60517, "name": "unknown", "code": "test('should verify phone numbers', () =>\n fc.assert(\n fc.property(fc.oneof(mobilePhone(), residentialPhone()), (phone) =>\n isPhoneNumber(phone)\n )\n ))", "language": "typescript", "source_file": "./repos/jonathanpalma/sivar-utils/src/lib/__tests__/telephones.test.ts", "start_line": null, "end_line": null, "dependencies": ["mobilePhone", "residentialPhone"], "repo": {"name": "jonathanpalma/sivar-utils", "url": "https://github.com/jonathanpalma/sivar-utils.git", "license": "MIT", "stars": 37, "forks": 9}, "metrics": null, "summary": "Verifies that numbers generated as mobile or residential phones are recognized as valid phone numbers by the `isPhoneNumber` function.", "mode": "fast-check"} {"id": 56403, "name": "unknown", "code": "it(\"should agree with andMapTask\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n pair(fc.anything(), task(fc.anything(), fc.anything())),\n andSndTaskDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `andSndTaskDefinition` should produce consistent results when applied to paired values and tasks, in agreement with `andMapTask`.", "mode": "fast-check"} {"id": 56404, "name": "unknown", "code": "it(\"should agree with orMapTask\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n pair(fc.anything(), fc.anything()),\n fc.func(task(fc.anything(), fc.anything())),\n orMapFstTaskDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should agree with the behavior of `orMapTask` when using `orMapFstTaskDefinition` with pairs and tasks.", "mode": "fast-check"} {"id": 56405, "name": "unknown", "code": "it(\"should agree with orMapTask\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n pair(fc.anything(), fc.anything()),\n fc.func(task(fc.anything(), fc.anything())),\n orMapSndTaskDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `pair` function output should agree with the `orMapTask` behavior when applied with `orMapSndTaskDefinition`.", "mode": "fast-check"} {"id": 56406, "name": "unknown", "code": "it(\"should agree with orMapTask\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n pair(\n task(fc.anything(), fc.anything()),\n task(fc.anything(), fc.anything()),\n ),\n orTaskDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test verifies that the output of the paired tasks is consistent with the output of `orMapTask` when given the same task definitions.", "mode": "fast-check"} {"id": 56407, "name": "unknown", "code": "it(\"should agree with orMapTask\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n pair(task(fc.anything(), fc.anything()), fc.anything()),\n orFstTaskDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test verifies that the function behavior is consistent with `orMapTask` when applied to pairs of tasks generated with arbitrary values.", "mode": "fast-check"} {"id": 56408, "name": "unknown", "code": "it(\"should agree with orMapTask\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n pair(fc.anything(), task(fc.anything(), fc.anything())),\n orSndTaskDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function being tested should produce consistent results with `orMapTask` when applied to a pair of arbitrary values and a task.", "mode": "fast-check"} {"id": 56409, "name": "unknown", "code": "it(\"should agree with distributeMap\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(fc.anything(), fc.anything()),\n fc.func(pair(fc.anything(), fc.anything())),\n distributeMapFstDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`distributeMapFstDefinition` applied to pairs and functions should yield consistent results as expected by `distributeMap`.", "mode": "fast-check"} {"id": 56410, "name": "unknown", "code": "it(\"should agree with distributeMap\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(fc.anything(), fc.anything()),\n fc.func(pair(fc.anything(), fc.anything())),\n distributeMapSndDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test verifies that the behavior of a function used with `distributeMapSndDefinition` is consistent with the `distributeMap` function when applied to pairs of arbitrary values.", "mode": "fast-check"} {"id": 56411, "name": "unknown", "code": "it(\"should agree with distributeMap\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(\n pair(fc.anything(), fc.anything()),\n pair(fc.anything(), fc.anything()),\n ),\n distributeDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that the behavior of an operation on paired elements aligns with the expected result defined by `distributeDefinition`.", "mode": "fast-check"} {"id": 56412, "name": "unknown", "code": "it(\"should agree with distributeMap\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(pair(fc.anything(), fc.anything()), fc.anything()),\n distributeFstDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `distributeFstDefinition` should agree with results generated from applying it to nested pairs of arbitrary values.", "mode": "fast-check"} {"id": 56413, "name": "unknown", "code": "it(\"should agree with distributeMap\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(fc.anything(), pair(fc.anything(), fc.anything())),\n distributeSndDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures that the behavior of `distributeSndDefinition` on pairs agrees with the expected distribution logic for nested pairs.", "mode": "fast-check"} {"id": 56414, "name": "unknown", "code": "it(\"should agree with exchangeSnd\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(pair(fc.anything(), fc.anything()), fc.anything()),\n exchangeMapSndDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`exchangeMapSndDefinition` should produce results consistent with `exchangeSnd` when applied to pairs.", "mode": "fast-check"} {"id": 56415, "name": "unknown", "code": "it(\"should agree with associateLeft\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(fc.anything(), pair(fc.anything(), fc.anything())),\n associateMapLeftDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The output from applying an associative mapping function on nested pairs should match the expected result defined by `associateMapLeftDefinition`.", "mode": "fast-check"} {"id": 56416, "name": "unknown", "code": "it(\"should be its own inverse\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(pair(fc.anything(), fc.anything()), fc.anything()),\n exchangeSndInverse,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `exchangeSndInverse` function should return the original input when applied to pairs nested within pairs.", "mode": "fast-check"} {"id": 56417, "name": "unknown", "code": "it(\"should be the inverse of associateRight\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(pair(fc.anything(), fc.anything()), fc.anything()),\n associateLeftInverse,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Associating left and right with `associateRight` should result in an inverse pair.", "mode": "fast-check"} {"id": 56418, "name": "unknown", "code": "it(\"should agree with exchangeFst\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(fc.anything(), pair(fc.anything(), fc.anything())),\n exchangeMapFstDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should hold that `exchangeFst` is consistent with `exchangeMapFstDefinition` for pairs with arbitrary elements.", "mode": "fast-check"} {"id": 56419, "name": "unknown", "code": "it(\"should agree with associateRight\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(pair(fc.anything(), fc.anything()), fc.anything()),\n associateMapRightDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures that the operation performed by `associateRight` aligns with `associateMapRightDefinition` when applied to nested pairs with arbitrary values.", "mode": "fast-check"} {"id": 56420, "name": "unknown", "code": "it(\"should be its own inverse\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(fc.anything(), pair(fc.anything(), fc.anything())),\n exchangeFstInverse,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `exchangeFstInverse` function should be its own inverse when applied to pairs of arbitrary values.", "mode": "fast-check"} {"id": 56421, "name": "unknown", "code": "it(\"should be the inverse of associateLeft\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(fc.anything(), pair(fc.anything(), fc.anything())),\n associateRightInverse,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The result of `associateRightInverse` applied to a pair should be the inverse of `associateLeft`.", "mode": "fast-check"} {"id": 56422, "name": "unknown", "code": "it(\"should agree with distributeOkay\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(fc.anything(), result(fc.anything(), fc.anything())),\n distributeMapOkayDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The agreement between the `pair` operation and `distributeOkay` is validated using `distributeMapOkayDefinition` for randomly generated input.", "mode": "fast-check"} {"id": 56423, "name": "unknown", "code": "it(\"should be inverted by Result#collectSnd\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(fc.anything(), result(fc.anything(), fc.anything())),\n distributeOkayInverse,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Result#collectSnd` inverts the operation performed by `distributeOkayInverse` on a pair containing any values and a result.", "mode": "fast-check"} {"id": 56424, "name": "unknown", "code": "it(\"should agree with distributeFail\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(result(fc.anything(), fc.anything()), fc.anything()),\n distributeMapFailDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that a pair of results and an arbitrary value satisfies the `distributeMapFailDefinition`.", "mode": "fast-check"} {"id": 56425, "name": "unknown", "code": "it(\"should be inverted by Result#collectFst\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(result(fc.anything(), fc.anything()), fc.anything()),\n distributeFailInverse,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Result#collectFst` inverts the distribution of a paired result generated with `distributeFailInverse`.", "mode": "fast-check"} {"id": 56426, "name": "unknown", "code": "it(\"should agree with scatterMapOkay\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n pair(fc.anything(), task(fc.anything(), fc.anything())),\n scatterOkayDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function being tested should be consistent with `scatterMapOkay` when applied to pairs containing a value and a task.", "mode": "fast-check"} {"id": 56427, "name": "unknown", "code": "it(\"should agree with scatterMapFail\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n pair(task(fc.anything(), fc.anything()), fc.anything()),\n scatterFailDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that the `scatterMapFail` function behaves consistently with the `scatterFailDefinition` when applied to pairs of tasks and arbitrary values.", "mode": "fast-check"} {"id": 56428, "name": "unknown", "code": "it(\"should return the values of the pair\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(fc.anything(), fc.anything(), valuesDefinition));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Calling the `valuesDefinition` should correctly handle two arbitrary values and return them as a pair.", "mode": "fast-check"} {"id": 56429, "name": "unknown", "code": "it(\"should agree with effect\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n fc.constant(new Text(\"\")),\n pair(fc.anything(), text),\n fc.func(fc.anything()),\n effectMapDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures that a constructed pair with various elements, functions, and an effect map definition maintains agreement with the `effect`.", "mode": "fast-check"} {"id": 56430, "name": "unknown", "code": "it(\"should be equivalent to multiple flatMapFst calls\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n fc.constant(new Text(\"\")),\n pair(fc.integer({ min: 1 }), text),\n fc.constant(isPowerOfTwo),\n fc.func(text).map((f) => (n: number) => new Pair(hotpo(n), f(n))),\n fc.func(pair(fc.anything(), text)),\n fromGeneratorEquivalence,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The equivalence between combining operations using a specific transformation method and using multiple `flatMapFst` calls is verified.", "mode": "fast-check"} {"id": 56432, "name": "unknown", "code": "it(\"should agree with isNotLess\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(ordering, isLessDefinition));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/ordering.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that the `ordering` function's output agrees with the behavior defined by `isLessDefinition`.", "mode": "fast-check"} {"id": 56433, "name": "unknown", "code": "it(\"should agree with isNotMore\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(ordering, isMoreDefinition));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/ordering.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test confirms that the behavior of an ordering function agrees with the `isNotMore` definition across generated inputs fifty times.", "mode": "fast-check"} {"id": 56434, "name": "unknown", "code": "it(\"should be reflexive\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(value, isSameReflexivity));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/order.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `isSameReflexivity` returns true when a value is equal to itself.", "mode": "fast-check"} {"id": 56435, "name": "unknown", "code": "it(\"should be symmetric\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(value, value, isSameSymmetry));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/order.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures that `isSameSymmetry` is symmetric for two values.", "mode": "fast-check"} {"id": 56436, "name": "unknown", "code": "it(\"should be transitive\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(value, value, value, isSameTransitivity));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/order.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `isSameTransitivity` function should hold transitivity for three given values.", "mode": "fast-check"} {"id": 56437, "name": "unknown", "code": "it(\"should respect function extensionality\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n value,\n value,\n fc.func(fc.anything()),\n isSameExtensionality,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/order.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`isSameExtensionality` verifies that two values, when applied to identical functions, produce equal results, respecting function extensionality.", "mode": "fast-check"} {"id": 56438, "name": "unknown", "code": "it(\"should agree with isSame\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(value, value, isNotSameDefinition));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/order.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property verifies that when two values satisfy `isNotSameDefinition`, they do not satisfy `isSame`.", "mode": "fast-check"} {"id": 56440, "name": "unknown", "code": "it(\"should be transitive\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(value, value, value, isLessTransitive));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/order.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`isLessTransitive` confirms that the transitive property holds among three values generated for testing.", "mode": "fast-check"} {"id": 56441, "name": "unknown", "code": "it(\"should be the dual of isMore\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(value, value, isLessDuality));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/order.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should hold that `isLessDuality` demonstrates the dual relationship between two values when compared using `isMore`.", "mode": "fast-check"} {"id": 56442, "name": "unknown", "code": "it(\"should agree with isMore or isSame\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(value, value, isNotLessDefinition));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/order.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should agree with the `isMore` or `isSame` conditions as defined in `isNotLessDefinition` when comparing two values.", "mode": "fast-check"} {"id": 56443, "name": "unknown", "code": "it(\"should be irreflexive\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(value, isMoreIrreflexivity));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/order.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `isMoreIrreflexivity` should return false for any given `value` when tested for irreflexivity.", "mode": "fast-check"} {"id": 56444, "name": "unknown", "code": "it(\"should be transitive\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(value, value, value, isMoreTransitive));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/order.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "isMoreTransitive should hold true for any three given values, demonstrating the transitive property.", "mode": "fast-check"} {"id": 56445, "name": "unknown", "code": "it(\"should be the dual of isLess\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(value, value, isMoreDuality));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/order.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`isMoreDuality` consistently returns the dual of `isLess` for a pair of values.", "mode": "fast-check"} {"id": 56446, "name": "unknown", "code": "it(\"should agree with isLess or isSame\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(value, value, isNotMoreDefinition));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/order.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`isNotMoreDefinition` should consistently agree with `isLess` or `isSame` across multiple `value` pairs.", "mode": "fast-check"} {"id": 56447, "name": "unknown", "code": "it(\"should agree with isSame\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(value, value, compareIsSame));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/order.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures that the `compareIsSame` function agrees with the concept defined by `isSame` when given two values.", "mode": "fast-check"} {"id": 56448, "name": "unknown", "code": "it(\"should agree with isLess\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(value, value, compareIsLess));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/order.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that the `compareIsLess` function behaves consistently with the expected ordering of two values.", "mode": "fast-check"} {"id": 56449, "name": "unknown", "code": "it(\"should agree with isMore\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(value, value, compareIsMore));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/order.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `compareIsMore` function should produce consistent results with `isMore` when given pairs of values.", "mode": "fast-check"} {"id": 56450, "name": "unknown", "code": "it(\"should agree with compare\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(value, value, maxDefinition));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/order.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property asserts that two `value` arguments, when compared using `maxDefinition`, consistently agree with a defined comparison logic.", "mode": "fast-check"} {"id": 56451, "name": "unknown", "code": "it(\"should agree with compare\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(value, value, minDefinition));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/order.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that some aspect involving two `value` inputs and `minDefinition` aligns with the behavior of a `compare` function or equivalent logic, asserting this agreement consistently across multiple instances.", "mode": "fast-check"} {"id": 56452, "name": "unknown", "code": "it(\"should agree with min and max\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(value, value, value, clampDefinition));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/order.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "[I AM UNSURE]\n\nThe actual properties being tested are unclear due to the lack of details on the `value`, `clampDefinition`, and what the test assertions are verifying.", "mode": "fast-check"} {"id": 56453, "name": "unknown", "code": "it(\"should convert Some to a string\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(fc.anything(), toStringSome));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property verifies that the `toStringSome` function successfully converts various inputs into their string representations.", "mode": "fast-check"} {"id": 56454, "name": "unknown", "code": "it(\"should convert None to a string\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(none, toStringNone));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`toStringNone` consistently converts `None` values to a string representation.", "mode": "fast-check"} {"id": 56456, "name": "unknown", "code": "it(\"should preserve identity morphisms\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(option(fc.anything()), mapIdentity));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Identity morphisms applied to options should preserve the original content.", "mode": "fast-check"} {"id": 56457, "name": "unknown", "code": "it(\"should agree with map\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(option(fc.anything()), fc.anything(), replaceDefinition),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should hold that the behavior of a function agrees with the concept of `map` when applied to options and various inputs.", "mode": "fast-check"} {"id": 56458, "name": "unknown", "code": "it(\"should have a left identity\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(option(fc.anything()), andLeftIdentity));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks the left identity property on options generated from any values.", "mode": "fast-check"} {"id": 56459, "name": "unknown", "code": "it(\"should have a right identity\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(option(fc.anything()), andRightIdentity));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `andRightIdentity` should satisfy the right identity property for an `option` type across various input values.", "mode": "fast-check"} {"id": 56460, "name": "unknown", "code": "it(\"should be associative\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n option(fc.anything()),\n option(fc.anything()),\n option(fc.anything()),\n andAssociativity,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Associativity should hold for operations on three `option` values, ensuring the result remains consistent regardless of how the operations are grouped.", "mode": "fast-check"} {"id": 56462, "name": "unknown", "code": "it(\"should have a right annihilator\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(option(fc.anything()), andRightAnnihilation));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `andRightAnnihilation` verifies the right annihilator property for options.", "mode": "fast-check"} {"id": 56463, "name": "unknown", "code": "it(\"should agree with and\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n option(fc.anything()),\n option(fc.anything()),\n andThenDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Agreement between two `option` values and `andThenDefinition`.", "mode": "fast-check"} {"id": 56465, "name": "unknown", "code": "it(\"should have a left identity\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(option(fc.anything()), orLeftIdentity));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures that applying the left identity function to an option does not alter the option's behavior.", "mode": "fast-check"} {"id": 56466, "name": "unknown", "code": "it(\"should have a right identity\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(option(fc.anything()), orRightIdentity));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `orRightIdentity` should correctly implement the right identity property for an option containing any value.", "mode": "fast-check"} {"id": 56468, "name": "unknown", "code": "it(\"should be left distributive\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n option(fc.anything()),\n option(fc.anything()),\n option(fc.anything()),\n orLeftDistributivity,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property asserts left distributivity for options across three arbitrary values.", "mode": "fast-check"} {"id": 56469, "name": "unknown", "code": "it(\"should be right distributive\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n option(fc.anything()),\n option(fc.anything()),\n option(fc.anything()),\n orRightDistributivity,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should verify that the `orRightDistributivity` function maintains right distributive properties over options of any values.", "mode": "fast-check"} {"id": 56472, "name": "unknown", "code": "it(\"should be associative\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n option(fc.anything()),\n fc.func(option(fc.anything())),\n fc.func(option(fc.anything())),\n flatMapAssociativity,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Mapping functions over `option` types should satisfy associativity through `flatMapAssociativity`.", "mode": "fast-check"} {"id": 56474, "name": "unknown", "code": "it(\"should be equivalent to multiple flatMap calls\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n option(fc.integer({ min: 1 })),\n fc.constant(\n (n: number): Option> => new Some(collatz(n)),\n ),\n flatMapUntilEquivalence,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Equivalence should hold between multiple `flatMap` calls on `Option>` objects and their single-step counterparts using `flatMapUntilEquivalence`.", "mode": "fast-check"} {"id": 56475, "name": "unknown", "code": "it(\"should be distributive\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n option(fc.anything()),\n fc.func(fc.boolean()),\n fc.func(fc.boolean()),\n filterDistributivity,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `filterDistributivity` confirms that an `option` applied to two boolean-returning functions distributes over a general set.", "mode": "fast-check"} {"id": 56477, "name": "unknown", "code": "it(\"should have an annihilating input\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(option(fc.anything()), filterAnnihilation));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should hold that an option applied with `filterAnnihilation` results in an annihilating input.", "mode": "fast-check"} {"id": 56478, "name": "unknown", "code": "it(\"should agree with filter\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n option(fc.anything()),\n fc.func(fc.boolean()),\n isSomeAndDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property verifies that the behavior of `option` objects is consistent with a filter function when verifying conditions using `isSomeAndDefinition`.", "mode": "fast-check"} {"id": 56480, "name": "unknown", "code": "it(\"should unzip None\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(fc.func(pair(fc.anything(), fc.anything())), unzipWithNone),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`unzipWithNone` produces correct results when applied to functions returning `None`.", "mode": "fast-check"} {"id": 56481, "name": "unknown", "code": "it(\"should unzip Some\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n fc.anything(),\n fc.func(pair(fc.anything(), fc.anything())),\n unzipWithSome,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`unzipWithSome` correctly handles input values and pairs generated by a function.", "mode": "fast-check"} {"id": 56482, "name": "unknown", "code": "it(\"should agree with unzipWith\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n option(pair(fc.anything(), fc.anything())),\n unzipDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function should produce consistent results with `unzipWith` when applied to option pairs.", "mode": "fast-check"} {"id": 56483, "name": "unknown", "code": "it(\"should be inverted by Result#transposeMapOkay\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n option(result(fc.anything(), fc.anything())),\n transposeMapOkayInverse,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Result#transposeMapOkay` inverts the transformation of an option wrapped result.", "mode": "fast-check"} {"id": 56484, "name": "unknown", "code": "it(\"should be inverted by Result#transposeMapFail\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n option(result(fc.anything(), fc.anything())),\n transposeMapFailInverse,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Result#transposeMapFail` is inversed by the `transposeMapFailInverse` function when applied to options containing results.", "mode": "fast-check"} {"id": 56507, "name": "unknown", "code": "it(\"should be an instance of Error\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(fc.string(), exceptionError));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/exceptions.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "An error produced by `exceptionError` from a given string should be an instance of `Error`.", "mode": "fast-check"} {"id": 56509, "name": "unknown", "code": "it(\"should convert Double to a string\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(double, toStringDefinition));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/double.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that converting a `Double` to a string representation complies with `toStringDefinition`.", "mode": "fast-check"} {"id": 56513, "name": "unknown", "code": "it(\"should convert All to a string\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(all, allToStringDefinition));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/bool.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The conversion of `All` to a string should satisfy `allToStringDefinition`.", "mode": "fast-check"} {"id": 56517, "name": "unknown", "code": "it('works', (key) => {\r\n fc.assert(fc.property(fc.jsonValue(), (x) => {\r\n assert.deepStrictEqual(jsonTryStringify(x, key), JSON.stringify(x));\r\n }));\r\n\r\n fc.assert(fc.property(fc.string(), (otherwise) => {\r\n assert.strictEqual(jsonTryStringify(1n, otherwise), otherwise);\r\n }));\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The test ensures that `jsonTryStringify` produces the same output as `JSON.stringify` for any JSON value, and returns the provided default string when attempting to stringify a BigInt.", "mode": "fast-check"} {"id": 56518, "name": "unknown", "code": "it('works', (key) => {\r\n fc.assert(fc.property(fc.jsonValue(), (x) => {\r\n assert.deepStrictEqual(jsonTryStringify(x, key), JSON.stringify(x));\r\n }));\r\n\r\n fc.assert(fc.property(fc.string(), (otherwise) => {\r\n assert.strictEqual(jsonTryStringify(1n, otherwise), otherwise);\r\n }));\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`jsonTryStringify` should return results equivalent to `JSON.stringify` for JSON values and return a specified string when attempting to stringify a BigInt.", "mode": "fast-check"} {"id": 56521, "name": "unknown", "code": "it('should find the last of a value in the array', () => {\r\n assert.strictEqual(findLast((x) => x === 3)([1, 2, 3, 4, 3, 5]), 3);\r\n\r\n fc.assert(\r\n fc.property(fc.array(fc.anything(), { minLength: 2 }), fc.anything(), (arr, target) => {\r\n const pred = (x: unknown) => x === target;\r\n\r\n fc.pre(arr.every(negate(pred)));\r\n fc.pre(!(typeof target === 'number' && isNaN(target)));\r\n\r\n const randIndex = ~~(Math.random() * arr.length - 1);\r\n arr[randIndex] = target;\r\n arr[randIndex + 1] = target;\r\n\r\n assert.strictEqual(findLast(pred)(arr), target);\r\n }),\r\n );\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`findLast` should return the last occurrence of a specified value in an array, even when the value is inserted consecutively within the array.", "mode": "fast-check"} {"id": 56532, "name": "unknown", "code": "it('should append elements to the end of the array', () => {\r\n fc.assert(\r\n fc.property(fc.array(fc.array(fc.anything())), (arrays) => {\r\n const result = monoids.array().concat(arrays);\r\n assert.deepStrictEqual(result, arrays.flat());\r\n }),\r\n );\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/opts-handlers.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`monoids.array().concat` should concatenate arrays of elements, preserving the order and structure by flattening them.", "mode": "fast-check"} {"id": 56533, "name": "unknown", "code": "it('should prepend elements to the beginning of the array', () => {\r\n fc.assert(\r\n fc.property(fc.array(fc.array(fc.anything())), (arrays) => {\r\n const result = monoids.prependingArray().concat(arrays);\r\n assert.deepStrictEqual(result, arrays.reverse().flat());\r\n }),\r\n );\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/opts-handlers.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The function `monoids.prependingArray().concat` should prepend arrays to produce a result equivalent to reversing and flattening the input arrays.", "mode": "fast-check"} {"id": 56534, "name": "unknown", "code": "it('should return a single reranking api key header', () => {\r\n fc.assert(\r\n fc.property(fc.string(), (apiKey) => {\r\n const provider = new RerankingAPIKeyHeaderProvider(apiKey);\r\n\r\n assert.deepStrictEqual(provider.getHeaders(untouchable()), {\r\n 'x-rerank-api-key': apiKey,\r\n });\r\n }),\r\n );\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/headers-providers/reranking/reranking-api-key-header-provider.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`RerankingAPIKeyHeaderProvider` returns headers with a single key-value pair containing the API key.", "mode": "fast-check"} {"id": 56535, "name": "unknown", "code": "it('should convert a string into an RerankingAPIKeyHeaderProvider', () => {\r\n fc.assert(\r\n fc.property(fc.string(), (apiKey) => {\r\n const provider = RerankingAPIKeyHeaderProvider.parse(apiKey);\r\n\r\n assert.deepStrictEqual(provider.getHeaders(untouchable()), {\r\n 'x-rerank-api-key': apiKey,\r\n });\r\n }),\r\n );\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/headers-providers/reranking/reranking-api-key-header-provider.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`RerankingAPIKeyHeaderProvider.parse` converts a string into a provider that generates headers with the key `'x-rerank-api-key'` set to the original string.", "mode": "fast-check"} {"id": 56536, "name": "unknown", "code": "it('should throw on non-string, non-nullish', () => {\r\n fc.assert(\r\n fc.property(fc.anything().filter((x) => typeof x !== 'string' && x !== null && x !== undefined), (x) => {\r\n assert.throws(() => RerankingAPIKeyHeaderProvider.parse(x), TypeError);\r\n }),\r\n );\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/headers-providers/reranking/reranking-api-key-header-provider.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`RerankingAPIKeyHeaderProvider.parse` throws a `TypeError` when given inputs that are neither strings nor nullish values.", "mode": "fast-check"} {"id": 56538, "name": "unknown", "code": "it('should never output a standalone . or &', () => {\r\n const StandaloneDotRegex = /(? {\r\n const escaped = escapeFieldNames(...arr);\r\n assert.ok(!StandaloneDotRegex.exec(escaped));\r\n assert.ok(!StandaloneAmpersandRegex.exec(escaped));\r\n }),\r\n );\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/field-escaping.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The output of `escapeFieldNames` should not contain standalone periods (`..`) or standalone ampersands (`&`) when processing input from `PathSegmentsArb`.", "mode": "fast-check"} {"id": 56540, "name": "unknown", "code": "it('should error if path starts with a .', () => {\r\n const arb = fc.string().map(s => `.${s}`);\r\n\r\n const prop = fc.property(arb, (invalidPath) => {\r\n assert.throws(() => unescapeFieldPath(invalidPath), { message: `Invalid field path '${invalidPath}'; '.' may not appear at the beginning of the path` });\r\n });\r\n fc.assert(prop);\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/field-escaping.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "An error should be thrown if a field path starts with a dot (`.`).", "mode": "fast-check"} {"id": 56541, "name": "unknown", "code": "it('should error if path ends with a .', () => {\r\n assert.doesNotThrow(() => unescapeFieldPath('&.'));\r\n\r\n const arb = NEStringPathSegArb.map(s => `${s}.`);\r\n\r\n const prop = fc.property(arb, (invalidPath) => {\r\n assert.throws(() => unescapeFieldPath(invalidPath), { message: `Invalid field path '${invalidPath}'; '.' may not appear at the end of the path` });\r\n });\r\n fc.assert(prop);\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/field-escaping.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "An error is expected if `unescapeFieldPath` is called with a path ending in a dot (`.`).", "mode": "fast-check"} {"id": 56542, "name": "unknown", "code": "it('should error if path ends with a &', () => {\r\n assert.doesNotThrow(() => unescapeFieldPath('&&'));\r\n\r\n const arb = StringPathSegArb.map(s => `${s}&`);\r\n\r\n const prop = fc.property(arb, (invalidPath) => {\r\n assert.throws(() => unescapeFieldPath(invalidPath), { message: `Invalid escape sequence in field path '${invalidPath}'; '&' may not appear at the end of the path` });\r\n });\r\n fc.assert(prop);\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/field-escaping.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "An error is thrown if a path ends with the character '&', as invalid in a field path.", "mode": "fast-check"} {"id": 56544, "name": "unknown", "code": "it('should error if there is a standalone &', () => {\r\n assert.throws(() => unescapeFieldPath('a&b.'), { message: `Invalid escape sequence in field path 'a&b.' at position 1; '&' may not appear alone (must be used as either '&&' or '&.')` });\r\n\r\n const arb = fc.tuple(NEStringPathSegArb, NEStringPathSegArb).map(([s1, s2]) => [s1.length, `${s1}&${s2}`] as const);\r\n\r\n const prop = fc.property(arb, ([errorPos, invalidPath]) => {\r\n assert.throws(() => unescapeFieldPath(invalidPath), { message: `Invalid escape sequence in field path '${invalidPath}' at position ${errorPos}; '&' may not appear alone (must be used as either '&&' or '&.')` });\r\n });\r\n fc.assert(prop);\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/field-escaping.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "An exception is thrown by `unescapeFieldPath` if a standalone `&` is present in a field path, indicating an invalid escape sequence.", "mode": "fast-check"} {"id": 56545, "name": "unknown", "code": "it('should function as a pair of adjoint functors or something idk', () => {\r\n const arb = PathSegmentsArb.filter(a => a.length > 0);\r\n\r\n fc.assert(\r\n fc.property(arb, (arr) => {\r\n const result = escapeFieldNames(...arr);\r\n\r\n assert.strictEqual(typeof result, 'string'); // type\r\n assert.strictEqual(result, escapeFieldNames(...arr)); // determinism\r\n\r\n const parts = unescapeFieldPath(result);\r\n\r\n assert.ok(Array.isArray(parts)); // type\r\n assert.strictEqual(parts.length, arr.length); // same num parts\r\n\r\n arr.forEach((original, i) => {\r\n const unescaped = parts[i];\r\n\r\n if (typeof original === 'number') {\r\n assert.strictEqual(unescaped, String(original)); // num is unchanged\r\n } else if (typeof original === 'string') {\r\n assert.strictEqual(unescaped, original); // each part can be individually escaped and remain the same\r\n }\r\n });\r\n }),\r\n );\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/field-escaping.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`escapeFieldNames` and `unescapeFieldPath` maintain type and length consistency; `escapeFieldNames` is deterministic, and numerical or string elements remain unchanged after escaping and unescaping.", "mode": "fast-check"} {"id": 56546, "name": "unknown", "code": "it('converts non-errors into errors', () => {\r\n fc.assert(\r\n fc.property(fc.anything(), (value) => {\r\n fc.pre(!(value instanceof Error));\r\n\r\n const error = NonErrorError.asError(value);\r\n assert.ok(error instanceof NonErrorError);\r\n assert.strictEqual(error.value, value);\r\n\r\n try {\r\n assert.strictEqual(error.message, `Non-error value thrown; type='${betterTypeOf(value)}' toString='${value}' JSON.stringified='${jsonTryStringify(value, `${value}`)}'`);\r\n } catch (_) {\r\n assert.strictEqual(error.message, `Non-error value thrown; type='${betterTypeOf(value)}'`);\r\n }\r\n }),\r\n );\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/errors.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Ensures that non-error values are converted to `NonErrorError` instances, preserving the original value and generating a message detailing the value's type and representation.", "mode": "fast-check"} {"id": 56547, "name": "unknown", "code": "it('should have any error as its fixed-point', () => {\r\n const errorsArb = fc.oneof(\r\n fc.string().chain((message) => {\r\n return fc.constantFrom(\r\n new Error(message),\r\n new TypeError(message),\r\n NonErrorError.asError(new Error(message)),\r\n NonErrorError.asError(message),\r\n );\r\n }),\r\n fc.anything().map((value) => {\r\n return NonErrorError.asError(value);\r\n },\r\n ),\r\n );\r\n\r\n fc.assert(\r\n fc.property(errorsArb, (error) => {\r\n for (let i = 0; i < 10; i++) {\r\n const nextError = NonErrorError.asError(error);\r\n assert.strictEqual(nextError, error);\r\n }\r\n }),\r\n );\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/errors.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`NonErrorError.asError` should return the original error when applied repeatedly.", "mode": "fast-check"} {"id": 56548, "name": "unknown", "code": "it('works w/ override number', () => {\r\n fc.assert(\r\n fc.property(fc.nat(), (overrideMs) => {\r\n const tm = timeouts.single('generalMethodTimeoutMs', { timeout: overrideMs });\r\n const [timeout, mkError] = tm.advance(info(tm));\r\n\r\n const expectedOverrideMs = overrideMs || EffectivelyInfinity;\r\n assert.strictEqual(timeout, expectedOverrideMs);\r\n\r\n const e = mkError();\r\n assert.ok(e instanceof TimeoutError);\r\n assert.deepStrictEqual(e.info, info(tm));\r\n assert.deepStrictEqual(e.timeoutType, 'provided');\r\n assert.strictEqual(e.message, `Command timed out after ${expectedOverrideMs}ms (The timeout provided via \\`{ timeout: }\\` timed out)`);\r\n\r\n assert.deepStrictEqual(tm.initial(), {\r\n generalMethodTimeoutMs: expectedOverrideMs,\r\n requestTimeoutMs: expectedOverrideMs,\r\n });\r\n }), {\r\n examples: [[0]],\r\n },\r\n );\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/api/timeouts.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Timeout configuration should reflect the override number or default to `EffectivelyInfinity`, and a `TimeoutError` should be generated with accurate information when timeout occurs.", "mode": "fast-check"} {"id": 56549, "name": "unknown", "code": "it('works w/ partial override object', () => {\r\n fc.assert(\r\n fc.property(fc.nat(), fc.nat(), (overrideDA, overrideGM) => {\r\n const tm = timeouts.single('databaseAdminTimeoutMs', { timeout: { generalMethodTimeoutMs: overrideGM, databaseAdminTimeoutMs: overrideDA } });\r\n const [timeout, mkError] = tm.advance(info(tm));\r\n\r\n const expectedOverrideDA = overrideDA || EffectivelyInfinity;\r\n const expectedOverrideMs = Math.min(Timeouts.Default.requestTimeoutMs, expectedOverrideDA);\r\n assert.strictEqual(timeout, expectedOverrideMs);\r\n\r\n const expectedOverrideField = (Timeouts.Default.requestTimeoutMs > expectedOverrideDA)\r\n ? 'databaseAdminTimeoutMs'\r\n : 'requestTimeoutMs';\r\n\r\n const e = mkError();\r\n assert.ok(e instanceof TimeoutError);\r\n assert.deepStrictEqual(e.info, info(tm));\r\n\r\n if (Timeouts.Default.requestTimeoutMs === expectedOverrideDA) {\r\n assert.deepStrictEqual(e.timeoutType, ['requestTimeoutMs', 'databaseAdminTimeoutMs']);\r\n assert.strictEqual(e.message, `Command timed out after ${expectedOverrideMs}ms (requestTimeoutMs and databaseAdminTimeoutMs simultaneously timed out)`);\r\n } else {\r\n assert.deepStrictEqual(e.timeoutType, [expectedOverrideField]);\r\n assert.strictEqual(e.message, `Command timed out after ${expectedOverrideMs}ms (${expectedOverrideField} timed out)`);\r\n }\r\n\r\n assert.deepStrictEqual(tm.initial(), {\r\n requestTimeoutMs: Timeouts.Default.requestTimeoutMs,\r\n databaseAdminTimeoutMs: expectedOverrideDA,\r\n });\r\n }), {\r\n examples: [\r\n [Timeouts.Default.requestTimeoutMs, arbs.one(fc.nat())],\r\n [0, 0],\r\n ],\r\n },\r\n );\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/api/timeouts.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Verifies that a timeout configuration with partially overridden values correctly determines the effective timeout, generates the appropriate timeout error, and initializes with the expected settings.", "mode": "fast-check"} {"id": 56550, "name": "unknown", "code": "it('works w/ full override object', () => {\r\n fc.assert(\r\n fc.property(fc.nat(), fc.nat(), fc.nat(), (overrideDA, overrideRT, overrideGM) => {\r\n const tm = timeouts.single('databaseAdminTimeoutMs', { timeout: { generalMethodTimeoutMs: overrideGM, requestTimeoutMs: overrideRT, databaseAdminTimeoutMs: overrideDA } });\r\n const [timeout, mkError] = tm.advance(info(tm));\r\n\r\n const expectedOverrideDA = overrideDA || EffectivelyInfinity;\r\n const expectedOverrideRT = overrideRT || EffectivelyInfinity;\r\n const expectedOverrideMs = Math.min(expectedOverrideRT, expectedOverrideDA);\r\n assert.strictEqual(timeout, expectedOverrideMs);\r\n\r\n const expectedOverrideField = (expectedOverrideRT > expectedOverrideDA)\r\n ? 'databaseAdminTimeoutMs'\r\n : 'requestTimeoutMs';\r\n\r\n const e = mkError();\r\n assert.ok(e instanceof TimeoutError);\r\n assert.deepStrictEqual(e.info, info(tm));\r\n\r\n if (expectedOverrideRT === expectedOverrideDA) {\r\n assert.deepStrictEqual(e.timeoutType, ['requestTimeoutMs', 'databaseAdminTimeoutMs']);\r\n assert.strictEqual(e.message, `Command timed out after ${expectedOverrideMs}ms (requestTimeoutMs and databaseAdminTimeoutMs simultaneously timed out)`);\r\n } else {\r\n assert.deepStrictEqual(e.timeoutType, [expectedOverrideField]);\r\n assert.strictEqual(e.message, `Command timed out after ${expectedOverrideMs}ms (${expectedOverrideField} timed out)`);\r\n }\r\n\r\n assert.deepStrictEqual(tm.initial(), {\r\n databaseAdminTimeoutMs: expectedOverrideDA,\r\n requestTimeoutMs: expectedOverrideRT,\r\n });\r\n }), {\r\n examples: [\r\n [123, 123, arbs.one(fc.nat())],\r\n [0, 0, 0],\r\n ],\r\n },\r\n );\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/api/timeouts.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Verifies that the `timeouts.single` function correctly handles a full override object by evaluating timeouts and generating appropriate `TimeoutError` messages and fields, ensuring it reflects the minimum effective timeout value.", "mode": "fast-check"} {"id": 56551, "name": "unknown", "code": "it('should set the proper initial timeout', () => {\r\n fc.assert(\r\n fc.property(fc.option(fc.nat(), { nil: undefined }), fc.option(fc.nat(), { nil: undefined }), fc.option(fc.nat(), { nil: undefined }), (overrideDA, overrideRT, overrideGM) => {\r\n const tm = timeouts.multipart('databaseAdminTimeoutMs', { timeout: { generalMethodTimeoutMs: overrideGM, requestTimeoutMs: overrideRT, databaseAdminTimeoutMs: overrideDA } });\r\n\r\n assert.deepStrictEqual(tm.initial(), {\r\n databaseAdminTimeoutMs: (overrideDA ?? Timeouts.Default.databaseAdminTimeoutMs) || EffectivelyInfinity,\r\n requestTimeoutMs: (overrideRT ?? Timeouts.Default.requestTimeoutMs) || EffectivelyInfinity,\r\n });\r\n }),\r\n );\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/api/timeouts.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The initial timeout settings for a multipart function should correctly apply any specified override values or use default values, ensuring non-specified timeouts fall back to \"EffectivelyInfinity\" if default is undefined.", "mode": "fast-check"} {"id": 56552, "name": "unknown", "code": "it('should return what it was given', () => {\r\n const timeoutTypeArb = fc.constantFrom('requestTimeoutMs', 'databaseAdminTimeoutMs');\r\n\r\n fc.assert(\r\n fc.property(fc.nat(), fc.nat(), fc.nat(), timeoutTypeArb, (overrideDA, overrideRT, advanceMS, timeoutType) => {\r\n const tm = timeouts.custom({ databaseAdminTimeoutMs: overrideDA, requestTimeoutMs: overrideRT }, () => [advanceMS, [timeoutType]]);\r\n\r\n for (let i = 0; i < 10; i++) {\r\n const [timeout, mkError] = tm.advance(info(tm));\r\n assert.strictEqual(timeout, advanceMS);\r\n\r\n const e = mkError();\r\n assert.ok(e instanceof TimeoutError);\r\n assert.deepStrictEqual(e.info, info(tm));\r\n assert.deepStrictEqual(e.timeoutType, [timeoutType]);\r\n assert.strictEqual(e.message, `Command timed out after ${timeoutType === 'requestTimeoutMs' ? overrideRT : overrideDA}ms (${timeoutType} timed out)`);\r\n\r\n assert.deepStrictEqual(tm.initial(), {\r\n databaseAdminTimeoutMs: overrideDA,\r\n requestTimeoutMs: overrideRT,\r\n });\r\n }\r\n }), {\r\n examples: [[0, 0, 0, arbs.one(timeoutTypeArb)]],\r\n },\r\n );\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/api/timeouts.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The function `timeouts.custom` returns an advance time and constructs a `TimeoutError` object with accurately reflected timeout information and messages, ensuring consistency with the provided timeout configuration and type.", "mode": "fast-check"} {"id": 56553, "name": "unknown", "code": "it('successfully replaces all null prototypes', () => {\n const jbi = withJbiNullProtoFix(JBI);\n\n assert.deepStrictEqual(Object.getPrototypeOf(JBI.parse('{ \"a\": 3 }')), null);\n assert.deepStrictEqual(Object.getPrototypeOf(jbi.parse('{ \"a\": 3 }')), Object.create(null));\n\n const values = [\n {},\n [],\n [{}],\n { a: 1, b: { c: BigNumber('321312312312312212121221'), d: { e: 3 } } },\n [{ a: 1, b: { c: 2, d: { e: 3 } } }],\n \"hello world\",\n BigNumber('12345678901234567890'),\n { a: [BigNumber('12345678901234567890213213123')] },\n ];\n\n for (const value of values) {\n const parsed = jbi.parse(jbi.stringify(value));\n assert.deepStrictEqual(parsed, value);\n }\n\n fc.assert(\n fc.property(fc.json(), (value) => {\n assert.deepStrictEqual(jbi.parse(jbi.stringify(value)), value);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/api/serdes/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The property ensures that the `jbi` object, with null prototype fix applied, correctly parses and stringifies various JSON values, preserving their structure and content.", "mode": "fast-check"} {"id": 56555, "name": "unknown", "code": "it('should return false for any different arrays', () => {\n fc.assert(\n fc.property(arbs.path(), arbs.path(), (arr1, arr2) => {\n fc.pre(JSON.stringify(arr1) !== JSON.stringify(arr2));\n assert.ok(!pathArraysEqual(arr1, arr2));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/api/serdes/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`pathArraysEqual` returns false for any arrays that are different when serialized to strings.", "mode": "fast-check"} {"id": 56556, "name": "unknown", "code": "it('is symmetric', () => {\n fc.assert(\n fc.property(arbs.path(), arbs.path(), (arr1, arr2) => {\n assert.strictEqual(pathArraysEqual(arr1, arr2), pathArraysEqual(arr2, arr1));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/api/serdes/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The symmetry property should hold such that `pathArraysEqual(arr1, arr2)` and `pathArraysEqual(arr2, arr1)` produce identical results for given path arrays.", "mode": "fast-check"} {"id": 56557, "name": "unknown", "code": "it('behaves like pathArraysEqual if exp has no wildcard', () => {\n fc.assert(\n fc.property(pathArb, pathArb, (pattern, arr) => {\n fc.pre(!pattern.includes('*'));\n assert.strictEqual(pathMatches(pattern, arr), pathArraysEqual(arr, pattern));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/api/serdes/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "When the pattern has no wildcard, `pathMatches` should behave identically to `pathArraysEqual`.", "mode": "fast-check"} {"id": 56558, "name": "unknown", "code": "it(\"should allow wildcards to match any segment\", () => {\n fc.assert(\n fc.property(pathArb, pathArb, (pattern, arr) => {\n fc.pre(pattern.length === arr.length);\n\n const adjustedPattern = pattern.map((p, i) => (p === arr[i] ? p : '*'));\n assert.ok(pathMatches(adjustedPattern, arr));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/api/serdes/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Wildcards in a pattern should match any corresponding segment in an array when both are of the same length.", "mode": "fast-check"} {"id": 56559, "name": "unknown", "code": "it('should ignore all undefined headers', async () => {\n const rawHeadersArb = fc.array(fc.dictionary(fc.string(), fc.oneof(fc.string(), fc.constant(undefined))));\n const baseHeadersArb = arbs.record(fc.string());\n\n await fc.assert(\n fc.asyncProperty(rawHeadersArb, baseHeadersArb, async (rawHeaders, baseHeaders) => {\n const providers = HeadersProvider.opts.monoid.concat(\n rawHeaders.map((h) => HeadersProvider.opts.fromObj.parse(h)),\n );\n\n const hr = new HeadersResolver('data-api', providers, baseHeaders);\n const headers = hr.resolve();\n\n const expected = mergeObjsIgnoringUndefined(baseHeaders, ...rawHeaders);\n\n assert.ok(!(headers instanceof Promise));\n assert.deepStrictEqual(headers, expected);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/api/clients/headers-resolver.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Resolving headers should result in merging base and raw headers, ignoring any undefined values.", "mode": "fast-check"} {"id": 56560, "name": "unknown", "code": "it('should ignore all undefined headers', async () => {\n const rawHeadersArb = fc.array(fc.dictionary(fc.string(), fc.oneof(fc.string(), fc.constant(undefined))));\n const baseHeadersArb = arbs.record(fc.string());\n\n await fc.assert(\n fc.asyncProperty(rawHeadersArb, baseHeadersArb, async (rawHeaders, baseHeaders) => {\n fc.pre(rawHeaders.length > 0);\n\n const providers = HeadersProvider.opts.monoid.concat(\n rawHeaders.map((h, i) => {\n if (Math.random() > .25 && i !== 0) {\n return HeadersProvider.opts.fromObj.parse(h);\n }\n\n return HeadersProvider.opts.fromObj.parse(new (class extends HeadersProvider {\n public async getHeaders() {\n return h;\n }\n })());\n }),\n );\n\n const hr = new HeadersResolver('data-api', providers, baseHeaders);\n const headers = hr.resolve();\n\n const expected = mergeObjsIgnoringUndefined(baseHeaders, ...rawHeaders);\n\n assert.ok(headers instanceof Promise);\n assert.deepStrictEqual(await headers, expected);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/api/clients/headers-resolver.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`HeadersResolver` should return a promise resolving to merged headers, excluding undefined values from raw headers.", "mode": "fast-check"} {"id": 56561, "name": "unknown", "code": "it('should extract the db id and region from valid astra endpoints', () => {\r\n const astraEnvArb = constantFrom('astra', 'astra-dev', 'astra-test');\r\n\r\n fc.assert(\r\n fc.property(fc.uuid(), fc.stringMatching(/^[a-z_-]+$/), astraEnvArb, (uuid, region, astraEnv) => {\r\n const endpoint = `https://${uuid}-${region}.apps.${astraEnv}.datastax.com`;\r\n assert.deepStrictEqual(extractDbComponentsFromAstraUrl(endpoint), [uuid, region]);\r\n }),\r\n );\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Extracting database ID and region from specified Astra endpoint URLs should return the expected components.", "mode": "fast-check"} {"id": 56562, "name": "unknown", "code": "it('should return empty array for invalid astra endpoints', () => {\r\n fc.assert(\r\n fc.property(fc.webUrl(), (webURL) => {\r\n assert.deepStrictEqual(extractDbComponentsFromAstraUrl(webURL), []);\r\n }),\r\n );\r\n\r\n fc.assert(\r\n fc.property(fc.string(), (webURL) => {\r\n assert.deepStrictEqual(extractDbComponentsFromAstraUrl(webURL), []);\r\n }),\r\n );\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`extractDbComponentsFromAstraUrl` returns an empty array for any given web URL or string that is an invalid Astra endpoint.", "mode": "fast-check"} {"id": 56565, "name": "unknown", "code": "it('should leave populated fields populated', () => {\n fc.assert(\n fc.property(arbs.tableDefinitionAndRow({ partialRow: true }), ([schema, row]) => {\n const [serializedRow] = serdes.serialize(row);\n\n const resp = serdes.deserialize(serializedRow, {\n status: { projectionSchema: schema },\n });\n\n assert.deepStrictEqual(resp, serializedRow);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/sparse-data.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Deserialized data should match the serialized input when populated fields are present.", "mode": "fast-check"} {"id": 56567, "name": "unknown", "code": "it('should populate all fields', () => {\n const defaultForType = (def: StrictCreateTableColumnDefinition) => {\n switch (def.type) {\n case 'map':\n return new Map();\n case 'set':\n return new Set();\n case 'list':\n return [];\n default:\n return null;\n }\n };\n\n fc.assert(\n fc.property(arbs.tableDefinitionAndRow(), ([schema]) => {\n const resp = serdes.deserialize({}, {\n status: { projectionSchema: schema },\n });\n\n const expected = Object.fromEntries(Object.entries(schema).map(([k, v]) => [k, defaultForType(v)]));\n\n assert.deepStrictEqual(resp, expected);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/sparse-data.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Deserializing with `serdes` should populate all fields using default values based on their types according to the schema.", "mode": "fast-check"} {"id": 56568, "name": "unknown", "code": "it('should return a single embedding api key header', () => {\r\n fc.assert(\r\n fc.property(fc.string(), (apiKey) => {\r\n const provider = new EmbeddingAPIKeyHeaderProvider(apiKey);\r\n\r\n assert.deepStrictEqual(provider.getHeaders(untouchable()), {\r\n 'x-embedding-api-key': apiKey,\r\n });\r\n }),\r\n );\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/headers-providers/embedding/embedding-api-key-header-provider.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`EmbeddingAPIKeyHeaderProvider` returns a header object containing the API key under 'x-embedding-api-key'.", "mode": "fast-check"} {"id": 56569, "name": "unknown", "code": "it('should convert a string into an EmbeddingAPIKeyHeaderProvider', () => {\r\n fc.assert(\r\n fc.property(fc.string(), (apiKey) => {\r\n const provider = EmbeddingAPIKeyHeaderProvider.parse(apiKey);\r\n\r\n assert.deepStrictEqual(provider.getHeaders(untouchable()), {\r\n 'x-embedding-api-key': apiKey,\r\n });\r\n }),\r\n );\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/headers-providers/embedding/embedding-api-key-header-provider.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`EmbeddingAPIKeyHeaderProvider.parse` converts a string into an object that provides headers with `x-embedding-api-key` set to the given string.", "mode": "fast-check"} {"id": 56570, "name": "unknown", "code": "it('should throw on non-string, non-nullish', () => {\r\n fc.assert(\r\n fc.property(fc.anything().filter((x) => typeof x !== 'string' && x !== null && x !== undefined), (x) => {\r\n assert.throws(() => EmbeddingAPIKeyHeaderProvider.parse(x), TypeError);\r\n }),\r\n );\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/headers-providers/embedding/embedding-api-key-header-provider.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`EmbeddingAPIKeyHeaderProvider.parse` should throw a `TypeError` for inputs that are neither strings nor nullish (i.e., not null or undefined).", "mode": "fast-check"} {"id": 56571, "name": "unknown", "code": "it('should deserialize integers into a BigInt', () => {\n fc.assert(\n fc.property(tableKeyArb, fc.integer(), (key, int) => {\n assert.deepStrictEqual(serdes.deserialize({ [key]: int }, desSchema({ [key]: { type: column } })), { [key]: BigInt(int) });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Deserialization of integers should result in `BigInt` values using the specified schema.", "mode": "fast-check"} {"id": 56572, "name": "unknown", "code": "it('should deserialize strings into a BigInt', () => {\n fc.assert(\n fc.property(tableKeyArb, fc.bigInt(), (key, bigInt) => {\n assert.deepStrictEqual(serdes.deserialize({ [key]: bigInt.toString() }, desSchema({ [key]: { type: column } })), { [key]: bigInt });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Deserializing strings should correctly convert them into `BigInt` values based on the provided schema.", "mode": "fast-check"} {"id": 54822, "name": "unknown", "code": "t.test('root', t => {\n fc.assert(\n fc.property(fc.integer(), fc.integer({ min: 1, max: 25 }), (n, m) => {\n if (n < 0 && m % 2 === 0) return;\n t.equal(t_root(n, m), BigIntMath.root(n, m));\n }),\n {\n examples: [\n [-7, 3],\n [7, 3],\n [15, 2],\n [22, 3]\n ]\n }\n );\n\n // // Identity\n // fc.assert(\n // fc.property(fc.bigInt(1n, 2n**64n), fc.integer({ min: 1, max: 10 }), (n, m) => {\n // t.equal(t_root(n**BigInt(m), m), n);\n // })\n // );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/roots.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`t_root` should produce the same results as `BigIntMath.root` for integers, except when `n` is negative and `m` is even.", "mode": "fast-check"} {"id": 56573, "name": "unknown", "code": "it('should deserialize integers into a BigInt (primary key)', () => {\n fc.assert(\n fc.property(tableKeyArb, fc.integer(), (key, int) => {\n assert.deepStrictEqual(serdes.deserialize([int], desSchema({ [key]: { type: column } }), SerDesTarget.InsertedId), { [key]: BigInt(int) });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Deserializing integers results in mapping them to `BigInt` values using a schema with a specified primary key.", "mode": "fast-check"} {"id": 56574, "name": "unknown", "code": "it('should deserialize strings into a BigInt (primary key)', () => {\n fc.assert(\n fc.property(tableKeyArb, fc.bigInt(), (key, bigInt) => {\n assert.deepStrictEqual(serdes.deserialize([bigInt.toString()], desSchema({ [key]: { type: column } }), SerDesTarget.InsertedId), { [key]: bigInt });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Deserialization of string representations into `BigInt` should correctly map to their expected primary key structure.", "mode": "fast-check"} {"id": 56575, "name": "unknown", "code": "it('should deserialize floats as themselves', () => {\n fc.assert(\n fc.property(tableKeyArb, doubleArb, (key, float) => {\n assert.deepStrictEqual(serdes.deserialize({ [key]: float }, desSchema({ [key]: { type: column } })), { [key]: float });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Deserialization returns the original float value for a given schema.", "mode": "fast-check"} {"id": 56576, "name": "unknown", "code": "it('should deserialize strings into a float', () => {\n fc.assert(\n fc.property(tableKeyArb, doubleArb, (key, float) => {\n assert.deepStrictEqual(serdes.deserialize({ [key]: float.toString() }, desSchema({ [key]: { type: column } })), { [key]: float });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Deserializing strings into floats should produce accurate float objects as specified by the schema.", "mode": "fast-check"} {"id": 56577, "name": "unknown", "code": "it('should deserialize floats as themselves (primary key)', () => {\n fc.assert(\n fc.property(tableKeyArb, doubleArb, (key, float) => {\n assert.deepStrictEqual(serdes.deserialize([float], desSchema({ [key]: { type: column } }), SerDesTarget.InsertedId), { [key]: float });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Deserialization of floats should retain their exact values when used as primary keys.", "mode": "fast-check"} {"id": 56578, "name": "unknown", "code": "it('should deserialize strings into a float (primary key)', () => {\n fc.assert(\n fc.property(tableKeyArb, doubleArb, (key, float) => {\n assert.deepStrictEqual(serdes.deserialize([float.toString()], desSchema({ [key]: { type: column } }), SerDesTarget.InsertedId), { [key]: float });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Deserializing strings into floats should result in the correct float value being mapped to the primary key.", "mode": "fast-check"} {"id": 56579, "name": "unknown", "code": "it('should deserialize integers as themselves', () => {\n fc.assert(\n fc.property(tableKeyArb, fc.integer(), (key, int) => {\n assert.deepStrictEqual(serdes.deserialize({ [key]: int }, desSchema({ [key]: { type: column } })), { [key]: int });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Deserialized integers should match their original values according to the specified schema.", "mode": "fast-check"} {"id": 56580, "name": "unknown", "code": "it('should deserialize integers as themselves (primary key)', () => {\n fc.assert(\n fc.property(tableKeyArb, fc.integer(), (key, int) => {\n assert.deepStrictEqual(serdes.deserialize([int], desSchema({ [key]: { type: column } }), SerDesTarget.InsertedId), { [key]: int });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Deserialization should return integers as themselves when used as a primary key.", "mode": "fast-check"} {"id": 56581, "name": "unknown", "code": "it('should serialize blobs properly', () => {\n fc.assert(\n fc.property(tableKeyArb, arbs.blob(), (key, blob) => {\n assert.deepStrictEqual(serdes.serialize({ [key]: blob }), [{ [key]: { $binary: blob.asBase64() } }, false]);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Serialization of blobs correctly converts them to a base64 binary representation in the output structure.", "mode": "fast-check"} {"id": 56582, "name": "unknown", "code": "it('should deserialize blobs properly', () => {\n fc.assert(\n fc.property(tableKeyArb, arbs.blob(), (key, blob) => {\n assert.deepStrictEqual(serdes.deserialize({ [key]: { $binary: blob.asBase64() } }, desSchema({ [key]: { type: 'blob' } })), { [key]: blob });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Deserialization of blobs should correctly reconstruct the original blob from a Base64-encoded binary object.", "mode": "fast-check"} {"id": 56583, "name": "unknown", "code": "it('should deserialize blobs properly (primary key)', () => {\n fc.assert(\n fc.property(tableKeyArb, arbs.blob(), (key, blob) => {\n assert.deepStrictEqual(serdes.deserialize([blob.asBase64()], desSchema({ [key]: { type: 'blob' } }), SerDesTarget.InsertedId), { [key]: blob });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Deserializing blobs as primary keys should return an object with the original blob when using the provided schema.", "mode": "fast-check"} {"id": 56584, "name": "unknown", "code": "it('should serialize dates properly', () => {\n fc.assert(\n fc.property(tableKeyArb, dateArb, (key, date) => {\n assert.deepStrictEqual(serdes.serialize({ [key]: date }), [{ [key]: date.toString() }, false]);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Serialization of date objects should convert them into string representations within the serialized output.", "mode": "fast-check"} {"id": 56586, "name": "unknown", "code": "it('should deserialize dates properly (primary key)', () => {\n fc.assert(\n fc.property(tableKeyArb, dateArb, (key, date) => {\n assert.deepStrictEqual(serdes.deserialize([date.toString()], desSchema({ [key]: { type: 'date' } }), SerDesTarget.InsertedId), { [key]: date });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Deserialization of date strings to the original date format should match the expected date when using a specified schema and key.", "mode": "fast-check"} {"id": 56589, "name": "unknown", "code": "it('should deserialize inet addresses properly (primary key)', () => {\n fc.assert(\n fc.property(tableKeyArb, arbs.inet(), (key, inet) => {\n assert.deepStrictEqual(serdes.deserialize([inet.toString()], desSchema({ [key]: { type: 'inet' } }), SerDesTarget.InsertedId), { [key]: inet });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Deserializing an `inet` address should result in an object with the correct key-value pair matching the expected type.", "mode": "fast-check"} {"id": 56590, "name": "unknown", "code": "it('should serialize dates properly', () => {\n fc.assert(\n fc.property(tableKeyArb, timeArb, (key, time) => {\n assert.deepStrictEqual(serdes.serialize({ [key]: time }), [{ [key]: time.toString() }, false]);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The `serdes.serialize` function should convert date objects to their string representations while maintaining the key-value structure.", "mode": "fast-check"} {"id": 56592, "name": "unknown", "code": "it('should deserialize dates properly (primary key)', () => {\n fc.assert(\n fc.property(tableKeyArb, timeArb, (key, time) => {\n assert.deepStrictEqual(serdes.deserialize([time.toString()], desSchema({ [key]: { type: 'time' } }), SerDesTarget.InsertedId), { [key]: time });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Deserialization of dates should result in a structure where the primary key maps to the correct time value.", "mode": "fast-check"} {"id": 56593, "name": "unknown", "code": "it('should serialize the date into the proper format', () => {\n fc.assert(\n fc.property(tableKeyArb, arbs.validDate(), (key, date) => {\n assert.deepStrictEqual(serdes.serialize({ [key]: date }), [{ [key]: date.toISOString() }, false]);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Serializing a date results in its conversion to the ISO string format in the output.", "mode": "fast-check"} {"id": 56594, "name": "unknown", "code": "it('should deserialize the date properly', () => {\n fc.assert(\n fc.property(tableKeyArb, arbs.validDate(), (key, date) => {\n assert.deepStrictEqual(serdes.deserialize({ [key]: date.toISOString() }, desSchema({ [key]: { type: 'timestamp' } })), { [key]: date });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Deserialization of a date string using a specified schema should result in an object with the original date.", "mode": "fast-check"} {"id": 56596, "name": "unknown", "code": "it('should deserialize vectors from { $binary }s properly', () => {\n fc.assert(\n fc.property(tableKeyArb, fc.integer({ min: 1, max: 999 }).chain(dim => fc.tuple(fc.constant(dim), arbs.vector({ dim }))), (key, [dim, vector]) => {\n assert.deepStrictEqual(serdes.deserialize({ [key]: { $binary: vector.asBase64() } }, desSchema({ [key]: { type: 'vector', dimension: dim } })), { [key]: new DataAPIVector({ $binary: vector.asBase64() }) });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Deserialization of vectors from binary strings should produce equivalent `DataAPIVector` objects when given dimensional schema information.", "mode": "fast-check"} {"id": 56597, "name": "unknown", "code": "it('should deserialize vectors from number[]s properly', () => {\n fc.assert(\n fc.property(tableKeyArb, fc.integer({ min: 1, max: 9999 }).chain(dim => fc.tuple(fc.constant(dim), arbs.vector({ dim }))), (key, [dim, vector]) => {\n assert.deepStrictEqual(serdes.deserialize({ [key]: vector.asArray() }, desSchema({ [key]: { type: 'vector', dimension: dim } })), { [key]: vector });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Vectors deserialized from number arrays should match the expected vectors defined by the schema.", "mode": "fast-check"} {"id": 56598, "name": "unknown", "code": "it('should serialize a map as an alist if it has >0 entries', () => {\n fc.assert(\n fc.property(tableKeyArb, anyKVsArb, (key, [keys, values]) => {\n const map = new Map(keys.map((k, i) => [k.jsRep, values[i].jsRep]));\n fc.pre(map.size > 0);\n\n const expectedObj = [...new Map(keys.map((k, i) => [k.jsonRep, values[i].jsonRep]))];\n fc.pre(map.size === expectedObj.length);\n\n const bigNumsPresent = keys.some((k) => k.jsRep instanceof BigNumber) || values.some((v) => v.jsRep instanceof BigNumber);\n\n assert.deepStrictEqual(serdes.serialize({ [key]: map }), [{ [key]: expectedObj }, bigNumsPresent]);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Serializing a map with more than zero entries should result in an associative list and indicate the presence of any `BigNumber` objects.", "mode": "fast-check"} {"id": 56599, "name": "unknown", "code": "it('should serialize a map as an empty object if it has 0 entries', () => {\n fc.assert(\n fc.property(tableKeyArb, (key) => {\n assert.deepStrictEqual(serdes.serialize({ [key]: new Map }), [{ [key]: {} }, false]);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Serializing a map with zero entries should result in an empty object.", "mode": "fast-check"} {"id": 56600, "name": "unknown", "code": "it('should serialize a normal object as an object normally', () => {\n fc.assert(\n fc.property(tableKeyArb, stringKVsArb, (key, [keys, values]) => {\n const obj = Object.fromEntries(keys.map((k, i) => [k, values[i].jsRep]));\n const expectedObj = Object.fromEntries(keys.map((k, i) => [k, values[i].jsonRep]));\n\n const bigNumsPresent = values.some((v) => v.jsRep instanceof BigNumber);\n\n assert.deepStrictEqual(serdes.serialize({ [key]: obj }), [{ [key]: expectedObj }, bigNumsPresent]);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Serializing an object should maintain its structure and convert properties correctly, detecting any presence of `BigNumber` instances.", "mode": "fast-check"} {"id": 56601, "name": "unknown", "code": "it('should recurse over an object when deserializing', () => {\n fc.assert(\n fc.property(tableKeyArb, stringKVsArb, (key, [keys, values]) => {\n const seenMap = new Map(keys.map((k, i) => [k, values[i].jsonRep]));\n\n const codec = TableCodecs.custom({\n deserializeGuard(val, ctx) {\n if (ctx.path.length === 2) {\n const key = ctx.path[1] as string;\n assert.strictEqual(val, seenMap.get(key));\n seenMap.delete(key);\n }\n return false;\n },\n deserialize: () => {\n throw new Error('Should not be called');\n },\n });\n\n const serdes = new TableSerDes({ ...TableSerDes.cfg.empty, codecs: [codec] });\n const schema = desSchema({ [key]: { type: 'map', valueType: values.definition.type } });\n\n const obj = Object.fromEntries(keys.map((k, i) => [k, values[i].jsonRep]));\n const expectMap = new Map(keys.map((k, i) => [k, values[i].jsRep]));\n\n assert.strictEqual(seenMap.size, expectMap.size);\n assert.deepStrictEqual(serdes.deserialize({ [key]: obj }, schema), { [key]: expectMap });\n assert.strictEqual(seenMap.size, 0);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Deserializing an object should involve recursion, verifying that values match expected representations at a specific depth and exhaustively processing all entries.", "mode": "fast-check"} {"id": 56602, "name": "unknown", "code": "it('should recurse over an association list when deserializing', () => {\n fc.assert(\n fc.property(tableKeyArb, anyKVsArb, (key, [keys, values]) => {\n const seenArray = keys.map((k, i) => [k, values[i].jsonRep]);\n let i = 0;\n\n const codec = TableCodecs.custom({\n deserializeGuard(kv, ctx) {\n if (ctx.path.length === 2) {\n const index = ctx.path[1] as number;\n assert.strictEqual(index, i++);\n assert.strictEqual(kv[0], seenArray[index][0]);\n assert.strictEqual(kv[1], seenArray[index][1]);\n seenArray[index] = null!;\n }\n return false;\n },\n deserialize: () => {\n throw new Error('Should not be called');\n },\n });\n\n const serdes = new TableSerDes({ ...TableSerDes.cfg.empty, codecs: [codec] });\n const schema = desSchema({ [key]: { type: 'map', valueType: values.definition.type } });\n\n const arr = keys.map((k, i) => [k, values[i].jsonRep]);\n const expectMap = new Map(keys.map((k, i) => [k, values[i].jsRep]));\n\n assert.strictEqual(seenArray.length, expectMap.size);\n assert.deepStrictEqual(serdes.deserialize({ [key]: arr }, schema), { [key]: expectMap });\n assert.strictEqual(seenArray.filter(Boolean).length, 0);\n assert.strictEqual(i, expectMap.size);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The property should hold that during deserialization, a custom codec recursively processes an association list, confirming the `deserializeGuard` correctly matches and nullifies each item in sequence according to the path context and expected values.", "mode": "fast-check"} {"id": 54831, "name": "unknown", "code": "t.test('rem', t => {\n fc.assert(\n fc.property(fc.bigIntN(N), fc.bigIntN(N), (n, m) => {\n m = m || 1n;\n t.equal(t_rem(n, m), n % m);\n }),\n {\n examples: [\n [10n, 1n],\n [10n, -1n],\n [-10n, 1n],\n [-10n, -1n],\n [10000n, 7n],\n [10000n, -7n],\n [-10000n, 7n],\n [-10000n, -7n]\n ]\n }\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/mod-rem.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The `t_rem` function should produce the same remainder as the native modulus operator `%` for pairs of big integers, with `m` defaulting to `1n` if zero.", "mode": "fast-check"} {"id": 56603, "name": "unknown", "code": "it('should serialize a set as a list', () => {\n fc.assert(\n fc.property(tableKeyArb, arbs.tableDatatypes({ scalarOnly: true }), (key, values) => {\n\n const jsSet = new Set(values.map((v) => v.jsRep));\n const jsonArr = [...new Set(values.map((v) => v.jsonRep))];\n fc.pre(jsSet.size === jsonArr.length);\n\n const bigNumsPresent = values.some((v) => v.jsRep instanceof BigNumber);\n\n assert.deepStrictEqual(serdes.serialize({ [key]: jsSet }), [{ [key]: jsonArr }, bigNumsPresent]);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Serializing a set should result in a list representation, maintaining the same length and structure, and including a flag if `BigNumber` instances are present.", "mode": "fast-check"} {"id": 56604, "name": "unknown", "code": "it('should deserialize a list into a set', () => {\n fc.assert(\n fc.property(tableKeyArb, arbs.tableDatatypes({ scalarOnly: true }), (key, values) => {\n const seenSet = new Set(values.map((v) => v.jsonRep));\n let i = 0;\n\n const codec = TableCodecs.custom({\n deserializeGuard(val, ctx) {\n if (ctx.path.length === 2) {\n assert.strictEqual(ctx.path.at(-1), i++);\n seenSet.delete(val);\n }\n return false;\n },\n deserialize: () => {\n throw new Error('Should not be called');\n },\n });\n\n const serdes = new TableSerDes({ ...TableSerDes.cfg.empty, codecs: [codec] });\n const schema = desSchema({ [key]: { type: 'set', valueType: values.definition.type } });\n\n const arr = [...values.map((v) => v.jsonRep)];\n const expectSet = new Set(values.map((v) => v.jsRep));\n\n assert.strictEqual(seenSet.size, new Set(arr).size);\n assert.deepStrictEqual(serdes.deserialize({ [key]: arr }, schema), { [key]: expectSet });\n assert.strictEqual(seenSet.size, 0);\n assert.strictEqual(i, arr.length); // arr.length instead of expectSet.size because deserialization should run before set conversion\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Deserializing a list should correctly result in a set, ensuring each element is processed and validated properly, with elements' positions being tracked and verified during the conversion.", "mode": "fast-check"} {"id": 56605, "name": "unknown", "code": "it('should error when trying to serialize an ObjectId', () => {\n fc.assert(\n fc.property(arbs.oid(), (oid) => {\n assert.throws(() => serdes.serialize(oid), { message: /ObjectId may not be used with tables by default\\..*/ });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "An error is expected when attempting to serialize an `ObjectId`, with a message indicating that `ObjectId` cannot be used with tables by default.", "mode": "fast-check"} {"id": 56607, "name": "unknown", "code": "it('should never mutate the input object in place', () => {\n fc.assert(\n fc.property(arbs.tableDefinitionAndRow({ requireOneOf: ['uuid', 'inet'] }), ([, row]) => { // forces usage of types which would cause the object to mutate\n const origStr = stableStringify(row);\n const [res] = serdes.serialize(row);\n const afterStr = stableStringify(row);\n const resStr = stableStringify(res);\n\n assert.strictEqual(origStr, afterStr);\n assert.notStrictEqual(afterStr, resStr);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/mutate-in-place.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Serialization does not mutate the input object; the original and post-serialization stringified representations are identical, while the serialized result differs.", "mode": "fast-check"} {"id": 56613, "name": "unknown", "code": "it('should not equal a different UUID', () => {\n fc.assert(\n fc.property(fc.uuid(), fc.uuid(), (uuid1, uuid2) => {\n fc.pre(uuid1 !== uuid2);\n assert.ok(!uuid(uuid1).equals(uuid2));\n assert.ok(!uuid(uuid1).equals(uuid(uuid2)));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/datatypes/uuid.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "A UUID should not equal a different UUID, whether comparing directly or through a UUID object.", "mode": "fast-check"} {"id": 56616, "name": "unknown", "code": "it('should properly construct an IPv4 address', () => {\n fc.assert(\n fc.property(fc.mixedCase(fc.ipV4()), (ip) => {\n const validate = (inet: DataAPIInet) => {\n assert.strictEqual(inet.toString(), ip.toLowerCase());\n assert.strictEqual(inet.version, 4);\n };\n\n validate(new DataAPIInet(ip));\n validate(new DataAPIInet(ip, 4));\n validate(new DataAPIInet(ip, 4, false));\n validate(new DataAPIInet(ip, null, false));\n\n validate(inet(ip));\n validate(inet(ip, 4));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/datatypes/inet.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`DataAPIInet` instances and `inet` function calls should consistently construct an IPv4 address from various input forms, ensuring the string representation is in lowercase and the version is 4.", "mode": "fast-check"} {"id": 56625, "name": "unknown", "code": "it('should error on invalid values', () => {\n fc.assert(\n fc.property(fc.anything(), (invalid) => {\n fc.pre(!DataAPIBlob.isBlobLike(invalid));\n assert.throws(() => new DataAPIBlob(invalid as DataAPIBlobLike));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/datatypes/blob.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Constructing a `DataAPIBlob` with values not passing `isBlobLike` should throw an error.", "mode": "fast-check"} {"id": 56626, "name": "unknown", "code": "it('should allow invalid values on validation: false', () => {\n fc.assert(\n fc.property(fc.anything(), (invalid) => {\n const blb = new DataAPIBlob(invalid as DataAPIBlobLike, false);\n assert.deepStrictEqual(blb.raw(), invalid);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/datatypes/blob.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The property ensures that `DataAPIBlob` created with `validation: false` retains the original invalid input value when calling `raw()`.", "mode": "fast-check"} {"id": 56627, "name": "unknown", "code": "it('should get the byte length of all types', () => {\n fc.assert(\n fc.property(allBlobLikeArb, (bls) => {\n const expectedLength = bls[0].length;\n\n for (const blb of bls) {\n assert.strictEqual(blob(blb).byteLength, expectedLength);\n assert.strictEqual(blob(blob(blb)).byteLength, expectedLength);\n }\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/datatypes/blob.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The byte length of all blob-like types should be consistent with the length of the first element in the array, even after being processed by the `blob` function.", "mode": "fast-check"} {"id": 56629, "name": "unknown", "code": "it('should convert between compatible types in the browser', { pretendEnv: 'browser' }, () => {\n fc.assert(\n fc.property(allBlobLikeArb, ([buff, arrBuff, binary]) => {\n const blobs = [blob(buff), blob(arrBuff), blob(binary), blob(blob(buff))];\n\n for (const blb of blobs) {\n assert.strictEqual(blb.asBase64(), binary.$binary);\n assert.deepStrictEqual(blb.asBuffer(), buff);\n assert.deepStrictEqual(blb.asArrayBuffer(), arrBuff);\n }\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/datatypes/blob.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Conversion between compatible types should preserve the correctness of Base64, Buffer, and ArrayBuffer representations.", "mode": "fast-check"} {"id": 56630, "name": "unknown", "code": "it('should throw various conversion errors in unknown environments', { pretendEnv: 'unknown' }, () => {\n fc.assert(\n fc.property(allBlobLikeArb, ([buff, arrBuff, binary]) => {\n assert.throws(() => blob(buff).asBase64());\n assert.throws(() => blob(buff).asBuffer());\n assert.throws(() => blob(buff).asArrayBuffer());\n\n assert.throws(() => blob(arrBuff).asBase64());\n assert.throws(() => blob(arrBuff).asBuffer());\n assert.deepStrictEqual(blob(arrBuff).asArrayBuffer(), arrBuff);\n\n assert.deepStrictEqual(blob(binary).asBase64(), binary.$binary);\n assert.throws(() => blob(binary).asBuffer());\n assert.throws(() => blob(binary).asArrayBuffer());\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/datatypes/blob.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The test verifies that various conversion methods on blob-like objects throw errors in unknown environments, with specific exceptions for `asArrayBuffer` and `asBase64` conversions under certain conditions.", "mode": "fast-check"} {"id": 56631, "name": "unknown", "code": "it('should have a working toString()', () => {\n fc.assert(\n fc.property(allBlobLikeArb, ([buff, arrBuff, binary]) => {\n assert.strictEqual(blob(buff).toString(), `DataAPIBlob(typeof raw=Buffer, byteLength=${buff.length})`);\n assert.strictEqual(blob(arrBuff).toString(), `DataAPIBlob(typeof raw=ArrayBuffer, byteLength=${buff.length})`);\n assert.strictEqual(blob(binary).toString(), `DataAPIBlob(typeof raw=base64, byteLength=${buff.length})`);\n assert.strictEqual(blob(blob(binary)).toString(), `DataAPIBlob(typeof raw=base64, byteLength=${buff.length})`);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/datatypes/blob.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`blob` object's `toString()` method accurately represents the type and byte length of Buffer, ArrayBuffer, and base64 blob inputs.", "mode": "fast-check"} {"id": 56632, "name": "unknown", "code": "it('should error if big numbers not enabled', () => {\n const serdes = new CollSerDes(CollSerDes.cfg.empty);\n\n fc.assert(\n fc.property(fc.bigInt(), (bigint) => {\n assert.throws(() => serdes.serialize({ bigint }), { message: 'BigInt serialization must be enabled through serdes.enableBigNumbers in CollectionSerDesConfig' });\n }),\n );\n\n fc.assert(\n fc.property(arbs.bigNum(), (bigint) => {\n assert.throws(() => serdes.serialize({ bigint }), { message: 'BigNumber serialization must be enabled through serdes.enableBigNumbers in CollectionSerDesConfig' });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/collections/ser-des/enable-big-numbers.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Serialization of big numbers without enabling specific serialization settings results in an error.", "mode": "fast-check"} {"id": 56633, "name": "unknown", "code": "it('should error if big numbers not enabled', () => {\n const serdes = new CollSerDes(CollSerDes.cfg.empty);\n\n fc.assert(\n fc.property(fc.bigInt(), (bigint) => {\n assert.throws(() => serdes.serialize({ bigint }), { message: 'BigInt serialization must be enabled through serdes.enableBigNumbers in CollectionSerDesConfig' });\n }),\n );\n\n fc.assert(\n fc.property(arbs.bigNum(), (bigint) => {\n assert.throws(() => serdes.serialize({ bigint }), { message: 'BigNumber serialization must be enabled through serdes.enableBigNumbers in CollectionSerDesConfig' });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/collections/ser-des/enable-big-numbers.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Serialization should throw an error if big numbers serialization is not enabled in `CollSerDes`.", "mode": "fast-check"} {"id": 56634, "name": "unknown", "code": "it('should error if no default * is specified for a CollNumCoercionCfg', () => {\n fc.assert(\n fc.property(arbs.record(fc.anything()), (spec) => {\n fc.pre(!('*' in spec));\n assert.throws(() => new CollSerDes({ ...CollSerDes.cfg.empty, enableBigNumbers: spec as any }), {\n message: 'The configuration must contain a \"*\" key',\n });\n }), {\n examples: [[{ a: { '*': 'bignumber' } }]],\n },\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/collections/ser-des/enable-big-numbers.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "An error should be thrown if a `CollNumCoercionCfg` is created without a default `*` key specified in the configuration.", "mode": "fast-check"} {"id": 56635, "name": "unknown", "code": "it('should handle to-number coercion properly', () => {\n const desAsserter = mkDesAsserter('number', Number);\n\n fc.assert(\n fc.property(fc.oneof(fc.double(), arbs.bigNum()), arbs.pathWithObj(), (num, pathWithObj) => {\n desAsserter.ok(pathWithObj, num);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/collections/ser-des/enable-big-numbers.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`mkDesAsserter` ensures that numerical values, including large numbers, are properly coerced to the `number` type within given path and object structures.", "mode": "fast-check"} {"id": 56636, "name": "unknown", "code": "it('should handle to-strict-number coercion properly', () => {\n const desAsserter = mkDesAsserter('strict_number', Number);\n\n fc.assert(\n fc.property(fc.double(), arbs.pathWithObj(), (num, pathWithObj) => {\n desAsserter.ok(pathWithObj, num);\n }),\n );\n\n fc.assert(\n fc.property(arbs.bigNum(), arbs.pathWithObj(), (bigNum, pathWithObj) => {\n if (bigNum.isEqualTo(bigNum.toNumber())) {\n desAsserter.ok(pathWithObj, bigNum);\n } else {\n desAsserter.notOk(pathWithObj, bigNum);\n }\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/collections/ser-des/enable-big-numbers.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`mkDesAsserter('strict_number', Number)` verifies that double values are coerced as expected, and checks whether big numbers can be accurately coerced to strict numbers based on their equality with their numeric representation.", "mode": "fast-check"} {"id": 56637, "name": "unknown", "code": "it('should handle to-strict-number coercion properly', () => {\n const desAsserter = mkDesAsserter('strict_number', Number);\n\n fc.assert(\n fc.property(fc.double(), arbs.pathWithObj(), (num, pathWithObj) => {\n desAsserter.ok(pathWithObj, num);\n }),\n );\n\n fc.assert(\n fc.property(arbs.bigNum(), arbs.pathWithObj(), (bigNum, pathWithObj) => {\n if (bigNum.isEqualTo(bigNum.toNumber())) {\n desAsserter.ok(pathWithObj, bigNum);\n } else {\n desAsserter.notOk(pathWithObj, bigNum);\n }\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/collections/ser-des/enable-big-numbers.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`mkDesAsserter` properly handles coercion of numbers by passing finite doubles and big numbers when they can be represented as a strict number, and failing otherwise.", "mode": "fast-check"} {"id": 56638, "name": "unknown", "code": "it('should handle to-bigint coercion properly', () => {\n const desAsserter = mkDesAsserter('bigint', (n) => BigInt(n.toFixed()));\n\n fc.assert(\n fc.property(fc.oneof(fc.integer(), fc.bigInt().map((n) => BigNumber(n.toString()))), arbs.pathWithObj(), (num, pathWithObj) => {\n desAsserter.ok(pathWithObj, num);\n }),\n );\n\n fc.assert(\n fc.property(fc.double(), arbs.pathWithObj(), (num, path) => {\n fc.pre(!Number.isInteger(num));\n desAsserter.notOk(path, num);\n }),\n );\n\n fc.assert(\n fc.property(arbs.bigNum(), arbs.pathWithObj(), (num, pathWithObj) => {\n fc.pre(!num.isInteger());\n desAsserter.notOk(pathWithObj, num);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/collections/ser-des/enable-big-numbers.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Proper coercion of numeric values to `bigint` is confirmed, ensuring the conversion is correct for integers and identifying when it is not applicable for non-integers, including `double` and `bigNum` types.", "mode": "fast-check"} {"id": 56639, "name": "unknown", "code": "it('should handle to-bigint coercion properly', () => {\n const desAsserter = mkDesAsserter('bigint', (n) => BigInt(n.toFixed()));\n\n fc.assert(\n fc.property(fc.oneof(fc.integer(), fc.bigInt().map((n) => BigNumber(n.toString()))), arbs.pathWithObj(), (num, pathWithObj) => {\n desAsserter.ok(pathWithObj, num);\n }),\n );\n\n fc.assert(\n fc.property(fc.double(), arbs.pathWithObj(), (num, path) => {\n fc.pre(!Number.isInteger(num));\n desAsserter.notOk(path, num);\n }),\n );\n\n fc.assert(\n fc.property(arbs.bigNum(), arbs.pathWithObj(), (num, pathWithObj) => {\n fc.pre(!num.isInteger());\n desAsserter.notOk(pathWithObj, num);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/collections/ser-des/enable-big-numbers.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The code ensures that converting numbers to `bigint` is handled correctly, with valid conversions passing `desAsserter.ok` and invalid conversions failing `desAsserter.notOk`.", "mode": "fast-check"} {"id": 54424, "name": "unknown", "code": "it('should detect potential issues with the MusicPlayer', () =>\n fc.assert(\n fc.property(fc.uniqueArray(TrackNameArb, { minLength: 1 }), MusicPlayerCommands, (initialTracks, commands) => {\n // const real = new MusicPlayerImplem(initialTracks, true); // with bugs\n const real = new MusicPlayerImplem(initialTracks);\n const model = new MusicPlayerModel();\n model.numTracks = initialTracks.length;\n for (const t of initialTracks) {\n model.tracksAlreadySeen[t] = true;\n }\n fc.modelRun(() => ({ model, real }), commands);\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/004-stateMachine/musicPlayer/main.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The test checks that the operations run on a `MusicPlayerImplem` instance match the expected behavior as defined by the `MusicPlayerModel`, using a sequence of commands and initial tracks.", "mode": "fast-check"} {"id": 54425, "name": "unknown", "code": "it('should always mark binary search trees as search trees', () => {\n fc.assert(\n fc.property(binarySearchTreeWithMaxDepth(3), (tree) => {\n return isSearchTree(tree);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/002-recursive/isSearchTree/main.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Binary search trees with a maximum depth of 3 should always return true when verified by `isSearchTree`.", "mode": "fast-check"} {"id": 56640, "name": "unknown", "code": "it('should handle to-bigint coercion properly', () => {\n const desAsserter = mkDesAsserter('bigint', (n) => BigInt(n.toFixed()));\n\n fc.assert(\n fc.property(fc.oneof(fc.integer(), fc.bigInt().map((n) => BigNumber(n.toString()))), arbs.pathWithObj(), (num, pathWithObj) => {\n desAsserter.ok(pathWithObj, num);\n }),\n );\n\n fc.assert(\n fc.property(fc.double(), arbs.pathWithObj(), (num, path) => {\n fc.pre(!Number.isInteger(num));\n desAsserter.notOk(path, num);\n }),\n );\n\n fc.assert(\n fc.property(arbs.bigNum(), arbs.pathWithObj(), (num, pathWithObj) => {\n fc.pre(!num.isInteger());\n desAsserter.notOk(pathWithObj, num);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/collections/ser-des/enable-big-numbers.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The test checks that `mkDesAsserter` correctly coerces integers and big integers to BigInt, ensuring non-integers (doubles and non-integer big numbers) do not pass coercion.", "mode": "fast-check"} {"id": 56642, "name": "unknown", "code": "it('should handle to-string coercion properly', () => {\n const desAsserter = mkDesAsserter('string', (n) => n.toString());\n\n fc.assert(\n fc.property(fc.oneof(fc.double(), arbs.bigNum()), arbs.pathWithObj(), (num, pathWithObj) => {\n desAsserter.ok(pathWithObj, num);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/collections/ser-des/enable-big-numbers.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The test checks that numbers, including doubles and big numbers, are correctly coerced to strings using the `mkDesAsserter` function when applied to paths within objects.", "mode": "fast-check"} {"id": 54426, "name": "unknown", "code": "it('should detect invalid search trees whenever tree traversal produces unordered arrays', () => {\n fc.assert(\n fc.property(binaryTreeWithMaxDepth(3), (tree) => {\n fc.pre(!isSorted(traversal(tree, (t) => t.value)));\n return !isSearchTree(tree);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/002-recursive/isSearchTree/main.spec.ts", "start_line": null, "end_line": null, "dependencies": ["isSorted", "traversal"], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The test verifies that traversing a binary tree with unordered elements results in `isSearchTree` returning false.", "mode": "fast-check"} {"id": 56643, "name": "unknown", "code": "it('should handle to-number_or_string coercion properly', () => {\n const desAsserterNum = mkDesAsserter('number_or_string', Number);\n const desAsserterStr = mkDesAsserter('number_or_string', (n) => n.toString());\n\n fc.assert(\n fc.property(fc.double(), arbs.pathWithObj(), (num, pathWithObj) => {\n desAsserterNum.ok(pathWithObj, num);\n }),\n );\n\n fc.assert(\n fc.property(arbs.bigNum(), arbs.pathWithObj(), (bigNum, pathWithObj) => {\n if (bigNum.isEqualTo(bigNum.toNumber())) {\n desAsserterNum.ok(pathWithObj, bigNum);\n } else {\n desAsserterStr.ok(pathWithObj, bigNum);\n }\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/collections/ser-des/enable-big-numbers.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The test checks that the `mkDesAsserter` function correctly coerces values to either numbers or strings depending on their representation and compatibility with JavaScript's number precision.", "mode": "fast-check"} {"id": 56644, "name": "unknown", "code": "it('should handle to-number_or_string coercion properly', () => {\n const desAsserterNum = mkDesAsserter('number_or_string', Number);\n const desAsserterStr = mkDesAsserter('number_or_string', (n) => n.toString());\n\n fc.assert(\n fc.property(fc.double(), arbs.pathWithObj(), (num, pathWithObj) => {\n desAsserterNum.ok(pathWithObj, num);\n }),\n );\n\n fc.assert(\n fc.property(arbs.bigNum(), arbs.pathWithObj(), (bigNum, pathWithObj) => {\n if (bigNum.isEqualTo(bigNum.toNumber())) {\n desAsserterNum.ok(pathWithObj, bigNum);\n } else {\n desAsserterStr.ok(pathWithObj, bigNum);\n }\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/collections/ser-des/enable-big-numbers.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Coercion between numbers and strings is handled correctly based on the size and representation of the number.", "mode": "fast-check"} {"id": 54430, "name": "unknown", "code": "it('should produce a non empty string', () => {\n fc.assert(\n fc.property(romanNumberArb, (n) => {\n expect(toRoman(n)).not.toBe('');\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/003-misc/roman/main.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`toRoman` function produces a non-empty string for any input generated by `romanNumberArb`.", "mode": "fast-check"} {"id": 54431, "name": "unknown", "code": "it('should be injective', () => {\n fc.assert(\n fc.property(romanNumberArb, romanNumberArb, (n1, n2) => {\n fc.pre(n1 !== n2);\n expect(toRoman(n2)).not.toBe(toRoman(n1));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/003-misc/roman/main.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`toRoman` function produces distinct outputs for different input values.", "mode": "fast-check"} {"id": 56645, "name": "unknown", "code": "it('should allow a custom coercion function', () => {\n fc.assert(\n fc.property(fc.oneof(fc.double(), arbs.bigNum()), fc.anything(), arbs.pathWithObj(), (num, output, pathWithObj) => {\n const coerceFn = (n: number | BigNumber) => {\n assert.deepStrictEqual(n, num);\n return output;\n };\n\n const coerceFnAndTestPath = (n: number | BigNumber, path2: readonly PathSegment[]) => {\n assert.deepStrictEqual(pathWithObj[0], path2);\n return coerceFn(n);\n };\n\n mkDesAsserter(coerceFnAndTestPath, coerceFn).ok(pathWithObj, num);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/collections/ser-des/enable-big-numbers.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "A custom coercion function should correctly transform numbers or BigNumbers, while maintaining consistent path information.", "mode": "fast-check"} {"id": 56654, "name": "unknown", "code": "it('should deserialize object ids properly', () => {\n fc.assert(\n fc.property(arbs.oid(), (objectId) => {\n assert.deepStrictEqual(serdes.deserialize({ $objectId: objectId.toString() }, {}), objectId);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/collections/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The deserialization process should correctly convert `$objectId` strings back into their original object ID format.", "mode": "fast-check"} {"id": 56655, "name": "unknown", "code": "it(`should error when trying to serialize a ${type}`, () => {\n fc.assert(\n fc.property(arb, (value) => {\n assert.throws(() => serdes.serialize(value), { message: new RegExp(`${type} may not be used with collections by default\\\\..*`) });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/collections/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Serialization of a specific type should throw an error with a message indicating it cannot be used with collections by default.", "mode": "fast-check"} {"id": 56658, "name": "unknown", "code": "it('inherits the keyspace from the db if not set', () => {\n const { db } = initTestObjects();\n\n fc.assert(\n fc.property(fc.string().filter(Boolean), (ks) => {\n db.useKeyspace(ks);\n const tsc = mkTSlashC(db, db._httpClient, 'tsc', opts, undefined);\n assert.strictEqual(tsc.keyspace, ks);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/table-slash-coll.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "If the keyspace is not specified, it should default to the keyspace set in the database.", "mode": "fast-check"} {"id": 56659, "name": "unknown", "code": "it('works', () => {\n fc.assert(\n fc.property(fc.string(), fc.string(), (keyspace, name) => {\n const tsc = mkTSlashC(db, db._httpClient, name, opts, { keyspace });\n assert.strictEqual((tsc as any)[$CustomInspect](), `${cfg.className}(keyspace=\"${keyspace}\",name=\"${name}\")`);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/table-slash-coll.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The function `mkTSlashC` should produce an object that, when custom-inspected, outputs a string formatted as `className(keyspace=\"keyspace\",name=\"name\")`.", "mode": "fast-check"} {"id": 56661, "name": "unknown", "code": "it('should function as a way to sneak ser/des implementations onto an existing class', () => {\n class Unsuspecting {\n constructor(public readonly value: T) {}\n }\n\n (Unsuspecting.prototype as any)[$SerSym] = function (ctx: BaseSerCtx) {\n return ctx.replace(this.value);\n };\n\n (Unsuspecting as any)[$DesSym] = function (_: string, ctx: BaseSerCtx) {\n return ctx.mapAfter((v) => new Unsuspecting(v));\n };\n\n const UnsuspectingCodecClass = CodecsClass.asCodecClass(Unsuspecting);\n const UnsuspectingCodec = CodecsClass.forName('unsuspecting', UnsuspectingCodecClass);\n\n const serdes = new SerDesClass({ ...SerDesClass.cfg.empty, codecs: [UnsuspectingCodec] } as any);\n\n fc.assert(\n fc.property(cfg.datatypesArb({ count: 1 }), (datatypes) => {\n const unsuspecting = new Unsuspecting(datatypes[0].jsRep);\n\n const [actualSer] = serdes.serialize({ unsuspecting });\n assert.deepStrictEqual(actualSer, { unsuspecting: datatypes[0].jsonRep });\n\n const actualDes = serdes.deserialize(actualSer, desSchema({ unsuspecting: datatypes.definition! }));\n\n assert.deepStrictEqual(actualDes, { unsuspecting });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/ser-des/as-codec-class.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The test verifies that serialization and deserialization implementations can be dynamically attached to an existing class, ensuring they produce and consume the expected representations for the `Unsuspecting` class.", "mode": "fast-check"} {"id": 56662, "name": "unknown", "code": "it('should accept a builder function to easily build implementations without typing as any', () => {\n class Unsuspecting {\n constructor(public readonly value: T) {}\n }\n\n const UnsuspectingCodecClass = CodecsClass.asCodecClass(Unsuspecting, {\n serializeForTable(ctx) {\n return ctx.replace(this.value);\n },\n deserializeForTable(_, ctx) {\n return ctx.mapAfter((v) => new Unsuspecting(v));\n },\n serializeForCollection(ctx) {\n return ctx.replace(this.value);\n },\n deserializeForCollection(_, ctx) {\n return ctx.mapAfter((v) => new Unsuspecting(v));\n },\n });\n\n const UnsuspectingCodec = CodecsClass.forName('unsuspecting', UnsuspectingCodecClass);\n\n const serdes = new SerDesClass({ ...SerDesClass.cfg.empty, codecs: [UnsuspectingCodec] } as any);\n\n fc.assert(\n fc.property(cfg.datatypesArb({ count: 1 }), (datatypes) => {\n const unsuspecting = new Unsuspecting(datatypes[0].jsRep);\n\n const [actualSer] = serdes.serialize({ unsuspecting });\n assert.deepStrictEqual(actualSer, { unsuspecting: datatypes[0].jsonRep });\n\n const actualDes = serdes.deserialize(actualSer, desSchema({ unsuspecting: datatypes.definition! }));\n\n assert.deepStrictEqual(actualDes, { unsuspecting });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/ser-des/as-codec-class.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Accepts a builder function to create codec implementations, allowing serialization and deserialization of `Unsuspecting` objects without requiring `any` typing.", "mode": "fast-check"} {"id": 56663, "name": "unknown", "code": "it('should throw an error if the \"clazz\" is not some function', () => {\n fc.assert(\n fc.property(fc.anything(), (clazz) => {\n fc.pre(typeof clazz !== 'function');\n assert.throws(() => CodecsClass.asCodecClass(clazz as any), TypeError);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/ser-des/as-codec-class.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "An error is thrown if the input `clazz` is not a function when passed to `CodecsClass.asCodecClass`.", "mode": "fast-check"} {"id": 56664, "name": "unknown", "code": "it('should throw an error when calling a builder method on a non-idle cursor', () => {\n const properties = ['filter', 'sort', 'limit', 'project', 'hybridLimits', 'rerankOn', 'map'] satisfies (keyof FindAndRerankCursor)[];\n\n fc.assert(\n fc.property(fc.constantFrom(...properties), (builder) => {\n const cursor = new CursorImpl(parent, cfg.serdes, [{}, false]);\n cursor['_state'] = (Math.random() > .5) ? 'started' : 'closed';\n assert.throws(() => (cursor as any)[builder](), (e) => e instanceof CursorError && e.message.includes('on a running/closed cursor'));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/cursors/rerank-cursor.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "An error should be thrown when invoking a builder method on a cursor that is not in the 'idle' state.", "mode": "fast-check"} {"id": 54842, "name": "unknown", "code": "t.test('>>', t => {\n fc.assert(\n fc.property(fc.bigIntN(N), fc.bigIntN(15), (n, m) => {\n t.equal(t_shr(n, m), n >> m);\n }),\n {\n examples: [\n [1n, -1n],\n [-1n, 1n],\n [1n, 1n],\n [-1n, -1n],\n [0xdeadbeefn, 1n],\n [0xdeadbeefn, 8n],\n [0xdeadbeefn, 32n],\n [0xdeadbeefn, 64n],\n [-0xdeadbeefn, 64n]\n ]\n }\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/bits.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`t_shr` function should produce the same result as the native bitwise right shift operation for given big integers `n` and `m`.", "mode": "fast-check"} {"id": 56665, "name": "unknown", "code": "it('should create a new cursor with a new pre-serialized sort', () => {\n fc.assert(\n fc.property(arbs.record(fc.anything()), arbs.record(fc.anything()), (sort, oldOptions) => {\n const cursor = new CursorImpl(parent, cfg.serdes, [{}, false], oldOptions);\n\n const newSort = cfg.serdes.serialize(sort, SerDesTarget.Sort)[0];\n\n CursorInternalDeltaAsserter\n .captureImmutDelta(cursor._internal, () => cursor.sort(sort as unknown as HybridSort)._internal)\n .assertDelta({ _options: { ...oldOptions, sort: newSort } });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/cursors/rerank-cursor.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "A new cursor should be created with an updated pre-serialized sort, maintaining immutability and correctly reflecting changes in internal options.", "mode": "fast-check"} {"id": 56666, "name": "unknown", "code": "it('should create a new cursor with a new limit', () => {\n fc.assert(\n fc.property(fc.nat(), arbs.record(fc.anything()), (limit, oldOptions) => {\n const cursor = new CursorImpl(parent, null!, [{}, false], oldOptions);\n\n CursorInternalDeltaAsserter\n .captureImmutDelta(cursor._internal, () => cursor.limit(limit)._internal)\n .assertDelta({ _options: { ...oldOptions, limit: limit || undefined } });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/cursors/rerank-cursor.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`CursorImpl` generates a new cursor reflecting an updated limit without altering other options.", "mode": "fast-check"} {"id": 56667, "name": "unknown", "code": "it('should create a new cursor with a new projection', () => {\n fc.assert(\n fc.property(arbs.record(fc.oneof(fc.constantFrom(0, 1), fc.boolean())), arbs.record(fc.anything()), (projection, oldOptions) => {\n const cursor = new CursorImpl(parent, null!, [{}, false], oldOptions);\n\n CursorInternalDeltaAsserter\n .captureImmutDelta(cursor._internal, () => cursor.project(projection)._internal)\n .assertDelta({ _options: { ...oldOptions, projection } });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/cursors/rerank-cursor.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "A new cursor should be created with an updated projection, verifying the internal state change reflects the new projection while retaining other options.", "mode": "fast-check"} {"id": 56668, "name": "unknown", "code": "it('should create a new cursor with new hybrid limits', () => {\n fc.assert(\n fc.property(fc.oneof(fc.nat(), arbs.record(fc.nat())), arbs.record(fc.anything()), (limits, oldOptions) => {\n const cursor = new CursorImpl(parent, null!, [{}, false], oldOptions);\n\n CursorInternalDeltaAsserter\n .captureImmutDelta(cursor._internal, () => cursor.hybridLimits(limits)._internal)\n .assertDelta({ _options: { ...oldOptions, hybridLimits: limits } });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/cursors/rerank-cursor.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`CursorImpl` creates a new cursor with updated hybrid limits, ensuring that the internal options reflect these changes.", "mode": "fast-check"} {"id": 56669, "name": "unknown", "code": "it('should create a new cursor with new rerankOn configuration', () => {\n fc.assert(\n fc.property(fc.string(), arbs.record(fc.anything()), (rerankField, oldOptions) => {\n const cursor = new CursorImpl(parent, null!, [{}, false], oldOptions);\n\n CursorInternalDeltaAsserter\n .captureImmutDelta(cursor._internal, () => cursor.rerankOn(rerankField)._internal)\n .assertDelta({ _options: { ...oldOptions, rerankOn: rerankField } });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/cursors/rerank-cursor.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Creating a new cursor should update the `rerankOn` field in `_options` with the new configuration while retaining other existing options.", "mode": "fast-check"} {"id": 56670, "name": "unknown", "code": "it('should create a new cursor with new rerankQuery configuration', () => {\n fc.assert(\n fc.property(fc.string(), arbs.record(fc.anything()), (rerankQuery, oldOptions) => {\n const cursor = new CursorImpl(parent, null!, [{}, false], oldOptions);\n\n CursorInternalDeltaAsserter\n .captureImmutDelta(cursor._internal, () => cursor.rerankQuery(rerankQuery)._internal)\n .assertDelta({ _options: { ...oldOptions, rerankQuery: rerankQuery } });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/cursors/rerank-cursor.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Creating a new cursor with a `rerankQuery` updates the `_options` configuration while ensuring immutability.", "mode": "fast-check"} {"id": 56671, "name": "unknown", "code": "it('should create a new cursor with new includeScores configuration', () => {\n fc.assert(\n fc.property(fc.boolean(), arbs.record(fc.anything()), (includeScores, oldOptions) => {\n const cursor = new CursorImpl(parent, null!, [{}, false], oldOptions);\n\n CursorInternalDeltaAsserter\n .captureImmutDelta(cursor._internal, () => cursor.includeScores(includeScores)._internal)\n .assertDelta({ _options: { ...oldOptions, includeScores: includeScores } });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/cursors/rerank-cursor.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Creating a new cursor should update the `_options` property to include a new `includeScores` configuration.", "mode": "fast-check"} {"id": 56672, "name": "unknown", "code": "it('should create a new cursor with sort vector included', () => {\n fc.assert(\n fc.property(fc.constantFrom(undefined, true, false), arbs.record(fc.anything()), (include, oldOptions) => {\n const cursor = new CursorImpl(parent, null!, [{}, false], oldOptions);\n\n CursorInternalDeltaAsserter\n .captureImmutDelta(cursor._internal, () => cursor.includeSortVector(include)._internal)\n .assertDelta({ _options: { ...oldOptions, includeSortVector: include ?? true } });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/cursors/rerank-cursor.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Including a sort vector in the creation of a new cursor properly updates the internal options with the `includeSortVector` flag.", "mode": "fast-check"} {"id": 56673, "name": "unknown", "code": "it('should create a new cursor with the initial page state set if a string', () => {\n fc.assert(\n fc.property(fc.string(), arbs.record(fc.anything()), (pageState, oldOptions) => {\n const cursor = new CursorImpl(parent, null!, [{}, false], oldOptions);\n\n CursorDeltaAsserter\n .captureImmutDelta(cursor, () => cursor.initialPageState(pageState))\n .assertDelta({ _currentPage: { nextPageState: pageState, result: [] } });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/cursors/rerank-cursor.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Creating a new cursor sets the initial page state with a given string, verifying that `_currentPage.nextPageState` is updated correctly.", "mode": "fast-check"} {"id": 56675, "name": "unknown", "code": "it('should error if initialPageState is null', () => {\n fc.assert(\n fc.property(arbs.record(fc.anything()), (oldOptions) => {\n const cursor = new CursorImpl(parent, null!, [{}, false], oldOptions);\n\n assert.throws(() => cursor.initialPageState(null!), (e) => {\n return e instanceof CursorError && e.message.includes('Cannot set an initial page state to `null`');\n });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/cursors/rerank-cursor.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "An error is thrown when `initialPageState` is set to `null` in `CursorImpl`.", "mode": "fast-check"} {"id": 56677, "name": "unknown", "code": "it('works', () => {\n fc.assert(\n fc.property(arbs.cursorState(), fc.nat(), fc.nat(), (state, consumed, buffered) => {\n const cursor = new CursorImpl(parent, null!, [{}, false]);\n cursor['_state'] = state;\n cursor['_consumed'] = consumed;\n cursor['_currentPage'] = { nextPageState: null, result: new Array(buffered) };\n\n assert.strictEqual((cursor as any)[$CustomInspect](), `${CursorImpl.name}(source=\"${parent.keyspace}.${parent.name}\",state=\"${state}\",consumed=${consumed},buffered=${buffered})`);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/cursors/rerank-cursor.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The `CursorImpl` object's custom inspection string representation includes its source, state, consumed count, and buffered count, formatted correctly.", "mode": "fast-check"} {"id": 56678, "name": "unknown", "code": "it('should throw an error when calling a builder method on a non-idle cursor', () => {\n const properties = ['filter', 'sort', 'limit', 'skip', 'project', 'includeSimilarity', 'includeSortVector', 'map'] satisfies (keyof FindCursor)[];\n\n fc.assert(\n fc.property(fc.constantFrom(...properties), (builder) => {\n const cursor = new CursorImpl(parent, cfg.serdes, [{}, false]);\n cursor['_state'] = (Math.random() > .5) ? 'started' : 'closed';\n assert.throws(() => (cursor as any)[builder](), (e) => e instanceof CursorError && e.message.includes('on a running/closed cursor'));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/cursors/find-cursor.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Calling a builder method on a non-idle cursor should throw a `CursorError` indicating the cursor is running or closed.", "mode": "fast-check"} {"id": 56679, "name": "unknown", "code": "it('should create a new cursor with a new pre-serialized sort', () => {\n fc.assert(\n fc.property(arbs.record(fc.anything()), arbs.record(fc.anything()), (sort, oldOptions) => {\n const cursor = new CursorImpl(parent, cfg.serdes, [{}, false], oldOptions);\n\n const newSort = cfg.serdes.serialize(sort, SerDesTarget.Sort)[0];\n\n CursorInternalDeltaAsserter\n .captureImmutDelta(cursor._internal, () => cursor.sort(sort as Sort)._internal)\n .assertDelta({ _options: { ...oldOptions, sort: newSort } });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/cursors/find-cursor.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "A new cursor should be created with an updated pre-serialized sort, ensuring the internal options reflect this change while maintaining immutability.", "mode": "fast-check"} {"id": 56680, "name": "unknown", "code": "it('should create a new cursor with a new limit', () => {\n fc.assert(\n fc.property(fc.nat(), arbs.record(fc.anything()), (limit, oldOptions) => {\n const cursor = new CursorImpl(parent, null!, [{}, false], oldOptions);\n\n CursorInternalDeltaAsserter\n .captureImmutDelta(cursor._internal, () => cursor.limit(limit)._internal)\n .assertDelta({ _options: { ...oldOptions, limit: limit || undefined } });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/cursors/find-cursor.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Creating a new cursor should update its `_options` with the specified limit, preserving other options.", "mode": "fast-check"} {"id": 56681, "name": "unknown", "code": "it('should create a new cursor with a new skip', () => {\n fc.assert(\n fc.property(fc.nat(), arbs.record(fc.anything()), (skip, oldOptions) => {\n const cursor = new CursorImpl(parent, null!, [{}, false], oldOptions);\n\n CursorInternalDeltaAsserter\n .captureImmutDelta(cursor._internal, () => cursor.skip(skip)._internal)\n .assertDelta({ _options: { ...oldOptions, skip } });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/cursors/find-cursor.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "A new cursor, when given a skip value, should update its internal options to reflect the new skip while preserving other options.", "mode": "fast-check"} {"id": 56683, "name": "unknown", "code": "it('should create a new cursor with similarity included', () => {\n fc.assert(\n fc.property(fc.constantFrom(undefined, true, false), arbs.record(fc.anything()), (include, oldOptions) => {\n const cursor = new CursorImpl(parent, null!, [{}, false], oldOptions);\n\n CursorInternalDeltaAsserter\n .captureImmutDelta(cursor._internal, () => cursor.includeSimilarity(include)._internal)\n .assertDelta({ _options: { ...oldOptions, includeSimilarity: include ?? true } });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/cursors/find-cursor.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "A new cursor should be created with the similarity option included, ensuring the internal state reflects this change based on the provided options.", "mode": "fast-check"} {"id": 56688, "name": "unknown", "code": "it('should return a brand new cursor with the same config', () => {\n const allArbs = [\n arbs.record(fc.anything()),\n arbs.record(fc.anything()),\n fc.func(fc.anything()),\n fc.array(fc.anything()),\n arbs.cursorState(),\n fc.nat(),\n fc.string(),\n ];\n\n fc.assert(\n fc.property(...allArbs, (filter, options, mapping, buffer, state, consumed, qs) => {\n const cursor = new CursorImpl(parent, null!, [filter, false], options, mapping);\n\n cursor['_currentPage'] = { nextPageState: qs, result: buffer };\n cursor['_state'] = state;\n cursor['_consumed'] = consumed;\n\n CursorDeltaAsserter\n .captureImmutDelta(cursor, () => {\n return cursor.clone();\n })\n .assertDelta({\n _currentPage: undefined,\n _state: 'idle',\n _consumed: 0,\n });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/cursors/find-cursor.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Cloning a cursor should produce a new cursor with reset properties, maintaining the original configuration but setting `_currentPage` to undefined, `_state` to 'idle', and `_consumed` to 0.", "mode": "fast-check"} {"id": 56689, "name": "unknown", "code": "it('works', () => {\n fc.assert(\n fc.property(arbs.cursorState(), fc.nat(), fc.nat(), (state, consumed, buffered) => {\n const cursor = new CursorImpl(parent, null!, [{}, false]);\n cursor['_state'] = state;\n cursor['_consumed'] = consumed;\n cursor['_currentPage'] = { nextPageState: null, result: new Array(buffered) };\n\n assert.strictEqual((cursor as any)[$CustomInspect](), `${CursorImpl.name}(source=\"${parent.keyspace}.${parent.name}\",state=\"${state}\",consumed=${consumed},buffered=${buffered})`);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/cursors/find-cursor.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The custom inspect method of `CursorImpl` should return a string representation that includes the source, state, consumed, and buffered values of the cursor.", "mode": "fast-check"} {"id": 56690, "name": "unknown", "code": "it('should return the length of cursor._currentPage.result', () => {\n fc.assert(\n fc.property(fc.nat(), (count) => {\n const cursor = new CursorImpl(parent, null!, [{}, false]);\n cursor['_currentPage'] = { nextPageState: null, result: Array(count) };\n assert.strictEqual(cursor.buffered(), count);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/cursors/abstract-cursor.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The `buffered` method should return the length of the `result` array in `cursor._currentPage`.", "mode": "fast-check"} {"id": 56692, "name": "unknown", "code": "it('should consume all docs & increase consumed() if no max parameter passed', () => {\n fc.assert(\n fc.property(fc.array(fc.anything()), (buffer) => {\n const cursor = new CursorImpl(parent, null!, [{}, false]);\n cursor['_currentPage'] = { nextPageState: null, result: [...buffer] as SomeDoc[] };\n\n assert.strictEqual(cursor.consumed(), 0);\n assert.strictEqual(cursor.buffered(), buffer.length);\n\n DeltaAsserter\n .captureMutDelta(cursor, () => {\n const consumed = cursor.consumeBuffer();\n assert.deepStrictEqual(consumed, buffer);\n })\n .assertDelta({\n _consumed: buffer.length,\n _currentPage: { nextPageState: null, result: [] },\n });\n\n assert.strictEqual(cursor.consumed(), buffer.length);\n assert.strictEqual(cursor.buffered(), 0);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/cursors/abstract-cursor.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The cursor should consume all documents, increasing the consumed count, when no max parameter is specified.", "mode": "fast-check"} {"id": 56693, "name": "unknown", "code": "it('should consume the max docs possible & increase consumed() if max parameter passed', () => {\n fc.assert(\n fc.property(fc.array(fc.anything()), fc.nat(), (buffer, max) => {\n const cursor = new CursorImpl(parent, null!, [{}, false]);\n cursor['_currentPage'] = { nextPageState: null, result: [...buffer] as SomeDoc[] };\n\n assert.strictEqual(cursor.consumed(), 0);\n assert.strictEqual(cursor.buffered(), buffer.length);\n\n const expectedConsumed = Math.min(buffer.length, max);\n\n DeltaAsserter\n .captureMutDelta(cursor, () => {\n const consumed = cursor.consumeBuffer(max);\n assert.deepStrictEqual(consumed, buffer.slice(0, expectedConsumed));\n })\n .assertDelta({\n _consumed: expectedConsumed,\n _currentPage: { nextPageState: null, result: buffer.slice(expectedConsumed) },\n });\n\n assert.strictEqual(cursor.consumed(), expectedConsumed);\n assert.strictEqual(cursor.buffered(), buffer.length - expectedConsumed);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/cursors/abstract-cursor.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The cursor should consume up to a maximum number of documents from the buffer, updating its consumed count accordingly, when a max parameter is specified.", "mode": "fast-check"} {"id": 56695, "name": "unknown", "code": "it('should reset the state, consumed count, currentPage, and isNextPage', () => {\n fc.assert(\n fc.property(fc.array(fc.anything()), fc.integer(), fc.option(fc.string()), fc.constantFrom('idle', 'started', 'closed'), (buffer, consumed, qs, state) => {\n const cursor = new CursorImpl(parent, null!, [{}, false]);\n cursor['_currentPage'] = { nextPageState: qs, result: [...buffer] as SomeDoc[] };\n cursor['_consumed'] = consumed;\n cursor['_state'] = state;\n cursor['_isNextPage'] = false;\n\n assert.strictEqual(cursor.state, state);\n assert.strictEqual(cursor.buffered(), buffer.length);\n assert.strictEqual(cursor.consumed(), consumed);\n\n DeltaAsserter\n .captureMutDelta(cursor, () => {\n cursor.rewind();\n })\n .assertDelta({\n _state: 'idle',\n _consumed: 0,\n _currentPage: undefined,\n _isNextPage: true,\n });\n\n assert.strictEqual(cursor.state, 'idle');\n assert.strictEqual(cursor.buffered(), 0);\n assert.strictEqual(cursor.consumed(), 0);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/cursors/abstract-cursor.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The `rewind` method resets the cursor's state to 'idle', sets consumed count to 0, clears the current page, and sets `isNextPage` to true.", "mode": "fast-check"} {"id": 56697, "name": "unknown", "code": "it('should reset the buffer but not consumed', () => {\n fc.assert(\n fc.property(fc.array(fc.anything()), fc.integer(), (buffer, consumed) => {\n const cursor = new CursorImpl(parent, null!, [{}, false]);\n cursor['_currentPage'] = { nextPageState: null, result: [...buffer] as SomeDoc[] };\n cursor['_consumed'] = consumed;\n\n assert.strictEqual(cursor.buffered(), buffer.length);\n assert.strictEqual(cursor.consumed(), consumed);\n\n DeltaAsserter\n .captureMutDelta(cursor, () => {\n cursor.close();\n })\n .assertDelta({\n _state: 'closed',\n _currentPage: undefined,\n });\n\n assert.strictEqual(cursor.buffered(), 0);\n assert.strictEqual(cursor.consumed(), consumed);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/cursors/abstract-cursor.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Resetting the buffer on `CursorImpl` should not affect the `consumed` count after closing the cursor, ensuring that only the `_state` and `_currentPage` change.", "mode": "fast-check"} {"id": 56698, "name": "unknown", "code": "it('should ser/des keys with matching names', () => {\n const arb = fc.jsonValue({ depthSize: 'medium' })\n .filter((val) => !!val && typeof val === 'object')\n .filter((val) => Object.keys(val).length > 0)\n .chain((val) => {\n return fc.tuple(fc.constant(val), fc.constantFrom(...Object.keys(val)));\n });\n\n fc.assert(\n fc.property(arb, ([obj, targetKey]) => {\n const codec = CodecsClass.forName(targetKey, {\n serialize: (v: any, ctx: BaseSerDesCtx) => ctx.done(JSON.stringify(v)),\n deserialize: (v: any, ctx: BaseSerDesCtx) => ctx.done(JSON.stringify(v)),\n });\n\n const serdes = mkSerDesWithCodecs([codec]);\n\n const expectedObj = structuredClone(obj);\n traverseObject(expectedObj, (obj, key) => {\n fc.pre(key !== '');\n\n if (String(key) === targetKey) {\n obj[key] = JSON.stringify(obj[key]);\n }\n });\n\n assert.deepStrictEqual(serdes.serialize(obj), [expectedObj, false]);\n assert.deepStrictEqual(serdes.deserialize(obj, { status: { projectionSchema: {} } }), expectedObj);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/ser-des/for-name.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Keys matching their name are serialized and deserialized correctly using specified codecs.", "mode": "fast-check"} {"id": 56699, "name": "unknown", "code": "it('should not do anything when returning ctx.nevermind()', () => {\n const arb = arbs.jsonObj()\n .filter((val) => Object.keys(val).length > 0)\n .chain((val) => {\n return fc.tuple(fc.constant(val), fc.constantFrom(...Object.keys(val)));\n });\n\n fc.assert(\n fc.property(arb, fc.integer({ min: 1, max: 100 }), ([obj, targetKey], numCodecs) => {\n const matchingValuesSet = new Set();\n let expectMatched = 0, matchedSer = 0, matchedDes = 0;\n\n const codec = CodecsClass.forName(targetKey, {\n serialize(v: any, ctx: BaseSerDesCtx) {\n assert.ok(matchingValuesSet.has(v));\n matchedSer++;\n return ctx.nevermind();\n },\n deserialize(v: any, ctx: BaseSerDesCtx) {\n assert.ok(matchingValuesSet.has(v));\n matchedDes++;\n return ctx.nevermind();\n },\n });\n\n const serdes = mkSerDesWithCodecs(Array(numCodecs).fill(codec));\n\n traverseObject(obj, (obj, key) => {\n fc.pre(key !== '');\n\n if (String(key) === targetKey) {\n matchingValuesSet.add(obj[key]);\n expectMatched++;\n }\n });\n\n assert.deepStrictEqual(serdes.serialize(obj), [obj, false]);\n assert.deepStrictEqual(serdes.deserialize(obj, { status: { projectionSchema: {} } }), obj);\n assert.ok(matchingValuesSet.size > 0);\n assert.ok(expectMatched >= matchingValuesSet.size);\n assert.strictEqual(matchedSer, expectMatched * numCodecs);\n assert.strictEqual(matchedDes, expectMatched * numCodecs);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/ser-des/for-name.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Verifies that when using `ctx.nevermind()` in serialization and deserialization, the operation effectively results in the original object being returned without alteration, ensuring correct serialization and deserialization counts match expectations.", "mode": "fast-check"} {"id": 56702, "name": "unknown", "code": "it('should be associative', () => {\n fc.assert(\n fc.property(valueArb, valueArb, valueArb, (a, b, c) => {\n assert.deepStrictEqual(\n handler.concat([a, handler.concat([b, c])]),\n handler.concat([handler.concat([a, b]), c]),\n );\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/testlib/laws.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The concatenation operation should be associative.", "mode": "fast-check"} {"id": 54864, "name": "unknown", "code": "t.test('factorials', t => {\n fc.assert(\n fc.property(fc.integer({ min: 5, max: N }), n => {\n t.equal(t_fact(n), BigIntMath.fact(BigInt(n)));\n }),\n {\n examples: [[0], [1], [10], [100], [1000]]\n }\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/fact.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The test verifies that the `t_fact` function produces the same result as `BigIntMath.fact` for integers between 5 and a specified maximum, including specific cases like 0, 1, 10, 100, and 1000.", "mode": "fast-check"} {"id": 56703, "name": "unknown", "code": "it('should follow identity laws', () => {\n fc.assert(\n fc.property(valueArb, (layer) => {\n assert.deepStrictEqual(handler.concat([layer, handler.empty]), layer);\n assert.deepStrictEqual(handler.concat([handler.empty, layer]), layer);\n }),\n );\n assert.deepStrictEqual(handler.concat([handler.empty, handler.empty]), handler.empty);\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/testlib/laws.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Concatenating a value with an empty element should return the original value, and concatenating two empty elements should return an empty element.", "mode": "fast-check"} {"id": 56704, "name": "unknown", "code": "test('pass', () => {\n fc.assert(\n fc.property(fc.anything(), (actual) => {\n return Match.ANY(actual);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/aws/jsii-compiler/test/tsconfig/validator.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aws/jsii-compiler", "url": "https://github.com/aws/jsii-compiler.git", "license": "Apache-2.0", "stars": 38, "forks": 18}, "metrics": null, "summary": "`Match.ANY` should return true for any input value.", "mode": "fast-check"} {"id": 56705, "name": "unknown", "code": "test('pass', () => {\n fc.assert(\n fc.property(\n fc\n .array(fc.oneof(fc.string(), fc.integer(), fc.float()), {\n minLength: 1,\n })\n .chain((allowed) => fc.tuple(fc.constant(allowed), fc.constantFrom(...allowed))),\n ([allowed, actual]) => {\n return Match.oneOf(...allowed)(actual);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aws/jsii-compiler/test/tsconfig/validator.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aws/jsii-compiler", "url": "https://github.com/aws/jsii-compiler.git", "license": "Apache-2.0", "stars": 38, "forks": 18}, "metrics": null, "summary": "`Match.oneOf` returns true for an `actual` value that is included in the `allowed` array.", "mode": "fast-check"} {"id": 56706, "name": "unknown", "code": "test('fail', () => {\n fc.assert(\n fc.property(\n fc.uniqueArray(fc.oneof(fc.string(), fc.integer(), fc.float()), {\n minLength: 1,\n }),\n (possible) => {\n const allowed = possible.slice(0, -1);\n const actual = possible.at(-1);\n return !Match.oneOf(...allowed)(actual, {\n reporter: expectViolation('Expected value to be one of', allowed, actual),\n });\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aws/jsii-compiler/test/tsconfig/validator.test.ts", "start_line": null, "end_line": null, "dependencies": ["expectViolation"], "repo": {"name": "aws/jsii-compiler", "url": "https://github.com/aws/jsii-compiler.git", "license": "Apache-2.0", "stars": 38, "forks": 18}, "metrics": null, "summary": "The test verifies that if the last element of a unique array is not in the preceding elements, `Match.oneOf` will correctly trigger a violation message indicating the actual value was not expected.", "mode": "fast-check"} {"id": 56707, "name": "unknown", "code": "test('pass', () => {\n fc.assert(\n fc.property(fc.anything(), (value) => {\n return Match.eq(value)(value);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/aws/jsii-compiler/test/tsconfig/validator.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aws/jsii-compiler", "url": "https://github.com/aws/jsii-compiler.git", "license": "Apache-2.0", "stars": 38, "forks": 18}, "metrics": null, "summary": "Evaluates that `Match.eq` correctly identifies any value as equal to itself.", "mode": "fast-check"} {"id": 56708, "name": "unknown", "code": "test('fail', () => {\n fc.assert(\n fc.property(\n fc.uniqueArray(\n // Need to remove empty arrays here as they are equal to each other\n fc.anything(),\n {\n minLength: 2,\n maxLength: 2,\n // mimic what the matcher does\n // this uses loose equality, while catching any not comparable values\n comparator: (a, b) => {\n try {\n return a == b || Match.arrEq(a as any)(b);\n } catch {\n return false;\n }\n },\n },\n ),\n ([expected, actual]) => {\n const keyword = Array.isArray(expected) ? 'array' : 'value';\n return !Match.eq(expected)(actual, { reporter: expectViolation(`Expected ${keyword}`, expected, actual) });\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aws/jsii-compiler/test/tsconfig/validator.test.ts", "start_line": null, "end_line": null, "dependencies": ["expectViolation"], "repo": {"name": "aws/jsii-compiler", "url": "https://github.com/aws/jsii-compiler.git", "license": "Apache-2.0", "stars": 38, "forks": 18}, "metrics": null, "summary": "Ensures that when two unique, non-identical values or arrays are compared using `Match.eq`, the comparison fails, triggering the `expectViolation` function to validate the message content.", "mode": "fast-check"} {"id": 56709, "name": "unknown", "code": "test('pass', () => {\n fc.assert(\n fc.property(\n fc\n .array(arrayEl)\n .chain((expected) =>\n fc.tuple(\n fc.constant(expected),\n fc.shuffledSubarray(expected, { minLength: expected.length, maxLength: expected.length }),\n ),\n ),\n ([expected, actual]) => {\n return Match.arrEq(expected)(actual);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aws/jsii-compiler/test/tsconfig/validator.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aws/jsii-compiler", "url": "https://github.com/aws/jsii-compiler.git", "license": "Apache-2.0", "stars": 38, "forks": 18}, "metrics": null, "summary": "`Match.arrEq` confirms that a shuffled subarray of `expected` with the same length is equal to `expected`.", "mode": "fast-check"} {"id": 56710, "name": "unknown", "code": "test('fail', () => {\n fc.assert(\n fc.property(\n fc.uniqueArray(arrayEl, {\n minLength: 1,\n }),\n fc.array(arrayEl),\n (possible, actualBase) => {\n const expected = possible.slice(0, -1);\n const actual = [...actualBase, possible.at(-1)];\n return !Match.arrEq(expected)(actual, {\n reporter: expectViolation('Expected array matching', expected, actual),\n });\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aws/jsii-compiler/test/tsconfig/validator.test.ts", "start_line": null, "end_line": null, "dependencies": ["expectViolation"], "repo": {"name": "aws/jsii-compiler", "url": "https://github.com/aws/jsii-compiler.git", "license": "Apache-2.0", "stars": 38, "forks": 18}, "metrics": null, "summary": "The property ensures that when an array is created by appending an element from a unique array, a mismatch is detected between the expected and actual arrays using a custom reporting function.", "mode": "fast-check"} {"id": 56711, "name": "unknown", "code": "test('pass', () => {\n fc.assert(\n fc.property(fc.string(), (value) => {\n return Match.strEq(value, true)(value);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/aws/jsii-compiler/test/tsconfig/validator.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aws/jsii-compiler", "url": "https://github.com/aws/jsii-compiler.git", "license": "Apache-2.0", "stars": 38, "forks": 18}, "metrics": null, "summary": "`Match.strEq` should return true when the input string is compared to itself.", "mode": "fast-check"} {"id": 56713, "name": "unknown", "code": "test('pass', () => {\n fc.assert(\n fc.property(\n fc.string({ minLength: 1 }).chain((s) => fc.tuple(fc.constant(s), fc.mixedCase(fc.constant(s)))),\n ([expected, actual]) => {\n return Match.strEq(expected, false)(actual);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aws/jsii-compiler/test/tsconfig/validator.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aws/jsii-compiler", "url": "https://github.com/aws/jsii-compiler.git", "license": "Apache-2.0", "stars": 38, "forks": 18}, "metrics": null, "summary": "`Match.strEq` should return true when comparing a string with its mixed-case variant.", "mode": "fast-check"} {"id": 56714, "name": "unknown", "code": "test('fail', () => {\n fc.assert(\n fc.property(\n fc.uniqueArray(fc.string(), {\n minLength: 2,\n maxLength: 2,\n }),\n ([expected, actual]) => {\n return !Match.strEq(expected, true)(actual, {\n reporter: expectViolation('Expected string', expected, actual),\n });\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aws/jsii-compiler/test/tsconfig/validator.test.ts", "start_line": null, "end_line": null, "dependencies": ["expectViolation"], "repo": {"name": "aws/jsii-compiler", "url": "https://github.com/aws/jsii-compiler.git", "license": "Apache-2.0", "stars": 38, "forks": 18}, "metrics": null, "summary": "The test ensures that `Match.strEq` correctly identifies strings as different when they are not equal, triggering `expectViolation` with a specific error message that includes both strings.", "mode": "fast-check"} {"id": 56715, "name": "unknown", "code": "test('fail', () => {\n fc.assert(\n fc.property(\n fc.anything().filter((v) => !(v === undefined || v === null)),\n (actual) => {\n return !Match.MISSING(actual);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aws/jsii-compiler/test/tsconfig/validator.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aws/jsii-compiler", "url": "https://github.com/aws/jsii-compiler.git", "license": "Apache-2.0", "stars": 38, "forks": 18}, "metrics": null, "summary": "`Match.MISSING` should not return true for any value that is not `undefined` or `null`.", "mode": "fast-check"} {"id": 56716, "name": "unknown", "code": "test('throws for non objects', () => {\n fc.assert(\n fc.property(fc.oneof(fc.anything({ maxDepth: 0 }), fc.array(fc.anything())), (data: any) => {\n const validator = new ObjectValidator(new RuleSet(), 'testData');\n expect(() => validator.validate(data)).toThrow('Provided data must be an object');\n }),\n );\n })", "language": "typescript", "source_file": "./repos/aws/jsii-compiler/test/tsconfig/validator.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aws/jsii-compiler", "url": "https://github.com/aws/jsii-compiler.git", "license": "Apache-2.0", "stars": 38, "forks": 18}, "metrics": null, "summary": "Validates that the `ObjectValidator` throws an error if the input data is not an object.", "mode": "fast-check"} {"id": 56719, "name": "unknown", "code": "test('strict', () => {\n fc.assert(\n fc.property(\n fcTsconfig({\n compilerRuleSet: rulesForStrict,\n }),\n (config) => {\n const validator = new TypeScriptConfigValidator(TypeScriptConfigValidationRuleSet.STRICT);\n validator.validate(config);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aws/jsii-compiler/test/tsconfig/tsconfig-validator.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aws/jsii-compiler", "url": "https://github.com/aws/jsii-compiler.git", "license": "Apache-2.0", "stars": 38, "forks": 18}, "metrics": null, "summary": "Validating that a TypeScript configuration adheres to the `STRICT` rule set using a `TypeScriptConfigValidator`.", "mode": "fast-check"} {"id": 56720, "name": "unknown", "code": "it('Should always generate values within the range [from ; to]', () =>\n fc.assert(\n fc.property(fc.noShrink(fc.integer()), fc.maxSafeInteger(), fc.maxSafeInteger(), (seed, a, b) => {\n const [from, to] = a < b ? [a, b] : [b, a];\n const [v, _nrng] = uniformIntDistribution(from, to)(mersenne(seed));\n return v >= from && v <= to;\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/pure-rand/test/unit/distribution/UniformIntDistribution.noreg.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/pure-rand", "url": "https://github.com/dubzzz/pure-rand.git", "license": "MIT", "stars": 88, "forks": 4}, "metrics": null, "summary": "Generated values should always fall within the specified inclusive range \\([from; to]\\) using `uniformIntDistribution`.", "mode": "fast-check"} {"id": 56721, "name": "unknown", "code": "it('Should always generate values within the range [from ; to]', () =>\n fc.assert(\n fc.property(fc.noShrink(fc.integer()), arrayIntArb(), arrayIntArb(), (seed, a, b) => {\n const [from, to] = arrayIntToBigInt(a) < arrayIntToBigInt(b) ? [a, b] : [b, a];\n const [v, _nrng] = uniformArrayIntDistribution(from, to)(mersenne(seed));\n const vBigInt = arrayIntToBigInt(v);\n return vBigInt >= arrayIntToBigInt(from) && vBigInt <= arrayIntToBigInt(to);\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/pure-rand/test/unit/distribution/UniformArrayIntDistribution.noreg.spec.ts", "start_line": null, "end_line": null, "dependencies": ["arrayIntArb", "arrayIntToBigInt"], "repo": {"name": "dubzzz/pure-rand", "url": "https://github.com/dubzzz/pure-rand.git", "license": "MIT", "stars": 88, "forks": 4}, "metrics": null, "summary": "Generated values from `uniformArrayIntDistribution` should lie within the range defined by two `ArrayInt` values converted to `BigInt`.", "mode": "fast-check"} {"id": 56722, "name": "unknown", "code": "it('Should always trim the zeros from the resulting value', () =>\n fc.assert(\n fc.property(fc.noShrink(fc.integer()), arrayIntArb(), arrayIntArb(), (seed, a, b) => {\n const [from, to] = arrayIntToBigInt(a) < arrayIntToBigInt(b) ? [a, b] : [b, a];\n const [v, _nrng] = uniformArrayIntDistribution(from, to)(mersenne(seed));\n expect(v.data).not.toHaveLength(0);\n if (v.data.length !== 1) {\n expect(v.data[0]).not.toBe(0); // do not start by zero when data has multiple values\n } else if (v.data[0] === 0) {\n expect(v.sign).toBe(1); // zero has sign=1\n }\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/pure-rand/test/unit/distribution/UniformArrayIntDistribution.noreg.spec.ts", "start_line": null, "end_line": null, "dependencies": ["arrayIntArb", "arrayIntToBigInt"], "repo": {"name": "dubzzz/pure-rand", "url": "https://github.com/dubzzz/pure-rand.git", "license": "MIT", "stars": 88, "forks": 4}, "metrics": null, "summary": "The resulting value from `uniformArrayIntDistribution` should not have leading zeros in its data array, and if it's zero, the sign should be positive.", "mode": "fast-check"} {"id": 56723, "name": "unknown", "code": "it('Should always produce valid ArrayInt', () =>\n fc.assert(\n fc.property(fc.noShrink(fc.integer()), arrayIntArb(), arrayIntArb(), (seed, a, b) => {\n const [from, to] = arrayIntToBigInt(a) < arrayIntToBigInt(b) ? [a, b] : [b, a];\n const [v, _nrng] = uniformArrayIntDistribution(from, to)(mersenne(seed));\n expect([-1, 1]).toContainEqual(v.sign); // sign is either 1 or -1\n expect(v.data).not.toHaveLength(0); // data is never empty\n for (const d of v.data) {\n // data in [0 ; 0xffffffff]\n expect(d).toBeGreaterThanOrEqual(0);\n expect(d).toBeLessThanOrEqual(0xffffffff);\n }\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/pure-rand/test/unit/distribution/UniformArrayIntDistribution.noreg.spec.ts", "start_line": null, "end_line": null, "dependencies": ["arrayIntArb", "arrayIntToBigInt"], "repo": {"name": "dubzzz/pure-rand", "url": "https://github.com/dubzzz/pure-rand.git", "license": "MIT", "stars": 88, "forks": 4}, "metrics": null, "summary": "The test checks that `uniformArrayIntDistribution` generates non-empty `ArrayInt` values with a sign of either 1 or -1, and data elements within the range [0, 0xffffffff].", "mode": "fast-check"} {"id": 56724, "name": "unknown", "code": "test(\"sign and verify should be symmetric operations\", async () => {\n\t\t\tawait fc.assert(\n\t\t\t\tfc.asyncProperty(validPayloadArb, validKeyArb, async (payload, key) => {\n\t\t\t\t\t// Create a token with a key ID\n\t\t\t\t\tconst token = await JWT.sign({\n\t\t\t\t\t\tpayload,\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\theader: { kid: \"test-key-prop\" },\n\t\t\t\t\t});\n\n\t\t\t\t\t// Create a JWK Set with the key\n\t\t\t\t\tconst jwkSet: JWKKeySet = {\n\t\t\t\t\t\tkeys: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tkty: \"oct\",\n\t\t\t\t\t\t\t\tk: base64Url.encode(new TextEncoder().encode(key)),\n\t\t\t\t\t\t\t\tkid: \"test-key-prop\",\n\t\t\t\t\t\t\t\talg: \"HS256\",\n\t\t\t\t\t\t\t\tuse: \"sig\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t};\n\n\t\t\t\t\tconst result = await JWT.verify({\n\t\t\t\t\t\ttoken,\n\t\t\t\t\t\tkey: jwkSet,\n\t\t\t\t\t\taudience: payload.aud,\n\t\t\t\t\t\tissuer: payload.iss,\n\t\t\t\t\t});\n\t\t\t\t\treturn result.valid && result.payload.sub === payload.sub;\n\t\t\t\t}),\n\t\t\t\t{ numRuns: 10 }, // Limit runs for test performance\n\t\t\t);\n\t\t})", "language": "typescript", "source_file": "./repos/shuntksh/auth-utils/packages/jwt/tests/jwt.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "shuntksh/auth-utils", "url": "https://github.com/shuntksh/auth-utils.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Signing and verifying a JWT should be symmetric, ensuring that the verified token is valid and its subject matches the original payload.", "mode": "fast-check"} {"id": 56725, "name": "unknown", "code": "test(\"encrypt and decrypt should be symmetric operations\", async () => {\n\t\t\tawait fc.assert(\n\t\t\t\tfc.asyncProperty(validPayloadArb, validKeyArb, async (payload, key) => {\n\t\t\t\t\tconst token = await JWT.encrypt({ payload, key });\n\t\t\t\t\tconst result = await JWT.decrypt({\n\t\t\t\t\t\ttoken,\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\taudience: payload.aud,\n\t\t\t\t\t\tissuer: payload.iss,\n\t\t\t\t\t});\n\t\t\t\t\treturn result.valid && result.payload.sub === payload.sub;\n\t\t\t\t}),\n\t\t\t\t{ numRuns: 10 }, // Limit runs for test performance\n\t\t\t);\n\t\t})", "language": "typescript", "source_file": "./repos/shuntksh/auth-utils/packages/jwt/tests/jwt.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "shuntksh/auth-utils", "url": "https://github.com/shuntksh/auth-utils.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Encrypting and then decrypting a payload with a key should result in a valid output with the same subject.", "mode": "fast-check"} {"id": 56726, "name": "unknown", "code": "test(\"should encrypt and decrypt arbitrary payloads\", async () => {\n\t\tawait fc.assert(\n\t\t\tfc.asyncProperty(\n\t\t\t\tfc.object({\n\t\t\t\t\tmaxDepth: 2,\n\t\t\t\t\tkey: fc.string(),\n\t\t\t\t\tvalues: [fc.string(), fc.integer(), fc.boolean()],\n\t\t\t\t}),\n\t\t\t\tfc.string(),\n\t\t\t\tasync (arbitraryPayload, arbitraryKey) => {\n\t\t\t\t\t// Skip empty keys\n\t\t\t\t\tif (!arbitraryKey) return true;\n\n\t\t\t\t\tconst payload = { ...arbitraryPayload } as StandardClaims;\n\t\t\t\t\tconst token = await JWE.encrypt({ payload, key: arbitraryKey });\n\t\t\t\t\tconst decrypted = await JWE.decrypt({ token, key: arbitraryKey });\n\n\t\t\t\t\treturn JSON.stringify(decrypted.payload) === JSON.stringify(payload);\n\t\t\t\t},\n\t\t\t),\n\t\t\t{ numRuns: 10 }, // Limit runs for performance\n\t\t);\n\t})", "language": "typescript", "source_file": "./repos/shuntksh/auth-utils/packages/jwt/tests/jwe.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "shuntksh/auth-utils", "url": "https://github.com/shuntksh/auth-utils.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Encrypting and then decrypting arbitrary payloads with a non-empty key should yield an equivalent payload.", "mode": "fast-check"} {"id": 56727, "name": "unknown", "code": "test(\"should fail decryption with wrong key\", async () => {\n\t\tawait fc.assert(\n\t\t\tfc.asyncProperty(\n\t\t\t\tfc.object(),\n\t\t\t\tfc.string({ minLength: 1 }),\n\t\t\t\tfc.string({ minLength: 1 }),\n\t\t\t\tasync (arbitraryPayload, correctKey, wrongKey) => {\n\t\t\t\t\t// Skip if keys are the same\n\t\t\t\t\tif (correctKey === wrongKey) return true;\n\n\t\t\t\t\tconst payload = { ...arbitraryPayload } as StandardClaims;\n\t\t\t\t\tconst token = await JWE.encrypt({ payload, key: correctKey });\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait JWE.decrypt({ token, key: wrongKey });\n\t\t\t\t\t\treturn false; // Should not succeed\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\treturn true; // Expected to fail\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t),\n\t\t\t{ numRuns: 10 }, // Limit runs for performance\n\t\t);\n\t})", "language": "typescript", "source_file": "./repos/shuntksh/auth-utils/packages/jwt/tests/jwe.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "shuntksh/auth-utils", "url": "https://github.com/shuntksh/auth-utils.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Decryption should fail when a token encrypted with a correct key is attempted to be decrypted with a different, incorrect key.", "mode": "fast-check"} {"id": 56728, "name": "unknown", "code": "test(\"should sign and verify arbitrary payloads\", async () => {\n\t\tawait fc.assert(\n\t\t\tfc.asyncProperty(\n\t\t\t\tfc.object({\n\t\t\t\t\tmaxDepth: 2,\n\t\t\t\t\tkey: fc.string(),\n\t\t\t\t\tvalues: [fc.string(), fc.integer(), fc.boolean()],\n\t\t\t\t}),\n\t\t\t\tfc.string({ minLength: 1 }),\n\t\t\t\tasync (arbitraryPayload, arbitraryKey) => {\n\t\t\t\t\tconst payload = { ...arbitraryPayload } as StandardClaims;\n\t\t\t\t\tconst token = await JWS.sign({ payload, key: arbitraryKey });\n\t\t\t\t\tconst verified = await JWS.verify({ token, key: arbitraryKey });\n\n\t\t\t\t\treturn JSON.stringify(verified) === JSON.stringify(payload);\n\t\t\t\t},\n\t\t\t),\n\t\t\t{ numRuns: 10 }, // Limit runs for performance\n\t\t);\n\t})", "language": "typescript", "source_file": "./repos/shuntksh/auth-utils/packages/jwt/tests/jws.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "shuntksh/auth-utils", "url": "https://github.com/shuntksh/auth-utils.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Signing and verifying arbitrary payloads with a given key should result in the verified payload matching the original payload.", "mode": "fast-check"} {"id": 56729, "name": "unknown", "code": "test(\"should fail verification with wrong key\", async () => {\n\t\tawait fc.assert(\n\t\t\tfc.asyncProperty(\n\t\t\t\tfc.object(),\n\t\t\t\tfc.string({ minLength: 1 }),\n\t\t\t\tfc.string({ minLength: 1 }),\n\t\t\t\tasync (arbitraryPayload, correctKey, wrongKey) => {\n\t\t\t\t\t// Skip if keys are the same\n\t\t\t\t\tif (correctKey === wrongKey) return true;\n\n\t\t\t\t\tconst payload = { ...arbitraryPayload } as StandardClaims;\n\t\t\t\t\tconst token = await JWS.sign({ payload, key: correctKey });\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait JWS.verify({ token, key: wrongKey });\n\t\t\t\t\t\treturn false; // Should not succeed\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\treturn true; // Expected to fail\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t),\n\t\t\t{ numRuns: 10 }, // Limit runs for performance\n\t\t);\n\t})", "language": "typescript", "source_file": "./repos/shuntksh/auth-utils/packages/jwt/tests/jws.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "shuntksh/auth-utils", "url": "https://github.com/shuntksh/auth-utils.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Verifying a JWS token with an incorrect key should fail.", "mode": "fast-check"} {"id": 56731, "name": "unknown", "code": "it(\"should correctly produce different public keys for the different private keys [fuzz]\", async () => {\n await fc.assert(\n fc.asyncProperty(fc.bigInt({ min: 1n, max: L - 1n }), async (x: bigint) => {\n const publicKeys = new Map();\n const privateKeys: PrivKey[] = [];\n\n let i = 0n;\n\n while (x + i * r <= 2n ** 253n) {\n privateKeys.push(new PrivKey(x + i * r));\n i += 1n;\n }\n\n // eslint-disable-next-line no-restricted-syntax\n for (const privateKey of privateKeys) {\n const publicKey = mulPointEscalar(Base8, BigInt(privateKey.rawPrivKey));\n\n // eslint-disable-next-line no-await-in-loop\n const witness = await circuit.calculateWitness({\n privKey: BigInt(privateKey.rawPrivKey),\n });\n // eslint-disable-next-line no-await-in-loop\n await circuit.expectConstraintPass(witness);\n // eslint-disable-next-line no-await-in-loop\n const derivedPubkey0 = await getSignal(circuit, witness, \"pubKey[0]\");\n // eslint-disable-next-line no-await-in-loop\n const derivedPubkey1 = await getSignal(circuit, witness, \"pubKey[1]\");\n\n expect(publicKey[0]).to.eq(derivedPubkey0);\n expect(publicKey[1]).to.eq(derivedPubkey1);\n\n publicKeys.set(privateKey.serialize(), new PubKey([derivedPubkey0, derivedPubkey1]));\n }\n\n const uniquePublicKeys = [...publicKeys.values()].filter(\n (value, index, array) => array.findIndex((publicKey) => publicKey.equals(value)) === index,\n );\n\n return uniquePublicKeys.length === privateKeys.length && uniquePublicKeys.length === publicKeys.size;\n }),\n { numRuns: 10_000 },\n );\n })", "language": "typescript", "source_file": "./repos/krisoshea-eth/CipherVote/maci/packages/circuits/ts/__tests__/PrivToPubKey.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "krisoshea-eth/CipherVote", "url": "https://github.com/krisoshea-eth/CipherVote.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": "Different private keys should produce distinct public keys, ensuring one-to-one correspondence between them.", "mode": "fast-check"} {"id": 56732, "name": "unknown", "code": "it(\"should correctly compute a public key [fuzz]\", async () => {\n await fc.assert(\n fc.asyncProperty(fc.bigInt(), async (salt: bigint) => {\n const { pubKey, privKey } = new Keypair(new PrivKey(salt));\n\n const witness = await circuit.calculateWitness({ privKey: BigInt(privKey.asCircuitInputs()) });\n await circuit.expectConstraintPass(witness);\n\n const derivedPubkey0 = await getSignal(circuit, witness, \"pubKey[0]\");\n const derivedPubkey1 = await getSignal(circuit, witness, \"pubKey[1]\");\n\n return (\n derivedPubkey0 === pubKey.rawPubKey[0] &&\n derivedPubkey1 === pubKey.rawPubKey[1] &&\n inCurve([derivedPubkey0, derivedPubkey1])\n );\n }),\n { numRuns: 10_000 },\n );\n })", "language": "typescript", "source_file": "./repos/krisoshea-eth/CipherVote/maci/packages/circuits/ts/__tests__/PrivToPubKey.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "krisoshea-eth/CipherVote", "url": "https://github.com/krisoshea-eth/CipherVote.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": "Computing a public key from a private key should produce expected results where derived public key components match the raw public key components and lie on the elliptic curve.", "mode": "fast-check"} {"id": 56733, "name": "unknown", "code": "it(\"should check the correct value [fuzz]\", async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.nat(),\n fc.array(fc.bigInt({ min: 0n, max: r - 1n }), { minLength: leavesPerNode, maxLength: leavesPerNode }),\n async (index: number, elements: bigint[]) => {\n fc.pre(elements.length > index);\n\n const witness = await circuitQuinSelector.calculateWitness({ index: BigInt(index), in: elements });\n await circuitQuinSelector.expectConstraintPass(witness);\n const out = await getSignal(circuitQuinSelector, witness, \"out\");\n\n return out.toString() === elements[index].toString();\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/krisoshea-eth/CipherVote/maci/packages/circuits/ts/__tests__/IncrementalQuinaryTree.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "krisoshea-eth/CipherVote", "url": "https://github.com/krisoshea-eth/CipherVote.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": "The circuit outputs the correct element from an array of big integers at a specified index.", "mode": "fast-check"} {"id": 56734, "name": "unknown", "code": "it(\"should loop the value if number is greater that r [fuzz]\", async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.nat(),\n fc.array(fc.bigInt({ min: r }), { minLength: leavesPerNode, maxLength: leavesPerNode }),\n async (index: number, elements: bigint[]) => {\n fc.pre(elements.length > index);\n\n const witness = await circuitQuinSelector.calculateWitness({ index: BigInt(index), in: elements });\n await circuitQuinSelector.expectConstraintPass(witness);\n const out = await getSignal(circuitQuinSelector, witness, \"out\");\n\n return out.toString() === (elements[index] % r).toString();\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/krisoshea-eth/CipherVote/maci/packages/circuits/ts/__tests__/IncrementalQuinaryTree.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "krisoshea-eth/CipherVote", "url": "https://github.com/krisoshea-eth/CipherVote.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": "Verifies that when an index is selected from an array of big integers, the output is the modulus of the selected element and a specified number \\( r \\), simulating looping behavior.", "mode": "fast-check"} {"id": 56735, "name": "unknown", "code": "it(\"should throw error if index is out of bounds [fuzz]\", async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.nat(),\n fc.array(fc.bigInt({ min: 0n }), { minLength: 1 }),\n async (index: number, elements: bigint[]) => {\n fc.pre(index >= elements.length);\n\n const circuit = await circomkitInstance.WitnessTester(\"quinSelector\", {\n file: \"./trees/incrementalQuinaryTree\",\n template: \"QuinSelector\",\n params: [elements.length],\n });\n\n return circuit\n .calculateWitness({ index: BigInt(index), in: elements })\n .then(() => false)\n .catch((error: Error) => error.message.includes(\"Assert Failed\"));\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/krisoshea-eth/CipherVote/maci/packages/circuits/ts/__tests__/IncrementalQuinaryTree.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "krisoshea-eth/CipherVote", "url": "https://github.com/krisoshea-eth/CipherVote.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": "An error is thrown if the given index is out of bounds when calculating the witness for `quinSelector` with an `IncrementalQuinaryTree`.", "mode": "fast-check"} {"id": 54444, "name": "unknown", "code": "it('should always reach its target', () => {\n fc.assert(\n fc.property(SpaceArbitrary, (inputs) => {\n const [space, max_guesses] = inputs;\n knight(space, max_guesses);\n return space.solved();\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/003-misc/knight/main.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "A knight should always reach its target space regardless of the moves attempted, as long as `space.solved()` returns true after invoking the `knight` function.", "mode": "fast-check"} {"id": 56736, "name": "unknown", "code": "it(\"should check value insertion [fuzz]\", async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.nat(),\n fc.bigInt({ min: 0n, max: r - 1n }),\n fc.array(fc.bigInt({ min: 0n, max: r - 1n }), { minLength: leavesPerNode - 1, maxLength: leavesPerNode - 1 }),\n async (index: number, leaf: bigint, elements: bigint[]) => {\n fc.pre(index < elements.length);\n\n const witness = await splicerCircuit.calculateWitness({\n in: elements,\n leaf,\n index: BigInt(index),\n });\n await splicerCircuit.expectConstraintPass(witness);\n\n const out: bigint[] = [];\n\n for (let i = 0; i < elements.length + 1; i += 1) {\n // eslint-disable-next-line no-await-in-loop\n const value = await getSignal(splicerCircuit, witness, `out[${i}]`);\n out.push(value);\n }\n\n return out.toString() === [...elements.slice(0, index), leaf, ...elements.slice(index)].toString();\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/krisoshea-eth/CipherVote/maci/packages/circuits/ts/__tests__/IncrementalQuinaryTree.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "krisoshea-eth/CipherVote", "url": "https://github.com/krisoshea-eth/CipherVote.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": "Inserting a value into an array at a specified index should produce an output array matching the expected order.", "mode": "fast-check"} {"id": 56737, "name": "unknown", "code": "it(\"should throw error if index is out of bounds [fuzz]\", async () => {\n const maxAllowedIndex = 7;\n\n await fc.assert(\n fc.asyncProperty(\n fc.integer({ min: maxAllowedIndex + 1 }),\n fc.bigInt({ min: 0n, max: r - 1n }),\n fc.array(fc.bigInt({ min: 0n, max: r - 1n }), { minLength: leavesPerNode - 1, maxLength: leavesPerNode - 1 }),\n async (index: number, leaf: bigint, elements: bigint[]) => {\n fc.pre(index > elements.length);\n\n return splicerCircuit\n .calculateWitness({\n in: elements,\n leaf,\n index: BigInt(index),\n })\n .then(() => false)\n .catch((error: Error) => error.message.includes(\"Assert Failed\"));\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/krisoshea-eth/CipherVote/maci/packages/circuits/ts/__tests__/IncrementalQuinaryTree.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "krisoshea-eth/CipherVote", "url": "https://github.com/krisoshea-eth/CipherVote.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": "An error should be thrown when an index exceeds the allowable bounds in a splicer circuit operation, verifying index-related constraints.", "mode": "fast-check"} {"id": 54448, "name": "unknown", "code": "it('should produce an ordered array with respect to a custom compare function', () => {\n fc.assert(\n fc.property(fc.array(fc.integer()), fc.compareBooleanFunc(), (data, compare) => {\n const sorted = sort(data, compare);\n for (let idx = 1; idx < sorted.length; ++idx) {\n // compare(sorted[idx], sorted[idx - 1]):\n // = true : sorted[idx - 1] > sorted[idx]\n // = false: sorted[idx - 1] <= sorted[idx]\n expect(compare(sorted[idx], sorted[idx - 1])).toBe(false);\n // Meaning of compare:\n // a = b means in terms of ordering a and b are equivalent\n // a < b means in terms of ordering a comes before b\n // One important property is: a < b and b < c implies a < c\n }\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/001-simple/sort/main.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Sorting a list with a custom compare function should produce an array where no element is greater than the next according to the compare function.", "mode": "fast-check"} {"id": 56738, "name": "unknown", "code": "it(\"should throw error if input is out of bounds [fuzz]\", async () => {\n const maxLevel = 1_000n;\n\n await fc.assert(\n fc.asyncProperty(\n fc.bigInt({ min: 1n, max: maxLevel }),\n fc.bigInt({ min: 1n, max: r - 1n }),\n async (levels: bigint, input: bigint) => {\n fc.pre(BigInt(leavesPerNode) ** levels < input);\n\n const witness = await circomkitInstance.WitnessTester(\"quinGeneratePathIndices\", {\n file: \"./trees/incrementalQuinaryTree\",\n template: \"QuinGeneratePathIndices\",\n params: [levels],\n });\n\n return witness\n .calculateWitness({ in: input })\n .then(() => false)\n .catch((error: Error) => error.message.includes(\"Assert Failed\"));\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/krisoshea-eth/CipherVote/maci/packages/circuits/ts/__tests__/IncrementalQuinaryTree.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "krisoshea-eth/CipherVote", "url": "https://github.com/krisoshea-eth/CipherVote.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": "An error should be thrown when an input is a bigint that exceeds the calculated bounds based on tree levels and node capacity.", "mode": "fast-check"} {"id": 56739, "name": "unknown", "code": "it(\"should check generation of path indices [fuzz]\", async () => {\n const maxLevel = 100n;\n\n await fc.assert(\n fc.asyncProperty(\n fc.bigInt({ min: 1n, max: maxLevel }),\n fc.bigInt({ min: 1n, max: r - 1n }),\n async (levels: bigint, input: bigint) => {\n fc.pre(BigInt(leavesPerNode) ** levels > input);\n\n const tree = new IncrementalQuinTree(Number(levels), 0n, 5, hash5);\n\n const circuit = await circomkitInstance.WitnessTester(\"quinGeneratePathIndices\", {\n file: \"./trees/incrementalQuinaryTree\",\n template: \"QuinGeneratePathIndices\",\n params: [levels],\n });\n\n const witness = await circuit.calculateWitness({\n in: input,\n });\n await circuit.expectConstraintPass(witness);\n\n const values: bigint[] = [];\n\n for (let i = 0; i < levels; i += 1) {\n // eslint-disable-next-line no-await-in-loop\n const value = await getSignal(circuit, witness, `out[${i}]`);\n tree.insert(value);\n values.push(value);\n }\n\n const { pathIndices } = tree.genProof(Number(input));\n\n const isEqual = pathIndices.every((item, index) => item.toString() === values[index].toString());\n\n return values.length === pathIndices.length && isEqual;\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/krisoshea-eth/CipherVote/maci/packages/circuits/ts/__tests__/IncrementalQuinaryTree.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "krisoshea-eth/CipherVote", "url": "https://github.com/krisoshea-eth/CipherVote.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": "Generation of path indices in an incremental quinary tree should accurately match the computed values for given levels and inputs.", "mode": "fast-check"} {"id": 56740, "name": "unknown", "code": "it(\"should check the correct leaf [fuzz]\", async () => {\n // TODO: seems js implementation doesn't work with levels more than 22\n const maxLevel = 22;\n\n await fc.assert(\n fc.asyncProperty(\n fc.integer({ min: 1, max: maxLevel }),\n fc.nat({ max: leavesPerNode - 1 }),\n fc.array(fc.bigInt({ min: 0n, max: r - 1n }), { minLength: leavesPerNode, maxLength: leavesPerNode }),\n async (levels: number, index: number, leaves: bigint[]) => {\n const circuit = await circomkitInstance.WitnessTester(\"quinLeafExists\", {\n file: \"./trees/incrementalQuinaryTree\",\n template: \"QuinLeafExists\",\n params: [levels],\n });\n\n const tree = new IncrementalQuinTree(levels, 0n, leavesPerNode, hash5);\n leaves.forEach((value) => {\n tree.insert(value);\n });\n\n const proof = tree.genProof(index);\n\n const witness = await circuit.calculateWitness({\n root: tree.root,\n leaf: leaves[index],\n path_elements: proof.pathElements,\n path_index: proof.pathIndices,\n });\n\n return circuit\n .expectConstraintPass(witness)\n .then(() => true)\n .catch(() => false);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/krisoshea-eth/CipherVote/maci/packages/circuits/ts/__tests__/IncrementalQuinaryTree.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "krisoshea-eth/CipherVote", "url": "https://github.com/krisoshea-eth/CipherVote.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": "The `IncrementalQuinTree` correctly generates proofs for leaf existence, ensuring the circuit's constraint validation passes with a calculated witness.", "mode": "fast-check"} {"id": 56743, "name": "unknown", "code": "it(\"correctly hashes 2 random values in order\", async () => {\n const n = 2;\n\n circuit = await circomkitInstance.WitnessTester(\"poseidonHasher\", {\n file: \"./utils/hashers\",\n template: \"PoseidonHasher\",\n params: [n],\n });\n\n await fc.assert(\n fc.asyncProperty(\n fc.array(fc.bigInt({ min: 0n, max: r - 1n }), { minLength: n, maxLength: n }),\n async (preImages: bigint[]) => {\n const witness = await circuit.calculateWitness({\n inputs: preImages,\n });\n await circuit.expectConstraintPass(witness);\n const output = await getSignal(circuit, witness, \"out\");\n const outputJS = hash2(preImages);\n\n return output === outputJS;\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/krisoshea-eth/CipherVote/maci/packages/circuits/ts/__tests__/Hasher.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "krisoshea-eth/CipherVote", "url": "https://github.com/krisoshea-eth/CipherVote.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": "The test verifies that hashing two random big integer values using the `PoseidonHasher` circuit produces the same output as the `hash2` function.", "mode": "fast-check"} {"id": 56744, "name": "unknown", "code": "it(\"correctly hashes 3 random values\", async () => {\n const n = 3;\n\n circuit = await circomkitInstance.WitnessTester(\"poseidonHasher\", {\n file: \"./utils/hashers\",\n template: \"PoseidonHasher\",\n params: [n],\n });\n\n await fc.assert(\n fc.asyncProperty(\n fc.array(fc.bigInt({ min: 0n, max: r - 1n }), { minLength: n, maxLength: n }),\n async (preImages: bigint[]) => {\n const witness = await circuit.calculateWitness({\n inputs: preImages,\n });\n await circuit.expectConstraintPass(witness);\n const output = await getSignal(circuit, witness, \"out\");\n const outputJS = hash3(preImages);\n\n return output === outputJS;\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/krisoshea-eth/CipherVote/maci/packages/circuits/ts/__tests__/Hasher.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "krisoshea-eth/CipherVote", "url": "https://github.com/krisoshea-eth/CipherVote.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": "Hashes of three random values should match the expected output using the `PoseidonHasher` circuit and the `hash3` function.", "mode": "fast-check"} {"id": 56745, "name": "unknown", "code": "it(\"correctly hashes 4 random values\", async () => {\n const n = 4;\n\n circuit = await circomkitInstance.WitnessTester(\"poseidonHasher\", {\n file: \"./utils/hashers\",\n template: \"PoseidonHasher\",\n params: [n],\n });\n\n await fc.assert(\n fc.asyncProperty(\n fc.array(fc.bigInt({ min: 0n, max: r - 1n }), { minLength: n, maxLength: n }),\n async (preImages: bigint[]) => {\n const witness = await circuit.calculateWitness({\n inputs: preImages,\n });\n await circuit.expectConstraintPass(witness);\n const output = await getSignal(circuit, witness, \"out\");\n const outputJS = hash4(preImages);\n\n return output === outputJS;\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/krisoshea-eth/CipherVote/maci/packages/circuits/ts/__tests__/Hasher.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "krisoshea-eth/CipherVote", "url": "https://github.com/krisoshea-eth/CipherVote.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": "The function correctly hashes four random bigint values using both a circuit and a JavaScript function, comparing outputs to ensure they match.", "mode": "fast-check"} {"id": 56747, "name": "unknown", "code": "it(\"should correctly hash a message [fuzz]\", async () => {\n const random50bitBigInt = (salt: bigint): bigint =>\n // eslint-disable-next-line no-bitwise\n ((BigInt(1) << BigInt(50)) - BigInt(1)) & salt;\n\n await fc.assert(\n fc.asyncProperty(\n fc.bigInt({ min: 0n }),\n fc.bigInt({ min: 0n }),\n fc.bigInt({ min: 0n }),\n fc.bigInt({ min: 0n }),\n fc.bigInt({ min: 0n }),\n fc.bigInt({ min: 0n }),\n async (\n stateIndex: bigint,\n voteOptionIndex: bigint,\n newVoteWeight: bigint,\n nonce: bigint,\n pollId: bigint,\n salt: bigint,\n ) => {\n const { pubKey, privKey } = new Keypair();\n\n const command: PCommand = new PCommand(\n random50bitBigInt(stateIndex),\n pubKey,\n random50bitBigInt(voteOptionIndex),\n random50bitBigInt(newVoteWeight),\n random50bitBigInt(nonce),\n random50bitBigInt(pollId),\n salt,\n );\n\n const ecdhSharedKey = Keypair.genEcdhSharedKey(privKey, pubKey);\n const signature = command.sign(privKey);\n const message = command.encrypt(signature, ecdhSharedKey);\n const messageHash = message.hash(pubKey);\n const circuitInputs = {\n in: message.asCircuitInputs(),\n encPubKey: pubKey.asCircuitInputs() as unknown as [bigint, bigint],\n };\n const witness = await circuit.calculateWitness(circuitInputs);\n await circuit.expectConstraintPass(witness);\n const output = await getSignal(circuit, witness, \"hash\");\n\n return output === messageHash;\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/krisoshea-eth/CipherVote/maci/packages/circuits/ts/__tests__/Hasher.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "krisoshea-eth/CipherVote", "url": "https://github.com/krisoshea-eth/CipherVote.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": "Hashes of encrypted and signed messages should match the computed circuit output for various randomly generated inputs.", "mode": "fast-check"} {"id": 56749, "name": "unknown", "code": "test('autodetectDoubleEncoded_fastcheck', () => {\n fc.assert(\n fc.property(fc.string({ minLength: 1, size: 'medium', unit: 'grapheme' }), (data) => {\n const asciiOnly = [...data].every((c) => (c.codePointAt(0) ?? -1) < 128)\n expect(doubleEncodedUTF8(e(data))).toBe(false)\n expect(doubleEncodedUTF8(de(data))).toBe(!asciiOnly)\n }),\n )\n})", "language": "typescript", "source_file": "./repos/simplebitlabs/tobytes/src/utf8.test.ts", "start_line": null, "end_line": null, "dependencies": ["e", "de"], "repo": {"name": "simplebitlabs/tobytes", "url": "https://github.com/simplebitlabs/tobytes.git", "license": "MIT", "stars": 3, "forks": 0}, "metrics": null, "summary": "`doubleEncodedUTF8` should return false for normally encoded UTF-8 strings and true for double-encoded ones when the string includes non-ASCII characters.", "mode": "fast-check"} {"id": 54450, "name": "unknown", "code": "it('should produce an array such that the product equals the input', () => {\n fc.assert(\n fc.property(fc.nat(MAX_INPUT), (n) => {\n const factors = decompPrime(n);\n const productOfFactors = factors.reduce((a, b) => a * b, 1);\n return productOfFactors === n;\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/001-simple/decompPrime/main.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The array produced by `decompPrime` should have a product that equals the input number.", "mode": "fast-check"} {"id": 56759, "name": "unknown", "code": "it(`should parse AstExpression`, () => {\n fc.assert(\n fc.property(randomAstExpression(maxDepth), (generatedAst) => {\n const prettyBefore = prettyPrint(generatedAst);\n\n const parsedAst = parser.parseExpression(prettyBefore);\n const prettyAfter = prettyPrint(parsedAst);\n\n expect(prettyBefore).toBe(prettyAfter);\n const actual = eqExpressions(generatedAst, parsedAst);\n if (!actual) {\n diffAstObjects(\n generatedAst,\n parsedAst,\n prettyBefore,\n prettyAfter,\n );\n }\n expect(actual).toBe(true);\n }),\n { seed: 1, numRuns: 5000 },\n );\n })", "language": "typescript", "source_file": "./repos/tact-lang/tact/src/ast/fuzz.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tact-lang/tact", "url": "https://github.com/tact-lang/tact.git", "license": "MIT", "stars": 629, "forks": 193}, "metrics": null, "summary": "Parsing and re-serializing an `AstExpression` should yield identical pretty-printed strings, and the original and parsed expressions should be equivalent.", "mode": "fast-check"} {"id": 56762, "name": "unknown", "code": "it(\"should not extend or reduce the duration of tasks\", () => {\n fc.assert(\n fc.property(tasksArbitrary(), (tasks) => {\n // Arrange / Act\n const schedule = christmasFactorySchedule(tasks);\n\n // Assert\n for (const scheduledTask of schedule) {\n const task = tasks.find((t) => t.taskId === scheduledTask.taskId);\n expect(scheduledTask.finish - scheduledTask.start).toBe(\n task.estimatedTime\n );\n }\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-24.spec.ts", "start_line": null, "end_line": null, "dependencies": ["tasksArbitrary"], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`christmasFactorySchedule` should schedule tasks such that the duration between the start and finish times equals the task's estimated time.", "mode": "fast-check"} {"id": 56764, "name": "unknown", "code": "it(\"should start tasks as soon as possible\", () => {\n fc.assert(\n fc.property(tasksArbitrary(), (tasks) => {\n // Arrange / Act\n const schedule = christmasFactorySchedule(tasks);\n\n // Assert\n for (const scheduledTask of schedule) {\n const dependencies = tasks.find(\n (t) => t.taskId === scheduledTask.taskId\n )!.dependsOnTasks;\n const finishTimeDependencies = dependencies.map((depTaskId) => {\n const depScheduledTask = schedule.find((s) => s.taskId === depTaskId);\n return depScheduledTask.finish;\n });\n const expectedStart =\n finishTimeDependencies.length !== 0\n ? Math.max(...finishTimeDependencies)\n : 0;\n expect(scheduledTask.start).toBe(expectedStart);\n }\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-24.spec.ts", "start_line": null, "end_line": null, "dependencies": ["tasksArbitrary"], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Tasks should be scheduled to start immediately after all their dependencies are completed.", "mode": "fast-check"} {"id": 56765, "name": "unknown", "code": "it(\"should be able to rebuild previous year given only the diff\", () => {\n fc.assert(\n fc.property(\n wishListArbitrary(),\n wishListArbitrary(),\n (previousYear, currentYear) => {\n // Arrange / Act\n const computedDiff = wishListsDiffer(previousYear, currentYear);\n\n // Assert\n expect(previousYearFromDiff(computedDiff)).toEqual(previousYear);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-23.spec.ts", "start_line": null, "end_line": null, "dependencies": ["wishListArbitrary", "previousYearFromDiff"], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Rebuilding the previous year from a diff should yield the original previous year text.", "mode": "fast-check"} {"id": 56766, "name": "unknown", "code": "it(\"should be able to rebuild current year given only the diff\", () => {\n fc.assert(\n fc.property(\n wishListArbitrary(),\n wishListArbitrary(),\n (previousYear, currentYear) => {\n // Arrange / Act\n const computedDiff = wishListsDiffer(previousYear, currentYear);\n\n // Assert\n expect(currentYearFromDiff(computedDiff)).toEqual(currentYear);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-23.spec.ts", "start_line": null, "end_line": null, "dependencies": ["wishListArbitrary", "currentYearFromDiff"], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The property should hold that reconstructing the current year's wishlist from the computed diff between two wishlists results in an exact match to the original current year.", "mode": "fast-check"} {"id": 56767, "name": "unknown", "code": "it(\"should compute the diff having the maximal number of unchanged lines\", () => {\n fc.assert(\n fc.property(diffArbitrary(), (diff) => {\n // Arrange\n const previousYear = previousYearFromDiff(diff);\n const currentYear = currentYearFromDiff(diff);\n\n // Act\n const computedDiff = wishListsDiffer(previousYear, currentYear);\n\n // Assert\n expect(countUnchangedLines(computedDiff)).toBeGreaterThanOrEqual(\n countUnchangedLines(diff)\n );\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-23.spec.ts", "start_line": null, "end_line": null, "dependencies": ["diffArbitrary", "previousYearFromDiff", "currentYearFromDiff", "countUnchangedLines"], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The computed diff from `wishListsDiffer` should have at least as many unchanged lines as the original diff input.", "mode": "fast-check"} {"id": 56768, "name": "unknown", "code": "it(\"should select some elves whenever there is a solution with one elf\", () => {\n fc.assert(\n fc.property(\n fc.array(fc.integer({ min: 1 }), { minLength: 1 }),\n fc.nat(),\n (elves, modElf1) => {\n // Arrange\n const indexElf1 = modElf1 % elves.length;\n const wallHeight = elves[indexElf1];\n\n // Act\n const selectedElves = spyOnSanta(elves, wallHeight);\n\n // Assert\n expect(selectedElves).not.toBe(undefined);\n assertElves(elves, selectedElves!, wallHeight);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-22.spec.ts", "start_line": null, "end_line": null, "dependencies": ["assertElves"], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Selecting elves correctly matches the wall height using a single elf, while ensuring valid indices, no repetitions, and a selection size between 1 and 3.", "mode": "fast-check"} {"id": 56769, "name": "unknown", "code": "it(\"should select some elves whenever there is a solution with two elves\", () => {\n fc.assert(\n fc.property(\n fc.array(fc.integer({ min: 1 }), { minLength: 2 }),\n fc.nat(),\n fc.nat(),\n (elves, modElf1, modElf2) => {\n // Arrange\n const indexElf1 = modElf1 % elves.length;\n const indexElf2 = modElf2 % elves.length;\n fc.pre(indexElf1 !== indexElf2);\n const wallHeight = elves[indexElf1] + elves[indexElf2];\n\n // Act\n const selectedElves = spyOnSanta(elves, wallHeight);\n\n // Assert\n expect(selectedElves).not.toBe(undefined);\n assertElves(elves, selectedElves!, wallHeight);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-22.spec.ts", "start_line": null, "end_line": null, "dependencies": ["assertElves"], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The test checks that when there is a solution involving the selection of two distinct elves to reach a specified wall height, `spyOnSanta` successfully selects elves whose combined heights exactly match the wall height, meeting specified constraints.", "mode": "fast-check"} {"id": 56770, "name": "unknown", "code": "it(\"should select some elves whenever there is a solution with three elves\", () => {\n fc.assert(\n fc.property(\n fc.array(fc.integer({ min: 1 }), { minLength: 3 }),\n fc.nat(),\n fc.nat(),\n fc.nat(),\n (elves, modElf1, modElf2, modElf3) => {\n // Arrange\n const indexElf1 = modElf1 % elves.length;\n const indexElf2 = modElf2 % elves.length;\n const indexElf3 = modElf3 % elves.length;\n fc.pre(indexElf1 !== indexElf2);\n fc.pre(indexElf1 !== indexElf3);\n fc.pre(indexElf2 !== indexElf3);\n const wallHeight =\n elves[indexElf1] + elves[indexElf2] + elves[indexElf3];\n\n // Act\n const selectedElves = spyOnSanta(elves, wallHeight);\n\n // Assert\n expect(selectedElves).not.toBe(undefined);\n assertElves(elves, selectedElves!, wallHeight);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-22.spec.ts", "start_line": null, "end_line": null, "dependencies": ["assertElves"], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Whenever there is a solution with three distinct elves that match the wall height, `spyOnSanta` correctly selects between 1 and 3 elves whose combined height equals the wall height without repetition and using valid indexes.", "mode": "fast-check"} {"id": 56771, "name": "unknown", "code": "it(\"should either propose a valid solution or nothing\", () => {\n fc.assert(\n fc.property(\n fc.array(fc.integer({ min: 1 })),\n fc.nat(),\n (elves, wallHeight) => {\n // Arrange / Act\n const selectedElves = spyOnSanta(elves, wallHeight);\n\n // Assert\n if (selectedElves !== undefined) {\n assertElves(elves, selectedElves!, wallHeight);\n }\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-22.spec.ts", "start_line": null, "end_line": null, "dependencies": ["assertElves"], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The function `spyOnSanta` should return a valid selection of 1 to 3 elves whose total height matches the wall height or return nothing.", "mode": "fast-check"} {"id": 56772, "name": "unknown", "code": "it(\"should find a place whenever the map has at least one with the right size\", () => {\n fc.assert(\n fc.property(\n fc\n .record({\n // Size of the map\n mapWidth: fc.nat({ max: 100 }),\n mapHeight: fc.nat({ max: 100 }),\n })\n .chain((mapSize) =>\n fc.record({\n // Default map with some holes for available places\n rawMap: mapArbitrary(mapSize),\n // Stand that will be allocated for Santa\n // We will free this room so that it will be available\n request: rectAreaArbitrary(mapSize),\n })\n ),\n ({ rawMap, request }) => {\n // Arrange\n // Allocate some room to Santa so that he will be able\n // to have his stand on the market\n const map: boolean[][] = [];\n for (let y = 0; y !== rawMap.length; ++y) {\n map[y] = [];\n for (let x = 0; x !== rawMap[0].length; ++x) {\n map[y][x] =\n rawMap[y][x] ||\n (request.x.start <= x &&\n x < request.x.end &&\n request.y.start <= y &&\n y < request.y.end);\n }\n }\n const requestedArea = {\n width: request.x.end - request.x.start,\n height: request.y.end - request.y.start,\n };\n\n // Act\n const foundPlace = findPlaceForSanta(map, requestedArea);\n\n // Assert\n expect(foundPlace).not.toBe(undefined);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-21.spec.ts", "start_line": null, "end_line": null, "dependencies": ["mapArbitrary", "rectAreaArbitrary"], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`findPlaceForSanta` should successfully find an available place for Santa when at least one area of the requested size exists on the map.", "mode": "fast-check"} {"id": 56773, "name": "unknown", "code": "it(\"should either return no place or the start of valid place with enough room\", () => {\n fc.assert(\n fc.property(\n fc\n .record({\n // Size of the map\n mapWidth: fc.nat({ max: 100 }),\n mapHeight: fc.nat({ max: 100 }),\n })\n .chain((mapSize) =>\n fc.record({\n // Default map with some holes for available places\n map: mapArbitrary(mapSize),\n // Size of the stand requested by Santa\n requestedArea: fc.record({\n width: fc.integer({ min: 0, max: mapSize.mapWidth }),\n height: fc.integer({ min: 0, max: mapSize.mapHeight }),\n }),\n })\n ),\n ({ map, requestedArea }) => {\n // Arrange / Act\n const foundPlace = findPlaceForSanta(map, requestedArea);\n\n // Assert\n if (foundPlace !== undefined) {\n for (let dy = 0; dy !== requestedArea.height; ++dy) {\n for (let dx = 0; dx !== requestedArea.width; ++dx) {\n expect(map[foundPlace.y + dy][foundPlace.x + dx]).toBe(true);\n }\n }\n }\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-21.spec.ts", "start_line": null, "end_line": null, "dependencies": ["mapArbitrary"], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`findPlaceForSanta` returns either no place or the starting position of a valid area in the map with enough room matching the requested dimensions.", "mode": "fast-check"} {"id": 56774, "name": "unknown", "code": "it(\"should build a linear trunk\", () => {\n fc.assert(\n fc.property(fc.integer({ min: 1, max: 1000 }), (n) => {\n // Arrange / Act\n const tree = drawTree(n);\n\n // Assert\n // Remove all the leaves from the tree to only keep the trunk\n const treeWithoutLeaves = tree\n .split(\"\\n\")\n .map((level) => level.replace(/[()]/g, \" \").trimRight());\n for (const level of treeWithoutLeaves) {\n expect(level.trimLeft()).toEqual(\"^\");\n expect(level).toEqual(treeWithoutLeaves[0]);\n }\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-20.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "A tree generated by `drawTree` with any integer input from 1 to 1000 should produce a linear trunk consisting of a single repeated character \"^\" across all levels without leaves.", "mode": "fast-check"} {"id": 56776, "name": "unknown", "code": "it(\"should offset leaves from one level to the next one\", () => {\n fc.assert(\n fc.property(fc.integer({ min: 1, max: 1000 }), (n) => {\n // Arrange / Act\n const tree = drawTree(n);\n\n // Assert\n const treeLevels = tree.split(\"\\n\").map((level) => level.trim());\n for (let index = 1; index < n; ++index) {\n expect(treeLevels[index]).toEqual(\"(\" + treeLevels[index - 1] + \")\");\n }\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-20.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The test verifies that each level of a tree is correctly offset by enclosing the previous level in parentheses.", "mode": "fast-check"} {"id": 56777, "name": "unknown", "code": "it(\"should create a base of size two with levels identical to the top\", () => {\n fc.assert(\n fc.property(fc.integer({ min: 1, max: 1000 }), (n) => {\n // Arrange / Act\n const tree = drawTree(n);\n\n // Assert\n const treeLevels = tree.split(\"\\n\");\n expect(treeLevels).toHaveLength(n + 2);\n expect(treeLevels[n]).toEqual(treeLevels[0]);\n expect(treeLevels[n + 1]).toEqual(treeLevels[0]);\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-20.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The tree should have `n + 2` levels, with the first, last, and `n-th` levels being identical.", "mode": "fast-check"} {"id": 56778, "name": "unknown", "code": "it(\"should build a path starting by the requested departure whenever a path from start to end exists\", () => {\n fc.assert(\n fc.property(orientedGraphArbitrary(), ({ knownPath, tracks }) => {\n // Arrange\n const departure = knownPath[0];\n const destination = knownPath[knownPath.length - 1];\n\n // Act\n const shortestPath = metroRoute(departure, destination, tracks);\n\n // Assert\n if (departure === destination) expect(shortestPath).toEqual([]);\n else expect(shortestPath![0].from).toBe(departure);\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-19.spec.ts", "start_line": null, "end_line": null, "dependencies": ["orientedGraphArbitrary"], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The presence of a path from start to end in a graph ensures that `metroRoute` builds a path starting with the requested departure node.", "mode": "fast-check"} {"id": 56779, "name": "unknown", "code": "it(\"should build a path ending by the requested destination whenever a path from start to end exists\", () => {\n fc.assert(\n fc.property(orientedGraphArbitrary(), ({ knownPath, tracks }) => {\n // Arrange\n const departure = knownPath[0];\n const destination = knownPath[knownPath.length - 1];\n\n // Act\n const shortestPath = metroRoute(departure, destination, tracks);\n\n // Assert\n if (departure === destination) expect(shortestPath).toEqual([]);\n else expect(shortestPath![shortestPath!.length - 1].to).toBe(destination);\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-19.spec.ts", "start_line": null, "end_line": null, "dependencies": ["orientedGraphArbitrary"], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The function `metroRoute` produces a path ending at the specified destination if a path from start to end exists in the given tracks.", "mode": "fast-check"} {"id": 56780, "name": "unknown", "code": "it(\"should build an ordered path of tracks whenever a path from start to end exists\", () => {\n fc.assert(\n fc.property(orientedGraphArbitrary(), ({ knownPath, tracks }) => {\n // Arrange\n const departure = knownPath[0];\n const destination = knownPath[knownPath.length - 1];\n\n // Act\n const shortestPath = metroRoute(departure, destination, tracks);\n\n // Assert\n for (let index = 1; index < shortestPath!.length; ++index) {\n expect(shortestPath![index].from).toBe(shortestPath![index - 1].to);\n }\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-19.spec.ts", "start_line": null, "end_line": null, "dependencies": ["orientedGraphArbitrary"], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Given an oriented graph with a known path from start to end, the `metroRoute` function should construct a valid ordered path of tracks with correct connections between nodes.", "mode": "fast-check"} {"id": 56781, "name": "unknown", "code": "it(\"should build a path of tracks being a subset of the tracks of the graph whenever a path from start to end exists\", () => {\n fc.assert(\n fc.property(orientedGraphArbitrary(), ({ knownPath, tracks }) => {\n // Arrange\n const departure = knownPath[0];\n const destination = knownPath[knownPath.length - 1];\n\n // Act\n const shortestPath = metroRoute(departure, destination, tracks);\n\n // Assert\n for (const edge of shortestPath!) {\n expect(shortestPath).toContainEqual(edge);\n }\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-19.spec.ts", "start_line": null, "end_line": null, "dependencies": ["orientedGraphArbitrary"], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The test ensures that the `metroRoute` function can find a valid path from start to end, with the path being a subset of the provided graph tracks when such a path exists.", "mode": "fast-check"} {"id": 56782, "name": "unknown", "code": "it(\"should be able to find a path shorther or equal to the one we come up with\", () => {\n fc.assert(\n fc.property(\n orientedGraphArbitrary(),\n ({ knownPath, knownPathTracks, tracks }) => {\n // Arrange\n const departure = knownPath[0];\n const destination = knownPath[knownPath.length - 1];\n\n // Act\n const shortestPath = metroRoute(departure, destination, tracks);\n\n // Assert\n const distanceKnownPath = knownPathTracks.reduce(\n (acc, e) => acc + e.length,\n 0\n );\n const distanceShortestPath = shortestPath!.reduce(\n (acc, e) => acc + e.length,\n 0\n );\n expect(distanceShortestPath).toBeLessThanOrEqual(distanceKnownPath);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-19.spec.ts", "start_line": null, "end_line": null, "dependencies": ["orientedGraphArbitrary"], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The function `metroRoute` should find a path between departure and destination with a distance less than or equal to a precomputed known path in the graph.", "mode": "fast-check"} {"id": 56783, "name": "unknown", "code": "it(\"should not return any path whenever there is no way going from start to end\", () => {\n fc.assert(\n fc.property(\n orientedGraphNoWayArbitrary(),\n ({ departure, destination, tracks }) => {\n // Arrange / Act\n const shortestPath = metroRoute(departure, destination, tracks);\n\n // Assert\n expect(shortestPath).toBe(undefined);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-19.spec.ts", "start_line": null, "end_line": null, "dependencies": ["orientedGraphNoWayArbitrary"], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Whenever no path exists from the start node (0) to the end node (19) in a graph, the `metroRoute` function should return `undefined`.", "mode": "fast-check"} {"id": 56784, "name": "unknown", "code": "it(\"should detect any valid palindrome having even number of characters\", () => {\n fc.assert(\n fc.property(fc.fullUnicodeString(), (start) => {\n // Arrange\n const reversedStart = [...start].reverse().join(\"\");\n const palindrome = `${start}${reversedStart}`;\n\n // Act / Assert\n expect(isPalindrome(palindrome)).toBe(true);\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-18.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "A valid palindrome with an even number of characters is correctly detected by `isPalindrome`.", "mode": "fast-check"} {"id": 56786, "name": "unknown", "code": "it(\"should detect any invalid palindrome\", () => {\n fc.assert(\n fc.property(\n fc.fullUnicodeString(),\n fc.fullUnicode(),\n fc.fullUnicode(),\n fc.fullUnicodeString(),\n (start, a, b, middle) => {\n // Arrange\n fc.pre(a !== b);\n const reversedStart = [...start].reverse().join(\"\");\n const notPalindrome = `${start}${a}${middle}${b}${reversedStart}`;\n // not a palindrome as the mirror of a is b and a !== b\n\n // Act / Assert\n expect(isPalindrome(notPalindrome)).toBe(false);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-18.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "A string constructed with distinct characters in mirrored positions should not be identified as a palindrome.", "mode": "fast-check"} {"id": 56788, "name": "unknown", "code": "it(\"should be equivalent to non-optimal implementation based on fully reversing the string\", () => {\n fc.assert(\n fc.property(fc.fullUnicodeString(), (s) => {\n // Arrange\n const reversedS = [...s].reverse().join(\"\");\n const expectedResult = reversedS === s;\n\n // Act / Assert\n expect(isPalindrome(s)).toBe(expectedResult);\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-18.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The function `isPalindrome` should return true if and only if reversing the full Unicode string results in the same string.", "mode": "fast-check"} {"id": 56790, "name": "unknown", "code": "it(\"should consider any composite with one prime factor >7 as non-humble\", () => {\n fc.assert(\n fc.property(\n fc\n .integer({ min: 11 }) // 8,9,10 would be filtered\n .filter((v) => v % 2 !== 0)\n .filter((v) => v % 3 !== 0)\n .filter((v) => v % 5 !== 0)\n .filter((v) => v % 7 !== 0),\n fc.array(fc.integer({ min: 1, max: 195225786 })),\n (tooLarge, factors) => {\n // Arrange\n let n = tooLarge;\n for (const f of factors) {\n if (n * f > 2 ** 31 - 1) break;\n n = n * f;\n }\n\n // Act / Assert\n expect(isHumbleNumber(n)).toBe(false);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-17.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Numbers with a prime factor greater than 7 should not be identified as humble numbers.", "mode": "fast-check"} {"id": 56791, "name": "unknown", "code": "it(\"should produce an array having the same length\", () => {\n fc.assert(\n fc.property(fc.array(fc.anything()), (data) => {\n // Arrange / Act\n const rev = reversed(data);\n\n // Assert\n expect(rev).toHaveLength(data.length);\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-16.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The `reversed` function should produce an array with the same length as the input array.", "mode": "fast-check"} {"id": 56792, "name": "unknown", "code": "it(\"should reverse any array\", () => {\n fc.assert(\n fc.property(fc.array(fc.anything()), (data) => {\n // Arrange / Act\n const rev = reversed(data);\n\n // Assert\n for (let index = 0; index !== data.length; ++index) {\n expect(rev[rev.length - index - 1]).toBe(data[index]);\n }\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-16.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Reversing any array should produce an output where the elements are in reverse order compared to the input.", "mode": "fast-check"} {"id": 56793, "name": "unknown", "code": "it(\"should properly reverse concatenated arrays: rev concat(a,b) = concat(rev b, rev a)\", () => {\n fc.assert(\n fc.property(fc.array(fc.anything()), fc.array(fc.anything()), (a, b) => {\n // Arrange / Act\n const rev = reversed([...a, ...b]);\n const revA = reversed(a);\n const revB = reversed(b);\n\n // Assert\n expect(rev).toEqual([...revB, ...revA]);\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-16.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Reversing concatenated arrays should yield the concatenation of the reversed arrays in reverse order.", "mode": "fast-check"} {"id": 56794, "name": "unknown", "code": "it(\"should go back to the original array if reversed twice\", () => {\n fc.assert(\n fc.property(fc.array(fc.anything()), (data) => {\n // Arrange / Act / Assert\n expect(reversed(reversed(data))).toEqual(data);\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-16.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Reversing an array twice should return the original array.", "mode": "fast-check"} {"id": 56795, "name": "unknown", "code": "it(\"should predict the right podium\", () => {\n fc.assert(\n fc.property(\n fc.array(fc.nat(), { minLength: 25, maxLength: 25 }),\n (speeds) => {\n // Arrange\n const compareParticipants = (pa: number, pb: number) => {\n if (speeds[pa] !== speeds[pb]) return speeds[pb] - speeds[pa];\n else return pa - pb;\n };\n const runRace = (\n ...participants: RaceParticipants\n ): RaceParticipants => {\n return participants.sort(compareParticipants);\n };\n\n // Act\n const podium = racePodium(runRace);\n\n // Assert\n const rankedParticipants = [...Array(25)]\n .map((_, i) => i)\n .sort(compareParticipants);\n const expectedPodium = rankedParticipants.slice(0, 3);\n expect(podium).toEqual(expectedPodium);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-15.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`racePodium` correctly predicts the top three participants based on sorted speeds of 25 participants.", "mode": "fast-check"} {"id": 56796, "name": "unknown", "code": "it(\"should never do more than 7 races\", () => {\n fc.assert(\n fc.property(\n fc.array(fc.nat(), { minLength: 25, maxLength: 25 }),\n (speeds) => {\n // Arrange\n const compareParticipants = (pa: number, pb: number) => {\n if (speeds[pa] !== speeds[pb]) return speeds[pb] - speeds[pa];\n else return pa - pb;\n };\n const runRace = jest.fn(\n (...participants: RaceParticipants): RaceParticipants => {\n return participants.sort(compareParticipants);\n }\n );\n\n // Act\n racePodium(runRace);\n\n // Assert\n expect(runRace.mock.calls.length).toBeLessThanOrEqual(7);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-15.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`racePodium` should require at most 7 races for determining the order of participants based on their speeds.", "mode": "fast-check"} {"id": 56797, "name": "unknown", "code": "it(\"should group selected tabs together\", () => {\n fc.assert(\n fc.property(\n tabsWithSelectionArb(),\n ({ tabs, selectedTabs, movePosition }) => {\n // Arrange / Act\n const newTabs = reorderTabs(tabs, selectedTabs, movePosition);\n\n // Assert\n const startMovedSelection = newTabs.indexOf(selectedTabs[0]);\n expect(\n newTabs.slice(\n startMovedSelection,\n startMovedSelection + selectedTabs.length\n )\n ).toEqual(selectedTabs);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-14.spec.ts", "start_line": null, "end_line": null, "dependencies": ["tabsWithSelectionArb"], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Selected tabs should be grouped together in the reordered tabs list.", "mode": "fast-check"} {"id": 56798, "name": "unknown", "code": "it(\"should insert all the selected tabs before the move position\", () => {\n fc.assert(\n fc.property(\n tabsWithSelectionArb(),\n ({ tabs, selectedTabs, movePosition }) => {\n // Arrange / Act\n const newTabs = reorderTabs(tabs, selectedTabs, movePosition);\n\n // Assert\n const movePositionIndex = newTabs.indexOf(movePosition);\n for (const selected of selectedTabs) {\n const selectedIndex = newTabs.indexOf(selected);\n expect(selectedIndex).toBeLessThan(movePositionIndex);\n }\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-14.spec.ts", "start_line": null, "end_line": null, "dependencies": ["tabsWithSelectionArb"], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Reordering tabs should insert all selected tabs before the specified move position.", "mode": "fast-check"} {"id": 56799, "name": "unknown", "code": "it(\"should not alter non-selected tabs\", () => {\n fc.assert(\n fc.property(\n tabsWithSelectionArb(),\n ({ tabs, selectedTabs, movePosition }) => {\n // Arrange / Act\n const newTabs = reorderTabs(tabs, selectedTabs, movePosition);\n\n // Assert\n expect(newTabs.filter((t) => !selectedTabs.includes(t))).toEqual(\n tabs.filter((t) => !selectedTabs.includes(t))\n );\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-14.spec.ts", "start_line": null, "end_line": null, "dependencies": ["tabsWithSelectionArb"], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Reordering tabs should not change the order of non-selected tabs.", "mode": "fast-check"} {"id": 56800, "name": "unknown", "code": "it(\"should not change the list of tabs, just its order\", () => {\n fc.assert(\n fc.property(\n tabsWithSelectionArb(),\n ({ tabs, selectedTabs, movePosition }) => {\n // Arrange / Act\n const newTabs = reorderTabs(tabs, selectedTabs, movePosition);\n\n // Assert\n expect([...newTabs].sort()).toEqual([...tabs].sort());\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-14.spec.ts", "start_line": null, "end_line": null, "dependencies": ["tabsWithSelectionArb"], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Reordering tabs should not change the original set of tabs, only their order.", "mode": "fast-check"} {"id": 56802, "name": "unknown", "code": "it(\"should accept any well-parenthesized expression\", () => {\n fc.assert(\n fc.property(wellParenthesizedStringArbitrary, (expression) => {\n expect(validParentheses(expression)).toBe(true);\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-12.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The property should hold that `validParentheses` returns true for any well-parenthesized expression.", "mode": "fast-check"} {"id": 56803, "name": "unknown", "code": "it(\"should reject any expression not containing an even number of signs\", () => {\n fc.assert(\n fc.property(\n fc\n .tuple(\n fc.array(\n fc.tuple(\n fc.constantFrom(\"(\", \"[\", \"{\", \")\", \"]\", \"}\"),\n fc.constantFrom(\"(\", \"[\", \"{\", \")\", \"]\", \"}\")\n )\n ),\n fc.constantFrom(\"(\", \"[\", \"{\", \")\", \"]\", \"}\")\n )\n .chain(([evenNumParentheses, extraParenthesis]) => {\n const parentheses = [...evenNumParentheses.flat(), extraParenthesis];\n return fc\n .shuffledSubarray(parentheses, { minLength: parentheses.length })\n .map((parentheses) => parentheses.join(\"\"));\n }),\n (invalidExpression) => {\n expect(validParentheses(invalidExpression)).toBe(false);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-12.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Expressions not containing an even number of parentheses characters should be rejected by `validParentheses`.", "mode": "fast-check"} {"id": 56804, "name": "unknown", "code": "it(\"should reject any expression not containing an even number of signs (2)\", () => {\n fc.assert(\n fc.property(\n fc\n .array(fc.constantFrom(\"(\", \"[\", \"{\", \")\", \"]\", \"}\"), { minLength: 1 })\n .filter((parentheses) => parentheses.length % 2 === 1)\n .map((parentheses) => parentheses.join(\"\")),\n (invalidExpression) => {\n expect(validParentheses(invalidExpression)).toBe(false);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-12.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "An expression with an odd number of parentheses should be rejected as invalid by `validParentheses`.", "mode": "fast-check"} {"id": 56808, "name": "unknown", "code": "it(\"should move the tower to the requested pillar\", () => {\n fc.assert(\n fc.property(\n fc.constantFrom(0, 1, 2),\n fc.constantFrom(0, 1, 2),\n fc.integer({ min: 0, max: 10 }),\n (startPosition, endPosition, towerHeight) => {\n // Arrange\n const stacks = buildInitialStacks(startPosition, towerHeight);\n const expectedStacks = buildInitialStacks(endPosition, towerHeight);\n const move = (from: number, to: number) => {\n const head = stacks[from].pop()!; // not checked by this test\n stacks[to].push(head);\n };\n\n // Act\n hanoiTower(towerHeight, startPosition, endPosition, move);\n\n // Assert\n expect(stacks).toEqual(expectedStacks);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-11.spec.ts", "start_line": null, "end_line": null, "dependencies": ["buildInitialStacks"], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The tower should be moved from a starting pillar to an ending pillar, resulting in stacks that match the expected configuration for the end position and given tower height.", "mode": "fast-check"} {"id": 56810, "name": "unknown", "code": "it(\"should not pass twice by the same state\", () => {\n fc.assert(\n fc.property(\n fc.constantFrom(0, 1, 2),\n fc.constantFrom(0, 1, 2),\n fc.integer({ min: 0, max: 10 }),\n (startPosition, endPosition, towerHeight) => {\n // Arrange\n const stacks = buildInitialStacks(startPosition, towerHeight);\n function stateToString(state: [number[], number[], number[]]): string {\n return `${state[0].join(\".\")}/${state[1].join(\".\")}/${state[2].join(\n \".\"\n )}`;\n }\n const seenStates = new Set([stateToString(stacks)]);\n\n // Act / Assert\n const move = (from: number, to: number) => {\n const head = stacks[from].pop()!; // not checked by this test\n stacks[to].push(head);\n const newStateString = stateToString(stacks);\n expect(seenStates.has(newStateString)).toBe(false);\n seenStates.add(newStateString);\n };\n hanoiTower(towerHeight, startPosition, endPosition, move);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-11.spec.ts", "start_line": null, "end_line": null, "dependencies": ["buildInitialStacks"], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "A state in the Tower of Hanoi puzzle, represented by stacks, should not be revisited during moves.", "mode": "fast-check"} {"id": 56811, "name": "unknown", "code": "it(\"should never request any changes when moving a string to itself\", () => {\n fc.assert(\n fc.property(fc.fullUnicodeString(), (value) => {\n // Arrange / Act\n const numChanges = minimalNumberOfChangesToBeOther(value, value);\n\n // Assert\n expect(numChanges).toBe(0);\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-10.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The number of changes needed to transform a string into itself should be zero.", "mode": "fast-check"} {"id": 56818, "name": "unknown", "code": "it(\"should have exactly the same number of occurrences as source for each item\", () => {\n fc.assert(\n fc.property(fc.array(fc.integer()), (data) => {\n const sortedData = sorted(data);\n expect(countEach(sortedData)).toEqual(countEach(data));\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-09.spec.ts", "start_line": null, "end_line": null, "dependencies": ["countEach"], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The number of occurrences for each item should remain the same in sorted and unsorted arrays.", "mode": "fast-check"} {"id": 56854, "name": "unknown", "code": "assertAsyncProperty: (predicate: (...args: Ts) => Promise) =>\n fc.assert(fc.asyncProperty(...arbitraries, predicate), params)", "language": "typescript", "source_file": "./repos/nmay231/lattice-grid/src/testing-utils/fcArbitraries.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nmay231/lattice-grid", "url": "https://github.com/nmay231/lattice-grid.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures that a predicate function, taking arbitrary arguments and returning a Promise, evaluates to true or void.", "mode": "fast-check"} {"id": 56855, "name": "unknown", "code": "it(\"should check state leaf and ballot transformers (full credits voting)\", async () => {\n const max = BigInt(2 ** 50);\n\n await fc.assert(\n fc.asyncProperty(\n fc.bigInt({ min: 1n, max }),\n fc.bigInt({ min: 1n, max }),\n fc.bigInt({ min: 1n, max }),\n fc.bigInt({ min: 1n, max }),\n fc.bigInt({ min: 1n, max: max - maxSignups }),\n fc.bigInt({ min: 1n, max: max - maxVoteOptions }),\n check,\n ),\n );\n\n async function check(\n votes: bigint,\n nonce: bigint,\n stateTreeIndex: bigint,\n voteOptionIndex: bigint,\n maxSignupsDifference: bigint,\n maxVoteOptionsDifference: bigint,\n ) {\n const { privateKey, publicKey } = new Keypair();\n const userCommand = new VoteCommand(stateTreeIndex, publicKey, voteOptionIndex, votes, nonce, 0n);\n const commandSignature = userCommand.sign(privateKey);\n\n const circuitInputs = {\n totalSignups: stateTreeIndex + maxSignupsDifference,\n voteOptions: voteOptionIndex + maxVoteOptionsDifference,\n stateLeafPublicKey: publicKey.asCircuitInputs() as unknown as [bigint, bigint],\n stateLeafVoiceCreditBalance: votes,\n ballotNonce: nonce - 1n,\n ballotCurrentVotesForOption: 0n,\n commandStateIndex: userCommand.stateIndex,\n commandPublicKey: userCommand.newPublicKey.asCircuitInputs() as unknown as [bigint, bigint],\n commandVoteOptionIndex: userCommand.voteOptionIndex,\n commandNewVoteWeight: userCommand.newVoteWeight,\n commandNonce: userCommand.nonce,\n commandPollId: userCommand.pollId,\n commandSalt: userCommand.salt,\n commandSignaturePoint: commandSignature.R8 as [bigint, bigint],\n commandSignatureScalar: commandSignature.S as bigint,\n packedCommand: userCommand.asCircuitInputs(),\n };\n\n const witness = await circuit.calculateWitness(circuitInputs);\n await circuit.expectConstraintPass(witness);\n\n const newStateLeafPublicKey0 = await getSignal(circuit, witness, \"newStateLeafPublicKey[0]\");\n const newStateLeafPublicKey1 = await getSignal(circuit, witness, \"newStateLeafPublicKey[1]\");\n const newBallotNonce = await getSignal(circuit, witness, \"newBallotNonce\");\n const isValid = await getSignal(circuit, witness, \"isValid\");\n const isStateLeafIndexValid = await getSignal(circuit, witness, \"isStateLeafIndexValid\");\n const isVoteOptionIndexValid = await getSignal(circuit, witness, \"isVoteOptionIndexValid\");\n\n return (\n isValid.toString() === \"1\" &&\n isStateLeafIndexValid.toString() === \"1\" &&\n isVoteOptionIndexValid.toString() === \"1\" &&\n newBallotNonce.toString() === userCommand.nonce.toString() &&\n newStateLeafPublicKey0.toString() === userCommand.newPublicKey.raw[0].toString() &&\n newStateLeafPublicKey1.toString() === userCommand.newPublicKey.raw[1].toString()\n );\n }\n })", "language": "typescript", "source_file": "./repos/privacy-scaling-explorations/maci/packages/circuits/ts/__tests__/StateLeafAndBallotTransformerFull.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "privacy-scaling-explorations/maci", "url": "https://github.com/privacy-scaling-explorations/maci.git", "license": "MIT", "stars": 571, "forks": 180}, "metrics": null, "summary": "The property ensures that state leaf and ballot transformations for full credits voting are valid by verifying the constraints and outputs of a circuit against expected values using a variety of randomly generated big integers.", "mode": "fast-check"} {"id": 56856, "name": "unknown", "code": "it(\"correctly hashes 2 random values in order\", async () => {\n const n = 2;\n\n circuit = await circomkitInstance.WitnessTester(\"poseidonHasher\", {\n file: \"./utils/PoseidonHasher\",\n template: \"PoseidonHasher\",\n params: [n],\n });\n\n await fc.assert(\n fc.asyncProperty(\n fc.array(fc.bigInt({ min: 0n, max: r - 1n }), { minLength: n, maxLength: n }),\n async (preImages: bigint[]) => {\n const witness = await circuit.calculateWitness({\n inputs: preImages,\n });\n await circuit.expectConstraintPass(witness);\n const output = await getSignal(circuit, witness, \"out\");\n const outputJS = hash2(preImages);\n\n return output === outputJS;\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/privacy-scaling-explorations/maci/packages/circuits/ts/__tests__/PoseidonHasher.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "privacy-scaling-explorations/maci", "url": "https://github.com/privacy-scaling-explorations/maci.git", "license": "MIT", "stars": 571, "forks": 180}, "metrics": null, "summary": "The function hashes two random big integer values using the PoseidonHasher circuit and verifies that the circuit's output matches the JavaScript hash function `hash2`.", "mode": "fast-check"} {"id": 56857, "name": "unknown", "code": "it(\"correctly hashes 3 random values\", async () => {\n const n = 3;\n\n circuit = await circomkitInstance.WitnessTester(\"poseidonHasher\", {\n file: \"./utils/PoseidonHasher\",\n template: \"PoseidonHasher\",\n params: [n],\n });\n\n await fc.assert(\n fc.asyncProperty(\n fc.array(fc.bigInt({ min: 0n, max: r - 1n }), { minLength: n, maxLength: n }),\n async (preImages: bigint[]) => {\n const witness = await circuit.calculateWitness({\n inputs: preImages,\n });\n await circuit.expectConstraintPass(witness);\n const output = await getSignal(circuit, witness, \"out\");\n const outputJS = hash3(preImages);\n\n return output === outputJS;\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/privacy-scaling-explorations/maci/packages/circuits/ts/__tests__/PoseidonHasher.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "privacy-scaling-explorations/maci", "url": "https://github.com/privacy-scaling-explorations/maci.git", "license": "MIT", "stars": 571, "forks": 180}, "metrics": null, "summary": "Hashes of three random bigint inputs using `poseidonHasher` should match the output of `hash3`.", "mode": "fast-check"} {"id": 56858, "name": "unknown", "code": "it(\"correctly hashes 4 random values\", async () => {\n const n = 4;\n\n circuit = await circomkitInstance.WitnessTester(\"poseidonHasher\", {\n file: \"./utils/PoseidonHasher\",\n template: \"PoseidonHasher\",\n params: [n],\n });\n\n await fc.assert(\n fc.asyncProperty(\n fc.array(fc.bigInt({ min: 0n, max: r - 1n }), { minLength: n, maxLength: n }),\n async (preImages: bigint[]) => {\n const witness = await circuit.calculateWitness({\n inputs: preImages,\n });\n await circuit.expectConstraintPass(witness);\n const output = await getSignal(circuit, witness, \"out\");\n const outputJS = hash4(preImages);\n\n return output === outputJS;\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/privacy-scaling-explorations/maci/packages/circuits/ts/__tests__/PoseidonHasher.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "privacy-scaling-explorations/maci", "url": "https://github.com/privacy-scaling-explorations/maci.git", "license": "MIT", "stars": 571, "forks": 180}, "metrics": null, "summary": "`PoseidonHasher` correctly hashes 4 random big integer values, ensuring the output matches the result of the `hash4` function for the same input.", "mode": "fast-check"} {"id": 56859, "name": "unknown", "code": "it(\"correctly hashes 5 random values\", async () => {\n const n = 5;\n\n circuit = await circomkitInstance.WitnessTester(\"poseidonHasher\", {\n file: \"./utils/PoseidonHasher\",\n template: \"PoseidonHasher\",\n params: [n],\n });\n\n await fc.assert(\n fc.asyncProperty(\n fc.array(fc.bigInt({ min: 0n, max: r - 1n }), { minLength: n, maxLength: n }),\n async (preImages: bigint[]) => {\n const witness = await circuit.calculateWitness({\n inputs: preImages,\n });\n await circuit.expectConstraintPass(witness);\n const output = await getSignal(circuit, witness, \"out\");\n const outputJS = hash5(preImages);\n\n return output === outputJS;\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/privacy-scaling-explorations/maci/packages/circuits/ts/__tests__/PoseidonHasher.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "privacy-scaling-explorations/maci", "url": "https://github.com/privacy-scaling-explorations/maci.git", "license": "MIT", "stars": 571, "forks": 180}, "metrics": null, "summary": "The `PoseidonHasher` correctly hashes an array of 5 random bigint values, ensuring that the circuit output matches the JavaScript `hash5` function output.", "mode": "fast-check"} {"id": 56860, "name": "unknown", "code": "it(\"should check message validator properly\", async () => {\n const max = BigInt(2 ** 50);\n\n await fc.assert(\n fc.asyncProperty(\n fc.bigInt({ min: 1n, max }),\n fc.bigInt({ min: 1n, max }),\n fc.bigInt({ min: 0n, max }),\n fc.bigInt({ min: 0n, max }),\n fc.bigInt({ min: 1n, max: max - maxSignups }),\n fc.bigInt({ min: 1n, max: max - maxVoteOptions }),\n check,\n ),\n );\n\n async function check(\n votes: bigint,\n nonce: bigint,\n stateTreeIndex: bigint,\n voteOptionIndex: bigint,\n maxSignupsDifference: bigint,\n maxVoteOptionsDifference: bigint,\n ) {\n const { privateKey, publicKey } = new Keypair();\n const command = new VoteCommand(stateTreeIndex, publicKey, voteOptionIndex, votes, nonce, 0n);\n\n const signature = command.sign(privateKey);\n\n const inputs = {\n originalNonce: nonce - 1n,\n commandNonce: nonce,\n currentVotesForOption: 0n,\n voteWeight: votes,\n currentVoiceCreditBalance: votes,\n signaturePoint: signature.R8 as unknown as bigint,\n signatureScalar: signature.S as bigint,\n publicKey: publicKey.asCircuitInputs() as unknown as [bigint, bigint],\n command: command.asCircuitInputs(),\n stateTreeIndex,\n totalSignups: stateTreeIndex + maxSignupsDifference,\n voteOptionIndex,\n voteOptions: voteOptionIndex + maxVoteOptionsDifference,\n };\n\n const witness = await circuit.calculateWitness(inputs);\n await circuit.expectConstraintPass(witness);\n const isValid = await getSignal(circuit, witness, \"isValid\");\n const isStateLeafIndexValid = await getSignal(circuit, witness, \"isStateLeafIndexValid\");\n const isVoteOptionIndexValid = await getSignal(circuit, witness, \"isVoteOptionIndexValid\");\n\n return (\n isValid.toString() === \"1\" &&\n isStateLeafIndexValid.toString() === \"1\" &&\n isVoteOptionIndexValid.toString() === \"1\"\n );\n }\n })", "language": "typescript", "source_file": "./repos/privacy-scaling-explorations/maci/packages/circuits/ts/__tests__/MessageValidatorFull.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "privacy-scaling-explorations/maci", "url": "https://github.com/privacy-scaling-explorations/maci.git", "license": "MIT", "stars": 571, "forks": 180}, "metrics": null, "summary": "The `MessageValidatorFull` test checks that a message validator accurately verifies validity, state leaf index validity, and vote option index validity for various input configurations.", "mode": "fast-check"} {"id": 56861, "name": "unknown", "code": "it(\"should correctly hash a message [fuzz]\", async () => {\n const random50bitBigInt = (salt: bigint): bigint =>\n // eslint-disable-next-line no-bitwise\n ((BigInt(1) << BigInt(50)) - BigInt(1)) & salt;\n\n await fc.assert(\n fc.asyncProperty(\n fc.bigInt({ min: 0n }),\n fc.bigInt({ min: 0n }),\n fc.bigInt({ min: 0n }),\n fc.bigInt({ min: 0n }),\n fc.bigInt({ min: 0n }),\n fc.bigInt({ min: 0n }),\n async (\n stateIndex: bigint,\n voteOptionIndex: bigint,\n newVoteWeight: bigint,\n nonce: bigint,\n pollId: bigint,\n salt: bigint,\n ) => {\n const { publicKey, privateKey } = new Keypair();\n\n const command: VoteCommand = new VoteCommand(\n random50bitBigInt(stateIndex),\n publicKey,\n random50bitBigInt(voteOptionIndex),\n random50bitBigInt(newVoteWeight),\n random50bitBigInt(nonce),\n random50bitBigInt(pollId),\n salt,\n );\n\n const ecdhSharedKey = Keypair.generateEcdhSharedKey(privateKey, publicKey);\n const signature = command.sign(privateKey);\n const message = command.encrypt(signature, ecdhSharedKey);\n const messageHash = message.hash(publicKey);\n const circuitInputs = {\n in: message.asCircuitInputs(),\n encryptionPublicKey: publicKey.asCircuitInputs() as unknown as [bigint, bigint],\n };\n const witness = await circuit.calculateWitness(circuitInputs);\n await circuit.expectConstraintPass(witness);\n const output = await getSignal(circuit, witness, \"hash\");\n\n return output === messageHash;\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/privacy-scaling-explorations/maci/packages/circuits/ts/__tests__/MessageHasher.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "privacy-scaling-explorations/maci", "url": "https://github.com/privacy-scaling-explorations/maci.git", "license": "MIT", "stars": 571, "forks": 180}, "metrics": null, "summary": "The property verifies that a message, when hashed using the `MessageHasher`, produces the expected hash after going through encryption and witness calculation processes, ensuring consistency between the computed and expected hashes.", "mode": "fast-check"} {"id": 56862, "name": "unknown", "code": "it(\"should check the correct value [fuzz]\", async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.nat(),\n fc.array(fc.bigInt({ min: 0n, max: r - 1n }), { minLength: leavesPerNode, maxLength: leavesPerNode }),\n async (index: number, elements: bigint[]) => {\n fc.pre(elements.length > index);\n\n const witness = await circuitQuinarySelector.calculateWitness({ index: BigInt(index), in: elements });\n await circuitQuinarySelector.expectConstraintPass(witness);\n const out = await getSignal(circuitQuinarySelector, witness, \"out\");\n\n return out.toString() === elements[index].toString();\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/privacy-scaling-explorations/maci/packages/circuits/ts/__tests__/IncrementalQuinaryTree.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "privacy-scaling-explorations/maci", "url": "https://github.com/privacy-scaling-explorations/maci.git", "license": "MIT", "stars": 571, "forks": 180}, "metrics": null, "summary": "`circuitQuinarySelector` outputs the value at a specified index from an array of fixed length.", "mode": "fast-check"} {"id": 56863, "name": "unknown", "code": "it(\"should loop the value if number is greater that r [fuzz]\", async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.nat(),\n fc.array(fc.bigInt({ min: r }), { minLength: leavesPerNode, maxLength: leavesPerNode }),\n async (index: number, elements: bigint[]) => {\n fc.pre(elements.length > index);\n\n const witness = await circuitQuinarySelector.calculateWitness({ index: BigInt(index), in: elements });\n await circuitQuinarySelector.expectConstraintPass(witness);\n const out = await getSignal(circuitQuinarySelector, witness, \"out\");\n\n return out.toString() === (elements[index] % r).toString();\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/privacy-scaling-explorations/maci/packages/circuits/ts/__tests__/IncrementalQuinaryTree.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "privacy-scaling-explorations/maci", "url": "https://github.com/privacy-scaling-explorations/maci.git", "license": "MIT", "stars": 571, "forks": 180}, "metrics": null, "summary": "The value should loop when indexed from elements with a length greater than the index, resulting in `out` equaling `elements[index] % r`.", "mode": "fast-check"} {"id": 56864, "name": "unknown", "code": "it(\"should throw error if index is out of bounds [fuzz]\", async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.nat(),\n fc.array(fc.bigInt({ min: 0n }), { minLength: 1 }),\n async (index: number, elements: bigint[]) => {\n fc.pre(index >= elements.length);\n\n const circuit = await circomkitInstance.WitnessTester(\"QuinarySelector\", {\n file: \"./utils/trees/QuinarySelector\",\n template: \"QuinarySelector\",\n params: [elements.length],\n });\n\n return circuit\n .calculateWitness({ index: BigInt(index), in: elements })\n .then(() => false)\n .catch((error: Error) => error.message.includes(\"Assert Failed\"));\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/privacy-scaling-explorations/maci/packages/circuits/ts/__tests__/IncrementalQuinaryTree.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "privacy-scaling-explorations/maci", "url": "https://github.com/privacy-scaling-explorations/maci.git", "license": "MIT", "stars": 571, "forks": 180}, "metrics": null, "summary": "Checks that an error is thrown when attempting to calculate a witness with an out-of-bounds index in a quinary tree circuit.", "mode": "fast-check"} {"id": 56868, "name": "unknown", "code": "it(\"should check generation of path indices [fuzz]\", async () => {\n const maxLevel = 100n;\n\n await fc.assert(\n fc.asyncProperty(\n fc.bigInt({ min: 1n, max: maxLevel }),\n fc.bigInt({ min: 1n, max: r - 1n }),\n async (levels: bigint, input: bigint) => {\n fc.pre(BigInt(leavesPerNode) ** levels > input);\n\n const tree = new IncrementalQuinTree(Number(levels), 0n, 5, hash5);\n\n const circuit = await circomkitInstance.WitnessTester(\"QuinaryGeneratePathIndices\", {\n file: \"./utils/trees/QuinaryGeneratePathIndices\",\n template: \"QuinaryGeneratePathIndices\",\n params: [levels],\n });\n\n const witness = await circuit.calculateWitness({\n in: input,\n });\n await circuit.expectConstraintPass(witness);\n\n const values: bigint[] = [];\n\n for (let i = 0; i < levels; i += 1) {\n // eslint-disable-next-line no-await-in-loop\n const value = await getSignal(circuit, witness, `out[${i}]`);\n tree.insert(value);\n values.push(value);\n }\n\n const { pathIndices } = tree.generateProof(Number(input));\n\n const isEqual = pathIndices.every((item, index) => item.toString() === values[index].toString());\n\n return values.length === pathIndices.length && isEqual;\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/privacy-scaling-explorations/maci/packages/circuits/ts/__tests__/IncrementalQuinaryTree.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "privacy-scaling-explorations/maci", "url": "https://github.com/privacy-scaling-explorations/maci.git", "license": "MIT", "stars": 571, "forks": 180}, "metrics": null, "summary": "Generation of path indices should accurately match expected values in an incremental quinary tree across multiple levels.", "mode": "fast-check"} {"id": 56869, "name": "unknown", "code": "it(\"should check the correct leaf [fuzz]\", async () => {\n // TODO: seems js implementation doesn't work with levels more than 22\n const maxLevel = 22;\n\n await fc.assert(\n fc.asyncProperty(\n fc.integer({ min: 1, max: maxLevel }),\n fc.nat({ max: leavesPerNode - 1 }),\n fc.array(fc.bigInt({ min: 0n, max: r - 1n }), { minLength: leavesPerNode, maxLength: leavesPerNode }),\n async (levels: number, index: number, leaves: bigint[]) => {\n const circuit = await circomkitInstance.WitnessTester(\"QuinaryLeafExists\", {\n file: \"./utils/trees/QuinaryLeafExists\",\n template: \"QuinaryLeafExists\",\n params: [levels],\n });\n\n const tree = new IncrementalQuinTree(levels, 0n, leavesPerNode, hash5);\n leaves.forEach((value) => {\n tree.insert(value);\n });\n\n const proof = tree.generateProof(index);\n\n const witness = await circuit.calculateWitness({\n root: tree.root,\n leaf: leaves[index],\n path_elements: proof.pathElements,\n path_indices: proof.pathIndices,\n });\n\n return circuit\n .expectConstraintPass(witness)\n .then(() => true)\n .catch(() => false);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/privacy-scaling-explorations/maci/packages/circuits/ts/__tests__/IncrementalQuinaryTree.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "privacy-scaling-explorations/maci", "url": "https://github.com/privacy-scaling-explorations/maci.git", "license": "MIT", "stars": 571, "forks": 180}, "metrics": null, "summary": "The property verifies that for a quinary tree with up to 22 levels, the circuit correctly confirms the existence of a specified leaf within the tree.", "mode": "fast-check"} {"id": 56871, "name": "unknown", "code": "it(\"should correctly sum a list of values [fuzz]\", async () => {\n await fc.assert(\n fc.asyncProperty(fc.array(fc.bigInt({ min: 0n, max: r - 1n }), { minLength: 1 }), async (nums: bigint[]) => {\n const sum = nums.reduce((a, b) => a + b, 0n);\n fc.pre(sum <= r - 1n);\n\n const testCircuit = await circomkitInstance.WitnessTester(\"calculateTotal\", {\n file: \"./utils/CalculateTotal\",\n template: \"CalculateTotal\",\n params: [nums.length],\n });\n\n const witness = await testCircuit.calculateWitness({ nums });\n await testCircuit.expectConstraintPass(witness);\n const total = await getSignal(testCircuit, witness, \"sum\");\n\n return total === sum;\n }),\n { numRuns: 10_000 },\n );\n })", "language": "typescript", "source_file": "./repos/privacy-scaling-explorations/maci/packages/circuits/ts/__tests__/CalculateTotal.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "privacy-scaling-explorations/maci", "url": "https://github.com/privacy-scaling-explorations/maci.git", "license": "MIT", "stars": 571, "forks": 180}, "metrics": null, "summary": "The property verifies that the sum of a list of bigint values matches the total calculated by the `calculateTotal` circuit, ensuring the sum does not exceed `r - 1`.", "mode": "fast-check"} {"id": 56874, "name": "unknown", "code": "it(\"should correctly compute a public key [fuzz]\", async () => {\n await fc.assert(\n fc.asyncProperty(fc.bigInt(), async (salt: bigint) => {\n const { publicKey, privateKey } = new Keypair(new PrivateKey(salt));\n\n const witness = await circuit.calculateWitness({ privateKey: BigInt(privateKey.asCircuitInputs()) });\n await circuit.expectConstraintPass(witness);\n\n const derivedPublicKeyX = await getSignal(circuit, witness, \"publicKey[0]\");\n const derivedPublicKeyY = await getSignal(circuit, witness, \"publicKey[1]\");\n\n return (\n derivedPublicKeyX === publicKey.raw[0] &&\n derivedPublicKeyY === publicKey.raw[1] &&\n inCurve([derivedPublicKeyX, derivedPublicKeyY])\n );\n }),\n { numRuns: 10_000 },\n );\n })", "language": "typescript", "source_file": "./repos/privacy-scaling-explorations/maci/packages/circuits/ts/__tests__/PrivToPubKey.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "privacy-scaling-explorations/maci", "url": "https://github.com/privacy-scaling-explorations/maci.git", "license": "MIT", "stars": 571, "forks": 180}, "metrics": null, "summary": "The function computes a public key from a given private key and verifies that the derived public key matches the expected values and lies on the curve.", "mode": "fast-check"} {"id": 56822, "name": "unknown", "code": "it(\"should be equal to the sum of fibo(n-1) and fibo(n-2)\", () => {\n fc.assert(\n fc.property(fc.integer({ min: 2, max: MaxN }), (n) => {\n expect(fibonacci(n)).toBe(fibonacci(n - 1) + fibonacci(n - 2));\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-07.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The function `fibonacci` should satisfy the property that its result equals the sum of `fibonacci(n-1)` and `fibonacci(n-2)` for integers `n` greater than or equal to 2.", "mode": "fast-check"} {"id": 56875, "name": "unknown", "code": "test(\"should encrypt and decrypt properly\", () => {\n fc.assert(\n fc.property(fc.string(), (text: string) => {\n const service = new CryptoService();\n\n const keypair = generateKeyPairSync(\"rsa\", {\n modulusLength: 2048,\n });\n\n const encryptedText = service.encrypt(keypair.publicKey.export({ type: \"pkcs1\", format: \"pem\" }), text);\n\n const decryptedText = service.decrypt(\n keypair.privateKey.export({ type: \"pkcs1\", format: \"pem\" }),\n encryptedText,\n );\n\n return decryptedText === text;\n }),\n );\n })", "language": "typescript", "source_file": "./repos/privacy-scaling-explorations/maci/apps/coordinator/ts/crypto/__tests__/crypto.service.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "privacy-scaling-explorations/maci", "url": "https://github.com/privacy-scaling-explorations/maci.git", "license": "MIT", "stars": 571, "forks": 180}, "metrics": null, "summary": "Encryption and decryption processes should accurately preserve the original string.", "mode": "fast-check"} {"id": 56876, "name": "unknown", "code": "test('compare test framework to real framework', () => {\n // Generate a tree of TestConditions using fast-check\n fc.assert(\n fc.property(fc.integer({min: 1, max: 20}), numConditions => {\n const conditions: TestCondition[] = fc\n .sample(fc.boolean(), numConditions)\n .map(\n value =>\n ({\n type: 'simple',\n right: {value},\n }) as const,\n );\n\n const pivots = conditions.map(\n () => fc.sample(fc.integer({min: 0, max: 100}), 1)[0] > 50,\n );\n\n const expected = conditions.reduce((acc, value, i) => {\n if (acc === undefined) {\n return value;\n }\n return pivots[i] ? simpleAnd(acc, value) : simpleOr(acc, value);\n });\n\n const actualConditions = conditions.map(convertTestCondition);\n const actual = simplifyCondition(\n actualConditions.reduce((acc, value, i) => {\n if (acc === undefined) {\n return value;\n }\n return pivots[i] ? and(value, acc) : or(value, acc);\n }),\n );\n\n expect(evaluate(actual as TestCondition)).toBe(evaluate(expected));\n\n // check that the real framework produced a flattened condition\n // console.log(toStr(actual));\n const check = (c: Condition): boolean =>\n c.type === 'simple' ||\n c.type === 'correlatedSubquery' ||\n c.conditions.every(child => child.type !== c.type && check(child));\n expect(check(actual)).toBe(true);\n }),\n );\n\n function convertTestCondition(c: TestCondition): Condition {\n assert(c.type === 'simple');\n return {\n type: 'simple',\n right: {\n type: 'literal',\n value: c.right.value,\n },\n op: '=',\n left: {\n type: 'column',\n name: 'n/a',\n },\n };\n }\n})", "language": "typescript", "source_file": "./repos/rocicorp/mono/packages/zql/src/query/expression.test.ts", "start_line": null, "end_line": null, "dependencies": ["simpleAnd", "simpleOr", "evaluate"], "repo": {"name": "rocicorp/mono", "url": "https://github.com/rocicorp/mono.git", "license": "Apache-2.0", "stars": 1802, "forks": 80}, "metrics": null, "summary": "The framework should correctly evaluate a tree of simplified `TestCondition` objects to ensure equivalence in evaluation results between the test condition and actual condition structures, while producing a flattened condition without repeating condition types in its children.", "mode": "fast-check"} {"id": 56878, "name": "unknown", "code": "test('normalizeUndefined', () => {\n fc.assert(\n fc.property(fc.constantFrom(null, undefined), v => {\n expect(normalizeUndefined(v)).toBe(null);\n }),\n );\n fc.assert(\n fc.property(fc.oneof(fc.boolean(), fc.double(), fc.string()), b => {\n expect(normalizeUndefined(b)).toBe(b);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/rocicorp/mono/packages/zql/src/ivm/data.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "rocicorp/mono", "url": "https://github.com/rocicorp/mono.git", "license": "Apache-2.0", "stars": 1802, "forks": 80}, "metrics": null, "summary": "`normalizeUndefined` converts `null` and `undefined` to `null`, leaving other types unchanged.", "mode": "fast-check"} {"id": 56879, "name": "unknown", "code": "test('compareValues', () => {\n // null and undefined are equal to each other\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.constantFrom(null, undefined),\n (v1, v2) => {\n expect(compareValues(v1, v2)).toBe(0);\n },\n ),\n );\n\n // null and undefined are less than any other value\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.oneof(fc.boolean(), fc.double(), fc.fullUnicodeString()),\n (v1, v2) => {\n expect(compareValues(v1, v2)).lessThan(0);\n expect(compareValues(v2, v1)).greaterThan(0);\n },\n ),\n );\n\n // boolean\n fc.assert(\n fc.property(fc.boolean(), fc.boolean(), (b1, b2) => {\n expect(compareValues(b1, b2)).toBe(b1 === b2 ? 0 : b1 ? 1 : -1);\n }),\n );\n fc.assert(\n fc.property(\n fc.boolean(),\n fc.oneof(fc.double(), fc.fullUnicodeString()),\n (b, v) => {\n expect(() => compareValues(b, v)).toThrow('expected boolean');\n },\n ),\n );\n\n // number\n fc.assert(\n fc.property(fc.double(), fc.double(), (n1, n2) => {\n expect(compareValues(n1, n2)).toBe(n1 - n2);\n }),\n );\n fc.assert(\n fc.property(\n fc.double(),\n fc.oneof(fc.boolean(), fc.fullUnicodeString()),\n (n, v) => {\n expect(() => compareValues(n, v)).toThrow('expected number');\n },\n ),\n );\n\n // string\n fc.assert(\n fc.property(fc.fullUnicodeString(), fc.fullUnicodeString(), (s1, s2) => {\n expect(compareValues(s1, s2)).toBe(compareUTF8(s1, s2));\n }),\n );\n fc.assert(\n fc.property(\n fc.fullUnicodeString(),\n fc.oneof(fc.boolean(), fc.double()),\n (s, v) => {\n expect(() => compareValues(s, v)).toThrow('expected string');\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/rocicorp/mono/packages/zql/src/ivm/data.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "rocicorp/mono", "url": "https://github.com/rocicorp/mono.git", "license": "Apache-2.0", "stars": 1802, "forks": 80}, "metrics": null, "summary": "`compareValues` is validated across different data types: `null` and `undefined` are treated as equal and less than other types, booleans are compared logically, numbers use arithmetic comparison, and strings are compared using UTF-8 logic. Mismatched types raise an exception.", "mode": "fast-check"} {"id": 56880, "name": "unknown", "code": "test('compareValues', () => {\n // null and undefined are equal to each other\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.constantFrom(null, undefined),\n (v1, v2) => {\n expect(compareValues(v1, v2)).toBe(0);\n },\n ),\n );\n\n // null and undefined are less than any other value\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.oneof(fc.boolean(), fc.double(), fc.fullUnicodeString()),\n (v1, v2) => {\n expect(compareValues(v1, v2)).lessThan(0);\n expect(compareValues(v2, v1)).greaterThan(0);\n },\n ),\n );\n\n // boolean\n fc.assert(\n fc.property(fc.boolean(), fc.boolean(), (b1, b2) => {\n expect(compareValues(b1, b2)).toBe(b1 === b2 ? 0 : b1 ? 1 : -1);\n }),\n );\n fc.assert(\n fc.property(\n fc.boolean(),\n fc.oneof(fc.double(), fc.fullUnicodeString()),\n (b, v) => {\n expect(() => compareValues(b, v)).toThrow('expected boolean');\n },\n ),\n );\n\n // number\n fc.assert(\n fc.property(fc.double(), fc.double(), (n1, n2) => {\n expect(compareValues(n1, n2)).toBe(n1 - n2);\n }),\n );\n fc.assert(\n fc.property(\n fc.double(),\n fc.oneof(fc.boolean(), fc.fullUnicodeString()),\n (n, v) => {\n expect(() => compareValues(n, v)).toThrow('expected number');\n },\n ),\n );\n\n // string\n fc.assert(\n fc.property(fc.fullUnicodeString(), fc.fullUnicodeString(), (s1, s2) => {\n expect(compareValues(s1, s2)).toBe(compareUTF8(s1, s2));\n }),\n );\n fc.assert(\n fc.property(\n fc.fullUnicodeString(),\n fc.oneof(fc.boolean(), fc.double()),\n (s, v) => {\n expect(() => compareValues(s, v)).toThrow('expected string');\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/rocicorp/mono/packages/zql/src/ivm/data.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "rocicorp/mono", "url": "https://github.com/rocicorp/mono.git", "license": "Apache-2.0", "stars": 1802, "forks": 80}, "metrics": null, "summary": "`compareValues` ensures that null and undefined are treated as equal to each other and less than any other value, that booleans are compared correctly and throw on invalid comparisons, that numbers are subtracted for comparison and throw on invalid comparisons, and that strings use `compareUTF8` and throw on invalid comparisons.", "mode": "fast-check"} {"id": 56882, "name": "unknown", "code": "test('compareValues', () => {\n // null and undefined are equal to each other\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.constantFrom(null, undefined),\n (v1, v2) => {\n expect(compareValues(v1, v2)).toBe(0);\n },\n ),\n );\n\n // null and undefined are less than any other value\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.oneof(fc.boolean(), fc.double(), fc.fullUnicodeString()),\n (v1, v2) => {\n expect(compareValues(v1, v2)).lessThan(0);\n expect(compareValues(v2, v1)).greaterThan(0);\n },\n ),\n );\n\n // boolean\n fc.assert(\n fc.property(fc.boolean(), fc.boolean(), (b1, b2) => {\n expect(compareValues(b1, b2)).toBe(b1 === b2 ? 0 : b1 ? 1 : -1);\n }),\n );\n fc.assert(\n fc.property(\n fc.boolean(),\n fc.oneof(fc.double(), fc.fullUnicodeString()),\n (b, v) => {\n expect(() => compareValues(b, v)).toThrow('expected boolean');\n },\n ),\n );\n\n // number\n fc.assert(\n fc.property(fc.double(), fc.double(), (n1, n2) => {\n expect(compareValues(n1, n2)).toBe(n1 - n2);\n }),\n );\n fc.assert(\n fc.property(\n fc.double(),\n fc.oneof(fc.boolean(), fc.fullUnicodeString()),\n (n, v) => {\n expect(() => compareValues(n, v)).toThrow('expected number');\n },\n ),\n );\n\n // string\n fc.assert(\n fc.property(fc.fullUnicodeString(), fc.fullUnicodeString(), (s1, s2) => {\n expect(compareValues(s1, s2)).toBe(compareUTF8(s1, s2));\n }),\n );\n fc.assert(\n fc.property(\n fc.fullUnicodeString(),\n fc.oneof(fc.boolean(), fc.double()),\n (s, v) => {\n expect(() => compareValues(s, v)).toThrow('expected string');\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/rocicorp/mono/packages/zql/src/ivm/data.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "rocicorp/mono", "url": "https://github.com/rocicorp/mono.git", "license": "Apache-2.0", "stars": 1802, "forks": 80}, "metrics": null, "summary": "`compareValues` function should return `0` for null and undefined pairs, indicate they are less than other types, correctly compare booleans and numbers, throw errors when comparing different types, and match `compareUTF8` results for strings.", "mode": "fast-check"} {"id": 56884, "name": "unknown", "code": "test('compareValues', () => {\n // null and undefined are equal to each other\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.constantFrom(null, undefined),\n (v1, v2) => {\n expect(compareValues(v1, v2)).toBe(0);\n },\n ),\n );\n\n // null and undefined are less than any other value\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.oneof(fc.boolean(), fc.double(), fc.fullUnicodeString()),\n (v1, v2) => {\n expect(compareValues(v1, v2)).lessThan(0);\n expect(compareValues(v2, v1)).greaterThan(0);\n },\n ),\n );\n\n // boolean\n fc.assert(\n fc.property(fc.boolean(), fc.boolean(), (b1, b2) => {\n expect(compareValues(b1, b2)).toBe(b1 === b2 ? 0 : b1 ? 1 : -1);\n }),\n );\n fc.assert(\n fc.property(\n fc.boolean(),\n fc.oneof(fc.double(), fc.fullUnicodeString()),\n (b, v) => {\n expect(() => compareValues(b, v)).toThrow('expected boolean');\n },\n ),\n );\n\n // number\n fc.assert(\n fc.property(fc.double(), fc.double(), (n1, n2) => {\n expect(compareValues(n1, n2)).toBe(n1 - n2);\n }),\n );\n fc.assert(\n fc.property(\n fc.double(),\n fc.oneof(fc.boolean(), fc.fullUnicodeString()),\n (n, v) => {\n expect(() => compareValues(n, v)).toThrow('expected number');\n },\n ),\n );\n\n // string\n fc.assert(\n fc.property(fc.fullUnicodeString(), fc.fullUnicodeString(), (s1, s2) => {\n expect(compareValues(s1, s2)).toBe(compareUTF8(s1, s2));\n }),\n );\n fc.assert(\n fc.property(\n fc.fullUnicodeString(),\n fc.oneof(fc.boolean(), fc.double()),\n (s, v) => {\n expect(() => compareValues(s, v)).toThrow('expected string');\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/rocicorp/mono/packages/zql/src/ivm/data.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "rocicorp/mono", "url": "https://github.com/rocicorp/mono.git", "license": "Apache-2.0", "stars": 1802, "forks": 80}, "metrics": null, "summary": "The `compareValues` function should return 0 when comparing `null` or `undefined`, treat these as less than any other types, correctly compare booleans and numbers against their respective types, ensure strings are compared using `compareUTF8`, and throw errors when types are mismatched.", "mode": "fast-check"} {"id": 56885, "name": "unknown", "code": "test('compareValues', () => {\n // null and undefined are equal to each other\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.constantFrom(null, undefined),\n (v1, v2) => {\n expect(compareValues(v1, v2)).toBe(0);\n },\n ),\n );\n\n // null and undefined are less than any other value\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.oneof(fc.boolean(), fc.double(), fc.fullUnicodeString()),\n (v1, v2) => {\n expect(compareValues(v1, v2)).lessThan(0);\n expect(compareValues(v2, v1)).greaterThan(0);\n },\n ),\n );\n\n // boolean\n fc.assert(\n fc.property(fc.boolean(), fc.boolean(), (b1, b2) => {\n expect(compareValues(b1, b2)).toBe(b1 === b2 ? 0 : b1 ? 1 : -1);\n }),\n );\n fc.assert(\n fc.property(\n fc.boolean(),\n fc.oneof(fc.double(), fc.fullUnicodeString()),\n (b, v) => {\n expect(() => compareValues(b, v)).toThrow('expected boolean');\n },\n ),\n );\n\n // number\n fc.assert(\n fc.property(fc.double(), fc.double(), (n1, n2) => {\n expect(compareValues(n1, n2)).toBe(n1 - n2);\n }),\n );\n fc.assert(\n fc.property(\n fc.double(),\n fc.oneof(fc.boolean(), fc.fullUnicodeString()),\n (n, v) => {\n expect(() => compareValues(n, v)).toThrow('expected number');\n },\n ),\n );\n\n // string\n fc.assert(\n fc.property(fc.fullUnicodeString(), fc.fullUnicodeString(), (s1, s2) => {\n expect(compareValues(s1, s2)).toBe(compareUTF8(s1, s2));\n }),\n );\n fc.assert(\n fc.property(\n fc.fullUnicodeString(),\n fc.oneof(fc.boolean(), fc.double()),\n (s, v) => {\n expect(() => compareValues(s, v)).toThrow('expected string');\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/rocicorp/mono/packages/zql/src/ivm/data.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "rocicorp/mono", "url": "https://github.com/rocicorp/mono.git", "license": "Apache-2.0", "stars": 1802, "forks": 80}, "metrics": null, "summary": "`compareValues` evaluates equality between `null` and `undefined`, ranks them below other types, and throws errors when comparing mismatched types, while correctly comparing booleans, numbers, and strings.", "mode": "fast-check"} {"id": 56886, "name": "unknown", "code": "test('compareValues', () => {\n // null and undefined are equal to each other\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.constantFrom(null, undefined),\n (v1, v2) => {\n expect(compareValues(v1, v2)).toBe(0);\n },\n ),\n );\n\n // null and undefined are less than any other value\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.oneof(fc.boolean(), fc.double(), fc.fullUnicodeString()),\n (v1, v2) => {\n expect(compareValues(v1, v2)).lessThan(0);\n expect(compareValues(v2, v1)).greaterThan(0);\n },\n ),\n );\n\n // boolean\n fc.assert(\n fc.property(fc.boolean(), fc.boolean(), (b1, b2) => {\n expect(compareValues(b1, b2)).toBe(b1 === b2 ? 0 : b1 ? 1 : -1);\n }),\n );\n fc.assert(\n fc.property(\n fc.boolean(),\n fc.oneof(fc.double(), fc.fullUnicodeString()),\n (b, v) => {\n expect(() => compareValues(b, v)).toThrow('expected boolean');\n },\n ),\n );\n\n // number\n fc.assert(\n fc.property(fc.double(), fc.double(), (n1, n2) => {\n expect(compareValues(n1, n2)).toBe(n1 - n2);\n }),\n );\n fc.assert(\n fc.property(\n fc.double(),\n fc.oneof(fc.boolean(), fc.fullUnicodeString()),\n (n, v) => {\n expect(() => compareValues(n, v)).toThrow('expected number');\n },\n ),\n );\n\n // string\n fc.assert(\n fc.property(fc.fullUnicodeString(), fc.fullUnicodeString(), (s1, s2) => {\n expect(compareValues(s1, s2)).toBe(compareUTF8(s1, s2));\n }),\n );\n fc.assert(\n fc.property(\n fc.fullUnicodeString(),\n fc.oneof(fc.boolean(), fc.double()),\n (s, v) => {\n expect(() => compareValues(s, v)).toThrow('expected string');\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/rocicorp/mono/packages/zql/src/ivm/data.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "rocicorp/mono", "url": "https://github.com/rocicorp/mono.git", "license": "Apache-2.0", "stars": 1802, "forks": 80}, "metrics": null, "summary": "`compareValues` function should correctly handle comparisons, equating `null` and `undefined`, treating them as less than other values, comparing boolean values realistically, throwing errors for mismatched types, and comparing numbers and strings according to expected logic.", "mode": "fast-check"} {"id": 56887, "name": "unknown", "code": "test('valuesEquals', () => {\n fc.assert(\n fc.property(\n fc.oneof(fc.boolean(), fc.double(), fc.fullUnicodeString()),\n fc.oneof(fc.boolean(), fc.double(), fc.fullUnicodeString()),\n (v1, v2) => {\n expect(valuesEqual(v1, v2)).toBe(v1 === v2);\n },\n ),\n );\n\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.oneof(\n fc.constantFrom(null, undefined),\n fc.boolean(),\n fc.double(),\n fc.fullUnicodeString(),\n ),\n (v1, v2) => {\n expect(valuesEqual(v1, v2)).false;\n expect(valuesEqual(v2, v1)).false;\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/rocicorp/mono/packages/zql/src/ivm/data.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "rocicorp/mono", "url": "https://github.com/rocicorp/mono.git", "license": "Apache-2.0", "stars": 1802, "forks": 80}, "metrics": null, "summary": "The `valuesEqual` function should correctly determine equality based on strict equivalence for various data types, and return false when comparing null or undefined with any other values.", "mode": "fast-check"} {"id": 56888, "name": "unknown", "code": "test('valuesEquals', () => {\n fc.assert(\n fc.property(\n fc.oneof(fc.boolean(), fc.double(), fc.fullUnicodeString()),\n fc.oneof(fc.boolean(), fc.double(), fc.fullUnicodeString()),\n (v1, v2) => {\n expect(valuesEqual(v1, v2)).toBe(v1 === v2);\n },\n ),\n );\n\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.oneof(\n fc.constantFrom(null, undefined),\n fc.boolean(),\n fc.double(),\n fc.fullUnicodeString(),\n ),\n (v1, v2) => {\n expect(valuesEqual(v1, v2)).false;\n expect(valuesEqual(v2, v1)).false;\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/rocicorp/mono/packages/zql/src/ivm/data.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "rocicorp/mono", "url": "https://github.com/rocicorp/mono.git", "license": "Apache-2.0", "stars": 1802, "forks": 80}, "metrics": null, "summary": "The `valuesEqual` function should return true if two values are strictly equal, and false if either value is null or undefined.", "mode": "fast-check"} {"id": 56889, "name": "unknown", "code": "test('basics', () => {\n // nulls and undefined are false in all conditions except IS NULL and IS NOT NULL\n fc.assert(\n fc.property(\n fc.oneof(fc.constant(null), fc.constant(undefined)),\n fc.oneof(\n fc.constant('='),\n fc.constant('!='),\n fc.constant('<'),\n fc.constant('<='),\n fc.constant('>'),\n fc.constant('>='),\n fc.constant('LIKE'),\n fc.constant('NOT LIKE'),\n fc.constant('ILIKE'),\n fc.constant('NOT ILIKE'),\n ),\n // hexastring to avoid sending escape chars to like\n fc.oneof(fc.hexaString(), fc.double(), fc.boolean(), fc.constant(null)),\n (a, operator, b) => {\n const condition: SimpleCondition = {\n type: 'simple',\n left: {\n type: 'column',\n name: 'foo',\n },\n op: operator as SimpleOperator,\n right: {\n type: 'literal',\n value: b,\n },\n };\n const predicate = createPredicate(condition);\n expect(predicate({foo: a})).toBe(false);\n },\n ),\n );\n\n let condition: SimpleCondition = {\n type: 'simple',\n left: {\n type: 'column',\n name: 'foo',\n },\n op: 'IS',\n right: {\n type: 'literal',\n value: null,\n },\n };\n let predicate = createPredicate(condition);\n expect(predicate({foo: null})).toBe(true);\n expect(predicate({foo: 1})).toBe(false);\n expect(predicate({foo: 'null'})).toBe(false);\n expect(predicate({foo: true})).toBe(false);\n expect(predicate({foo: false})).toBe(false);\n\n condition = {\n type: 'simple',\n left: {\n type: 'column',\n name: 'foo',\n },\n op: 'IS NOT',\n right: {\n type: 'literal',\n value: null,\n },\n };\n predicate = createPredicate(condition);\n expect(predicate({foo: null})).toBe(false);\n expect(predicate({foo: 1})).toBe(true);\n expect(predicate({foo: 'null'})).toBe(true);\n expect(predicate({foo: true})).toBe(true);\n expect(predicate({foo: false})).toBe(true);\n\n // basic operators\n fc.assert(\n fc.property(\n fc.oneof(fc.boolean(), fc.double(), fc.string()),\n fc.oneof(\n fc.constant('='),\n fc.constant('!='),\n fc.constant('<'),\n fc.constant('<='),\n fc.constant('>'),\n fc.constant('>='),\n ),\n fc.oneof(fc.boolean(), fc.double(), fc.string()),\n (a, op, b) => {\n const condition: SimpleCondition = {\n type: 'simple',\n left: {\n type: 'column',\n name: 'foo',\n },\n op: op as SimpleOperator,\n right: {\n type: 'literal',\n value: b,\n },\n };\n const predicate = createPredicate(condition);\n const jsOp = {'=': '===', '!=': '!=='}[op] ?? op;\n expect(predicate({foo: a})).toBe(eval(`a ${jsOp} b`));\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/rocicorp/mono/packages/zql/src/builder/filter.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "rocicorp/mono", "url": "https://github.com/rocicorp/mono.git", "license": "Apache-2.0", "stars": 1802, "forks": 80}, "metrics": null, "summary": "Null and undefined values yield false with all operators except IS NULL and IS NOT NULL, for which they return true and false respectively. For basic comparison operators, the predicate created should replicate the JavaScript evaluation of the same operation.", "mode": "fast-check"} {"id": 56891, "name": "unknown", "code": "test('no clashes - single pk', () => {\n fc.assert(\n fc.property(\n fc.oneof(\n fc.tuple(fc.string(), fc.string()),\n fc.tuple(fc.double(), fc.double()),\n fc.tuple(fc.boolean(), fc.boolean()),\n ),\n ([a, b]) => {\n const keyA = toPrimaryKeyStringImpl('issue', ['id'], {id: a});\n const keyB = toPrimaryKeyStringImpl('issue', ['id'], {id: b});\n if (a === b) {\n expect(keyA).toBe(keyB);\n } else {\n expect(keyA).not.toBe(keyB);\n }\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/rocicorp/mono/packages/zero-client/src/client/keys.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "rocicorp/mono", "url": "https://github.com/rocicorp/mono.git", "license": "Apache-2.0", "stars": 1802, "forks": 80}, "metrics": null, "summary": "`toPrimaryKeyStringImpl` generates unique primary key strings for different values and identical strings for equal values.", "mode": "fast-check"} {"id": 56892, "name": "unknown", "code": "test('no clashes - multiple pk', () => {\n const primaryKey = ['id', 'name'] as const;\n fc.assert(\n fc.property(\n fc.tuple(\n fc.oneof(fc.string(), fc.double(), fc.boolean()),\n fc.oneof(fc.string(), fc.double(), fc.boolean()),\n fc.oneof(fc.string(), fc.double(), fc.boolean()),\n fc.oneof(fc.string(), fc.double(), fc.boolean()),\n ),\n ([a1, a2, b1, b2]) => {\n const keyA = toPrimaryKeyStringImpl('issue', primaryKey, {\n id: a1,\n name: a2,\n });\n const keyB = toPrimaryKeyStringImpl('issue', primaryKey, {\n id: b1,\n name: b2,\n });\n if (a1 === b1 && a2 === b2) {\n expect(keyA).toBe(keyB);\n } else {\n expect(keyA).not.toBe(keyB);\n }\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/rocicorp/mono/packages/zero-client/src/client/keys.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "rocicorp/mono", "url": "https://github.com/rocicorp/mono.git", "license": "Apache-2.0", "stars": 1802, "forks": 80}, "metrics": null, "summary": "When creating primary keys from combinations of different types, identical input values should produce identical keys, while different values should produce distinct keys.", "mode": "fast-check"} {"id": 56893, "name": "unknown", "code": "test('encode/decodeSecProtocols round-trip', () => {\n fc.assert(\n fc.property(\n fc.record({\n initConnectionMessage: fc.tuple(\n fc.constant<'initConnection'>('initConnection'),\n fc.record(\n {\n desiredQueriesPatch: fc.array(\n fc.oneof(\n fc.record(\n {\n op: fc.constant<'put'>('put'),\n hash: fc.string(),\n data: fc.fullUnicodeString(),\n ast: fc.constant({\n table: 'table',\n }),\n ttl: fc.option(\n fc.double({\n noDefaultInfinity: true,\n noNaN: true,\n min: 0,\n }),\n {nil: undefined},\n ),\n },\n {requiredKeys: ['op', 'hash', 'ast']},\n ),\n fc.record({\n op: fc.constant<'del'>('del'),\n hash: fc.string(),\n }),\n ),\n ),\n deleted: fc.record(\n {\n clientIDs: fc.array(fc.string()),\n clientGroupIDs: fc.array(fc.string()),\n },\n {requiredKeys: []},\n ),\n },\n {requiredKeys: ['desiredQueriesPatch']},\n ),\n ),\n authToken: fc.option(\n fc.stringOf(\n fc.constantFrom(...'abcdefghijklmnopqrstuvwxyz0123456789-_.'),\n ),\n {nil: undefined},\n ),\n }),\n ({initConnectionMessage, authToken}) => {\n const encoded = encodeSecProtocols(initConnectionMessage, authToken);\n const {\n initConnectionMessage: decodedInitConnectionMessage,\n authToken: decodedAuthToken,\n } = decodeSecProtocols(encoded);\n expect(decodedInitConnectionMessage).toEqual(initConnectionMessage);\n expect(decodedAuthToken).toEqual(authToken);\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/rocicorp/mono/packages/zero-protocol/src/connect.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "rocicorp/mono", "url": "https://github.com/rocicorp/mono.git", "license": "Apache-2.0", "stars": 1802, "forks": 80}, "metrics": null, "summary": "The property should ensure that `encodeSecProtocols` and `decodeSecProtocols` are inverse operations, such that decoding the encoded result of given inputs yields the original inputs.", "mode": "fast-check"} {"id": 56894, "name": "unknown", "code": "test('random using fast check', () => {\n fc.assert(\n fc.property(\n fc.bigInt({min: 0n}),\n fc.integer({min: 2, max: 36}),\n (n, radix) => {\n const s = n.toString(radix);\n const actual = parseBigInt(s, radix);\n expect(actual).toBe(n);\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/rocicorp/mono/packages/shared/src/parse-big-int.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "rocicorp/mono", "url": "https://github.com/rocicorp/mono.git", "license": "Apache-2.0", "stars": 1802, "forks": 80}, "metrics": null, "summary": "`parseBigInt` accurately parses strings representing non-negative big integers in various radices back to their original big integer values.", "mode": "fast-check"} {"id": 56896, "name": "unknown", "code": "test('random with fast-check', () => {\n fc.assert(\n fc.property(fc.float(), fc.float(), (a, b) => {\n const as = encodeFloat64AsString(a);\n const bs = encodeFloat64AsString(b);\n\n const a2 = decodeFloat64AsString(as);\n const b2 = decodeFloat64AsString(bs);\n\n expect(a2).toBe(a);\n expect(b2).toBe(b);\n\n if (Object.is(a, b)) {\n expect(as).toBe(bs);\n } else {\n expect(as).not.toBe(bs);\n if (!Number.isNaN(a) && !Number.isNaN(b)) {\n expect(as < bs).toBe(a < b);\n }\n }\n }),\n );\n})", "language": "typescript", "source_file": "./repos/rocicorp/mono/packages/shared/src/float-to-ordered-string.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "rocicorp/mono", "url": "https://github.com/rocicorp/mono.git", "license": "Apache-2.0", "stars": 1802, "forks": 80}, "metrics": null, "summary": "Encoding and decoding of `float` values to and from strings should preserve the original values, and the string comparison should reflect the numeric comparison, except for `NaN` values.", "mode": "fast-check"} {"id": 56899, "name": "unknown", "code": "test('creating an arbitrary context field should return the created context field', async () => {\n await fc.assert(\n fc\n .asyncProperty(contextFieldDto(), async (input) => {\n const { createdAt, ...storedData } =\n await stores.contextFieldStore.create(input);\n\n Object.entries(input).forEach(([key, value]) => {\n expect(storedData[key]).toStrictEqual(value);\n });\n })\n .afterEach(cleanup),\n );\n})", "language": "typescript", "source_file": "./repos/Unleash/unleash/src/test/e2e/stores/context-field-store.e2e.test.ts", "start_line": null, "end_line": null, "dependencies": ["contextFieldDto"], "repo": {"name": "Unleash/unleash", "url": "https://github.com/Unleash/unleash.git", "license": "Apache-2.0", "stars": 12374, "forks": 783}, "metrics": null, "summary": "Creating an arbitrary context field should result in stored data that matches the input values exactly, except for the creation timestamp.", "mode": "fast-check"} {"id": 56900, "name": "unknown", "code": "test('updating a context field should update the specified fields and leave everything else untouched', async () => {\n await fc.assert(\n fc\n .asyncProperty(\n contextFieldDto(),\n contextFieldDto(),\n async (original, { name, ...updateData }) => {\n await stores.contextFieldStore.create(original);\n\n const { createdAt, ...updatedData } =\n await stores.contextFieldStore.update({\n name: original.name,\n ...updateData,\n });\n\n const allKeys = [\n 'sortOrder',\n 'stickiness',\n 'description',\n 'legalValues',\n ];\n const updateKeys = Object.keys(updateData);\n\n const unchangedKeys = allKeys.filter(\n (k) => !updateKeys.includes(k),\n );\n\n Object.entries(updateData).forEach(([key, value]) => {\n expect(updatedData[key]).toStrictEqual(value);\n });\n\n for (const key in unchangedKeys) {\n expect(updatedData[key]).toStrictEqual(original[key]);\n }\n },\n )\n .afterEach(cleanup),\n );\n})", "language": "typescript", "source_file": "./repos/Unleash/unleash/src/test/e2e/stores/context-field-store.e2e.test.ts", "start_line": null, "end_line": null, "dependencies": ["contextFieldDto"], "repo": {"name": "Unleash/unleash", "url": "https://github.com/Unleash/unleash.git", "license": "Apache-2.0", "stars": 12374, "forks": 783}, "metrics": null, "summary": "Updating a context field should change the specified fields while leaving all other fields unchanged.", "mode": "fast-check"} {"id": 54458, "name": "unknown", "code": "it('should reject configurations specifying non existing keys as required', () =>\n fc.assert(\n fc.property(fc.uniqueArray(keyArb, { minLength: 1 }), keyArb, (keys, requiredKey) => {\n // Arrange\n fc.pre(!keys.includes(requiredKey));\n const recordModel: Record> = {};\n for (const k of keys) {\n const { instance } = fakeArbitrary();\n recordModel[k] = instance;\n }\n\n // Act / Assert\n expect(() =>\n record(recordModel, {\n requiredKeys: [requiredKey],\n }),\n ).toThrowError();\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/record.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "An error is thrown when attempting to require a key not present in the record model.", "mode": "fast-check"} {"id": 54459, "name": "unknown", "code": "it('should reject any inputs containing at least one strictly negative entry', () =>\n fc.assert(\n fc.property(fc.array(fc.nat()), fc.array(fc.nat()), fc.integer({ max: -1 }), (beforeNeg, afterNeg, neg) => {\n // Arrange\n const entries = [...beforeNeg, neg, ...afterNeg].map((num) => ({ num, build: vi.fn() }));\n\n // Act / Assert\n expect(() => mapToConstant(...entries)).toThrowError();\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/mapToConstant.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`mapToConstant` should throw an error if any input contains a strictly negative entry.", "mode": "fast-check"} {"id": 54460, "name": "unknown", "code": "it('should reject any inputs summing to zero', () =>\n fc.assert(\n fc.property(fc.nat({ max: 1000 }), (length) => {\n // Arrange\n const entries = [...Array(length)].map(() => ({ num: 0, build: vi.fn() }));\n\n // Act / Assert\n expect(() => mapToConstant(...entries)).toThrowError();\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/mapToConstant.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`mapToConstant` throws an error for inputs with elements summing to zero.", "mode": "fast-check"} {"id": 56902, "name": "unknown", "code": "test(\"should return all of a feature's strategies\", async () => {\n await fc.assert(\n fc\n .asyncProperty(\n clientFeaturesAndSegments({ minLength: 1 }),\n generateContext(),\n fc.context(),\n async (data, context, ctx) => {\n const log = (x: unknown) => ctx.log(JSON.stringify(x));\n const serviceFeatures = await insertAndEvaluateFeatures(\n {\n ...data,\n context,\n },\n );\n\n const serviceFeaturesDict: {\n [key: string]: PlaygroundFeatureSchema;\n } = serviceFeatures.reduce(\n (acc, feature) => ({\n ...acc,\n [feature.name]: feature,\n }),\n {},\n );\n\n // for each feature, find the corresponding evaluated feature\n // and make sure that the evaluated\n // return genFeat.length === servFeat.length && zip(gen, serv).\n data.features.forEach((feature) => {\n const mappedFeature: PlaygroundFeatureSchema =\n serviceFeaturesDict[feature.name];\n\n // log(feature);\n log(mappedFeature);\n\n const featureStrategies = feature.strategies ?? [];\n\n expect(\n mappedFeature.strategies.data.length,\n ).toEqual(featureStrategies.length);\n\n // we can't guarantee that the order we inserted\n // strategies into the database is the same as it\n // was returned by the service , so we'll need to\n // scan through the list of strats.\n\n // extract the `result` property, because it\n // doesn't exist in the input\n\n const removeResult = ({\n result,\n ...rest\n }: T & {\n result: unknown;\n }) => rest;\n\n const cleanedReceivedStrategies =\n mappedFeature.strategies.data.map(\n (strategy) => {\n const {\n segments: mappedSegments,\n ...mappedStrategy\n } = removeResult(strategy);\n\n return {\n ...mappedStrategy,\n constraints:\n mappedStrategy.constraints?.map(\n removeResult,\n ),\n };\n },\n );\n\n feature.strategies?.forEach(\n ({ segments, ...strategy }) => {\n expect(cleanedReceivedStrategies).toEqual(\n expect.arrayContaining([\n {\n ...strategy,\n title: undefined,\n disabled: false,\n constraints:\n strategy.constraints ?? [],\n parameters:\n strategy.parameters ?? {},\n },\n ]),\n );\n },\n );\n });\n },\n )\n .afterEach(cleanup),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/Unleash/unleash/src/test/e2e/services/playground-service.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Unleash/unleash", "url": "https://github.com/Unleash/unleash.git", "license": "Apache-2.0", "stars": 12374, "forks": 783}, "metrics": null, "summary": "The test verifies that for each feature, the strategies returned by evaluating service features match the expected strategies in count and content, while accommodating unordered results by checking for array containment.", "mode": "fast-check"} {"id": 54461, "name": "unknown", "code": "it('should accept any inputs not summing to zero and with positive or null values', () =>\n fc.assert(\n fc.property(fc.array(fc.nat(), { minLength: 1 }), (nums) => {\n // Arrange\n fc.pre(nums.some((n) => n > 0));\n const entries = nums.map((num) => ({ num, build: vi.fn() }));\n\n // Act / Assert\n expect(() => mapToConstant(...entries)).not.toThrowError();\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/mapToConstant.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`mapToConstant` accepts inputs with values that are positive or zero, ensuring the sum is not zero, without throwing an error.", "mode": "fast-check"} {"id": 56903, "name": "unknown", "code": "test('should return feature strategies with all their segments', async () => {\n await fc.assert(\n fc\n .asyncProperty(\n clientFeaturesAndSegments({ minLength: 1 }),\n generateContext(),\n async (\n { segments, features: generatedFeatures },\n context,\n ) => {\n const serviceFeatures = await insertAndEvaluateFeatures(\n {\n features: generatedFeatures,\n context,\n segments,\n },\n );\n\n const serviceFeaturesDict: {\n [key: string]: PlaygroundFeatureSchema;\n } = serviceFeatures.reduce(\n (acc, feature) => ({\n ...acc,\n [feature.name]: feature,\n }),\n {},\n );\n\n // ensure that segments are mapped on to features\n // correctly. We do not need to check whether the\n // evaluation is correct; that is taken care of by other\n // tests.\n\n // For each feature strategy, find its list of segments and\n // compare it to the input.\n //\n // We can assert three things:\n //\n // 1. The segments lists have the same length\n //\n // 2. All segment ids listed in an input id list are\n // also in the original segments list\n //\n // 3. If a feature is considered enabled, _all_ segments\n // must be true. If a feature is _disabled_, _at least_\n // one segment is not true.\n generatedFeatures.forEach((unmappedFeature) => {\n const strategies = serviceFeaturesDict[\n unmappedFeature.name\n ].strategies.data.reduce(\n (acc, strategy) => ({\n ...acc,\n [strategy.id]: strategy,\n }),\n {},\n );\n\n unmappedFeature.strategies?.forEach(\n (unmappedStrategy) => {\n const mappedStrategySegments: PlaygroundSegmentSchema[] =\n strategies[unmappedStrategy.id!]\n .segments;\n\n const unmappedSegments =\n unmappedStrategy.segments ?? [];\n\n // 1. The segments lists have the same length\n // 2. All segment ids listed in the input exist:\n expect(\n [\n ...mappedStrategySegments?.map(\n (segment) => segment.id,\n ),\n ].sort(),\n ).toEqual([...unmappedSegments].sort());\n\n switch (\n strategies[unmappedStrategy.id!].result\n ) {\n case true:\n // If a strategy is considered true, _all_ segments\n // must be true.\n expect(\n mappedStrategySegments.every(\n (segment) =>\n segment.result === true,\n ),\n ).toBeTruthy();\n break;\n case false:\n // empty -- all segments can be true and\n // the toggle still not enabled. We\n // can't check for anything here.\n case 'not found':\n // empty -- we can't evaluate this\n }\n },\n );\n });\n },\n )\n .afterEach(cleanup),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/Unleash/unleash/src/test/e2e/services/playground-service.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Unleash/unleash", "url": "https://github.com/Unleash/unleash.git", "license": "Apache-2.0", "stars": 12374, "forks": 783}, "metrics": null, "summary": "The test ensures that feature strategies are returned with correctly mapped segments, verifies that the segment lists have matching lengths and IDs, and checks that all segments are true if a strategy is enabled.", "mode": "fast-check"} {"id": 56904, "name": "unknown", "code": "test(\"should evaluate a strategy to be unknown if it doesn't recognize the strategy and all constraints pass\", async () => {\n await fc.assert(\n fc\n .asyncProperty(\n clientFeaturesAndSegments({ minLength: 1 }).map(\n ({ features, ...rest }) => ({\n ...rest,\n features: features.map((feature) => ({\n ...feature,\n // remove any constraints and use a name that doesn't exist\n strategies: feature.strategies?.map(\n (strategy) => ({\n ...strategy,\n name: 'bogus-strategy',\n constraints: [],\n segments: [],\n }),\n ),\n })),\n }),\n ),\n generateContext(),\n fc.context(),\n async (featsAndSegments, context, ctx) => {\n const serviceFeatures = await insertAndEvaluateFeatures(\n {\n ...featsAndSegments,\n context,\n },\n );\n\n serviceFeatures.forEach((feature) =>\n feature.strategies.data.forEach((strategy) => {\n expect(strategy.result.evaluationStatus).toBe(\n playgroundStrategyEvaluation.evaluationIncomplete,\n );\n expect(strategy.result.enabled).toBe(\n playgroundStrategyEvaluation.unknownResult,\n );\n }),\n );\n\n ctx.log(JSON.stringify(serviceFeatures));\n serviceFeatures.forEach((feature) => {\n // if there are strategies and they're all\n // incomplete and unknown, then the feature can't be\n // evaluated fully\n if (feature.strategies.data.length) {\n expect(feature.isEnabled).toBe(false);\n }\n });\n },\n )\n .afterEach(cleanup),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/Unleash/unleash/src/test/e2e/services/playground-service.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Unleash/unleash", "url": "https://github.com/Unleash/unleash.git", "license": "Apache-2.0", "stars": 12374, "forks": 783}, "metrics": null, "summary": "Evaluates whether a strategy is labeled as unknown and incomplete if the strategy name is unrecognized and all constraints pass, ensuring features with such strategies are not fully enabled.", "mode": "fast-check"} {"id": 56905, "name": "unknown", "code": "test(\"should evaluate a strategy as false if it doesn't recognize the strategy and constraint checks fail\", async () => {\n await fc.assert(\n fc\n .asyncProperty(\n fc\n .tuple(\n fc.uuid(),\n clientFeaturesAndSegments({ minLength: 1 }),\n )\n .map(([uuid, { features, ...rest }]) => ({\n ...rest,\n features: features.map((feature) => ({\n ...feature,\n // use a constraint that will never be true\n strategies: feature.strategies?.map(\n (strategy) => ({\n ...strategy,\n name: 'bogusStrategy',\n constraints: [\n {\n contextName: 'appName',\n operator: 'IN' as const,\n values: [uuid],\n },\n ],\n }),\n ),\n })),\n })),\n generateContext(),\n fc.context(),\n async (featsAndSegments, context, ctx) => {\n const serviceFeatures = await insertAndEvaluateFeatures(\n {\n ...featsAndSegments,\n context,\n },\n );\n\n serviceFeatures.forEach((feature) =>\n feature.strategies.data.forEach((strategy) => {\n expect(strategy.result.evaluationStatus).toBe(\n playgroundStrategyEvaluation.evaluationIncomplete,\n );\n expect(strategy.result.enabled).toBe(false);\n }),\n );\n\n ctx.log(JSON.stringify(serviceFeatures));\n\n serviceFeatures.forEach((feature) => {\n if (feature.strategies.data.length) {\n // if there are strategies and they're all\n // incomplete and false, then the feature\n // is also false\n expect(feature.isEnabled).toEqual(false);\n }\n });\n },\n )\n .afterEach(cleanup),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/Unleash/unleash/src/test/e2e/services/playground-service.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Unleash/unleash", "url": "https://github.com/Unleash/unleash.git", "license": "Apache-2.0", "stars": 12374, "forks": 783}, "metrics": null, "summary": "An unrecognized strategy with failing constraint checks should result in strategy evaluation being incomplete and the feature being disabled.", "mode": "fast-check"} {"id": 56906, "name": "unknown", "code": "test('should evaluate a feature as unknown if there is at least one incomplete strategy among all failed strategies', async () => {\n await fc.assert(\n fc\n .asyncProperty(\n fc\n .tuple(\n fc.uuid(),\n clientFeaturesAndSegments({ minLength: 1 }),\n )\n .map(([uuid, { features, ...rest }]) => ({\n ...rest,\n features: features.map((feature) => ({\n ...feature,\n // use a constraint that will never be true\n strategies: [\n ...feature.strategies!.map((strategy) => ({\n ...strategy,\n constraints: [\n {\n contextName: 'appName',\n operator: 'IN' as const,\n values: [uuid],\n },\n ],\n })),\n { name: 'my-custom-strategy' },\n ],\n })),\n })),\n generateContext(),\n async (featsAndSegments, context) => {\n const serviceFeatures = await insertAndEvaluateFeatures(\n {\n ...featsAndSegments,\n context,\n },\n );\n\n serviceFeatures.forEach((feature) => {\n if (feature.strategies.data.length) {\n // if there are strategies and they're\n // all incomplete and unknown, then\n // the feature is also unknown and\n // thus 'false' (from an SDK point of\n // view)\n expect(feature.isEnabled).toEqual(false);\n }\n });\n },\n )\n .afterEach(cleanup),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/Unleash/unleash/src/test/e2e/services/playground-service.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Unleash/unleash", "url": "https://github.com/Unleash/unleash.git", "license": "Apache-2.0", "stars": 12374, "forks": 783}, "metrics": null, "summary": "A feature is evaluated as unknown and disabled if at least one strategy is incomplete or all strategies are unknown.", "mode": "fast-check"} {"id": 56907, "name": "unknown", "code": "test(\"features can't be evaluated to true if they're not enabled in the current environment\", async () => {\n await fc.assert(\n fc\n .asyncProperty(\n clientFeaturesAndSegments({ minLength: 1 }).map(\n ({ features, ...rest }) => ({\n ...rest,\n features: features.map((feature) => ({\n ...feature,\n enabled: false,\n // remove any constraints and use a name that doesn't exist\n strategies: [{ name: 'default' }],\n })),\n }),\n ),\n generateContext(),\n fc.context(),\n async (featsAndSegments, context, ctx) => {\n const serviceFeatures = await insertAndEvaluateFeatures(\n {\n ...featsAndSegments,\n context,\n },\n );\n\n serviceFeatures.forEach((feature) =>\n feature.strategies.data.forEach((strategy) => {\n expect(strategy.result.evaluationStatus).toBe(\n playgroundStrategyEvaluation.evaluationComplete,\n );\n expect(strategy.result.enabled).toBe(true);\n }),\n );\n\n ctx.log(JSON.stringify(serviceFeatures));\n serviceFeatures.forEach((feature) => {\n expect(feature.isEnabled).toBe(false);\n expect(feature.isEnabledInCurrentEnvironment).toBe(\n false,\n );\n });\n },\n )\n .afterEach(cleanup),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/Unleash/unleash/src/test/e2e/services/playground-service.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Unleash/unleash", "url": "https://github.com/Unleash/unleash.git", "license": "Apache-2.0", "stars": 12374, "forks": 783}, "metrics": null, "summary": "Features should not evaluate to true if they are not enabled in the current environment.", "mode": "fast-check"} {"id": 56908, "name": "unknown", "code": "test('output toggles should have the same variants as input toggles', async () => {\n await fc.assert(\n fc\n .asyncProperty(\n clientFeaturesAndSegments({ minLength: 1 }),\n generateContext(),\n async ({ features, segments }, context) => {\n const serviceFeatures = await insertAndEvaluateFeatures(\n {\n features,\n segments,\n context,\n },\n );\n\n const variantsMap = features.reduce(\n (acc, feature) => ({\n ...acc,\n [feature.name]: feature.variants,\n }),\n {},\n );\n\n serviceFeatures.forEach((feature) => {\n if (variantsMap[feature.name]) {\n expect(feature.variants).toEqual(\n expect.arrayContaining(\n variantsMap[feature.name],\n ),\n );\n expect(variantsMap[feature.name]).toEqual(\n expect.arrayContaining(feature.variants),\n );\n } else {\n expect(feature.variants).toStrictEqual([]);\n }\n });\n },\n )\n .afterEach(cleanup),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/Unleash/unleash/src/test/e2e/services/playground-service.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Unleash/unleash", "url": "https://github.com/Unleash/unleash.git", "license": "Apache-2.0", "stars": 12374, "forks": 783}, "metrics": null, "summary": "Output toggles should contain the same variants as the input toggles after feature insertion and evaluation.", "mode": "fast-check"} {"id": 56909, "name": "unknown", "code": "test('isEnabled matches strategies.results', async () => {\n await fc.assert(\n fc\n .asyncProperty(\n clientFeaturesAndSegments({ minLength: 1 }),\n generateContext(),\n async ({ features, segments }, context) => {\n const serviceFeatures = await insertAndEvaluateFeatures(\n {\n features,\n segments,\n context,\n },\n );\n\n serviceFeatures.forEach((feature) => {\n if (feature.isEnabled) {\n expect(\n feature.isEnabledInCurrentEnvironment,\n ).toBe(true);\n expect(feature.strategies.result).toBe(true);\n } else {\n expect(\n !feature.isEnabledInCurrentEnvironment ||\n feature.strategies.result !== true,\n ).toBe(true);\n }\n });\n },\n )\n .afterEach(cleanup),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/Unleash/unleash/src/test/e2e/services/playground-service.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Unleash/unleash", "url": "https://github.com/Unleash/unleash.git", "license": "Apache-2.0", "stars": 12374, "forks": 783}, "metrics": null, "summary": "`isEnabled` should match `strategies.result` for each feature after evaluation.", "mode": "fast-check"} {"id": 54468, "name": "unknown", "code": "it('should throw whenever max is an invalid date', () =>\n fc.assert(\n fc.property(invalidMaxConstraintsArb(), (constraints) => {\n // Act / Assert\n expect(() => date(constraints)).toThrowError();\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/date.spec.ts", "start_line": null, "end_line": null, "dependencies": ["invalidMaxConstraintsArb"], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Throw an error when the `max` constraint is an invalid date.", "mode": "fast-check"} {"id": 56910, "name": "unknown", "code": "test('strategies.results matches the individual strategy results', async () => {\n await fc.assert(\n fc\n .asyncProperty(\n clientFeaturesAndSegments({ minLength: 1 }),\n generateContext(),\n async ({ features, segments }, context) => {\n const serviceFeatures = await insertAndEvaluateFeatures(\n {\n features,\n segments,\n context,\n },\n );\n\n serviceFeatures.forEach(({ strategies }) => {\n if (strategies.result === false) {\n expect(\n strategies.data.every(\n (strategy) =>\n strategy.result.enabled === false,\n ),\n ).toBe(true);\n } else if (\n strategies.result ===\n playgroundStrategyEvaluation.unknownResult\n ) {\n expect(\n strategies.data.some(\n (strategy) =>\n strategy.result.enabled ===\n playgroundStrategyEvaluation.unknownResult,\n ),\n ).toBe(true);\n\n expect(\n strategies.data.every(\n (strategy) =>\n strategy.result.enabled !== true,\n ),\n ).toBe(true);\n } else {\n if (strategies.data.length > 0) {\n expect(\n strategies.data.some(\n (strategy) =>\n strategy.result.enabled ===\n true,\n ),\n ).toBe(true);\n }\n }\n });\n },\n )\n .afterEach(cleanup),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/Unleash/unleash/src/test/e2e/services/playground-service.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Unleash/unleash", "url": "https://github.com/Unleash/unleash.git", "license": "Apache-2.0", "stars": 12374, "forks": 783}, "metrics": null, "summary": "The `strategies.results` should correspond to the individual results of feature strategies, where the collective result reflects individual strategy outcomes, ensuring consistency across evaluation contexts.", "mode": "fast-check"} {"id": 56911, "name": "unknown", "code": "test('unevaluated features should not have variants', async () => {\n await fc.assert(\n fc\n .asyncProperty(\n clientFeaturesAndSegments({ minLength: 1 }),\n generateContext(),\n async ({ features, segments }, context) => {\n const serviceFeatures = await insertAndEvaluateFeatures(\n {\n features,\n segments,\n context,\n },\n );\n\n serviceFeatures.forEach((feature) => {\n if (\n feature.strategies.result ===\n playgroundStrategyEvaluation.unknownResult\n ) {\n expect(feature.variant).toEqual({\n name: 'disabled',\n enabled: false,\n feature_enabled: false,\n });\n }\n });\n },\n )\n .afterEach(cleanup),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/Unleash/unleash/src/test/e2e/services/playground-service.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Unleash/unleash", "url": "https://github.com/Unleash/unleash.git", "license": "Apache-2.0", "stars": 12374, "forks": 783}, "metrics": null, "summary": "Unevaluated features must have variants set to `{ name: 'disabled', enabled: false, feature_enabled: false }`.", "mode": "fast-check"} {"id": 56912, "name": "unknown", "code": "test('url-friendly strings are URL-friendly', () =>\n fc.assert(\n fc.property(urlFriendlyString(), (input: string) =>\n /^[\\w~.-]+$/.test(input),\n ),\n ))", "language": "typescript", "source_file": "./repos/Unleash/unleash/src/test/arbitraries.test.ts", "start_line": null, "end_line": null, "dependencies": ["urlFriendlyString"], "repo": {"name": "Unleash/unleash", "url": "https://github.com/Unleash/unleash.git", "license": "Apache-2.0", "stars": 12374, "forks": 783}, "metrics": null, "summary": "The property should ensure that `urlFriendlyString` generates strings containing only URL-safe characters (alphanumeric, hyphens, underscores, tildes, and dots).", "mode": "fast-check"} {"id": 56913, "name": "unknown", "code": "test('variant payloads are either present or undefined; never null', () =>\n fc.assert(\n fc.property(\n variant(),\n (generatedVariant) =>\n !!generatedVariant.payload ||\n generatedVariant.payload === undefined,\n ),\n ))", "language": "typescript", "source_file": "./repos/Unleash/unleash/src/test/arbitraries.test.ts", "start_line": null, "end_line": null, "dependencies": ["variant"], "repo": {"name": "Unleash/unleash", "url": "https://github.com/Unleash/unleash.git", "license": "Apache-2.0", "stars": 12374, "forks": 783}, "metrics": null, "summary": "Variant payloads must be either defined or undefined, but never null.", "mode": "fast-check"} {"id": 56914, "name": "unknown", "code": "it('Returned features should be a subset of the provided flags', async () => {\n await fc.assert(\n fc\n .asyncProperty(\n clientFeatures({ minLength: 1 }),\n generateRequest(),\n async (features, request) => {\n // seed the database\n await seedDatabase(db, features, request.environment);\n\n const body = await playgroundRequest(\n app,\n token.secret,\n request,\n );\n\n // the returned list should always be a subset of the provided list\n expect(features.map((feature) => feature.name)).toEqual(\n expect.arrayContaining(\n body.features.map((feature) => feature.name),\n ),\n );\n },\n )\n .afterEach(reset(db)),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/Unleash/unleash/src/test/e2e/api/admin/playground.e2e.test.ts", "start_line": null, "end_line": null, "dependencies": ["playgroundRequest", "reset"], "repo": {"name": "Unleash/unleash", "url": "https://github.com/Unleash/unleash.git", "license": "Apache-2.0", "stars": 12374, "forks": 783}, "metrics": null, "summary": "Returned features from `playgroundRequest` should always be a subset of the provided feature flags.", "mode": "fast-check"} {"id": 54473, "name": "unknown", "code": "it('should be able to shrink any value it shrunk if not adapted or shrinkable adapted', () => {\n fc.assert(\n fc.property(\n fc.option(fc.integer({ min: 2 }), { nil: undefined }),\n fc.anything(),\n fc.anything(),\n fc.record({ adapted: fc.boolean(), value: fc.anything() }),\n fc.anything(),\n fc.anything(),\n fc.record({ adapted: fc.boolean(), value: fc.anything() }),\n fc.anything(),\n fc.anything(),\n fc.record({ adapted: fc.boolean(), value: fc.anything() }),\n fc.anything(),\n fc.anything(),\n fc.record({ adapted: fc.boolean(), value: fc.anything() }),\n fc.anything(),\n fc.anything(),\n fc.record({ adapted: fc.boolean(), value: fc.anything() }),\n fc.boolean(),\n (\n biasFactor,\n vA,\n cA,\n adaptedA,\n vAA,\n cAA,\n adaptedAA,\n vAB,\n cAB,\n adaptedAB,\n vAC,\n cAC,\n adaptedAC,\n vABC,\n cABC,\n adaptedABC,\n canShrinkIfAdapted,\n ) => {\n // Arrange\n fc.pre(allUniques(vA, vAA, vAB, vAC, vABC)); // check for adapterFunction\n const valueA = new Value(vA, cA);\n const valueAA = new Value(vAA, cAA);\n const valueAB = new Value(vAB, cAB);\n const valueAC = new Value(vAC, cAC);\n const valueABC = new Value(vABC, cABC);\n const { instance, generate, shrink, canShrinkWithoutContext } = fakeArbitrary();\n generate.mockReturnValueOnce(valueA);\n shrink.mockReturnValueOnce(Stream.of(valueAA, valueAB, valueAC)).mockReturnValueOnce(Stream.of(valueABC));\n if (adaptedA.adapted) canShrinkWithoutContext.mockReturnValueOnce(true);\n canShrinkWithoutContext.mockReturnValueOnce(canShrinkIfAdapted);\n const { instance: mrng } = fakeRandom();\n const adapterFunction = vi\n .fn<(arg0: any) => AdapterOutput>()\n .mockImplementation((v) =>\n Object.is(v, vA)\n ? adaptedA\n : Object.is(v, vAA)\n ? adaptedAA\n : Object.is(v, vAB)\n ? adaptedAB\n : Object.is(v, vAC)\n ? adaptedAC\n : adaptedABC,\n );\n\n // Act\n const arb = adapter(instance, adapterFunction);\n const g = arb.generate(mrng, biasFactor);\n const g2 = [...arb.shrink(g.value, g.context)][1];\n const shrinks = [...arb.shrink(g2.value, g2.context)];\n\n // Assert\n expect(generate).toHaveBeenCalledWith(mrng, biasFactor);\n if (adaptedA.adapted) {\n expect(shrink).toHaveBeenCalledWith(adaptedA.value, undefined);\n } else {\n expect(shrink).toHaveBeenCalledWith(vA, cA);\n }\n if (!adaptedAB.adapted || canShrinkIfAdapted) {\n expect(shrinks).toHaveLength(1);\n if (adaptedABC.adapted) {\n expect(shrinks[0].value_).toBe(adaptedABC.value);\n } else {\n expect(shrinks[0]).toBe(valueABC);\n }\n if (adaptedAB.adapted) {\n expect(shrink).toHaveBeenCalledWith(adaptedAB.value, undefined);\n expect(canShrinkWithoutContext).toHaveBeenCalledWith(adaptedAB.value);\n } else {\n expect(shrink).toHaveBeenCalledWith(vAB, cAB);\n }\n } else {\n expect(shrinks).toHaveLength(0);\n expect(canShrinkWithoutContext).toHaveBeenCalledWith(adaptedAB.value);\n }\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/AdapterArbitrary.spec.ts", "start_line": null, "end_line": null, "dependencies": ["allUniques"], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The ability to shrink any value it produces is verified, except when the value is adapted and marked as not shrinkable, ensuring correctness in the shrinking behavior of `adapter`.", "mode": "fast-check"} {"id": 56915, "name": "unknown", "code": "it('should filter the list according to the input parameters', async () => {\n await fc.assert(\n fc\n .asyncProperty(\n generateRequest(),\n clientFeatures({ minLength: 1 }),\n async (request, features) => {\n await seedDatabase(db, features, request.environment);\n\n // get a subset of projects that exist among the features\n const [projects] = fc.sample(\n fc.oneof(\n fc.constant(ALL as '*'),\n fc.uniqueArray(\n fc.constantFrom(\n ...features.map(\n (feature) => feature.project,\n ),\n ),\n ),\n ),\n );\n\n request.projects = projects as any;\n\n // create a list of features that can be filtered\n // pass in args that should filter the list\n const body = await playgroundRequest(\n app,\n token.secret,\n request,\n );\n\n switch (projects) {\n case ALL:\n // no features have been filtered out\n return body.features.length === features.length;\n case []:\n // no feature should be without a project\n return body.features.length === 0;\n default:\n // every feature should be in one of the prescribed projects\n return body.features.every((feature) =>\n projects.includes(feature.projectId),\n );\n }\n },\n )\n .afterEach(reset(db)),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/Unleash/unleash/src/test/e2e/api/admin/playground.e2e.test.ts", "start_line": null, "end_line": null, "dependencies": ["playgroundRequest", "reset"], "repo": {"name": "Unleash/unleash", "url": "https://github.com/Unleash/unleash.git", "license": "Apache-2.0", "stars": 12374, "forks": 783}, "metrics": null, "summary": "The feature filtering should correctly match the input parameters in terms of projects, ensuring all features belong to specified projects or none if no projects are specified.", "mode": "fast-check"} {"id": 56916, "name": "unknown", "code": "it('should map project and name correctly', async () => {\n // note: we're not testing `isEnabled` and `variant` here, because\n // that's the SDK's responsibility and it's tested elsewhere.\n await fc.assert(\n fc\n .asyncProperty(\n clientFeatures(),\n fc.context(),\n async (features, ctx) => {\n await seedDatabase(db, features, 'default');\n\n const body = await playgroundRequest(\n app,\n token.secret,\n {\n projects: ALL,\n environment: DEFAULT_ENV,\n context: {\n appName: 'playground-test',\n },\n },\n );\n\n const createDict = (xs: { name: string }[]) =>\n xs.reduce(\n (acc, next) => ({ ...acc, [next.name]: next }),\n {},\n );\n\n const mappedToggles = createDict(body.features);\n\n if (features.length !== body.features.length) {\n ctx.log(\n `I expected the number of mapped flags (${body.features.length}) to be the same as the number of created toggles (${features.length}), but that was not the case.`,\n );\n return false;\n }\n\n return features.every((feature) => {\n const mapped: PlaygroundFeatureSchema =\n mappedToggles[feature.name];\n\n expect(mapped).toBeTruthy();\n\n return (\n feature.name === mapped.name &&\n feature.project === mapped.projectId\n );\n });\n },\n )\n .afterEach(reset(db)),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/Unleash/unleash/src/test/e2e/api/admin/playground.e2e.test.ts", "start_line": null, "end_line": null, "dependencies": ["playgroundRequest", "reset"], "repo": {"name": "Unleash/unleash", "url": "https://github.com/Unleash/unleash.git", "license": "Apache-2.0", "stars": 12374, "forks": 783}, "metrics": null, "summary": "The property should ensure that for each created feature toggle, the project and name are accurately mapped in the playground response.", "mode": "fast-check"} {"id": 56917, "name": "unknown", "code": "it('isEnabledInCurrentEnvironment should always match feature.enabled', async () => {\n await fc.assert(\n fc\n .asyncProperty(\n clientFeatures(),\n fc.context(),\n async (features, ctx) => {\n await seedDatabase(db, features, DEFAULT_ENV);\n\n const body = await playgroundRequest(\n app,\n token.secret,\n {\n projects: ALL,\n environment: DEFAULT_ENV,\n context: {\n appName: 'playground-test',\n },\n },\n );\n\n const createDict = (xs: { name: string }[]) =>\n xs.reduce(\n (acc, next) => ({ ...acc, [next.name]: next }),\n {},\n );\n\n const mappedToggles = createDict(body.features);\n\n ctx.log(JSON.stringify(features));\n ctx.log(JSON.stringify(mappedToggles));\n\n return features.every(\n (feature) =>\n feature.enabled ===\n mappedToggles[feature.name]\n .isEnabledInCurrentEnvironment,\n );\n },\n )\n .afterEach(reset(db)),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/Unleash/unleash/src/test/e2e/api/admin/playground.e2e.test.ts", "start_line": null, "end_line": null, "dependencies": ["playgroundRequest", "reset"], "repo": {"name": "Unleash/unleash", "url": "https://github.com/Unleash/unleash.git", "license": "Apache-2.0", "stars": 12374, "forks": 783}, "metrics": null, "summary": "The `isEnabledInCurrentEnvironment` property should match the `feature.enabled` status for all features in the test environment.", "mode": "fast-check"} {"id": 56918, "name": "unknown", "code": "it('applies appName constraints correctly', async () => {\n const appNames = ['A', 'B', 'C'];\n\n // Choose one of the app names at random\n const appName = () => fc.constantFrom(...appNames);\n\n // generate a list of features that are active only for a specific\n // app name (constraints). Each feature will be constrained to a\n // random appName from the list above.\n const constrainedFeatures = (): Arbitrary =>\n fc.uniqueArray(\n fc\n .tuple(\n clientFeature(),\n fc.record({\n name: fc.constant('default'),\n constraints: fc\n .record({\n values: appName().map(toArray),\n inverted: fc.constant(false),\n operator: fc.constant('IN' as const),\n contextName: fc.constant('appName'),\n caseInsensitive: fc.boolean(),\n })\n .map(toArray),\n }),\n )\n .map(([feature, strategy]) => ({\n ...feature,\n enabled: true,\n strategies: [strategy],\n })),\n { selector: (feature) => feature.name },\n );\n\n await fc.assert(\n fc\n .asyncProperty(\n fc\n .tuple(appName(), generateRequest())\n .map(([generatedAppName, req]) => ({\n ...req,\n // generate a context that has appName set to\n // one of the above values\n context: {\n appName: generatedAppName,\n environment: DEFAULT_ENV,\n },\n })),\n constrainedFeatures(),\n async (req, features) => {\n await seedDatabase(db, features, req.environment);\n const body = await playgroundRequest(\n app,\n token.secret,\n req,\n );\n\n const shouldBeEnabled = features.reduce(\n (acc, next) => ({\n ...acc,\n [next.name]:\n // @ts-ignore\n next.strategies[0].constraints[0]\n .values[0] === req.context.appName,\n }),\n {},\n );\n\n return body.features.every(\n (feature) =>\n feature.isEnabled ===\n shouldBeEnabled[feature.name],\n );\n },\n )\n .afterEach(reset(db)),\n {\n ...testParams,\n examples: [],\n },\n );\n })", "language": "typescript", "source_file": "./repos/Unleash/unleash/src/test/e2e/api/admin/playground.e2e.test.ts", "start_line": null, "end_line": null, "dependencies": ["playgroundRequest", "reset"], "repo": {"name": "Unleash/unleash", "url": "https://github.com/Unleash/unleash.git", "license": "Apache-2.0", "stars": 12374, "forks": 783}, "metrics": null, "summary": "AppName constraints are applied correctly by ensuring that features are only enabled when their associated constraints match the specified app name in the request context.", "mode": "fast-check"} {"id": 56919, "name": "unknown", "code": "it('applies dynamic context fields correctly', async () => {\n const contextValue = () =>\n fc.oneof(\n fc.record({\n name: fc.constant('remoteAddress'),\n value: fc.ipV4(),\n operator: fc.constant('IN' as const),\n }),\n fc.record({\n name: fc.constant('sessionId'),\n value: fc.uuid(),\n operator: fc.constant('IN' as const),\n }),\n fc.record({\n name: fc.constant('userId'),\n value: fc.emailAddress(),\n operator: fc.constant('IN' as const),\n }),\n );\n\n const constrainedFeatures = (): Arbitrary =>\n fc.uniqueArray(\n fc\n .tuple(\n clientFeature(),\n contextValue().map((context) => ({\n name: 'default',\n constraints: [\n {\n values: [context.value],\n inverted: false,\n operator: context.operator,\n contextName: context.name,\n caseInsensitive: false,\n },\n ],\n })),\n )\n .map(([feature, strategy]) => ({\n ...feature,\n enabled: true,\n strategies: [strategy],\n })),\n { selector: (feature) => feature.name },\n );\n await fc.assert(\n fc\n .asyncProperty(\n fc\n .tuple(contextValue(), generateRequest())\n .map(([generatedContextValue, req]) => ({\n ...req,\n // generate a context that has a dynamic context field set to\n // one of the above values\n context: {\n ...req.context,\n [generatedContextValue.name]:\n generatedContextValue.value,\n },\n })),\n constrainedFeatures(),\n async (req, features) => {\n await seedDatabase(db, features, 'default');\n\n const body = await playgroundRequest(\n app,\n token.secret,\n req,\n );\n\n const contextField = Object.values(req.context)[0];\n\n const shouldBeEnabled = features.reduce(\n (acc, next) => ({\n ...acc,\n [next.name]:\n next.strategies![0].constraints![0]\n .values![0] === contextField,\n }),\n {},\n );\n return body.features.every(\n (feature) =>\n feature.isEnabled ===\n shouldBeEnabled[feature.name],\n );\n },\n )\n .afterEach(reset(db)),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/Unleash/unleash/src/test/e2e/api/admin/playground.e2e.test.ts", "start_line": null, "end_line": null, "dependencies": ["playgroundRequest", "reset"], "repo": {"name": "Unleash/unleash", "url": "https://github.com/Unleash/unleash.git", "license": "Apache-2.0", "stars": 12374, "forks": 783}, "metrics": null, "summary": "Dynamic context fields should correctly enable or disable features based on matching constraints within the provided context.", "mode": "fast-check"} {"id": 56923, "name": "unknown", "code": "test('playgroundRequestSchema', () =>\n fc.assert(\n fc.property(\n generate(),\n (data: PlaygroundRequestSchema) =>\n validateSchema(playgroundRequestSchema.$id, data) === undefined,\n ),\n ))", "language": "typescript", "source_file": "./repos/Unleash/unleash/src/lib/openapi/spec/playground-request-schema.test.ts", "start_line": null, "end_line": null, "dependencies": ["generate"], "repo": {"name": "Unleash/unleash", "url": "https://github.com/Unleash/unleash.git", "license": "Apache-2.0", "stars": 12374, "forks": 783}, "metrics": null, "summary": "Validation of `PlaygroundRequestSchema` instances should pass without errors, ensuring they conform to the defined schema.", "mode": "fast-check"} {"id": 56924, "name": "unknown", "code": "test('playgroundFeatureSchema', () =>\n fc.assert(\n fc.property(\n generate(),\n fc.context(),\n (data: PlaygroundFeatureSchema, ctx) => {\n const results = validateSchema(\n playgroundFeatureSchema.$id,\n data,\n );\n ctx.log(JSON.stringify(results));\n return results === undefined;\n },\n ),\n ))", "language": "typescript", "source_file": "./repos/Unleash/unleash/src/lib/openapi/spec/playground-feature-schema.test.ts", "start_line": null, "end_line": null, "dependencies": ["generate"], "repo": {"name": "Unleash/unleash", "url": "https://github.com/Unleash/unleash.git", "license": "Apache-2.0", "stars": 12374, "forks": 783}, "metrics": null, "summary": "The generated `PlaygroundFeatureSchema` should validate successfully against the `playgroundFeatureSchema` without errors.", "mode": "fast-check"} {"id": 56926, "name": "unknown", "code": "it('should return the provided input arguments as part of the response', async () => {\n await fc.assert(\n fc.asyncProperty(\n generateRequest(),\n async (payload: PlaygroundRequestSchema) => {\n const { request, base } = await getSetup();\n const { body } = await request\n .post(`${base}/api/admin/playground`)\n .send(payload)\n .expect('Content-Type', /json/)\n .expect(200);\n\n expect(body.input).toStrictEqual(payload);\n\n return true;\n },\n ),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/Unleash/unleash/src/lib/features/playground/playground.test.ts", "start_line": null, "end_line": null, "dependencies": ["getSetup"], "repo": {"name": "Unleash/unleash", "url": "https://github.com/Unleash/unleash.git", "license": "Apache-2.0", "stars": 12374, "forks": 783}, "metrics": null, "summary": "The response should include the provided input arguments as part of the body.", "mode": "fast-check"} {"id": 56927, "name": "unknown", "code": "it('should return 400 if any of the required query properties are missing', async () => {\n await fc.assert(\n fc.asyncProperty(\n generateRequest(),\n fc.constantFrom(...playgroundRequestSchema.required),\n async (payload, requiredKey) => {\n const { request, base } = await getSetup();\n\n delete payload[requiredKey];\n\n const { status } = await request\n .post(`${base}/api/admin/playground`)\n .send(payload)\n .expect('Content-Type', /json/);\n\n expect(status).toBe(400);\n },\n ),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/Unleash/unleash/src/lib/features/playground/playground.test.ts", "start_line": null, "end_line": null, "dependencies": ["getSetup"], "repo": {"name": "Unleash/unleash", "url": "https://github.com/Unleash/unleash.git", "license": "Apache-2.0", "stars": 12374, "forks": 783}, "metrics": null, "summary": "A 400 status code should be returned when a required query property is missing in the request payload.", "mode": "fast-check"} {"id": 56831, "name": "unknown", "code": "it(\"should only produce integer values for the numerator and denominator\", () => {\n fc.assert(\n fc.property(\n fc.integer(),\n fc.integer().filter((n) => n !== 0),\n (numerator, denominator) => {\n const fSource = { numerator, denominator };\n const fOut = simplifyFraction(fSource);\n expect(Number.isInteger(fOut.numerator)).toBe(true);\n expect(Number.isInteger(fOut.denominator)).toBe(true);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-06.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`simplifyFraction` ensures the output has integer values for both the numerator and denominator.", "mode": "fast-check"} {"id": 56929, "name": "unknown", "code": "test('For any size TSID array, first item should small than the second one', () => {\n fc.assert(\n fc.property(fc.integer({ min: 2, max: 10_000 }), (size) => {\n const arr: Array = Array.from({ length: size }, () => getTsid())\n expect(arr[0].toBigInt()).toBeLessThan(arr[1].toBigInt())\n })\n )\n })", "language": "typescript", "source_file": "./repos/yubinTW/tsid-ts/test/tsid.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "yubinTW/tsid-ts", "url": "https://github.com/yubinTW/tsid-ts.git", "license": "MIT", "stars": 20, "forks": 3}, "metrics": null, "summary": "For any TSID array of specified size, the first item should be smaller than the second item when compared as BigInt.", "mode": "fast-check"} {"id": 56930, "name": "unknown", "code": "test('For any size TSID array, last item should bigger than the last second one', () => {\n fc.assert(\n fc.property(fc.integer({ min: 2, max: 10_000 }), (size) => {\n const arr: Array = Array.from({ length: size }, () => getTsid())\n expect(arr.pop()?.toBigInt()).toBeGreaterThan(arr[0].toBigInt())\n })\n )\n })", "language": "typescript", "source_file": "./repos/yubinTW/tsid-ts/test/tsid.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "yubinTW/tsid-ts", "url": "https://github.com/yubinTW/tsid-ts.git", "license": "MIT", "stars": 20, "forks": 3}, "metrics": null, "summary": "For any TSID array, the last item should be greater than the first item.", "mode": "fast-check"} {"id": 56931, "name": "unknown", "code": "test('For any size TSID array, each item should be unique', () => {\n fc.assert(\n fc.property(fc.integer({ min: 2, max: 10_000 }), (size) => {\n const tsidArr: Array = Array.from({ length: size }, () => getTsid())\n const tsidSet: Set = new Set(tsidArr)\n expect(tsidArr).toHaveLength(tsidSet.size)\n })\n )\n })", "language": "typescript", "source_file": "./repos/yubinTW/tsid-ts/test/tsid.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "yubinTW/tsid-ts", "url": "https://github.com/yubinTW/tsid-ts.git", "license": "MIT", "stars": 20, "forks": 3}, "metrics": null, "summary": "For any given size of a TSID array, all items must be unique.", "mode": "fast-check"} {"id": 56932, "name": "unknown", "code": "test(\"fast check\", () => {\n fc.assert(\n fc.property(fc.uuid(), (uuid) => {\n expect(fromIfcGuid(toIfcGuid(uuid))).toEqual(uuid);\n }),\n { numRuns: 1_000 }\n );\n })", "language": "typescript", "source_file": "./repos/phi-ag/ifc-guid/src/index.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "phi-ag/ifc-guid", "url": "https://github.com/phi-ag/ifc-guid.git", "license": "MIT", "stars": 1, "forks": 1}, "metrics": null, "summary": "Converting a UUID to an IFC GUID and back should yield the original UUID.", "mode": "fast-check"} {"id": 56933, "name": "unknown", "code": "it('executorLzReceiveOption', async () => {\n // sanity check that generated options are the same with value as 0 and not provided.\n expect(Options.newOptions().addExecutorLzReceiveOption(1, 0)).toEqual(\n Options.newOptions().addExecutorLzReceiveOption(1)\n )\n await fc.assert(\n fc.asyncProperty(\n omnicounterIncrementTypeArbitrary,\n gasLimitArbitrary,\n nativeDropArbitrary,\n\n // Test the generation and submission of arbitrary LZ_RECEIVE Options. The transaction should succeed,\n // and the options from the transaction receipt logs should match the generated input.\n async (type, gasLimit, nativeDrop) => {\n const options = Options.newOptions().addExecutorLzReceiveOption(gasLimit, nativeDrop)\n const packetSentEvents = await incrementAndReturnLogs(type, options)\n expect(packetSentEvents).toEqual([\n expect.objectContaining({\n args: expect.objectContaining({\n options: expect.toEqualCaseInsensitive(options.toHex()),\n }),\n }),\n ])\n const rawPacketOptions = packetSentEvents[0]!.args.options\n expect(rawPacketOptions).toEqualCaseInsensitive(options.toHex())\n\n // test decoding\n const packetOptions = Options.fromOptions(rawPacketOptions)\n const decodedExecutorLzReceiveOption = packetOptions.decodeExecutorLzReceiveOption()\n expect(decodedExecutorLzReceiveOption).toEqual({\n gas: gasLimit,\n value: nativeDrop,\n })\n expect(packetOptions.decodeExecutorNativeDropOption()).toEqual([])\n expect(packetOptions.decodeExecutorComposeOption()).toEqual([])\n expect(packetOptions.decodeExecutorOrderedExecutionOption()).toEqual(false)\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/tests/ua-devtools-evm-hardhat-test/test/omnicounter/options.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Generated `executorLzReceiveOption` values should yield identical options when value is set to 0 or omitted, and for arbitrary LZ_RECEIVE options, transaction logs must match generated inputs, with correct decoding results for fields like gas and nativeDrop.", "mode": "fast-check"} {"id": 56935, "name": "unknown", "code": "it('executorLzNativeDrop', async () => {\n const address = await ethSigner.signer.getAddress()\n await fc.assert(\n fc.asyncProperty(\n omnicounterIncrementTypeArbitrary,\n nativeDropArbitrary,\n\n // Test the generation and submission of arbitrary NATIVE_DROP Options. The transaction should succeed,\n // and the options from the transaction receipt logs should match the generated input.\n async (type, nativeDrop) => {\n const options = Options.newOptions()\n .addExecutorNativeDropOption(nativeDrop, address)\n // We also need to add a lzReceive option to avoid Executor_ZeroLzReceiveGasProvided error\n .addExecutorLzReceiveOption(MIN_GAS_LIMIT)\n const packetSentEvents = await incrementAndReturnLogs(type, options)\n expect(packetSentEvents).toEqual([\n expect.objectContaining({\n args: expect.objectContaining({\n options: expect.toEqualCaseInsensitive(options.toHex()),\n }),\n }),\n ])\n const rawPacketOptions = packetSentEvents[0]!.args.options\n expect(rawPacketOptions).toEqualCaseInsensitive(options.toHex())\n\n // test decoding\n const packetOptions = Options.fromOptions(rawPacketOptions)\n const decodedExecutorNativeDropOptions = packetOptions.decodeExecutorNativeDropOption()\n expect(decodedExecutorNativeDropOptions).toEqual([\n {\n amount: nativeDrop,\n receiver: expect.toEqualCaseInsensitive(makeBytes32(address)),\n },\n ])\n expect(packetOptions.decodeExecutorLzReceiveOption()).toEqual({\n gas: MIN_GAS_LIMIT,\n value: BigInt(0),\n })\n expect(packetOptions.decodeExecutorComposeOption()).toEqual([])\n expect(packetOptions.decodeExecutorOrderedExecutionOption()).toEqual(false)\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/tests/ua-devtools-evm-hardhat-test/test/omnicounter/options.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`executorLzNativeDrop` verifies that generated options with `NATIVE_DROP` and `lzReceive` produce transaction receipts with matching logs, ensuring correct encoding/decoding of options and expected execution outcomes.", "mode": "fast-check"} {"id": 56936, "name": "unknown", "code": "it('executorOrderedExecutionOption', async () => {\n await fc.assert(\n fc.asyncProperty(\n omnicounterIncrementTypeArbitrary,\n\n // Test the generation and submission of arbitrary ORDERED Options. The transaction should succeed, and the\n // options from the transaction receipt logs should match the generated input.\n async (type) => {\n const options = Options.newOptions()\n .addExecutorOrderedExecutionOption()\n // We also need to add a lzReceive option to avoid Executor_ZeroLzReceiveGasProvided error\n .addExecutorLzReceiveOption(MIN_GAS_LIMIT)\n const packetSentEvents = await incrementAndReturnLogs(type, options)\n expect(packetSentEvents).toHaveLength(1)\n const rawPacketOptions = packetSentEvents[0]!.args.options.toLowerCase()\n expect(rawPacketOptions).toBe(options.toHex().toLowerCase())\n\n // test decoding\n const packetOptions = Options.fromOptions(rawPacketOptions)\n expect(packetOptions.decodeExecutorOrderedExecutionOption()).toBe(true)\n expect(packetOptions.decodeExecutorLzReceiveOption()).toEqual({\n gas: MIN_GAS_LIMIT,\n value: BigInt(0),\n })\n expect(packetOptions.decodeExecutorComposeOption()).toEqual([])\n expect(packetOptions.decodeExecutorNativeDropOption()).toEqual([])\n }\n ),\n { numRuns: 10 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/tests/ua-devtools-evm-hardhat-test/test/omnicounter/options.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "The function verifies that generating and submitting `ORDERED` options for execution in an omnicounter transaction produces expected logs, correctly decodes options, and ensures transaction success without errors, such as `Executor_ZeroLzReceiveGasProvided`.", "mode": "fast-check"} {"id": 56937, "name": "unknown", "code": "it('stacked options', async () => {\n // custom gasLimit arbitrary so \"stacked\" compose options won't have a gasLimit sum that overflows MAX_UINT_128\n const stackedGasLimitArbitrary: fc.Arbitrary = fc.bigInt({\n min: MIN_GAS_LIMIT,\n max: BigInt('0xFFFFFFFFFFFFFFFF'),\n })\n\n // custom nativeDrop arbitrary so \"stacked\" compose options won't have a nativeDrop sum that exceeds DEFAULT_MAX_NATIVE_DROP\n const stackedValueArbitrary: fc.Arbitrary = fc.bigInt({\n min: DEFAULT_MIN_NATIVE_DROP,\n max: DEFAULT_MAX_NATIVE_DROP / BigInt(4),\n })\n\n const address = await ethSigner.signer.getAddress()\n await fc.assert(\n fc.asyncProperty(\n omnicounterIncrementTypeArbitrary,\n composedIndexArbitrary,\n stackedGasLimitArbitrary,\n stackedValueArbitrary,\n\n // Test the generation of multiple Options in a single Packet. The transaction should succeed. Options\n // should be decoded to match inputs. gasLimit and nativeDrop should be summed for Packets that have\n // multiple COMPOSE options for the same index.\n async (type, index, gasLimit, stackedValue) => {\n const options = Options.newOptions()\n .addExecutorComposeOption(index, gasLimit, stackedValue)\n .addExecutorLzReceiveOption(gasLimit, stackedValue)\n .addExecutorNativeDropOption(stackedValue, address)\n .addExecutorComposeOption(index, gasLimit, stackedValue) // Repeat executor compose option to make sure values/gasLimits are summed\n\n const packetSentEvents = await incrementAndReturnLogs(type, options)\n expect(packetSentEvents).toEqual([\n expect.objectContaining({\n args: expect.objectContaining({\n options: expect.toEqualCaseInsensitive(options.toHex()),\n }),\n }),\n ])\n const packetOptions = Options.fromOptions(packetSentEvents[0]!.args.options)\n\n // check executorComposeOption\n const packetComposeOptions = packetOptions.decodeExecutorComposeOption()\n expect(packetComposeOptions).toEqual([\n {\n index,\n gas: gasLimit * BigInt(2),\n // compose options with same index are summed (in this specific case, just multiplied by 2)\n value: stackedValue * BigInt(2),\n },\n ])\n\n // check executorLzReceiveOption\n const packetLzReceiveOption = packetOptions.decodeExecutorLzReceiveOption()\n expect(packetLzReceiveOption).toEqual({\n gas: gasLimit,\n value: stackedValue,\n })\n\n // check executorNativeDropOption\n const packetNativeDropOptions = packetOptions.decodeExecutorNativeDropOption()\n expect(packetNativeDropOptions).toEqual([\n {\n amount: stackedValue,\n receiver: expect.toEqualCaseInsensitive(makeBytes32(address)),\n },\n ])\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/tests/ua-devtools-evm-hardhat-test/test/omnicounter/options.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Multiple options in a single packet should decode to match the inputs, with `gasLimit` and `nativeDrop` values correctly summed for packets with repeated compose options.", "mode": "fast-check"} {"id": 56938, "name": "unknown", "code": "it('child no arg event', async () => {\n const receipt = await (await child.emitNoArgEvent()).wait()\n expect(parseLogs(receipt, parent)).toMatchSnapshot()\n expect(parseLogsWithName(receipt, parent, 'NoArgEvent')).toEqual([]) // only the child should emit the event\n expect(parseLogsWithName(receipt, child, 'NoArgEvent')).toHaveLength(1)\n expect(parseLogsWithName(receipt, parallel, 'NoArgEvent')).toEqual([]) // parallel logs should be empty\n\n fc.assert(\n fc.property(fc.string(), (name) => {\n fc.pre(name !== 'NoArgEvent')\n expect(parseLogsWithName(receipt, parent, name)).toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/tests/devtools-evm-test/test/events/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Emitting a 'NoArgEvent' from a child contract should only be detected in the child's logs, not in the parent or parallel logs, and parsing logs with a different name should result in empty arrays.", "mode": "fast-check"} {"id": 56939, "name": "unknown", "code": "it('not parse an event with one arg from a different contract', async () => {\n await fc.assert(\n fc.asyncProperty(fc.integer({ min: 0 }), async (arg) => {\n const receipt = await (await child.emitOneArgEvent(arg)).wait()\n expect(parseLogsWithName(receipt, parent, 'OneArgEvent')).toEqual([])\n }),\n { numRuns: 10 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/tests/devtools-evm-test/test/events/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Ensures that `parseLogsWithName` returns an empty array when attempting to parse an event with one argument emitted by a child contract, rather than the parent contract.", "mode": "fast-check"} {"id": 56940, "name": "unknown", "code": "it('not parse an event with one arg with unknown name', async () => {\n await fc.assert(\n fc.asyncProperty(fc.integer({ min: 0 }), fc.string(), async (arg, name) => {\n fc.pre(name !== 'OneArgEvent')\n\n const receipt = await (await child.emitOneArgEvent(arg)).wait()\n expect(parseLogsWithName(receipt, parent, name)).toEqual([])\n }),\n { numRuns: 10 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/tests/devtools-evm-test/test/events/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`parseLogsWithName` should return an empty array when attempting to parse an event with one argument using an unknown event name.", "mode": "fast-check"} {"id": 56941, "name": "unknown", "code": "it('not parse an event with many args from a different contract', async () => {\n const eventNameArbitrary = fc.constantFrom('NoArgEvent', 'OneArgEvent', 'FourArgEvent')\n\n await fc.assert(\n fc.asyncProperty(fc.integer({ min: 0, max: 10 }), eventNameArbitrary, async (count, name) => {\n const receipt = await (await child.emitMany(count)).wait()\n\n expect(parseLogsWithName(receipt, child, name)).toHaveLength(count)\n expect(parseLogsWithName(receipt, parent, name)).toEqual([])\n }),\n { numRuns: 10 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/tests/devtools-evm-test/test/events/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Parsing logs should detect events emitted from a specific contract and not from a different contract, even if the events have many arguments.", "mode": "fast-check"} {"id": 56943, "name": "unknown", "code": "it('should pass an error through if it already is a ContractError', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, async (eid) => {\n const errorParser = await createContractErrorParser({ contract, eid })\n const error = new RevertError('A reason is worth a million bytes')\n const parsedError = await errorParser(error)\n\n expect(parsedError).toBe(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/tests/devtools-evm-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "A `ContractError` should remain unchanged when passed through the error parser.", "mode": "fast-check"} {"id": 54483, "name": "unknown", "code": "it('should wait the end of act before moving to the next task', async () =>\n fc.assert(\n fc.asyncProperty(fc.infiniteStream(fc.nat()), async (seeds) => {\n // Arrange\n let locked = false;\n const updateLocked = (newLocked: boolean) => (locked = newLocked);\n const act = vi.fn().mockImplementation(async (f) => {\n expect(locked).toBe(false);\n updateLocked(true); // equivalent to: locked = true\n await f();\n updateLocked(false); // equivalent to: locked = false\n });\n const nextTaskIndex = buildSeededNextTaskIndex(seeds);\n const taskSelector: TaskSelector = { clone: vi.fn(), nextTaskIndex };\n\n // Act\n const s = new SchedulerImplem(act, taskSelector);\n s.schedule(Promise.resolve(1));\n s.schedule(Promise.resolve(8));\n s.schedule(Promise.resolve(42));\n\n // Assert\n await s.waitAll();\n expect(locked).toBe(false);\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/implementations/SchedulerImplem.spec.ts", "start_line": null, "end_line": null, "dependencies": ["buildSeededNextTaskIndex"], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "A scheduler waits for the current task's execution to finish completely before moving to the next scheduled task.", "mode": "fast-check"} {"id": 56944, "name": "unknown", "code": "it('should parse assert/panic', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, async (eid) => {\n const errorParser = await createContractErrorParser({ contract, eid })\n const error = await assertFailed(contract.throwWithAssert())\n const parsedError = await errorParser(error)\n\n expect(parsedError).toEqual(new PanicError(BigInt(1)))\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/tests/devtools-evm-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Parses assertion failures to verify they result in a `PanicError` with code `1`.", "mode": "fast-check"} {"id": 56945, "name": "unknown", "code": "it('should parse assert/panic with code', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, async (eid) => {\n const errorParser = await createContractErrorParser({ contract, eid })\n const error = await assertFailed(contract.throwWithAssertWithCode())\n const parsedError = await errorParser(error)\n\n expect(parsedError).toEqual(new PanicError(BigInt(18)))\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/tests/devtools-evm-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "The parsing of an assert or panic error should produce a `PanicError` with a specific code when invoked through a contract function.", "mode": "fast-check"} {"id": 56947, "name": "unknown", "code": "it('should parse require with an argument', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, async (eid) => {\n const errorParser = await createContractErrorParser({ contract, eid })\n const error = await assertFailed(contract.throwWithRequireAndArgument('my bad'))\n const parsedError = await errorParser(error)\n\n expect(parsedError).toEqual(new RevertError('my bad'))\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/tests/devtools-evm-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Parsing a require statement with an argument should generate a `RevertError` with the specified message.", "mode": "fast-check"} {"id": 54484, "name": "unknown", "code": "it('should end whenever possible while never launching multiple tasks at the same time', async () => {\n const schedulingTypeArb = fc.constantFrom(...(['none', 'init'] as const));\n const dependenciesArbFor = (currentItem: number) =>\n fc.uniqueArray(fc.nat({ max: currentItem - 2 }), { maxLength: currentItem - 1 });\n const buildAndAddScheduled = (\n s: SchedulerImplem,\n unscheduled: Promise,\n allPs: Promise[],\n dependencies: number[],\n schedulingType: 'none' | 'init',\n ) => {\n const label = `p${allPs.length + 1}:${JSON.stringify(dependencies)}`;\n const deps = dependencies.map((id) => allPs[id]);\n let self: Promise;\n if (schedulingType === 'init') {\n if (deps.length === 0) {\n self = s.schedule(unscheduled, label);\n } else {\n self = Promise.all(deps).then(() => s.schedule(unscheduled, label));\n }\n } else {\n self = deps.length !== 0 ? Promise.all([...deps, unscheduled]) : unscheduled;\n }\n allPs.push(self);\n };\n const scheduleResolution = (\n wrappingScheduler: fc.Scheduler,\n p: ReturnType,\n pName: string,\n directResolved: boolean,\n ctx: fc.ContextValue,\n ): void => {\n if (directResolved) {\n ctx.log(`${pName} resolved (direct)`);\n p.resolve();\n return;\n }\n wrappingScheduler.schedule(Promise.resolve(`Resolve ${pName}`)).then(() => {\n ctx.log(`${pName} resolved`);\n p.resolve();\n });\n };\n await fc.assert(\n fc.asyncProperty(\n // Scheduler not being tested itself, it will be used to schedule when task will resolve\n fc.scheduler(),\n // Stream of positive integers used to tell which task should be selected by `nextTaskIndex`\n // whenever asked for the next task to be scheduled\n fc.infiniteStream(fc.nat()),\n // Define the tree of pre-requisite tasks:\n // - type of scheduling: should they be scheduled within the Schduler under test?\n // - when should they resolved: on init or when `fc.scheduler` decides it?\n // - what are the dependencies needed for this task?\n fc.tuple(schedulingTypeArb, fc.boolean()),\n fc.tuple(schedulingTypeArb, fc.boolean(), dependenciesArbFor(2)),\n fc.tuple(schedulingTypeArb, fc.boolean(), dependenciesArbFor(3)),\n fc.tuple(schedulingTypeArb, fc.boolean(), dependenciesArbFor(4)),\n fc.tuple(schedulingTypeArb, fc.boolean(), dependenciesArbFor(5)),\n fc.tuple(fc.boolean(), dependenciesArbFor(6)),\n fc.tuple(fc.boolean(), dependenciesArbFor(6)),\n fc.tuple(fc.boolean(), dependenciesArbFor(6)),\n // Extra boolean values used to add some delays between resolved Promises and next ones\n fc.infiniteStream(fc.boolean()),\n // Logger for easier troubleshooting\n fc.context(),\n async (\n wrappingScheduler,\n nextTaskIndexSeed,\n [schedulingType1, directResolve1],\n [schedulingType2, directResolve2, dependencies2],\n [schedulingType3, directResolve3, dependencies3],\n [schedulingType4, directResolve4, dependencies4],\n [schedulingType5, directResolve5, dependencies5],\n [directResolveA, finalDependenciesA],\n [directResolveB, finalDependenciesB],\n [directResolveC, finalDependenciesC],\n addExtraDelays,\n ctx,\n ) => {\n // Arrange\n const p1 = buildUnresolved();\n const p2 = buildUnresolved();\n const p3 = buildUnresolved();\n const p4 = buildUnresolved();\n const p5 = buildUnresolved();\n const rawAllPs = [p1, p2, p3, p4, p5];\n const pAwaitedA = buildUnresolved();\n const pAwaitedB = buildUnresolved();\n const pAwaitedC = buildUnresolved();\n let unknownTaskReleased = false;\n let multipleTasksReleasedAtTheSameTime: string | undefined = undefined;\n let alreadyRunningPx: typeof p1 | undefined = undefined;\n const taskSelector: TaskSelector = {\n clone: vi.fn(),\n nextTaskIndex: (scheduledTasks) => {\n const selectedId = nextTaskIndexSeed.next().value % scheduledTasks.length;\n const selectedPx = rawAllPs.find((p) => p.p === scheduledTasks[selectedId].original);\n const newPx = `p${rawAllPs.indexOf(selectedPx!) + 1}`;\n ctx.log(`Releasing ${newPx}${selectedPx!.hasBeenResolved() ? ' (resolved)' : ''}`);\n\n if (\n multipleTasksReleasedAtTheSameTime === undefined &&\n alreadyRunningPx !== undefined &&\n !alreadyRunningPx.hasBeenResolved()\n ) {\n const oldPx = `p${rawAllPs.indexOf(alreadyRunningPx) + 1}`;\n multipleTasksReleasedAtTheSameTime = `${oldPx} already running when releasing ${newPx}`;\n }\n alreadyRunningPx = selectedPx;\n unknownTaskReleased = unknownTaskReleased || alreadyRunningPx === undefined;\n return selectedId;\n },\n };\n const s = new SchedulerImplem((f) => f(), taskSelector);\n const allPs: Promise[] = [];\n buildAndAddScheduled(s, p1.p, allPs, [], schedulingType1);\n buildAndAddScheduled(s, p2.p, allPs, dependencies2, schedulingType2);\n buildAndAddScheduled(s, p3.p, allPs, dependencies3, schedulingType3);\n buildAndAddScheduled(s, p4.p, allPs, dependencies4, schedulingType4);\n buildAndAddScheduled(s, p5.p, allPs, dependencies5, schedulingType5);\n const awaitedTaskA = Promise.all([...finalDependenciesA.map((id) => allPs[id]), pAwaitedA.p]);\n let resolvedA = false;\n s.waitFor(awaitedTaskA).then(() => {\n ctx.log(`A ended`);\n resolvedA = true;\n });\n const awaitedTaskB = Promise.all([...finalDependenciesB.map((id) => allPs[id]), pAwaitedB.p]);\n let resolvedB = false;\n s.waitFor(awaitedTaskB).then(() => {\n ctx.log(`B ended`);\n resolvedB = true;\n });\n const awaitedTaskC = Promise.all([...finalDependenciesC.map((id) => allPs[id]), pAwaitedC.p]);\n let resolvedC = false;\n s.waitFor(awaitedTaskC).then(() => {\n ctx.log(`C ended`);\n resolvedC = true;\n });\n\n // Act\n scheduleResolution(wrappingScheduler, p1, 'p1', directResolve1, ctx);\n scheduleResolution(wrappingScheduler, p2, 'p2', directResolve2, ctx);\n scheduleResolution(wrappingScheduler, p3, 'p3', directResolve3, ctx);\n scheduleResolution(wrappingScheduler, p4, 'p4', directResolve4, ctx);\n scheduleResolution(wrappingScheduler, p5, 'p5', directResolve5, ctx);\n scheduleResolution(wrappingScheduler, pAwaitedA, 'pAwaitedA', directResolveA, ctx);\n scheduleResolution(wrappingScheduler, pAwaitedB, 'pAwaitedB', directResolveB, ctx);\n scheduleResolution(wrappingScheduler, pAwaitedC, 'pAwaitedC', directResolveC, ctx);\n\n while (wrappingScheduler.count() > 0) {\n // Extra delays based on timeouts of 0ms can potentially trigger unwanted bugs: let's try to add some before waitOne.\n if (addExtraDelays.next().value) {\n await delay();\n }\n await wrappingScheduler.waitOne();\n }\n // Extra delay done after all the scheduling as wrappingScheduler only schedules triggers to resolve tasks\n // and never waits for their associated Promises to really resolve.\n await delay();\n\n // Assert\n // All awaited tasks should have resolved\n expect(resolvedA).toBe(true);\n expect(resolvedB).toBe(true);\n expect(resolvedC).toBe(true);\n // Only one scheduled task awaited by the scheduler at a given point in time\n expect(multipleTasksReleasedAtTheSameTime).toBe(undefined);\n // Only known tasks could be scheduled\n expect(unknownTaskReleased).toBe(false);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/implementations/SchedulerImplem.spec.ts", "start_line": null, "end_line": null, "dependencies": ["buildUnresolved", "delay"], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The `SchedulerImplem` should ensure that all tasks are resolved whenever possible, without running multiple tasks concurrently, and only known tasks are scheduled.", "mode": "fast-check"} {"id": 56948, "name": "unknown", "code": "it('should parse require with a custom error with no arguments', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, async (eid) => {\n const errorParser = await createContractErrorParser({ contract, eid })\n const error = await assertFailed(contract.throwWithCustomErrorAndNoArguments())\n const parsedError = await errorParser(error)\n\n expect(parsedError).toEqual(new CustomError('CustomErrorWithNoArguments', []))\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/tests/devtools-evm-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Parsing a custom error with no arguments should return an error object with the correct name and an empty arguments array.", "mode": "fast-check"} {"id": 57047, "name": "unknown", "code": "it('should work for non-negative bigint strings', () => {\n fc.assert(\n fc.property(fc.bigInt({ min: BigInt(0) }), (value) => {\n expect(UIntBigIntSchema.parse(String(value))).toBe(value)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`UIntBigIntSchema.parse` correctly parses non-negative bigint strings back to their original bigint values.", "mode": "fast-check"} {"id": 57048, "name": "unknown", "code": "it('should not work for negative bigint strings', () => {\n fc.assert(\n fc.property(fc.bigInt({ max: BigInt(-1) }), (value) => {\n expect(() => UIntBigIntSchema.parse(String(value))).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`UIntBigIntSchema.parse` should throw an error for negative bigint strings.", "mode": "fast-check"} {"id": 57050, "name": "unknown", "code": "it('should not work for negative integers', () => {\n fc.assert(\n fc.property(fc.integer({ max: -1 }), (value) => {\n expect(() => UIntBigIntSchema.parse(value)).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`UIntBigIntSchema` should throw an error when parsing negative integers.", "mode": "fast-check"} {"id": 57051, "name": "unknown", "code": "it('should work for non-negative integer strings', () => {\n fc.assert(\n fc.property(fc.integer({ min: 0 }), (value) => {\n expect(UIntBigIntSchema.parse(String(value))).toBe(BigInt(value))\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`UIntBigIntSchema` correctly parses non-negative integer strings into their equivalent `BigInt` representations.", "mode": "fast-check"} {"id": 57052, "name": "unknown", "code": "it('should not work for negative integer strings', () => {\n fc.assert(\n fc.property(fc.integer({ max: -1 }), (value) => {\n expect(() => UIntBigIntSchema.parse(String(value))).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`UIntBigIntSchema.parse` throws an error when parsing negative integer strings represented as strings.", "mode": "fast-check"} {"id": 57053, "name": "unknown", "code": "it('should throw a ZodError for invalid values', () => {\n fc.assert(\n fc.property(fc.anything(), (value) => {\n let isValid = false\n\n try {\n isValid = UIntBigIntSchema.safeParse(value).success\n } catch {\n // This catch block is designed to catch errors caused by messed up standard methods\n // like toString or toValue that fast check throws at us\n }\n\n fc.pre(!isValid)\n\n // Here we expect that whatever we got, we'll not receive a SyntaxError\n // (coming from a BigInt() constructor) but a ZodError\n expect(() => UIntBigIntSchema.parse(value)).toThrow(ZodError)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`UIntBigIntSchema` should throw a `ZodError` for invalid input values that fail to successfully parse.", "mode": "fast-check"} {"id": 57054, "name": "unknown", "code": "it('should work for non-negative integers', () => {\n fc.assert(\n fc.property(fc.integer({ min: 0 }), (value) => {\n expect(UIntNumberSchema.parse(value)).toBe(value)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`UIntNumberSchema` accurately parses non-negative integers, returning the same value.", "mode": "fast-check"} {"id": 57055, "name": "unknown", "code": "it('should not work for negative integers', () => {\n fc.assert(\n fc.property(fc.integer({ max: -1 }), (value) => {\n expect(() => UIntNumberSchema.parse(value)).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`UIntNumberSchema.parse` throws an error when parsing negative integers.", "mode": "fast-check"} {"id": 57056, "name": "unknown", "code": "it('should work for non-negative integer strings', () => {\n fc.assert(\n fc.property(fc.integer({ min: 0 }), (value) => {\n expect(UIntNumberSchema.parse(String(value))).toBe(value)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`UIntNumberSchema` correctly parses non-negative integer strings into their integer form.", "mode": "fast-check"} {"id": 57058, "name": "unknown", "code": "it('should throw a ZodError for invalid values', () => {\n fc.assert(\n fc.property(fc.anything(), (value) => {\n let isValid = false\n\n try {\n isValid = UIntNumberSchema.safeParse(value).success\n } catch {\n // This catch block is designed to catch errors caused by messed up standard methods\n // like toString or toValue that fast check throws at us\n }\n\n fc.pre(!isValid)\n\n // Here we expect that whatever we got, we'll not receive a SyntaxError\n // (coming from a BigInt() constructor) but a ZodError\n expect(() => UIntNumberSchema.parse(value)).toThrow(ZodError)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`UIntNumberSchema` should throw a `ZodError` when parsing invalid values, ensuring that no `SyntaxError` is thrown during the process.", "mode": "fast-check"} {"id": 57059, "name": "unknown", "code": "it('should work without contract name innit', () => {\n fc.assert(\n fc.property(pointArbitrary, (point) => {\n fc.pre(!point.contractName)\n\n expect(formatOmniPoint(point)).toBe(`[${point.address} @ ${formatEid(point.eid)}]`)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/format.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "The test confirms that `formatOmniPoint` correctly formats a point without a contract name as `[address @ formattedEid]`.", "mode": "fast-check"} {"id": 57060, "name": "unknown", "code": "it('should work with contract name innit', () => {\n fc.assert(\n fc.property(pointArbitrary, (point) => {\n fc.pre(!!point.contractName)\n\n expect(formatOmniPoint(point)).toBe(\n `[${point.address} (${point.contractName}) @ ${formatEid(point.eid)}]`\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/format.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "The `formatOmniPoint` function correctly formats points that contain a `contractName` into the specified string representation.", "mode": "fast-check"} {"id": 57061, "name": "unknown", "code": "it('should just work innit', () => {\n fc.assert(\n fc.property(vectorArbitrary, (vector) => {\n expect(formatOmniVector(vector)).toBe(\n `${formatOmniPoint(vector.from)} \u2192 ${formatOmniPoint(vector.to)}`\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/format.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`formatOmniVector` outputs a formatted string representation of a vector, showing its 'from' and 'to' points connected by an arrow.", "mode": "fast-check"} {"id": 57062, "name": "unknown", "code": "it('should be true for referentially equal vector', () => {\n fc.assert(\n fc.property(pointArbitrary, (point) => {\n expect(arePointsEqual(point, point)).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`arePointsEqual` returns true for a vector that is referentially equal to itself.", "mode": "fast-check"} {"id": 57063, "name": "unknown", "code": "it('should be true for value equal vector', () => {\n fc.assert(\n fc.property(pointArbitrary, (point) => {\n expect(arePointsEqual(point, { ...point })).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`arePointsEqual` returns true when comparing a point to itself.", "mode": "fast-check"} {"id": 57064, "name": "unknown", "code": "it(\"should be false when addresses don't match\", () => {\n fc.assert(\n fc.property(pointArbitrary, addressArbitrary, (point, address) => {\n fc.pre(point.address !== address)\n\n expect(arePointsEqual(point, { ...point, address })).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Verifies that `arePointsEqual` returns false when comparing points with differing addresses.", "mode": "fast-check"} {"id": 57065, "name": "unknown", "code": "it(\"should be false when endpoint IDs don't match\", () => {\n fc.assert(\n fc.property(pointArbitrary, endpointArbitrary, (point, eid) => {\n fc.pre(point.eid !== eid)\n\n expect(arePointsEqual(point, { ...point, eid })).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`arePointsEqual` should return false when the endpoint IDs of the points do not match.", "mode": "fast-check"} {"id": 57066, "name": "unknown", "code": "it(\"should be false when contract names don't match\", () => {\n fc.assert(\n fc.property(pointArbitrary, nullableArbitrary(fc.string()), (point, contractName) => {\n fc.pre(point.contractName !== contractName)\n\n expect(arePointsEqual(point, { ...point, contractName })).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`arePointsEqual` returns false when the contract names of two points differ.", "mode": "fast-check"} {"id": 57067, "name": "unknown", "code": "it('should be true for referentially equal vector', () => {\n fc.assert(\n fc.property(vectorArbitrary, (vector) => {\n expect(areVectorsEqual(vector, vector)).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`areVectorsEqual` returns true for referentially equal vectors.", "mode": "fast-check"} {"id": 57069, "name": "unknown", "code": "it(\"should be false when from point doesn't match\", () => {\n fc.assert(\n fc.property(vectorArbitrary, pointArbitrary, (vector, from) => {\n fc.pre(!arePointsEqual(vector.from, from))\n\n expect(areVectorsEqual(vector, { ...vector, from })).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "The property asserts that if the starting point of a vector doesn't match a given point, then the vectors are not considered equal.", "mode": "fast-check"} {"id": 57070, "name": "unknown", "code": "it(\"should be false when to point doesn't match\", () => {\n fc.assert(\n fc.property(vectorArbitrary, pointArbitrary, (vector, to) => {\n fc.pre(!arePointsEqual(vector.from, to))\n\n expect(areVectorsEqual(vector, { ...vector, to })).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`areVectorsEqual` returns false when the `to` point of a vector does not match the expected `to` point.", "mode": "fast-check"} {"id": 57071, "name": "unknown", "code": "it('should return true if the eids match', () => {\n fc.assert(\n fc.property(pointArbitrary, pointArbitrary, (pointA, pointB) => {\n expect(areSameEndpoint(pointA, { ...pointB, eid: pointA.eid })).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`areSameEndpoint` returns true if the `eid` properties of two points match.", "mode": "fast-check"} {"id": 57072, "name": "unknown", "code": "it('should return false if the eids differ', () => {\n fc.assert(\n fc.property(pointArbitrary, pointArbitrary, (pointA, pointB) => {\n fc.pre(pointA.eid !== pointB.eid)\n\n expect(areSameEndpoint(pointA, pointB)).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`areSameEndpoint` returns false if the `eid` values of two points differ.", "mode": "fast-check"} {"id": 57073, "name": "unknown", "code": "it('should produce identical serialized values if the vector match', () => {\n fc.assert(\n fc.property(pointArbitrary, (point) => {\n expect(serializePoint(point)).toBe(serializePoint({ ...point }))\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`serializePoint` should produce identical serialized values for identical vector inputs.", "mode": "fast-check"} {"id": 57075, "name": "unknown", "code": "it('should produce identical serialized values if the vector match', () => {\n fc.assert(\n fc.property(vectorArbitrary, (vector) => {\n expect(serializeVector(vector)).toBe(serializeVector({ ...vector }))\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Serialization produces identical values for matching vectors.", "mode": "fast-check"} {"id": 57076, "name": "unknown", "code": "it(\"should produce different serialized values if the vector don't match\", () => {\n fc.assert(\n fc.property(vectorArbitrary, vectorArbitrary, (lineA, lineB) => {\n fc.pre(!areVectorsEqual(lineA, lineB))\n\n expect(serializeVector(lineA)).not.toBe(serializeVector(lineB))\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Serializing unequal vectors produces different serialized values.", "mode": "fast-check"} {"id": 57078, "name": "unknown", "code": "it('should return false if two points are not on the same stage', () => {\n fc.assert(\n fc.property(endpointArbitrary, endpointArbitrary, addressArbitrary, (eid1, eid2, address) => {\n fc.pre(endpointIdToStage(eid1) !== endpointIdToStage(eid2))\n\n expect(\n isVectorPossible({ from: { eid: eid1, address }, to: { eid: eid2, address } })\n ).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "The test checks that `isVectorPossible` returns false when two points have different stages as determined by their endpoint IDs.", "mode": "fast-check"} {"id": 57079, "name": "unknown", "code": "it('should append eid to a value', () => {\n fc.assert(\n fc.property(endpointArbitrary, fc.dictionary(fc.string(), fc.anything()), (eid, value) => {\n expect(withEid(eid)(value)).toEqual({ ...value, eid })\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Appending `eid` to a value creates an object that merges the original value with the `eid` key-value pair.", "mode": "fast-check"} {"id": 57080, "name": "unknown", "code": "it('should return an empty array if configuration function returns null, undefined or an empty array', async () => {\n const createSdk = jest.fn()\n const configureNode = jest.fn()\n const configureNodes = createConfigureNodes(configureNode)\n\n await fc.assert(\n fc.asyncProperty(nodesArbitrary, async (contracts) => {\n createSdk.mockClear()\n configureNode.mockClear()\n\n // We mock the node configurator to only return empty values\n configureNode.mockResolvedValueOnce(null).mockResolvedValueOnce(undefined).mockResolvedValue([])\n\n const graph = { contracts, connections: [] }\n await expect(configureNodes(graph, createSdk)).resolves.toEqual([])\n\n expect(createSdk).toHaveBeenCalledTimes(contracts.length)\n expect(configureNode).toHaveBeenCalledTimes(contracts.length)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/config.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`configureNodes` should return an empty array when `configureNode` resolves to null, undefined, or an empty array for each contract.", "mode": "fast-check"} {"id": 54492, "name": "unknown", "code": "it('should be able to parse any nat serialized with toString(radix)', () =>\n fc.assert(\n fc.property(fc.maxSafeNat(), fc.integer({ min: 2, max: 36 }), (n, radix) => {\n // Arrange\n const stringifiedNat = n.toString(radix);\n\n // Act\n const out = tryParseStringifiedNat(stringifiedNat, radix);\n\n // Assert\n expect(out).toBe(n);\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/mappers/NatToStringifiedNat.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Parsing any natural number serialized with `toString(radix)` should yield the original number when using `tryParseStringifiedNat`.", "mode": "fast-check"} {"id": 54493, "name": "unknown", "code": "it('should be able to unmap any mapped value', () =>\n fc.assert(\n fc.property(fc.maxSafeNat(), fc.constantFrom(...(['dec', 'oct', 'hex'] as const)), (n, base) => {\n // Arrange\n const stringifiedNat = natToStringifiedNatMapper([base, n]);\n\n // Act\n const out = natToStringifiedNatUnmapper(stringifiedNat);\n\n // Assert\n expect(out[0]).toBe(base);\n expect(out[1]).toBe(n);\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/mappers/NatToStringifiedNat.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`natToStringifiedNatUnmapper` correctly reverses the transformation performed by `natToStringifiedNatMapper` for mapped values.", "mode": "fast-check"} {"id": 57081, "name": "unknown", "code": "it('should create an SDK and execute configurator for every node', async () => {\n // Just some random SDK factory\n const createSdk = jest.fn().mockImplementation((point: OmniPoint) => ({ sdkFor: point }))\n // And a configuration function that returns something that we can identify in the result\n const configureNode = jest\n .fn()\n .mockImplementation((node: OmniNode, sdk: unknown) => ({ point: node.point, sdk }))\n const configureNodes = createConfigureNodes(configureNode)\n\n await fc.assert(\n fc.asyncProperty(nodesArbitrary, async (contracts) => {\n createSdk.mockClear()\n configureNode.mockClear()\n\n const graph = { contracts, connections: [] }\n const transactions = await configureNodes(graph, createSdk)\n\n // First we check that the transactions match what our configuration function would return\n expect(transactions).toHaveLength(contracts.length)\n expect(transactions).toEqual(\n contracts.map(({ point }) => ({\n point,\n sdk: {\n sdkFor: point,\n },\n }))\n )\n\n // Then we check that the configurations have been called properly\n expect(createSdk).toHaveBeenCalledTimes(contracts.length)\n expect(configureNode).toHaveBeenCalledTimes(contracts.length)\n\n for (const contract of contracts) {\n expect(createSdk).toHaveBeenCalledWith(contract.point)\n expect(configureNode).toHaveBeenCalledWith(\n contract,\n expect.objectContaining({ sdkFor: contract.point }),\n graph,\n createSdk\n )\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/config.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "The test ensures that an SDK is created and a configurator function is executed for each node in a graph, verifying the transactions returned and that the SDK creation and configurator functions are called the expected number of times and with the correct arguments.", "mode": "fast-check"} {"id": 57082, "name": "unknown", "code": "it('should return an empty array if configuration function returns null, undefined or an empty array', async () => {\n const createSdk = jest.fn()\n const configureEdge = jest.fn()\n const configureEdges = createConfigureEdges(configureEdge)\n\n await fc.assert(\n fc.asyncProperty(edgesArbitrary, async (connections) => {\n createSdk.mockClear()\n configureEdge.mockClear()\n\n // We mock the node configurator to only return empty values\n configureEdge.mockResolvedValueOnce(null).mockResolvedValueOnce(undefined).mockResolvedValue([])\n\n const graph = { contracts: [], connections }\n await expect(configureEdges(graph, createSdk)).resolves.toEqual([])\n\n expect(createSdk).toHaveBeenCalledTimes(connections.length)\n expect(configureEdge).toHaveBeenCalledTimes(connections.length)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/config.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`configureEdges` should return an empty array when the configuration function yields null, undefined, or an empty array for each connection.", "mode": "fast-check"} {"id": 54495, "name": "unknown", "code": "it('should be able to box and unbox any non-boxed value', () =>\n fc.assert(\n fc.property(fc.array(fc.anything({ withBoxedValues: false })), (data) => {\n // Arrange\n const source = unboxedToBoxedMapper(data);\n\n // Act / Assert\n expect(unboxedToBoxedUnmapper(source)).toBe(data);\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/mappers/UnboxedToBoxed.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Boxing and unboxing a non-boxed value should return the original value unchanged.", "mode": "fast-check"} {"id": 57083, "name": "unknown", "code": "it('should create an SDK and execute configurator for every connection', async () => {\n // Just some random SDK factory\n const createSdk = jest.fn().mockImplementation((point: OmniPoint) => ({ sdkFor: point }))\n // And a configuration function that returns something that we can identify in the result\n const configureEdge = jest\n .fn()\n .mockImplementation((edge: OmniEdge, sdk: unknown) => ({ vector: edge.vector, sdk }))\n const configureEdges = createConfigureEdges(configureEdge)\n\n await fc.assert(\n fc.asyncProperty(edgesArbitrary, async (connections) => {\n createSdk.mockClear()\n configureEdge.mockClear()\n\n const graph = { contracts: [], connections }\n const transactions = await configureEdges(graph, createSdk)\n\n // First we check that the transactions match what our configuration function would return\n expect(transactions).toHaveLength(connections.length)\n expect(transactions).toEqual(\n connections.map(({ vector }) => ({\n vector,\n sdk: {\n sdkFor: vector.from,\n },\n }))\n )\n\n // Then we check that the configurations have been called properly\n expect(createSdk).toHaveBeenCalledTimes(connections.length)\n expect(configureEdge).toHaveBeenCalledTimes(connections.length)\n\n for (const contract of connections) {\n expect(createSdk).toHaveBeenCalledWith(contract.vector.from)\n expect(configureEdge).toHaveBeenCalledWith(\n contract,\n expect.objectContaining({ sdkFor: contract.vector.from }),\n graph,\n createSdk\n )\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/config.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "An SDK and configurator are created for each connection in the graph, with transactions matching the expected configuration outputs and all calls occurring the correct number of times.", "mode": "fast-check"} {"id": 57084, "name": "unknown", "code": "it('should return a configurator that does nothing with no configurators', async () => {\n const createSdk = jest.fn()\n const emptyConfigurator = createConfigureMultiple()\n\n await fc.assert(\n fc.asyncProperty(graphArbitrary, async (graph) => {\n expect(createSdk).not.toHaveBeenCalled()\n\n await expect(emptyConfigurator(graph, createSdk)).resolves.toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/config.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "An empty configurator should return an empty array and not call `createSdk` when no configurators are provided.", "mode": "fast-check"} {"id": 54496, "name": "unknown", "code": "it('should be able to split any string mapped from chars into chars', () =>\n fc.assert(\n fc.property(fc.array(fc.nat({ max: 0xffff }).map((n) => String.fromCharCode(n))), (data) => {\n // Arrange\n const source = charsToStringMapper(data);\n\n // Act / Assert\n expect(charsToStringUnmapper(source)).toEqual(data);\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/mappers/CharsToString.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Strings mapped from character arrays should split back into their original character arrays using `charsToStringUnmapper`.", "mode": "fast-check"} {"id": 54499, "name": "unknown", "code": "it('should call Random to generate any integer in [0, length-1] when provided multiple values', () =>\n fc.assert(\n fc.property(\n fc.array(fc.anything(), { minLength: 2 }),\n fc.option(fc.integer({ min: 2 }), { nil: undefined }),\n fc.nat(),\n (values, biasFactor, mod) => {\n // Arrange\n const { instance: mrng, nextInt } = fakeRandom();\n nextInt.mockImplementation((a, b) => a + (mod % (b - a + 1)));\n\n // Act\n const arb = new ConstantArbitrary(values);\n const g = arb.generate(mrng, biasFactor);\n\n // Assert\n expect(nextInt).toHaveBeenCalledTimes(1);\n expect(nextInt).toHaveBeenCalledWith(0, values.length - 1);\n expect(values).toContainEqual(g.value);\n },\n ),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/ConstantArbitrary.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`ConstantArbitrary` uses `Random` to generate an integer within the range `[0, length-1]` for an array of values, and ensures it selects a valid element from the array.", "mode": "fast-check"} {"id": 57085, "name": "unknown", "code": "it('should call all configurators', async () => {\n const createSdk = jest.fn()\n\n await fc.assert(\n fc.asyncProperty(\n graphArbitrary,\n fc.array(transactionArbitrary),\n async (graph, transactionGroups) => {\n createSdk.mockClear()\n\n // We create a configurator for every group of transactions\n const configurators = transactionGroups.map((transactions) =>\n jest.fn().mockResolvedValue(transactions)\n )\n\n // Now we execute these configurators\n const multiConfigurator = createConfigureMultiple(...configurators)\n\n // And expect to get all the transactions back\n await expect(multiConfigurator(graph, createSdk)).resolves.toEqual(transactionGroups.flat())\n\n // We also check that every configurator has been called\n for (const configurator of configurators) {\n expect(configurator).toHaveBeenCalledOnce()\n }\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/config.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`createConfigureMultiple` calls all configurators, and returns a flattened array of their transactions.", "mode": "fast-check"} {"id": 57086, "name": "unknown", "code": "it('should add a single node', () => {\n fc.assert(\n fc.property(nodeArbitrary, (node) => {\n const builder = new OmniGraphBuilder()\n\n builder.addNodes(node)\n expect(builder.nodes).toEqual([node])\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Adding a single node to `OmniGraphBuilder` should result in the builder containing precisely that node in its `nodes` array.", "mode": "fast-check"} {"id": 54504, "name": "unknown", "code": "it('should shrink towards the first value if it was not already this one and to nil otherwise even without any context', () =>\n fc.assert(\n fc.property(fc.array(fc.anything(), { minLength: 1 }), fc.nat(), (values, mod) => {\n // Arrange\n const { instance: mrng, nextInt } = fakeRandom();\n nextInt.mockImplementation((a, b) => a + (mod % (b - a + 1)));\n\n // Act\n const arb = new ConstantArbitrary(values);\n const value = arb.generate(mrng, undefined);\n const shrinks = [...arb.shrink(value.value, undefined)];\n\n // Assert\n if (Object.is(value.value, values[0])) {\n expect(shrinks.map((v) => v.value)).toEqual([]);\n } else {\n expect(shrinks.map((v) => v.value)).toEqual([values[0]]);\n }\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/ConstantArbitrary.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`ConstantArbitrary` shrinks towards the first value if the generated value is different, and shrinks to an empty array otherwise, when no context is provided.", "mode": "fast-check"} {"id": 57088, "name": "unknown", "code": "it('should overwrite a node if the points are equal', () => {\n fc.assert(\n fc.property(pointArbitrary, nodeConfigArbitrary, nodeConfigArbitrary, (point, configA, configB) => {\n const builder = new OmniGraphBuilder()\n\n const nodeA = { point, config: configA }\n const nodeB = { point, config: configB }\n\n builder.addNodes(nodeA, nodeB)\n expect(builder.nodes).toEqual([nodeB])\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Overwriting a node occurs when two nodes with the same point are added, resulting in the latter node being retained in the graph.", "mode": "fast-check"} {"id": 57089, "name": "unknown", "code": "it('should not do anything when there are no nodes', () => {\n fc.assert(\n fc.property(nodeArbitrary, (node) => {\n const builder = new OmniGraphBuilder()\n\n builder.removeNodeAt(node.point)\n expect(builder.nodes).toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`OmniGraphBuilder` retains no nodes after attempting to remove a node from an empty graph.", "mode": "fast-check"} {"id": 54505, "name": "unknown", "code": "it('should unmap any string coming from the mapper', () =>\n fc.assert(\n fc.property(wordsArrayArbitrary, (words) => {\n // Arrange\n const { instance, canShrinkWithoutContext } = fakeArbitrary();\n canShrinkWithoutContext.mockImplementation(\n (value): value is string => typeof value === 'string' && words.includes(value),\n );\n\n // Act\n const mapped = wordsToJoinedStringMapper(words);\n const unmapper = wordsToJoinedStringUnmapperFor(instance);\n const unmappedValue = unmapper(mapped);\n\n // Assert\n expect(unmappedValue).toEqual(words);\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/mappers/WordsToLorem.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Unmapping a string derived from `wordsToJoinedStringMapper` should reconstruct the original array of words using `wordsToJoinedStringUnmapperFor`.", "mode": "fast-check"} {"id": 54506, "name": "unknown", "code": "it('should unmap any string coming from the mapper', () =>\n fc.assert(\n fc.property(wordsArrayArbitrary, (words) => {\n // Arrange\n const { instance, canShrinkWithoutContext } = fakeArbitrary();\n canShrinkWithoutContext.mockImplementation(\n (value): value is string => typeof value === 'string' && words.includes(value),\n );\n\n // Act\n const mapped = wordsToSentenceMapper(words);\n const unmapper = wordsToSentenceUnmapperFor(instance);\n const unmappedValue = unmapper(mapped);\n\n // Assert\n expect(unmappedValue).toEqual(words);\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/mappers/WordsToLorem.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Unmapped value should equal the original array of words after mapping and unmapping a string.", "mode": "fast-check"} {"id": 57090, "name": "unknown", "code": "it('should return self', () => {\n fc.assert(\n fc.property(nodeArbitrary, (node) => {\n const builder = new OmniGraphBuilder()\n\n expect(builder.removeNodeAt(node.point)).toBe(builder)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`OmniGraphBuilder.removeNodeAt` should return the builder instance itself.", "mode": "fast-check"} {"id": 57093, "name": "unknown", "code": "it('should remove all edges starting at the node', () => {\n fc.assert(\n fc.property(\n nodeArbitrary,\n nodeArbitrary,\n nodeArbitrary,\n edgeConfigArbitrary,\n (nodeA, nodeB, nodeC, edgeConfig) => {\n fc.pre(!arePointsEqual(nodeA.point, nodeB.point))\n fc.pre(!arePointsEqual(nodeA.point, nodeC.point))\n fc.pre(!arePointsEqual(nodeB.point, nodeC.point))\n\n const edgeAB = { vector: { from: nodeA.point, to: nodeB.point }, config: edgeConfig }\n const edgeAC = { vector: { from: nodeA.point, to: nodeC.point }, config: edgeConfig }\n const edgeBA = { vector: { from: nodeB.point, to: nodeA.point }, config: edgeConfig }\n const edgeBC = { vector: { from: nodeB.point, to: nodeC.point }, config: edgeConfig }\n const edgeCA = { vector: { from: nodeC.point, to: nodeA.point }, config: edgeConfig }\n const edgeCB = { vector: { from: nodeC.point, to: nodeB.point }, config: edgeConfig }\n\n fc.pre(isVectorPossible(edgeAB.vector))\n fc.pre(isVectorPossible(edgeAC.vector))\n fc.pre(isVectorPossible(edgeBA.vector))\n fc.pre(isVectorPossible(edgeBC.vector))\n fc.pre(isVectorPossible(edgeCA.vector))\n fc.pre(isVectorPossible(edgeCB.vector))\n\n const builder = new OmniGraphBuilder()\n\n builder\n .addNodes(nodeA, nodeB, nodeC)\n .addEdges(edgeAB, edgeAC, edgeBA, edgeBC, edgeCA, edgeCB)\n .removeNodeAt(nodeA.point)\n expect(builder.edges).toEqual([edgeBA, edgeBC, edgeCA, edgeCB])\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Upon removing a node from the graph, all edges originating from that node should be removed, while edges starting from other nodes should remain.", "mode": "fast-check"} {"id": 54507, "name": "unknown", "code": "it('should unmap any string coming from the mapper', () =>\n fc.assert(\n fc.property(\n fc.array(\n wordsArrayArbitrary.map((words) => wordsToSentenceMapper(words)),\n { minLength: 1 },\n ),\n (sentences) => {\n // Arrange / Act\n const mapped = sentencesToParagraphMapper(sentences);\n const unmappedValue = sentencesToParagraphUnmapper(mapped);\n\n // Assert\n expect(unmappedValue).toEqual(sentences);\n },\n ),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/mappers/WordsToLorem.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Mapping sentences to a paragraph and then unmapping should return the original sentences.", "mode": "fast-check"} {"id": 57094, "name": "unknown", "code": "it('should fail if from is not in the graph', () => {\n fc.assert(\n fc.property(edgeArbitrary, nodeConfigArbitrary, (edge, nodeConfig) => {\n fc.pre(isVectorPossible(edge.vector))\n\n const builder = new OmniGraphBuilder()\n\n builder\n .addNodes(\n { point: edge.vector.from, config: nodeConfig },\n { point: edge.vector.to, config: nodeConfig }\n )\n .removeNodeAt(edge.vector.from)\n\n expect(() => builder.addEdges(edge)).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "An exception is thrown when attempting to add an edge from a node that has been removed from the graph.", "mode": "fast-check"} {"id": 54509, "name": "unknown", "code": "it('should be able to split any string mapped from code-points into code-points', () =>\n fc.assert(\n fc.property(fc.array(fc.string({ unit: 'binary', minLength: 1, maxLength: 1 })), (data) => {\n // Arrange\n const source = codePointsToStringMapper(data);\n\n // Act / Assert\n expect(codePointsToStringUnmapper(source)).toEqual(data);\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/mappers/CodePointsToString.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "A string mapped from code-points can be split back into the original code-points array by `codePointsToStringUnmapper`.", "mode": "fast-check"} {"id": 54511, "name": "unknown", "code": "it('should result into higher or equal maxLength given higher size', () => {\n fc.assert(\n fc.property(sizeArb, sizeArb, fc.integer({ min: 0, max: MaxLengthUpperBound }), (sa, sb, minLength) => {\n // Arrange\n const [smallSize, largeSize] = isSmallerSize(sa, sb) ? [sa, sb] : [sb, sa];\n\n // Act / Assert\n expect(maxLengthFromMinLength(minLength, smallSize)).toBeLessThanOrEqual(\n maxLengthFromMinLength(minLength, largeSize),\n );\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/helpers/MaxLengthFromMinLength.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`maxLengthFromMinLength` produces a maximum length that is greater than or equal when given a larger size input.", "mode": "fast-check"} {"id": 57095, "name": "unknown", "code": "it('should fail if vector is not possible', () => {\n fc.assert(\n fc.property(edgeArbitrary, nodeConfigArbitrary, (edge, nodeConfig) => {\n fc.pre(!isVectorPossible(edge.vector))\n\n const builder = new OmniGraphBuilder()\n\n builder\n .addNodes(\n { point: edge.vector.from, config: nodeConfig },\n { point: edge.vector.to, config: nodeConfig }\n )\n .removeNodeAt(edge.vector.from)\n\n expect(() => builder.addEdges(edge)).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "The test ensures that when an edge's vector is not possible and a node at the vector's origin is removed, attempting to add such edges results in an error being thrown.", "mode": "fast-check"} {"id": 57096, "name": "unknown", "code": "it('should not fail if to is not in the graph', () => {\n fc.assert(\n fc.property(edgeArbitrary, nodeConfigArbitrary, (edge, nodeConfig) => {\n fc.pre(isVectorPossible(edge.vector))\n\n const builder = new OmniGraphBuilder()\n\n builder\n .addNodes(\n { point: edge.vector.from, config: nodeConfig },\n { point: edge.vector.to, config: nodeConfig }\n )\n .removeNodeAt(edge.vector.to)\n .addEdges(edge)\n\n expect(builder.edges).toEqual([edge])\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Ensures that removing a node from the graph that matches `edge.vector.to` does not prevent adding the edge back to the graph.", "mode": "fast-check"} {"id": 54512, "name": "unknown", "code": "it('should result into higher or equal maxLength given higher minLength', () => {\n fc.assert(\n fc.property(\n sizeArb,\n fc.integer({ min: 0, max: MaxLengthUpperBound }),\n fc.integer({ min: 0, max: MaxLengthUpperBound }),\n (size, minLengthA, minLengthB) => {\n // Arrange\n const [smallMinLength, largeMinLength] =\n minLengthA < minLengthB ? [minLengthA, minLengthB] : [minLengthB, minLengthA];\n\n // Act / Assert\n expect(maxLengthFromMinLength(smallMinLength, size)).toBeLessThanOrEqual(\n maxLengthFromMinLength(largeMinLength, size),\n );\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/helpers/MaxLengthFromMinLength.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Increasing the minimum length should yield a maximum length that is higher or equal.", "mode": "fast-check"} {"id": 57097, "name": "unknown", "code": "it('should add a single edge', () => {\n fc.assert(\n fc.property(edgeArbitrary, nodeConfigArbitrary, (edge, nodeConfig) => {\n fc.pre(isVectorPossible(edge.vector))\n\n const builder = new OmniGraphBuilder()\n\n builder\n .addNodes({ point: edge.vector.from, config: nodeConfig })\n .addNodes({ point: edge.vector.to, config: nodeConfig })\n .addEdges(edge)\n expect(builder.edges).toEqual([edge])\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Adding a single edge to an `OmniGraphBuilder` should result in the builder's edges list containing that edge.", "mode": "fast-check"} {"id": 57098, "name": "unknown", "code": "it('should not add a duplicate edge', () => {\n fc.assert(\n fc.property(edgeArbitrary, nodeConfigArbitrary, (edge, nodeConfig) => {\n fc.pre(isVectorPossible(edge.vector))\n\n const builder = new OmniGraphBuilder()\n\n builder\n .addNodes({ point: edge.vector.from, config: nodeConfig })\n .addNodes({ point: edge.vector.to, config: nodeConfig })\n .addEdges(edge, edge)\n expect(builder.edges).toEqual([edge])\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "OmniGraphBuilder should not include duplicate edges when adding the same edge twice.", "mode": "fast-check"} {"id": 57099, "name": "unknown", "code": "it('should overwrite an edge if the points are equal', () => {\n fc.assert(\n fc.property(\n vectorArbitrary,\n edgeConfigArbitrary,\n edgeConfigArbitrary,\n nodeConfigArbitrary,\n (vector, configA, configB, nodeConfig) => {\n fc.pre(isVectorPossible(vector))\n\n const builder = new OmniGraphBuilder()\n\n const edgeA = { vector, config: configA }\n const edgeB = { vector, config: configB }\n\n builder\n .addNodes({ point: vector.from, config: nodeConfig })\n .addNodes({ point: vector.to, config: nodeConfig })\n .addEdges(edgeA, edgeB)\n expect(builder.edges).toEqual([edgeB])\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "When two edges with identical points are added, the latter edge should overwrite the former in the `OmniGraphBuilder`.", "mode": "fast-check"} {"id": 57101, "name": "unknown", "code": "it('should return self', () => {\n fc.assert(\n fc.property(edgeArbitrary, (edge) => {\n fc.pre(isVectorPossible(edge.vector))\n\n const builder = new OmniGraphBuilder()\n\n expect(builder.removeEdgeAt(edge.vector)).toBe(builder)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`OmniGraphBuilder.removeEdgeAt` method should return the builder instance itself.", "mode": "fast-check"} {"id": 57102, "name": "unknown", "code": "it('should remove a edge at a specified vector', () => {\n fc.assert(\n fc.property(edgeArbitrary, nodeConfigArbitrary, (edge, nodeConfig) => {\n fc.pre(isVectorPossible(edge.vector))\n\n const builder = new OmniGraphBuilder()\n\n builder\n .addNodes({ point: edge.vector.from, config: nodeConfig })\n .addNodes({ point: edge.vector.to, config: nodeConfig })\n .addEdges(edge)\n\n builder.removeEdgeAt(edge.vector)\n expect(builder.edges).toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Removing an edge at a specified vector results in no edges remaining in the `OmniGraphBuilder`.", "mode": "fast-check"} {"id": 57103, "name": "unknown", "code": "it('should not remove edges at different vectors', () => {\n fc.assert(\n fc.property(edgeArbitrary, edgeArbitrary, nodeConfigArbitrary, (edgeA, edgeB, nodeConfig) => {\n fc.pre(isVectorPossible(edgeA.vector))\n fc.pre(isVectorPossible(edgeB.vector))\n fc.pre(!areVectorsEqual(edgeA.vector, edgeB.vector))\n\n const builder = new OmniGraphBuilder()\n\n builder\n .addNodes({ point: edgeA.vector.from, config: nodeConfig })\n .addNodes({ point: edgeA.vector.to, config: nodeConfig })\n .addNodes({ point: edgeB.vector.from, config: nodeConfig })\n .addNodes({ point: edgeB.vector.to, config: nodeConfig })\n .addEdges(edgeA, edgeB)\n builder.removeEdgeAt(edgeA.vector)\n expect(builder.edges).toEqual([edgeB])\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`OmniGraphBuilder` retains edges at different vectors when one edge is removed.", "mode": "fast-check"} {"id": 57104, "name": "unknown", "code": "it('should return undefined when there are no nodes', () => {\n const builder = new OmniGraphBuilder()\n\n fc.assert(\n fc.property(pointArbitrary, (point) => {\n expect(builder.getNodeAt(point)).toBeUndefined()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`OmniGraphBuilder` returns undefined when attempting to get a node at any point if no nodes exist.", "mode": "fast-check"} {"id": 57105, "name": "unknown", "code": "it('should return undefined when there are no nodes at a specified point', () => {\n fc.assert(\n fc.property(nodesArbitrary, (nodes) => {\n const node = nodes.at(-1)\n fc.pre(node != null)\n\n const builder = new OmniGraphBuilder()\n\n builder.addNodes(...nodes)\n builder.removeNodeAt(node!.point)\n expect(builder.getNodeAt(node!.point)).toBeUndefined()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Removing a node at a specified point should result in `getNodeAt` returning undefined.", "mode": "fast-check"} {"id": 57108, "name": "unknown", "code": "it('should return undefined when there are no edges at a specified vector', () => {\n fc.assert(\n fc.property(edgesArbitrary, nodeConfigArbitrary, (edges, nodeConfig) => {\n const edge = edges.at(-1)\n fc.pre(edge != null)\n fc.pre(edges.map((e) => e.vector).every(isVectorPossible))\n\n const builder = new OmniGraphBuilder()\n const nodes = edges.flatMap(({ vector: { from, to } }) => [\n { point: from, config: nodeConfig },\n { point: to, config: nodeConfig },\n ])\n\n builder\n .addNodes(...nodes)\n .addEdges(...edges)\n .removeEdgeAt(edge!.vector)\n expect(builder.getEdgeAt(edge!.vector)).toBeUndefined()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "When an edge is removed from a specified vector in `OmniGraphBuilder`, `getEdgeAt` should return undefined for that vector.", "mode": "fast-check"} {"id": 57109, "name": "unknown", "code": "it('should return edge when there is a edge at a specified vector', () => {\n fc.assert(\n fc.property(edgesArbitrary, nodeConfigArbitrary, (edges, nodeConfig) => {\n const edge = edges.at(-1)\n fc.pre(edge != null)\n fc.pre(edges.map((e) => e.vector).every(isVectorPossible))\n\n const builder = new OmniGraphBuilder()\n const nodes = edges.flatMap(({ vector: { from, to } }) => [\n { point: from, config: nodeConfig },\n { point: to, config: nodeConfig },\n ])\n\n builder.addNodes(...nodes).addEdges(...edges)\n expect(builder.getEdgeAt(edge!.vector)).toBe(edge)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Returns the correct edge from `OmniGraphBuilder` when there is an edge at the specified vector.", "mode": "fast-check"} {"id": 57110, "name": "unknown", "code": "it('should return an empty array when there are no edges', () => {\n const builder = new OmniGraphBuilder()\n\n fc.assert(\n fc.property(pointArbitrary, (point) => {\n expect(builder.getEdgesFrom(point)).toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`OmniGraphBuilder` returns an empty array for points with no edges.", "mode": "fast-check"} {"id": 57111, "name": "unknown", "code": "it('should return all edges that originate at a specific point', () => {\n fc.assert(\n fc.property(edgesArbitrary, nodeConfigArbitrary, (edges, nodeConfig) => {\n const edge = edges.at(-1)\n fc.pre(edge != null)\n fc.pre(edges.map((e) => e.vector).every(isVectorPossible))\n\n const builder = new OmniGraphBuilder()\n const nodes = edges.flatMap(({ vector: { from, to } }) => [\n { point: from, config: nodeConfig },\n { point: to, config: nodeConfig },\n ])\n\n builder.addNodes(...nodes).addEdges(...edges)\n\n const edgesFrom = builder.edges.filter(({ vector }) =>\n arePointsEqual(vector.from, edge!.vector.from)\n )\n expect(builder.getEdgesFrom(edge!.vector.from)).toEqual(edgesFrom)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`OmniGraphBuilder.getEdgesFrom` returns all edges originating from a specified point in the graph.", "mode": "fast-check"} {"id": 57112, "name": "unknown", "code": "it('should return an empty array when there are no edges', () => {\n const builder = new OmniGraphBuilder()\n\n fc.assert(\n fc.property(pointArbitrary, (point) => {\n expect(builder.getEdgesTo(point)).toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`OmniGraphBuilder.getEdgesTo(point)` returns an empty array when no edges are present.", "mode": "fast-check"} {"id": 57113, "name": "unknown", "code": "it('should return all edges that end at a specific point', () => {\n fc.assert(\n fc.property(edgesArbitrary, nodeConfigArbitrary, (edges, nodeConfig) => {\n const edge = edges.at(-1)\n fc.pre(edge != null)\n fc.pre(edges.map((e) => e.vector).every(isVectorPossible))\n\n const builder = new OmniGraphBuilder()\n const nodes = edges.flatMap(({ vector: { from, to } }) => [\n { point: from, config: nodeConfig },\n { point: to, config: nodeConfig },\n ])\n\n builder.addNodes(...nodes).addEdges(...edges)\n\n const edgesTo = builder.edges.filter(({ vector }) => arePointsEqual(vector.to, edge!.vector.to))\n expect(builder.getEdgesTo(edge!.vector.to)).toEqual(edgesTo)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "The test verifies that `OmniGraphBuilder` correctly returns all edges terminating at a specified point.", "mode": "fast-check"} {"id": 57115, "name": "unknown", "code": "it('should return all successful transactions if they all go through', async () => {\n await fc.assert(\n fc.asyncProperty(fc.array(transactionArbitrary), async (transactions) => {\n // We'll prepare some mock objects for this test\n // to mock the transaction responses and receipts\n const receipt = { transactionHash: '0x0' }\n\n // Our successful wait will produce a receipt\n const successfulWait = jest.fn().mockResolvedValue(receipt)\n const successfulResponse: OmniTransactionResponse = {\n transactionHash: '0x0',\n wait: successfulWait,\n }\n\n // Our signAndSend will then use the map to resolve/reject transactions\n const signAndSend = jest.fn().mockResolvedValue(successfulResponse)\n const sign = jest.fn().mockRejectedValue('Oh god no')\n const signerFactory: OmniSignerFactory = jest.fn().mockResolvedValue({ signAndSend, sign })\n const signAndSendTransactions = createSignAndSend(signerFactory)\n\n // Now we send all the transactions to the flow and observe the output\n const [successful, errors, pending] = await signAndSendTransactions(transactions)\n\n // Since we are executing groups of transactions in parallel,\n // in general the order of successful transaction will not match the order of input transactions\n expect(successful).toContainAllValues(\n transactions.map((transaction) => ({ transaction, receipt }))\n )\n expect(errors).toEqual([])\n expect(pending).toEqual([])\n\n // What needs to match though is the order of successful transactions within groups\n //\n // For that we group the successful transactions and make sure those are equal to the grouped original transactions\n const groupedSuccessful = groupTransactionsByEid(\n successful.map(({ transaction }) => transaction)\n )\n expect(groupedSuccessful).toEqual(groupTransactionsByEid(transactions))\n\n // We also check that the signer factory has been called with the eids\n for (const transaction of transactions) {\n expect(signerFactory).toHaveBeenCalledWith(transaction.point.eid)\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "All transactions should succeed and produce receipts, with empty error and pending lists, and grouped transactions maintaining their original order.", "mode": "fast-check"} {"id": 57117, "name": "unknown", "code": "it('should call onProgress for every successful transaction', async () => {\n await fc.assert(\n fc.asyncProperty(fc.array(transactionArbitrary), async (transactions) => {\n // We'll prepare some mock objects for this test\n // to mock the transaction responses and receipts\n const receipt = { transactionHash: '0x0' }\n\n // Our successful wait will produce a receipt\n const successfulWait = jest.fn().mockResolvedValue(receipt)\n const successfulResponse: OmniTransactionResponse = {\n transactionHash: '0x0',\n wait: successfulWait,\n }\n\n // Our signAndSend will then use the map to resolve/reject transactions\n const signAndSend = jest.fn().mockResolvedValue(successfulResponse)\n const sign = jest.fn().mockRejectedValue('Oh god no')\n const signerFactory: OmniSignerFactory = jest.fn().mockResolvedValue({ signAndSend, sign })\n const signAndSendTransactions = createSignAndSend(signerFactory)\n\n const handleProgress = jest.fn()\n const [successful] = await signAndSendTransactions(transactions, handleProgress)\n\n // We check whether onProgress has been called for every transaction\n for (const [index, transaction] of successful.entries()) {\n expect(handleProgress).toHaveBeenNthCalledWith(\n index + 1,\n // We expect the transaction in question to be passed\n transaction,\n // As well as the list of all the successful transactions so far\n successful.slice(0, index + 1)\n )\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "The `onProgress` callback should be called for every successful transaction processed by `signAndSendTransactions`, passing the current transaction and the list of all successful transactions so far.", "mode": "fast-check"} {"id": 54522, "name": "unknown", "code": "it('should only consider the received size when set to Size', () => {\n fc.assert(\n fc.property(sizeRelatedGlobalConfigArb, sizeArb, fc.boolean(), (config, size, specifiedMaxDepth) => {\n // Arrange / Act\n const computedDepthBias = withConfiguredGlobal(config, () =>\n depthBiasFromSizeForArbitrary(size, specifiedMaxDepth),\n );\n const expectedDepthBias = { xsmall: 1, small: 1 / 2, medium: 1 / 4, large: 1 / 8, xlarge: 1 / 16 }[size];\n\n // Assert\n expect(computedDepthBias).toBe(expectedDepthBias);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/helpers/MaxLengthFromMinLength.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "When set to Size, `depthBiasFromSizeForArbitrary` should compute depth bias based solely on the received size, matching expected values.", "mode": "fast-check"} {"id": 57118, "name": "unknown", "code": "it('should bail on the first wait error', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.array(transactionArbitrary),\n transactionArbitrary,\n fc.array(transactionArbitrary),\n async (firstBatch, failedTransaction, secondBatch) => {\n // We'll prepare some mock objects for this test\n // to mock the transaction responses and receipts\n const error = new Error('Failed transaction')\n const receipt = { transactionHash: '0x0' }\n\n // Our successful wait will produce a receipt\n const successfulWait = jest.fn().mockResolvedValue(receipt)\n const successfulResponse: OmniTransactionResponse = {\n transactionHash: '0x0',\n wait: successfulWait,\n }\n\n // Our unsuccessful wait will throw an error\n const unsuccessfulWait = jest.fn().mockRejectedValue(error)\n const unsuccessfulResponse: OmniTransactionResponse = {\n transactionHash: '0x0',\n wait: unsuccessfulWait,\n }\n\n // In order to resolve the good ones and reject the bad ones\n // we'll prepare a map between a transaction and its response\n //\n // This map relies on the fact that we are passing the transaction object without modifying it\n // so the objects are referentially equal\n const implementations: Map> = new Map([\n ...firstBatch.map((t) => [t, Promise.resolve(successfulResponse)] as const),\n ...secondBatch.map((t) => [t, Promise.resolve(successfulResponse)] as const),\n [failedTransaction, Promise.resolve(unsuccessfulResponse)],\n ])\n\n const expectedSuccessful = [\n // The first batch should all go through\n ...firstBatch,\n // The transactions that are not on the chain affected by the failed transaction should also pass\n ...secondBatch.filter(({ point }) => point.eid !== failedTransaction.point.eid),\n ]\n\n const expectedPending = secondBatch.filter(\n ({ point }) => point.eid === failedTransaction.point.eid\n )\n\n // Our signAndSend will then use the map to resolve/reject transactions\n const signAndSend = jest.fn().mockImplementation((t) => implementations.get(t))\n const sign = jest.fn().mockRejectedValue('Oh god no')\n const signerFactory: OmniSignerFactory = jest.fn().mockResolvedValue({ signAndSend, sign })\n const signAndSendTransactions = createSignAndSend(signerFactory)\n\n // Now we send all the transactions to the flow and observe the output\n const transactions = [...firstBatch, failedTransaction, ...secondBatch]\n const [successful, errors, pending] = await signAndSendTransactions(transactions)\n\n // Since we are executing groups of transactions in parallel,\n // in general the order of successful transaction will not match the order of input transactions\n expect(successful).toContainAllValues(\n expectedSuccessful.map((transaction) => ({ transaction, receipt }))\n )\n expect(errors).toEqual([{ transaction: failedTransaction, error }])\n expect(pending).toEqual([failedTransaction, ...expectedPending])\n\n // What needs to match though is the order of successful transactions within groups\n //\n // For that we group the successful transactions and make sure those are equal to the grouped original transactions\n const groupedSuccessful = groupTransactionsByEid(\n successful.map(({ transaction }) => transaction)\n )\n expect(groupedSuccessful).toEqual(groupTransactionsByEid(expectedSuccessful))\n\n // We also check that the signer factory has been called with the eids\n expect(signerFactory).toHaveBeenCalledWith(failedTransaction.point.eid)\n for (const transaction of firstBatch) {\n expect(signerFactory).toHaveBeenCalledWith(transaction.point.eid)\n }\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Verifies that when processing a batch of transactions, the flow stops at the first transaction that fails and correctly categorizes successful, errored, and pending transactions.", "mode": "fast-check"} {"id": 54524, "name": "unknown", "code": "it('should always return 0 if size is max whatever the global configuration', () => {\n fc.assert(\n fc.property(sizeRelatedGlobalConfigArb, fc.boolean(), (config, specifiedMaxDepth) => {\n // Arrange / Act\n const computedDepthBias = withConfiguredGlobal(config, () =>\n depthBiasFromSizeForArbitrary('max', specifiedMaxDepth),\n );\n\n // Assert\n expect(computedDepthBias).toBe(0);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/helpers/MaxLengthFromMinLength.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`depthBiasFromSizeForArbitrary` should return 0 when the size is 'max', regardless of the global configuration settings.", "mode": "fast-check"} {"id": 54526, "name": "unknown", "code": "it('should always return empty stream when current equals target', () =>\n fc.assert(\n fc.property(fc.maxSafeInteger(), fc.boolean(), (value, tryAsap) => {\n // Arrange / Act\n const shrinks = [...shrinkInteger(value, value, tryAsap)];\n\n // Assert\n expect(shrinks).toHaveLength(0);\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/helpers/ShrinkInteger.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "An empty stream should be returned by `shrinkInteger` when the current value equals the target value.", "mode": "fast-check"} {"id": 57119, "name": "unknown", "code": "it('should not bail on the first wait error', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.array(transactionArbitrary),\n transactionArbitrary,\n fc.array(transactionArbitrary),\n async (firstBatch, failedTransaction, secondBatch) => {\n // We'll prepare some mock objects for this test\n // to mock the transaction responses and receipts\n const error = new Error('Failed transaction')\n const receipt = { transactionHash: '0x0' }\n\n // Our successful wait will produce a receipt\n const successfulWait = jest.fn().mockResolvedValue(receipt)\n const successfulResponse: OmniTransactionResponse = {\n transactionHash: '0x0',\n wait: successfulWait,\n }\n\n // Our unsuccessful wait will throw an error\n const unsuccessfulWait = jest.fn().mockRejectedValue(error)\n const unsuccessfulResponse: OmniTransactionResponse = {\n transactionHash: '0x0',\n wait: unsuccessfulWait,\n }\n\n // In order to resolve the good ones and reject the bad ones\n // we'll prepare a map between a transaction and its response\n //\n // This map relies on the fact that we are passing the transaction object without modifying it\n // so the objects are referentially equal\n const implementations: Map> = new Map([\n ...firstBatch.map((t) => [t, Promise.resolve(successfulResponse)] as const),\n ...secondBatch.map((t) => [t, Promise.resolve(successfulResponse)] as const),\n [failedTransaction, Promise.resolve(unsuccessfulResponse)],\n ])\n\n const expectedSuccessful = [\n // The first batch should all go through\n ...firstBatch,\n // The second batch should all go through since they all were submitted and will all be mined\n ...secondBatch,\n ]\n\n // Our signAndSend will then use the map to resolve/reject transactions\n const signAndSend = jest.fn().mockImplementation((t) => implementations.get(t))\n const sign = jest.fn().mockRejectedValue('Oh god no')\n const signerFactory: OmniSignerFactory = jest.fn().mockResolvedValue({ signAndSend, sign })\n const signAndSendTransactions = createSignAndSend(signerFactory)\n\n // Now we send all the transactions to the flow and observe the output\n const transactions = [...firstBatch, failedTransaction, ...secondBatch]\n const [successful, errors, pending] = await signAndSendTransactions(transactions)\n\n // Since we are executing groups of transactions in parallel,\n // in general the order of successful transaction will not match the order of input transactions\n expect(successful).toContainAllValues(\n expectedSuccessful.map((transaction) => ({ transaction, receipt }))\n )\n expect(errors).toEqual([{ transaction: failedTransaction, error }])\n expect(pending).toEqual([failedTransaction])\n\n // What needs to match though is the order of successful transactions within groups\n //\n // For that we group the successful transactions and make sure those are equal to the grouped original transactions\n const groupedSuccessful = groupTransactionsByEid(\n successful.map(({ transaction }) => transaction)\n )\n expect(groupedSuccessful).toEqual(groupTransactionsByEid(expectedSuccessful))\n\n // We also check that the signer factory has been called with the eids\n expect(signerFactory).toHaveBeenCalledWith(failedTransaction.point.eid)\n for (const transaction of firstBatch) {\n expect(signerFactory).toHaveBeenCalledWith(transaction.point.eid)\n }\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "The `signAndSendTransactions` function should continue processing transactions even if a single transaction fails, ensuring that other transactions succeed and correctly grouping them by execution order.", "mode": "fast-check"} {"id": 57120, "name": "unknown", "code": "it('should only return errors if the submission fails', async () => {\n await fc.assert(\n fc.asyncProperty(fc.array(transactionArbitrary), async (transactions) => {\n // We'll prepare some mock objects for this test\n // to mock the transaction responses and receipts\n const error = new Error('Failed transaction')\n\n // Our signAndSend will then use the map to resolve/reject transactions\n const signAndSendBatch = jest.fn().mockRejectedValue(error)\n const signAndSend = jest.fn().mockRejectedValue('Oh god no')\n const sign = jest.fn().mockRejectedValue('Oh god no')\n const signerFactory: OmniSignerFactory = jest\n .fn()\n .mockResolvedValue({ signAndSend, signAndSendBatch, sign })\n const signAndSendTransactions = createSignAndSend(signerFactory)\n\n // Now we send all the transactions to the flow and observe the output\n const [successful, errors, pending] = await signAndSendTransactions(transactions)\n\n // Since we are executing groups of transactions in parallel,\n // in general the order of successful transaction will not match the order of input transactions\n expect(successful).toEqual([])\n expect(errors).toContainAllValues(\n transactions.map((transaction) => ({ transaction, error }))\n )\n expect(pending).toContainAllValues(transactions)\n\n // We also check that the signer factory has been called with the eids\n for (const transaction of transactions) {\n expect(signerFactory).toHaveBeenCalledWith(transaction.point.eid)\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Sign and send operations should result in errors matching all transactions when each transaction in the batch fails, with no successful transactions reported.", "mode": "fast-check"} {"id": 54529, "name": "unknown", "code": "it('should never include current in the stream', () =>\n fc.assert(\n fc.property(fc.maxSafeInteger(), fc.maxSafeInteger(), fc.boolean(), (current, target, tryAsap) => {\n // Arrange / Act\n const shrinks = [...shrinkInteger(current, target, tryAsap)];\n const values = shrinks.map((v) => v.value);\n\n // Assert\n expect(values).not.toContain(current);\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/helpers/ShrinkInteger.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The `shrinkInteger` function should produce a stream of values that do not include the current integer.", "mode": "fast-check"} {"id": 57121, "name": "unknown", "code": "it('should only return errors if the waiting fails', async () => {\n await fc.assert(\n fc.asyncProperty(fc.array(transactionArbitrary), async (transactions) => {\n // We'll prepare some mock objects for this test\n // to mock the transaction responses and receipts\n const error = new Error('Failed transaction')\n // Our unsuccessful wait will throw an error\n const wait = jest.fn().mockRejectedValue(error)\n const response: OmniTransactionResponse = {\n transactionHash: '0x0',\n wait,\n }\n\n // Our signAndSend will then use the map to resolve/reject transactions\n const signAndSendBatch = jest.fn().mockResolvedValue(response)\n const signAndSend = jest.fn().mockRejectedValue('Oh god no')\n const sign = jest.fn().mockRejectedValue('Oh god no')\n const signerFactory: OmniSignerFactory = jest\n .fn()\n .mockResolvedValue({ signAndSend, signAndSendBatch, sign })\n const signAndSendTransactions = createSignAndSend(signerFactory)\n\n // Now we send all the transactions to the flow and observe the output\n const [successful, errors, pending] = await signAndSendTransactions(transactions)\n\n // Since we are executing groups of transactions in parallel,\n // in general the order of successful transaction will not match the order of input transactions\n expect(successful).toEqual([])\n expect(errors).toContainAllValues(\n transactions.map((transaction) => ({ transaction, error }))\n )\n expect(pending).toContainAllValues(transactions)\n\n // We also check that the signer factory has been called with the eids\n for (const transaction of transactions) {\n expect(signerFactory).toHaveBeenCalledWith(transaction.point.eid)\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Ensures that when transactions fail during the waiting process, no transactions are marked as successful, errors are returned corresponding to each transaction, and all transactions are reported as pending.", "mode": "fast-check"} {"id": 54533, "name": "unknown", "code": "it('should always strictly increase distance from target as we move in the stream', () =>\n fc.assert(\n fc.property(fc.maxSafeInteger(), fc.maxSafeInteger(), fc.boolean(), (current, target, tryAsap) => {\n // Arrange / Act\n const shrinks = [...shrinkInteger(current, target, tryAsap)];\n const absDiff = (a: number, b: number): bigint => {\n const result = BigInt(a) - BigInt(b);\n return result >= 0 ? result : -result;\n };\n\n // Assert\n for (let idx = 1; idx < shrinks.length; ++idx) {\n const previousDistance = absDiff(shrinks[idx - 1].value, target);\n const currentDistance = absDiff(shrinks[idx].value, target);\n expect(currentDistance).toBeGreaterThan(previousDistance);\n }\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/helpers/ShrinkInteger.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Each successive value in the `shrinkInteger` stream should have a greater distance from the target than the previous value.", "mode": "fast-check"} {"id": 57122, "name": "unknown", "code": "it('should only return successes if waiting succeeds', async () => {\n await fc.assert(\n fc.asyncProperty(fc.array(transactionArbitrary), async (transactions) => {\n const receipt = { transactionHash: '0x0' }\n\n // Our successful wait will produce a receipt\n const wait = jest.fn().mockResolvedValue(receipt)\n const response: OmniTransactionResponse = {\n transactionHash: '0x0',\n wait,\n }\n\n // Our signAndSend will then use the map to resolve/reject transactions\n const signAndSendBatch = jest.fn().mockResolvedValue(response)\n const signAndSend = jest.fn().mockRejectedValue('Oh god no')\n const sign = jest.fn().mockRejectedValue('Oh god no')\n const signerFactory: OmniSignerFactory = jest\n .fn()\n .mockResolvedValue({ signAndSend, signAndSendBatch, sign })\n const signAndSendTransactions = createSignAndSend(signerFactory)\n\n // Now we send all the transactions to the flow and observe the output\n const [successful, errors, pending] = await signAndSendTransactions(transactions)\n\n // Since we are executing groups of transactions in parallel,\n // in general the order of successful transaction will not match the order of input transactions\n expect(successful).toContainAllValues(\n transactions.map((transaction) => ({ transaction, receipt }))\n )\n expect(errors).toEqual([])\n expect(pending).toEqual([])\n\n // We also check that the signer factory has been called with the eids\n for (const transaction of transactions) {\n expect(signerFactory).toHaveBeenCalledWith(transaction.point.eid)\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "The function `signAndSendTransactions` processes an array of transactions, ensuring it only returns successful transactions if all waits succeed, while the errors and pending arrays remain empty.", "mode": "fast-check"} {"id": 57123, "name": "unknown", "code": "it('should return padded values for address', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, (address) => {\n const bytes = makeBytes32(address)\n\n expect(bytes.length).toBe(66)\n expect(BigInt(bytes)).toBe(BigInt(address))\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`makeBytes32` should convert an address to a 66-character padded string, preserving its numeric value.", "mode": "fast-check"} {"id": 54537, "name": "unknown", "code": "it('should never include current in the stream', () =>\n fc.assert(\n fc.property(fc.bigInt(), fc.bigInt(), fc.boolean(), (current, target, tryAsap) => {\n // Arrange / Act\n const shrinks = [...shrinkBigInt(current, target, tryAsap)];\n const values = shrinks.map((v) => v.value);\n\n // Assert\n expect(values).not.toContain(current);\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/helpers/ShrinkBigInt.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The `shrinkBigInt` function should generate a stream of values that does not include the current value.", "mode": "fast-check"} {"id": 57127, "name": "unknown", "code": "it('should return true for an address and bytes', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, (address) => {\n expect(areBytes32Equal(address, makeBytes32(address))).toBe(true)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`areBytes32Equal` returns true when comparing an address with its converted bytes32 representation using `makeBytes32`.", "mode": "fast-check"} {"id": 57128, "name": "unknown", "code": "it('should return false for a zeroish value and a non-zeroish address', () => {\n fc.assert(\n fc.property(zeroishBytes32Arbitrary, evmAddressArbitrary, (bytes, address) => {\n fc.pre(!isZero(address))\n\n expect(areBytes32Equal(bytes, address)).toBe(false)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Returns false when comparing a zeroish value with a non-zeroish address using `areBytes32Equal`.", "mode": "fast-check"} {"id": 54538, "name": "unknown", "code": "it('should never include target in the stream when try asap is not requested', () =>\n fc.assert(\n fc.property(fc.bigInt(), fc.bigInt(), (current, target) => {\n // Arrange / Act\n const shrinks = [...shrinkBigInt(current, target, false)];\n const values = shrinks.map((v) => v.value);\n\n // Assert\n expect(values).not.toContain(target);\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/helpers/ShrinkBigInt.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The property ensures that the target value is not included in the output stream of `shrinkBigInt` when \"try asap\" is set to false.", "mode": "fast-check"} {"id": 57132, "name": "unknown", "code": "it('should return false two non-matching UInt8Array instances', () => {\n fc.assert(\n fc.property(\n fc.uint8Array({ minLength: 1, maxLength: 32 }),\n fc.uint8Array({ minLength: 1, maxLength: 32 }),\n (a, b) => {\n // We need to filter out matching arrays\n fc.pre(\n // We walk over the first array and check that there is at least one non-matching element\n //\n // We default any missing (undefined) values in the second array to 0\n // since any leading zeros are equal to undefined\n a.some((v, i) => v !== b[i] || 0) ||\n // And we do the same for the second array (since we don't know which one lis longer)\n b.some((v, i) => v !== a[i] || 0)\n )\n\n expect(areBytes32Equal(a, b)).toBe(false)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`areBytes32Equal` returns false for two non-matching `UInt8Array` instances where at least one element differs or is undefined in one array.", "mode": "fast-check"} {"id": 57133, "name": "unknown", "code": "it('should return false two a UInt8Array & non-matching hex string', () => {\n fc.assert(\n fc.property(\n fc.uint8Array({ minLength: 1, maxLength: 32 }),\n fc.uint8Array({ minLength: 1, maxLength: 32 }),\n (a, b) => {\n fc.pre(\n // We walk over the first array and check that there is at least one non-matching element\n //\n // We default any missing (undefined) values in the second array to 0\n // since any leading zeros are equal to undefined\n a.some((v, i) => v !== b[i]) ||\n // And we do the same for the second array (since we don't know which one lis longer)\n b.some((v, i) => v !== a[i])\n )\n\n expect(areBytes32Equal(a, makeBytes32(b))).toBe(false)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`areBytes32Equal` returns false when there is at least one non-matching element between a `UInt8Array` and a `makeBytes32` conversion of another `UInt8Array`.", "mode": "fast-check"} {"id": 54542, "name": "unknown", "code": "it('should be able to revert any mapped date correctly even invalid ones', () => {\n fc.assert(\n fc.property(fc.date(), (d) => {\n // Arrange / Act\n const rev = timeToDateUnmapper(d);\n const revRev = timeToDateMapper(rev);\n\n // Assert\n expect(revRev.getTime()).toEqual(d.getTime());\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/mappers/TimeToDate.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`timeToDateUnmapper` followed by `timeToDateMapper` should revert a date to its original form, even for invalid dates.", "mode": "fast-check"} {"id": 57136, "name": "unknown", "code": "it('should return true with a zero-only UInt8Array', () => {\n fc.assert(\n fc.property(fc.uint8Array({ min: 0, max: 0 }), (bytes) => {\n expect(isZero(bytes)).toBe(true)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`isZero` returns true when given a `UInt8Array` consisting only of zeros.", "mode": "fast-check"} {"id": 54543, "name": "unknown", "code": "it('should be able to revert any mapped date correctly even invalid once', () => {\n fc.assert(\n fc.property(fc.date(), fc.integer({ min: -8640000000000000, max: 8640000000000001 }), (d, nanValue) => {\n // Arrange / Act\n const rev = timeToDateUnmapperWithNaN(nanValue)(d);\n const revRev = timeToDateMapperWithNaN(nanValue)(rev);\n\n // Assert\n if (d.getTime() === nanValue) {\n expect(rev).toBe(nanValue);\n expect(revRev.getTime()).toEqual(Number.NaN);\n } else {\n expect(revRev.getTime()).toEqual(d.getTime());\n }\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/mappers/TimeToDate.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Reversing a mapped date, whether valid or invalid, should accurately reflect the original date or return NaN if the original timestamp equals a specified NaN value.", "mode": "fast-check"} {"id": 57140, "name": "unknown", "code": "it('should return a negative value for zero address and any other address', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, (address) => {\n fc.pre(!isZero(address))\n\n expect(compareBytes32Ascending(AddressZero, address)).toBeLessThan(0)\n expect(compareBytes32Ascending(AddressZero, makeBytes32(address))).toBeLessThan(0)\n expect(compareBytes32Ascending(makeBytes32(AddressZero), address)).toBeLessThan(0)\n expect(compareBytes32Ascending(makeBytes32(AddressZero), makeBytes32(address))).toBeLessThan(0)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Comparison of `AddressZero` with any other address should return a negative value using `compareBytes32Ascending` function.", "mode": "fast-check"} {"id": 57141, "name": "unknown", "code": "it('should return a positive value for zero address and any other address', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, (address) => {\n fc.pre(!isZero(address))\n\n expect(compareBytes32Ascending(address, AddressZero)).toBeGreaterThan(0)\n expect(compareBytes32Ascending(makeBytes32(address), AddressZero)).toBeGreaterThan(0)\n expect(compareBytes32Ascending(address, makeBytes32(AddressZero))).toBeGreaterThan(0)\n expect(compareBytes32Ascending(makeBytes32(address), makeBytes32(AddressZero))).toBeGreaterThan(0)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "The comparison function `compareBytes32Ascending` should return a positive value when comparing a non-zero address with the zero address.", "mode": "fast-check"} {"id": 57143, "name": "unknown", "code": "it('should return a negative if address comes after the other address', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, evmAddressArbitrary, (addressA, addressB) => {\n fc.pre(addressA.toLowerCase() > addressB.toLowerCase())\n\n expect(compareBytes32Ascending(addressA, addressB)).toBeGreaterThan(0)\n expect(compareBytes32Ascending(makeBytes32(addressA), addressB)).toBeGreaterThan(0)\n expect(compareBytes32Ascending(addressA, makeBytes32(addressB))).toBeGreaterThan(0)\n expect(compareBytes32Ascending(makeBytes32(addressA), makeBytes32(addressB))).toBeGreaterThan(0)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "When one address comes after another address (case-insensitive), `compareBytes32Ascending` returns a positive number for both original and converted addresses.", "mode": "fast-check"} {"id": 57247, "name": "unknown", "code": "it('should work goddammit', async () => {\n await fc.assert(\n fc.asyncProperty(portArbitrary, anvilOptionsRecordArbitrary, async (port, anvilOptions) => {\n const simulationConfig = resolveSimulationConfig({ port }, hre.config)\n const spec = serializeDockerComposeSpec(createSimulationComposeSpec(simulationConfig, anvilOptions))\n\n await writeFile(SPEC_FILE_PATH, spec)\n\n const result = validateSpec()\n\n expect(result.stderr.toString('utf8')).toBe('')\n expect(result.status).toBe(0)\n }),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/simulation/compose.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "The property validates that a Docker Compose specification, generated from given simulation configurations and options, writes correctly without errors and is valid according to `validateSpec`.", "mode": "fast-check"} {"id": 57249, "name": "unknown", "code": "it('should call the contractFactory if contract is not an OmniPoint', async () => {\n await fc.assert(\n fc.asyncProperty(pointHardhatArbitrary, evmAddressArbitrary, async (point, address) => {\n fc.pre(!isOmniPoint(point))\n\n const contract = new Contract(address, [])\n const contractFactory = jest\n .fn()\n .mockImplementation(async (point: OmniPointHardhat) => ({ eid: point.eid, contract }))\n const transformer = createOmniPointHardhatTransformer(contractFactory)\n\n const transformed = await transformer(point)\n\n expect(transformed).toEqual({ ...point, address })\n expect(contractFactory).toHaveBeenCalledTimes(1)\n expect(contractFactory).toHaveBeenCalledWith(point)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/transformations.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Call `contractFactory` when the given `point` is not an `OmniPoint`.", "mode": "fast-check"} {"id": 57250, "name": "unknown", "code": "it('should add the contractName if point is not an OmniPoint', async () => {\n await fc.assert(\n fc.asyncProperty(pointHardhatArbitrary, evmAddressArbitrary, async (point, address) => {\n fc.pre(!isOmniPoint(point))\n\n const contract = new Contract(address, [])\n const contractFactory = jest\n .fn()\n .mockImplementation(async (point: OmniPointHardhat) => ({ eid: point.eid, contract }))\n const transformer = createOmniPointHardhatTransformer(contractFactory)\n\n const transformed = await transformer(point)\n\n expect(transformed).toEqual({ eid: point.eid, address, contractName: point.contractName })\n expect(contractFactory).toHaveBeenCalledTimes(1)\n expect(contractFactory).toHaveBeenCalledWith(point)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/transformations.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Adds a `contractName` to a point if it is not already an `OmniPoint`, using a transformer function that calls a mocked contract factory.", "mode": "fast-check"} {"id": 57251, "name": "unknown", "code": "it('should call the pointTransformer on the point', async () => {\n await fc.assert(\n fc.asyncProperty(\n pointHardhatArbitrary,\n evmAddressArbitrary,\n fc.anything(),\n async (point, address, config) => {\n fc.pre(!isOmniPoint(point))\n\n const pointTransformer = jest.fn().mockImplementation(async (point: OmniPointHardhat) => ({\n eid: point.eid,\n address: address,\n }))\n const transformer = createOmniNodeHardhatTransformer(pointTransformer)\n\n const node = await transformer({ contract: point, config })\n\n expect(node).toEqual({ point: { eid: point.eid, address }, config })\n expect(pointTransformer).toHaveBeenCalledTimes(1)\n expect(pointTransformer).toHaveBeenCalledWith(point)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/transformations.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "The `pointTransformer` function should be called once with a specified `point` and should transform it correctly into a node with `eid` and `address`, adhering to the expected output.", "mode": "fast-check"} {"id": 57252, "name": "unknown", "code": "it('should call the pointTransformer on from and to', async () => {\n await fc.assert(\n fc.asyncProperty(\n pointHardhatArbitrary,\n pointHardhatArbitrary,\n evmAddressArbitrary,\n fc.anything(),\n async (from, to, address, config) => {\n const pointTransformer = jest.fn().mockImplementation(async (point: OmniPointHardhat) => ({\n eid: point.eid,\n address,\n }))\n const transformer = createOmniEdgeHardhatTransformer(pointTransformer)\n\n const edge = await transformer({ from, to, config })\n\n expect(edge).toEqual({\n vector: { from: { eid: from.eid, address }, to: { eid: to.eid, address } },\n config,\n })\n expect(pointTransformer).toHaveBeenCalledTimes(2)\n expect(pointTransformer).toHaveBeenCalledWith(from)\n expect(pointTransformer).toHaveBeenCalledWith(to)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/transformations.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "The `pointTransformer` should be called twice\u2014once on the `from` point and once on the `to` point\u2014resulting in an edge object with transformed addresses.", "mode": "fast-check"} {"id": 54882, "name": "unknown", "code": "it(\"should always return notice\", async () => {\n const file = \"foo.html\";\n const root = await tempFs.create({ [file]: \"\" });\n const wrapper = new MarkuplintWrapper(\n {\n level: Levels.INFO,\n fix: false,\n root,\n files: [file],\n },\n { rules: { \"attr-value-quotes\": true } },\n );\n\n await fc.assert(\n fc.asyncProperty(\n fc.string({ unit: \"binary\" }),\n async (content) => {\n await fs.writeFile(file, content);\n\n const notices = await wrapper.lint(file);\n for (const notice of notices) {\n assert.equal(notice.file, file);\n assert.equal(notice.linter, \"markuplint\");\n }\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/regseb/metalint/test/fuzz/core/wrapper/markuplint.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "regseb/metalint", "url": "https://github.com/regseb/metalint.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "`MarkuplintWrapper` always returns notices that specify the file as \"foo.html\" and the linter as \"markuplint\" when checking binary string content.", "mode": "fast-check"} {"id": 57253, "name": "unknown", "code": "it('should call the nodeTransformer and edgeTransformer for every node and edge and return the result', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.array(nodeHardhatArbitrary),\n fc.array(edgeHardhatArbitrary),\n async (contracts, connections) => {\n const nodeTransformer = jest.fn().mockImplementation(async (node) => ({ node }))\n const edgeTransformer = jest.fn().mockImplementation(async (edge) => ({ edge }))\n const transformer = createOmniGraphHardhatTransformer(nodeTransformer, edgeTransformer)\n\n const graph = await transformer({ contracts, connections })\n\n expect(graph.contracts).toEqual(contracts.map((node) => ({ node })))\n expect(graph.connections).toEqual(connections.map((edge) => ({ edge })))\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/transformations.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`nodeTransformer` and `edgeTransformer` are applied to each node and edge, respectively, and the results match the expected transformed output.", "mode": "fast-check"} {"id": 57254, "name": "unknown", "code": "it('should support sequential applicative', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.array(nodeHardhatArbitrary),\n fc.array(edgeHardhatArbitrary),\n async (contracts, connections) => {\n const nodeTransformer = jest.fn().mockImplementation(async (node) => ({ node }))\n const edgeTransformer = jest.fn().mockImplementation(async (edge) => ({ edge }))\n const transformerSequential = createOmniGraphHardhatTransformer(\n nodeTransformer,\n edgeTransformer,\n sequence\n )\n const transformerParallel = createOmniGraphHardhatTransformer(\n nodeTransformer,\n edgeTransformer,\n parallel\n )\n\n const graphSequential = await transformerSequential({ contracts, connections })\n const graphParallel = await transformerParallel({ contracts, connections })\n\n expect(graphSequential).toEqual(graphParallel)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/transformations.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "The transformation of graph data with sequential application should produce the same result as parallel application when using the `createOmniGraphHardhatTransformer`.", "mode": "fast-check"} {"id": 57255, "name": "unknown", "code": "it('should just work', () => {\n fc.assert(\n fc.property(endpointArbitrary, evmAddressArbitrary, (eid, address) => {\n const omniDeployment: OmniDeployment = { eid, deployment: { address } as Deployment }\n\n expect(omniDeploymentToPoint(omniDeployment)).toEqual({ eid, address })\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Converting an `OmniDeployment` to a point should correctly map `eid` and `address` to the expected output object.", "mode": "fast-check"} {"id": 57256, "name": "unknown", "code": "it('should just work', () => {\n fc.assert(\n fc.property(endpointArbitrary, evmAddressArbitrary, (eid, address) => {\n const omniDeployment: OmniDeployment = { eid, deployment: { address, abi: [] } as Deployment }\n const omniContract = omniDeploymentToContract(omniDeployment)\n\n // chai is not great with deep equality on class instances so we need to compare the result property by property\n expect(omniContract.eid).toBe(eid)\n expect(omniContract.contract.address).toBe(address)\n expect(omniContract.contract.interface.fragments).toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "The property ensures that converting an `OmniDeployment` to a contract correctly assigns the `eid`, `address`, and an empty `abi` to the resulting `omniContract` instance.", "mode": "fast-check"} {"id": 57257, "name": "unknown", "code": "it('should fall back on getting the artifact based on the deployments if artifact not found', async () => {\n await fc.assert(\n fc.asyncProperty(evmAddressArbitrary, async (address) => {\n const environmentFactory = createGetHreByEid(hre)\n const contractFactory = createContractFactory(environmentFactory)\n\n const env = await environmentFactory(EndpointId.ETHEREUM_V2_MAINNET)\n jest.spyOn(env.deployments, 'getArtifact').mockRejectedValue(new Error(`oh no`))\n jest.spyOn(env.deployments, 'getDeploymentsFromAddress').mockResolvedValue([\n {\n address,\n abi: [],\n },\n ])\n\n // Then check whether the factory will get it for us\n const deployment = await contractFactory({\n eid: EndpointId.ETHEREUM_V2_MAINNET,\n address,\n contractName: 'MyContract',\n })\n\n expect(deployment).toEqual({\n eid: EndpointId.ETHEREUM_V2_MAINNET,\n contract: expect.any(Contract),\n })\n expect(env.deployments.getArtifact).toHaveBeenCalledWith('MyContract')\n expect(env.deployments.getDeploymentsFromAddress).toHaveBeenCalledWith(address)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "If the artifact is not found via `getArtifact`, the test ensures retrieval from `getDeploymentsFromAddress` based on given deployments.", "mode": "fast-check"} {"id": 57258, "name": "unknown", "code": "it('should reject when eid does not exist', async () => {\n await fc.assert(\n fc.asyncProperty(evmAddressArbitrary, async (address) => {\n const contractFactory = createContractFactory()\n\n await expect(() =>\n contractFactory({ eid: EndpointId.CANTO_TESTNET, address })\n ).rejects.toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Rejects contract creation when `eid` does not exist for the given address.", "mode": "fast-check"} {"id": 57259, "name": "unknown", "code": "it('should reject when contract has not been deployed', async () => {\n await fc.assert(\n fc.asyncProperty(evmAddressArbitrary, async (address) => {\n const contractFactory = createContractFactory()\n\n await expect(() =>\n contractFactory({ eid: EndpointId.ETHEREUM_V2_MAINNET, address })\n ).rejects.toThrow(/Could not find a deployment for address/)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "The test checks that attempting to create a contract factory with an address of a non-deployed contract results in a rejection with the specific error message \"Could not find a deployment for address.\"", "mode": "fast-check"} {"id": 57260, "name": "unknown", "code": "it('should resolve when there is only one deployment for the contract', async () => {\n await fc.assert(\n fc.asyncProperty(evmAddressArbitrary, async (address) => {\n const environmentFactory = createGetHreByEid(hre)\n const contractFactory = createContractFactory(environmentFactory)\n\n const env = await environmentFactory(EndpointId.ETHEREUM_V2_MAINNET)\n jest.spyOn(env.deployments, 'getDeploymentsFromAddress').mockResolvedValue([\n {\n address,\n abi: [],\n },\n ])\n\n // Then check whether the factory will get it for us\n const deployment = await contractFactory({\n eid: EndpointId.ETHEREUM_V2_MAINNET,\n address,\n })\n\n expect(deployment).toEqual({\n eid: EndpointId.ETHEREUM_V2_MAINNET,\n contract: expect.any(Contract),\n })\n expect(env.deployments.getDeploymentsFromAddress).toHaveBeenCalledWith(address)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "The test checks that when there is only one deployment for a contract, the contract factory successfully resolves the deployment using the specified environment and address.", "mode": "fast-check"} {"id": 57261, "name": "unknown", "code": "it('should merge ABIs when there are multiple deployments with the same address (proxy deployments)', async () => {\n await fc.assert(\n fc.asyncProperty(evmAddressArbitrary, async (address) => {\n const environmentFactory = createGetHreByEid(hre)\n const contractFactory = createContractFactory(environmentFactory)\n\n const env = await environmentFactory(EndpointId.ETHEREUM_V2_MAINNET)\n jest.spyOn(env.deployments, 'getDeploymentsFromAddress').mockResolvedValue([\n {\n address,\n abi: [\n { name: 'implementation', outputs: [], stateMutability: 'view', type: 'function' },\n ],\n },\n {\n address,\n abi: [\n { name: 'contractMethod', outputs: [], stateMutability: 'view', type: 'function' },\n ],\n },\n ])\n\n // Then check whether the factory will get it for us\n const omniContract = await contractFactory({\n eid: EndpointId.ETHEREUM_V2_MAINNET,\n address,\n })\n\n expect(omniContract).toEqual({\n eid: EndpointId.ETHEREUM_V2_MAINNET,\n contract: expect.any(Contract),\n })\n expect(omniContract.contract.implementation).toBeInstanceOf(Function)\n expect(omniContract.contract.contractMethod).toBeInstanceOf(Function)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Merging multiple ABIs into a single contract when multiple deployments share the same address.", "mode": "fast-check"} {"id": 57262, "name": "unknown", "code": "it('should reject if contractFactory rejects', async () => {\n await fc.assert(\n fc.asyncProperty(pointArbitrary, async (point) => {\n const error = new Error()\n const contractFactory = jest.fn().mockRejectedValue(error)\n const connectedContractFactory = createConnectedContractFactory(contractFactory)\n\n await expect(connectedContractFactory(point)).rejects.toBe(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/contracts.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "The function `createConnectedContractFactory` should reject with an error if `contractFactory` is mocked to reject.", "mode": "fast-check"} {"id": 57264, "name": "unknown", "code": "it('should return a connected contract', async () => {\n await fc.assert(\n fc.asyncProperty(pointArbitrary, async (point) => {\n const contract = new Contract(makeZeroAddress(undefined), [])\n const provider = new JsonRpcProvider()\n const contractFactory = jest.fn().mockResolvedValue({ eid: point.eid, contract })\n const providerFactory = jest.fn().mockResolvedValue(provider)\n const connectedContractFactory = createConnectedContractFactory(contractFactory, providerFactory)\n\n const connectedOmniContract = await connectedContractFactory(point)\n\n expect(connectedOmniContract.eid).toBe(point.eid)\n expect(connectedOmniContract.contract).not.toBe(contract)\n expect(connectedOmniContract.contract).toBeInstanceOf(Contract)\n expect(connectedOmniContract.contract.provider).toBe(provider)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/contracts.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "A connected contract should be created with the correct `eid`, using a new `Contract` instance linked to the correct `provider`.", "mode": "fast-check"} {"id": 57265, "name": "unknown", "code": "it('should not throw if called with an array of networks defined in hardhat config', () => {\n fc.assert(\n fc.property(definedNetworksArrayArbitrary, (networks) => {\n expect(assertDefinedNetworks(networks)).toBe(networks)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/internal/assertions.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`assertDefinedNetworks` should return the networks array when called with an array of networks defined in the hardhat configuration.", "mode": "fast-check"} {"id": 57266, "name": "unknown", "code": "it('should not throw if called with a Set of networks defined in hardhat config', () => {\n fc.assert(\n fc.property(definedNetworksSetArbitrary, (networks) => {\n expect(assertDefinedNetworks(networks)).toBe(networks)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/internal/assertions.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "The function `assertDefinedNetworks` should return the input set of networks when called with networks defined in the hardhat configuration.", "mode": "fast-check"} {"id": 57267, "name": "unknown", "code": "it('should throw if called if a network has not been defined in an array', () => {\n fc.assert(\n fc.property(definedNetworksArrayArbitrary, fc.string(), (networks, network) => {\n fc.pre(!definedNetworks.includes(network))\n\n expect(() => assertDefinedNetworks([...networks, network])).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/internal/assertions.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`assertDefinedNetworks` throws an error if it is called with a network not included in the defined networks array.", "mode": "fast-check"} {"id": 57268, "name": "unknown", "code": "it('should throw if called if a network has not been defined in a Set', () => {\n fc.assert(\n fc.property(definedNetworksSetArbitrary, fc.string(), (networks, network) => {\n fc.pre(!definedNetworks.includes(network))\n\n expect(() => assertDefinedNetworks(networks.add(network))).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/internal/assertions.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "The test checks that calling `assertDefinedNetworks` throws an error when attempting to add a network that is not included in `definedNetworks`.", "mode": "fast-check"} {"id": 57269, "name": "unknown", "code": "it('should throw if negative index is passed', () => {\n fc.assert(\n fc.property(fc.integer({ max: -1 }), (index) => {\n expect(() => signer.parse('signer', String(index))).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/cli.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Passing a negative index to the `signer.parse` function should throw an error.", "mode": "fast-check"} {"id": 57270, "name": "unknown", "code": "it('should return the address if valid address is passed', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, (address) => {\n expect(signer.parse('signer', address)).toEqual({ type: 'address', address })\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/cli.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "The test checks that the `signer.parse` function returns an object with a valid address when a valid address is passed.", "mode": "fast-check"} {"id": 57271, "name": "unknown", "code": "it('should return the index if non-negative index is passed', () => {\n fc.assert(\n fc.property(fc.integer({ min: 0 }), (index) => {\n expect(signer.parse('signer', String(index))).toEqual({ type: 'index', index })\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/cli.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "A non-negative integer index parsed by `signer.parse` should return an object with the same index and type 'index'.", "mode": "fast-check"} {"id": 57272, "name": "unknown", "code": "it('should parse all valid endpoint IDs', () => {\n fc.assert(\n fc.property(endpointArbitrary, (eid) => {\n expect(types.eid.parse('eid', String(eid))).toEqual(eid)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/cli.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Parsing should correctly convert valid endpoint IDs using `types.eid.parse`.", "mode": "fast-check"} {"id": 57277, "name": "unknown", "code": "it(\"should convert principal\", () => {\n fc.assert(\n fc.property(generators, (expected) => {\n const principal = publicKeyToAddress(expected.hex);\n\n const resultStandard = stringToCV(principal, \"principal\");\n expect(resultStandard.type).toEqual(\"principal\");\n expect(resultStandard.value).toBePrincipal(principal);\n\n const contract = `${principal}.${expected.name}`;\n const resultContract = stringToCV(contract, \"principal\");\n expect(resultContract.type).toEqual(\"principal\");\n expect(resultContract.value).toStrictEqual(principalCV(contract));\n })\n );\n })", "language": "typescript", "source_file": "./repos/stacks-network/clarunit/tests/string-to-cv.prop.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "stacks-network/clarunit", "url": "https://github.com/stacks-network/clarunit.git", "license": "MIT", "stars": 5, "forks": 7}, "metrics": null, "summary": "Converting a principal or contract string representation using `stringToCV` should produce a CV of type \"principal\" matching the expected principal or contract.", "mode": "fast-check"} {"id": 57279, "name": "unknown", "code": "it(\"should parse with simple annotations\", () => {\n fc.assert(fc.property(generators, (expected) => {\n const result = extractTestAnnotations(\n `\n;; @name ${expected.name}\n(define-public (${expected.functionName})\n ;; @mine-before is ignored here\n (ok true))\n`\n );\n expect(result[expected.functionName]).toEqual({\n name: expected.name,\n });\n }));\n })", "language": "typescript", "source_file": "./repos/stacks-network/clarunit/tests/clarity-parser.prop.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "stacks-network/clarunit", "url": "https://github.com/stacks-network/clarunit.git", "license": "MIT", "stars": 5, "forks": 7}, "metrics": null, "summary": "Parsing should correctly identify and extract `@name` annotations associated with function names.", "mode": "fast-check"} {"id": 57280, "name": "unknown", "code": "it(\"should parse with all annotations\", () => {\n fc.assert(fc.property(fc.uniqueArray(generators), (array) => {\n const contractSource = array\n .map((expected) =>\n `\n;; @name ${expected.name}\n;; @description ${expected.description}\n;; @mine-before ${expected.mineBefore}\n;; @caller ${expected.caller}\n(define-public (${expected.functionName})\n (ok true))\n`\n )\n .join();\n\n const result = extractTestAnnotations(contractSource);\n\n array.forEach(expected => {\n expect(result[expected.functionName]).toEqual({\n name: expected.name,\n description: expected.description,\n \"mine-before\": expected.mineBefore,\n caller: expected.caller,\n });\n });\n }));\n })", "language": "typescript", "source_file": "./repos/stacks-network/clarunit/tests/clarity-parser.prop.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "stacks-network/clarunit", "url": "https://github.com/stacks-network/clarunit.git", "license": "MIT", "stars": 5, "forks": 7}, "metrics": null, "summary": "Parsing extracts expected annotations from contract source strings containing name, description, mine-before, and caller fields for each function.", "mode": "fast-check"} {"id": 57281, "name": "unknown", "code": "it(\"should convert string to cv\", () => {\n fc.assert(\n fc.property(fc.string(), (someStr) => {\n const result = stringToCV(someStr, { \"string-utf8\": { length: 100 } });\n expect(result).toEqual({\n type: \"string\",\n value: stringUtf8CV(someStr),\n });\n })\n );\n })", "language": "typescript", "source_file": "./repos/stacks-network/clarunit/tests/clarity-parser-string-to-cv.prop.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "stacks-network/clarunit", "url": "https://github.com/stacks-network/clarunit.git", "license": "MIT", "stars": 5, "forks": 7}, "metrics": null, "summary": "Converting a string to CV results in an object with a type of \"string\" and a value from `stringUtf8CV` of the original string.", "mode": "fast-check"} {"id": 57282, "name": "unknown", "code": "it(\"should convert uint to cv\", () => {\n fc.assert(\n fc.property(uint128, (someUInt) => {\n const result = stringToCV(`u${someUInt}`, \"uint128\");\n expect(result).toEqual({\n type: \"uint\",\n value: uintCV(someUInt),\n });\n })\n );\n })", "language": "typescript", "source_file": "./repos/stacks-network/clarunit/tests/clarity-parser-string-to-cv.prop.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "stacks-network/clarunit", "url": "https://github.com/stacks-network/clarunit.git", "license": "MIT", "stars": 5, "forks": 7}, "metrics": null, "summary": "The function `stringToCV` should correctly convert a string representation of a uint into a cv with the type \"uint\" and the corresponding value.", "mode": "fast-check"} {"id": 57283, "name": "unknown", "code": "it(\"should convert tuple to cv\", () => {\n fc.assert(\n fc.property(\n fc.record({\n key: fc.stringMatching(/^[a-zA-Z][a-zA-Z0-9]{0,9}$/),\n val: int128,\n }),\n (r) => {\n const result = stringToCV(`{${r.key}: ${r.val}}`, {\n tuple: [{ name: r.key, type: \"int128\" }],\n });\n expect(result).toEqual({\n type: \"tuple\",\n value: {\n value: { [r.key]: intCV(r.val) },\n type: ClarityType.Tuple,\n },\n });\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/stacks-network/clarunit/tests/clarity-parser-string-to-cv.prop.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "stacks-network/clarunit", "url": "https://github.com/stacks-network/clarunit.git", "license": "MIT", "stars": 5, "forks": 7}, "metrics": null, "summary": "A tuple string representation is converted to a Clarity Value (CV) tuple with an `int128` value using `stringToCV`.", "mode": "fast-check"} {"id": 57286, "name": "unknown", "code": "it('Can get an age group given a numerical age', () => {\n\t\tfc.assert(\n\t\t\tfc.property(\n\t\t\t\tfc.float(),\n\t\t\t\t(age: number) => typeof convertAgeToGroup(age) === 'string'\n\t\t\t)\n\t\t);\n\n\t\t// @ts-ignore\n\t\texpect(convertAgeToGroup(undefined)).toEqual('n/a');\n\t\texpect(convertAgeToGroup(-1)).toEqual('n/a');\n\t})", "language": "typescript", "source_file": "./repos/Elsa-Health/model-runtime/test/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Elsa-Health/model-runtime", "url": "https://github.com/Elsa-Health/model-runtime.git", "license": "Apache-2.0", "stars": 2, "forks": 1}, "metrics": null, "summary": "`convertAgeToGroup` should return a string for any numerical age input, and \"n/a\" for undefined or negative age inputs.", "mode": "fast-check"} {"id": 57291, "name": "unknown", "code": "it('Creates a cauchy variable', () => {\n\t\tfc.assert(\n\t\t\tfc.property(\n\t\t\t\tfc.float(),\n\t\t\t\tfc.float({ next: false, min: 0.01 }),\n\t\t\t\t(a, b) => {\n\t\t\t\t\tconst rv = createCauchy('testCauchy', a, b);\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\trv._.dist === 'cauchy' &&\n\t\t\t\t\t\trv.scale === b &&\n\t\t\t\t\t\trv.location === a\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t)\n\t\t);\n\t})", "language": "typescript", "source_file": "./repos/Elsa-Health/model-runtime/test/lib/distributions.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Elsa-Health/model-runtime", "url": "https://github.com/Elsa-Health/model-runtime.git", "license": "Apache-2.0", "stars": 2, "forks": 1}, "metrics": null, "summary": "Creating a Cauchy variable correctly assigns the distribution type as 'cauchy', and sets the location and scale parameters according to the inputs.", "mode": "fast-check"} {"id": 57292, "name": "unknown", "code": "it(\"should filter duplicates\", () => {\n fc.assert(\n fc.property(arbDomainName, (packumentName) => {\n let registry = makeScopedRegistry(\"test\", someRegistryUrl);\n\n registry = addScope(registry, packumentName);\n registry = addScope(registry, packumentName);\n\n expect(registry.scopes).toEqual([packumentName]);\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/scoped-registry.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "The test checks that adding the same scope twice to a registry results in no duplicates, ensuring the `scopes` list contains only one instance of the `packumentName`.", "mode": "fast-check"} {"id": 57293, "name": "unknown", "code": "it(\"should have scope that was added\", () => {\n fc.assert(\n fc.property(arbDomainName, (packumentName) => {\n let registry = makeScopedRegistry(\"test\", someRegistryUrl);\n\n registry = addScope(registry, packumentName);\n\n expect(hasScope(registry, packumentName)).toBeTruthy();\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/scoped-registry.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "A scope added to a registry should be confirmed as present using `hasScope`.", "mode": "fast-check"} {"id": 57294, "name": "unknown", "code": "it(\"should not have scope that was not added\", () => {\n fc.assert(\n fc.property(arbDomainName, (packumentName) => {\n const registry = makeScopedRegistry(\"test\", someRegistryUrl);\n\n expect(hasScope(registry, packumentName)).toBeFalsy();\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/scoped-registry.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "Verifies that a newly created scoped registry does not contain any scope that was not explicitly added.", "mode": "fast-check"} {"id": 57295, "name": "unknown", "code": "it(\"should not have scope after removing it\", () => {\n fc.assert(\n fc.property(arbDomainName, (packumentName) => {\n let registry = makeScopedRegistry(\"test\", someRegistryUrl, [\n packumentName,\n ]);\n\n registry = removeScope(registry, packumentName);\n\n expect(hasScope(registry, packumentName)).toBeFalsy();\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/scoped-registry.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "Removing a scope from a registry should result in `hasScope` returning false for that scope.", "mode": "fast-check"} {"id": 57296, "name": "unknown", "code": "it(\"should remove duplicate scopes\", () => {\n fc.assert(\n fc.property(arbDomainName, (packumentName) => {\n let registry = makeScopedRegistry(\"test\", someRegistryUrl, [\n packumentName,\n packumentName,\n ]);\n\n registry = removeScope(registry, packumentName);\n\n expect(registry.scopes).toHaveLength(0);\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/scoped-registry.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "Ensures duplicate scopes are removed from a scoped registry, resulting in no remaining scopes.", "mode": "fast-check"} {"id": 57297, "name": "unknown", "code": "it(\"should add dependency when adding first time\", () => {\n fc.assert(\n fc.property(arbDomainName, (packumentName) => {\n let manifest = emptyProjectManifest;\n\n manifest = setDependency(\n manifest,\n packumentName,\n SemanticVersion.parse(\"1.2.3\")\n );\n\n expect(manifest.dependencies).toEqual({ [packumentName]: \"1.2.3\" });\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/project-manifest.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "Adding a dependency for the first time results in the dependency appearing in the manifest with the specified version.", "mode": "fast-check"} {"id": 57298, "name": "unknown", "code": "it(\"should overwrite dependency when adding second time\", () => {\n fc.assert(\n fc.property(arbDomainName, (packumentName) => {\n let manifest = emptyProjectManifest;\n\n manifest = setDependency(\n manifest,\n packumentName,\n SemanticVersion.parse(\"1.2.3\")\n );\n manifest = setDependency(\n manifest,\n packumentName,\n SemanticVersion.parse(\"2.3.4\")\n );\n\n expect(manifest.dependencies).toEqual({ [packumentName]: \"2.3.4\" });\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/project-manifest.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "Adding a dependency with the same name updates the version in the project manifest to the latest specified version.", "mode": "fast-check"} {"id": 57299, "name": "unknown", "code": "it(\"should remove existing dependency\", () => {\n fc.assert(\n fc.property(arbDomainName, (packumentName) => {\n let manifest = emptyProjectManifest;\n\n manifest = setDependency(\n manifest,\n packumentName,\n SemanticVersion.parse(\"1.2.3\")\n );\n manifest = removeDependency(manifest, packumentName);\n\n expect(manifest.dependencies).toEqual({});\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/project-manifest.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "Removing a dependency should result in an empty dependencies object in the manifest.", "mode": "fast-check"} {"id": 57303, "name": "unknown", "code": "it(\"should remove scope from all scoped registries\", () => {\n fc.assert(\n fc.property(arbDomainName, arbDomainName, (scope1, scope2) => {\n const original: UnityProjectManifest = {\n dependencies: {},\n scopedRegistries: [\n {\n name: \"Scope A\",\n url: RegistryUrl.parse(\"https://a.com\"),\n scopes: [scope1],\n },\n {\n name: \"Scope B\",\n url: RegistryUrl.parse(\"https://b.com\"),\n scopes: [scope1, scope2],\n },\n ],\n };\n\n const actual = removeScopeFromAllScopedRegistries(original, scope1);\n\n expect(actual).toEqual({\n dependencies: {},\n scopedRegistries: [\n {\n name: \"Scope A\",\n url: RegistryUrl.parse(\"https://a.com\"),\n scopes: [],\n },\n {\n name: \"Scope B\",\n url: RegistryUrl.parse(\"https://b.com\"),\n scopes: [scope2],\n },\n ],\n });\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/project-manifest.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "The function `removeScopeFromAllScopedRegistries` should remove a specified scope from all `scopedRegistries` in a `UnityProjectManifest`.", "mode": "fast-check"} {"id": 57304, "name": "unknown", "code": "it(\"should leave non-empty scoped registries\", () => {\n fc.assert(\n fc.property(arbDomainName, (scope) => {\n const original: UnityProjectManifest = {\n dependencies: {},\n scopedRegistries: [\n {\n name: \"Scope A\",\n url: RegistryUrl.parse(\"https://a.com\"),\n scopes: [scope],\n },\n ],\n };\n\n const actual = removeEmptyScopedRegistries(original);\n\n expect(actual).toEqual(original);\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/project-manifest.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "The function `removeEmptyScopedRegistries` should not alter a `UnityProjectManifest` if it contains non-empty scoped registries.", "mode": "fast-check"} {"id": 57305, "name": "unknown", "code": "it('should have no effect for undefined \"testables\"', () => {\n fc.assert(\n fc.property(arbDomainName, (packageName) => {\n const original: UnityProjectManifest = { dependencies: {} };\n\n const actual = removeTestable(original, packageName);\n\n expect(actual).toEqual(original);\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/project-manifest.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "Removing a package in `removeTestable` should have no effect if \"testables\" is undefined in `original`.", "mode": "fast-check"} {"id": 57306, "name": "unknown", "code": "it(\"should remove testable\", () => {\n fc.assert(\n fc.property(arbDomainName, (packageName) => {\n const original: UnityProjectManifest = {\n dependencies: {},\n testables: [packageName],\n };\n\n const actual = removeTestable(original, packageName);\n\n expect(actual).toEqual({\n dependencies: {},\n testables: [],\n });\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/project-manifest.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "`removeTestable` removes a specified package name from the `testables` list in a `UnityProjectManifest`.", "mode": "fast-check"} {"id": 57307, "name": "unknown", "code": "it(\"should be ok for http\", () => {\n fc.assert(\n fc.property(arbDomainName, (packumentName) => {\n const input = `http://github.com/user/${{ packumentName }}`;\n expect(isZod(input, PackageUrl)).toBeTruthy();\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/package-url.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "Validates that a URL with the HTTP scheme and a given domain name is considered valid by the `isZod` function with the `PackageUrl` object.", "mode": "fast-check"} {"id": 57308, "name": "unknown", "code": "it(\"should be ok for https\", () => {\n fc.assert(\n fc.property(arbDomainName, (packumentName) => {\n const input = `https://github.com/user/${{ packumentName }}`;\n expect(isZod(input, PackageUrl)).toBeTruthy();\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/package-url.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "URLs with the structure `https://github.com/user/{packumentName}` should be valid according to `PackageUrl`.", "mode": "fast-check"} {"id": 57309, "name": "unknown", "code": "it(\"should be ok for git\", () => {\n fc.assert(\n fc.property(arbDomainName, (packumentName) => {\n const input = `git@github:user/${{ packumentName }}`;\n expect(isZod(input, PackageUrl)).toBeTruthy();\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/package-url.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "`isZod` should return true for inputs formatted as Git URLs with domain names.", "mode": "fast-check"} {"id": 57316, "name": "unknown", "code": "it(\"should be ok for name with latest tag\", () => {\n fc.assert(\n fc.property(arbDomainName, (packumentName) => {\n const input = `${packumentName}@latest`;\n expect(isPackageSpec(input)).toBeTruthy();\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/package-spec.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "`isPackageSpec` should return true for package names combined with the `@latest` tag.", "mode": "fast-check"} {"id": 57317, "name": "unknown", "code": "it(\"should split package without version\", () =>\n fc.assert(\n fc.property(arbDomainName, (packageName) =>\n shouldSplitCorrectly(packageName)\n )\n ))", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/package-spec.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "Packages are split correctly when no version is provided.", "mode": "fast-check"} {"id": 57318, "name": "unknown", "code": "it(\"should split package with semantic version\", () =>\n fc.assert(\n fc.property(arbDomainName, arbSemanticVersion, (packageName, version) =>\n shouldSplitCorrectly(packageName, version)\n )\n ))", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/package-spec.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "`shouldSplitCorrectly` ensures a package with a semantic version is split appropriately.", "mode": "fast-check"} {"id": 57319, "name": "unknown", "code": "it(\"should split package with package-url\", () =>\n fc.assert(\n fc.property(arbDomainName, arbPackageUrl, (packageName, version) =>\n shouldSplitCorrectly(packageName, version)\n )\n ))", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/package-spec.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "The function verifies that a package with a package URL is split correctly using given domain names and package URLs.", "mode": "fast-check"} {"id": 57320, "name": "unknown", "code": "it(\"should be ok for name with semantic version\", () => {\n fc.assert(\n fc.property(arbDomainName, (packumentName) => {\n const input = `${packumentName}@1.2.3`;\n expect(isPackageId(input)).toBeTruthy();\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/package-id.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "The function `isPackageId` should return true for names appended with a semantic version like `@1.2.3`.", "mode": "fast-check"} {"id": 57321, "name": "unknown", "code": "it(\"should not be ok for just name\", () => {\n fc.assert(\n fc.property(arbDomainName, (packumentName) =>\n expect(isPackageId(packumentName)).toBeFalsy()\n )\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/package-id.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "`isPackageId` should return false for a domain name.", "mode": "fast-check"} {"id": 57322, "name": "unknown", "code": "it(\"should return error for package that is not in manifest\", () => {\n fc.assert(\n fc.property(arbManifest, arbDomainName, (manifest, packageName) => {\n // In the rare case where the manifest has the dependency we cancel\n // the test.\n if (hasDependency(manifest, packageName)) return;\n\n const error = tryRemoveProjectDependency(\n manifest,\n packageName\n ).unwrapErr();\n\n expect(error).toEqual(new PackumentNotFoundError(packageName));\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/dependency-management.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "Attempting to remove a package not listed in a manifest should result in a `PackumentNotFoundError`.", "mode": "fast-check"} {"id": 57323, "name": "unknown", "code": "it(\"should remove dependency\", () => {\n fc.assert(\n fc.property(arbNonEmptyManifest, (manifest) => {\n const packageName = recordKeys(manifest.dependencies)[0]!;\n\n const [updated] = tryRemoveProjectDependency(\n manifest,\n packageName\n ).unwrap();\n\n const hasDependency = recordKeys(updated.dependencies).includes(\n packageName\n );\n expect(hasDependency).toBeFalsy();\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/dependency-management.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "Removing a dependency from a non-empty manifest should result in the dependency being absent in the updated manifest.", "mode": "fast-check"} {"id": 57324, "name": "unknown", "code": "it(\"should return removed version\", () => {\n fc.assert(\n fc.property(arbNonEmptyManifest, (manifest) => {\n const packageName = recordKeys(manifest.dependencies)[0]!;\n const versionInManifest = manifest.dependencies[packageName]!;\n\n const [, removedPackage] = tryRemoveProjectDependency(\n manifest,\n packageName\n ).unwrap();\n\n expect(removedPackage).toEqual({\n name: packageName,\n version: versionInManifest,\n });\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/dependency-management.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "Checking that `tryRemoveProjectDependency` returns the removed package with its original name and version from the manifest.", "mode": "fast-check"} {"id": 54557, "name": "unknown", "code": "it('should accept any subdomain composed of only alphabet characters and with at most 63 characters', () =>\n fc.assert(\n fc.property(fc.string({ unit: alphaChar(), minLength: 1, maxLength: 63 }), (subdomainLabel) => {\n expect(filterInvalidSubdomainLabel(subdomainLabel)).toBe(true);\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/helpers/InvalidSubdomainLabelFiIter.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`filterInvalidSubdomainLabel` accepts subdomains composed solely of alphabetic characters with lengths up to 63 characters.", "mode": "fast-check"} {"id": 57326, "name": "unknown", "code": "it(\"should remove empty scoped registries\", () => {\n fc.assert(\n fc.property(arbManifestWithDependencyCount(1), (manifest) => {\n const originalScopedRegistryUrl = manifest.scopedRegistries![0]!.url;\n // Add a second scoped registry so that at least one non-empty registry\n // will remain in the manifest. Otherwise it would fully remove the\n // scoped registries property.\n const otherRegistry = RegistryUrl.parse(\"http://other.registry\");\n manifest = mapScopedRegistry(manifest, otherRegistry, () =>\n makeScopedRegistry(\"Other registry\", otherRegistry, [\n DomainName.parse(\"com.some.package\"),\n ])\n );\n const packageName = recordKeys(manifest.dependencies)[0]!;\n\n const [updated] = tryRemoveProjectDependency(\n manifest,\n packageName\n ).unwrap();\n\n const hasOriginalScopedRegistry = updated.scopedRegistries!.some(\n (it) => it.url === originalScopedRegistryUrl\n );\n expect(hasOriginalScopedRegistry).toBeFalsy();\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/dependency-management.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "Removing a project dependency with `tryRemoveProjectDependency` should eliminate empty scoped registries from the manifest, ensuring that the original scoped registry is no longer present.", "mode": "fast-check"} {"id": 54561, "name": "unknown", "code": "it('should be equal to the sum of fibo(n-1) and fibo(n-2)', () => {\n fc.assert(\n fc.property(fc.integer({ min: 2, max: MaxN }), (n) => {\n expect(fibo(n)).toBe(fibo(n - 1) + fibo(n - 2));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/001-simple/fibonacci/main.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`fibo(n)` should equal the sum of `fibo(n-1)` and `fibo(n-2)` for integers `n` greater than or equal to 2.", "mode": "fast-check"} {"id": 54562, "name": "unknown", "code": "it('should fulfill fibo(p)*fibo(q+1)+fibo(p-1)*fibo(q) = fibo(p+q)', () => {\n fc.assert(\n fc.property(fc.integer({ min: 1, max: MaxN }), fc.integer({ min: 0, max: MaxN }), (p, q) => {\n expect(fibo(p + q)).toBe(fibo(p) * fibo(q + 1) + fibo(p - 1) * fibo(q));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/001-simple/fibonacci/main.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The equality `fibo(p) * fibo(q + 1) + fibo(p - 1) * fibo(q) = fibo(p + q)` holds for Fibonacci numbers.", "mode": "fast-check"} {"id": 57329, "name": "unknown", "code": "it(\"should remove testables property if empty\", () => {\n fc.assert(\n fc.property(arbManifestWithDependencyCount(1), (manifest) => {\n const packageName = recordKeys(manifest.dependencies)[0]!;\n\n const [updated] = tryRemoveProjectDependency(\n manifest,\n packageName\n ).unwrap();\n\n expect(updated.testables).not.toBeDefined();\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/dependency-management.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "Removing a project dependency should result in the `testables` property being undefined if it was empty.", "mode": "fast-check"} {"id": 57330, "name": "unknown", "code": "it(\"should have no effect for empty package list\", () => {\n fc.assert(\n fc.property(arbManifest, (manifest) => {\n const [updated] = tryRemoveProjectDependencies(manifest, []).unwrap();\n\n expect(updated).toEqual(manifest);\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/dependency-management.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "Removing dependencies from a manifest with an empty package list should result in no changes to the manifest.", "mode": "fast-check"} {"id": 54564, "name": "unknown", "code": "it('should fulfill Catalan identity', () => {\n fc.assert(\n fc.property(fc.integer({ min: 0, max: MaxN }), fc.integer({ min: 0, max: MaxN }), (a, b) => {\n const [p, q] = a < b ? [b, a] : [a, b];\n const sign = (p - q) % 2 === 0 ? 1n : -1n; // (-1)^(p-q)\n expect(fibo(p) * fibo(p) - fibo(p - q) * fibo(p + q)).toBe(sign * fibo(q) * fibo(q));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/001-simple/fibonacci/main.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The Fibonacci function should satisfy the Catalan identity for non-negative integers \\(a\\) and \\(b\\), where \\(a \\geq b\\).", "mode": "fast-check"} {"id": 57331, "name": "unknown", "code": "it(\"should remove packages\", () => {\n fc.assert(\n fc.property(arbManifestWithDependencyCount(10), (manifest) => {\n const packagesToRemove = recordKeys(manifest.dependencies).slice(\n 0,\n 5\n );\n\n const [updated, removed] = tryRemoveProjectDependencies(\n manifest,\n packagesToRemove\n ).unwrap();\n\n // Here we only do some surface level tests to check that the\n // packages were removed correctly. More detailed tests are in\n // the section for the \"remove single\" function because the\n // \"remove multiple\" version uses that internally.\n\n packagesToRemove.forEach((it) => {\n const hasDependency = recordKeys(updated.dependencies).includes(it);\n expect(hasDependency).toEqual(false);\n });\n expect(removed.map((it) => it.name)).toEqual(packagesToRemove);\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/dependency-management.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "`tryRemoveProjectDependencies` should correctly remove specified packages from a manifest's dependencies.", "mode": "fast-check"} {"id": 57333, "name": "unknown", "code": "it(\"should have dependency after adding\", () => {\n fc.assert(\n fc.property(\n arbManifest,\n arbDomainName,\n abrDependencyVersion,\n (manifest, packageName, version) => {\n const [updated] = addProjectDependency(\n manifest,\n packageName,\n version\n );\n\n expect(updated.dependencies?.[packageName]).toEqual(version);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/dependency-management.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "Adding a project dependency results in the manifest containing the dependency with the specified version.", "mode": "fast-check"} {"id": 54565, "name": "unknown", "code": "it('should fulfill Cassini identity', () => {\n fc.assert(\n fc.property(fc.integer({ min: 1, max: MaxN }), (p) => {\n const sign = p % 2 === 0 ? 1n : -1n; // (-1)^p\n expect(fibo(p + 1) * fibo(p - 1) - fibo(p) * fibo(p)).toBe(sign);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/001-simple/fibonacci/main.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The test verifies that the Cassini identity holds for Fibonacci numbers, ensuring \\( \\text{fibo}(p+1) \\times \\text{fibo}(p-1) - \\text{fibo}(p)^2 \\) equals \\( (-1)^p \\).", "mode": "fast-check"} {"id": 54566, "name": "unknown", "code": "it('should fibo(nk) divisible by fibo(n)', () => {\n fc.assert(\n fc.property(fc.integer({ min: 1, max: MaxN }), fc.integer({ min: 0, max: 100 }), (n, k) => {\n expect(fibo(n * k) % fibo(n)).toBe(0n);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/001-simple/fibonacci/main.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`fibo(n * k)` should be divisible by `fibo(n)`.", "mode": "fast-check"} {"id": 57335, "name": "unknown", "code": "it(\"should have correct change for updated dependency\", () => {\n fc.assert(\n fc.property(\n arbManifest,\n arbDomainName,\n abrDependencyVersion,\n abrDependencyVersion,\n (manifest, packageName, previousVersion, version) => {\n // If generated versions are equal, we cancel the test\n if (previousVersion === version) return;\n\n // Add previous version\n manifest = addProjectDependency(\n manifest,\n packageName,\n previousVersion\n )[0];\n\n const [, change] = addProjectDependency(\n manifest,\n packageName,\n version\n );\n\n expect(change).toEqual({\n type: \"upgraded\",\n fromVersion: previousVersion,\n toVersion: version,\n });\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/dependency-management.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "Updating a dependency in a manifest should reflect a change of type \"upgraded\" with correct `fromVersion` and `toVersion` details.", "mode": "fast-check"} {"id": 54571, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\tawait handler(event, context);\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/s3-object-response/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 54572, "name": "unknown", "code": "test(\"fuzz `event` w/ `record`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(\n\t\t\tfc.record({\n\t\t\t\tgetObjectContext: fc.record({\n\t\t\t\t\tinputS3Url: fc.webUrl(),\n\t\t\t\t\toutputRoute: fc.webUrl(),\n\t\t\t\t\toutputToken: fc.string(),\n\t\t\t\t}),\n\t\t\t\tBody: fc.string(),\n\t\t\t}),\n\t\t\tasync (event) => {\n\t\t\t\tawait handler(event, context);\n\t\t\t},\n\t\t),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/s3-object-response/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": "The handler processes a fuzzed event with nested `getObjectContext` and `Body` properties without errors.", "mode": "fast-check"} {"id": 57338, "name": "unknown", "code": "it(\"should transform repo\", async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.string(), // name\n fc.string(), // html_url\n fc.option(fc.webUrl()), // homepage\n fc.option(fc.string()), // description?\n fc.option(fc.string()), // language?\n fc.boolean(), // fork\n fc.option(\n // source?\n fc.record({\n full_name: fc.string(),\n html_url: fc.string(),\n })\n ),\n fc.integer(), // stargazers_count\n fc.integer(), // forks\n async (name, url, hp, desc, lang, frk, src, sg, frks) => {\n const hpr = hp ? hp : \"\";\n const raw = buildRaw(name, url, hpr, desc, lang, frk, src, sg, frks);\n const repo = buildRepo(name, url, hp, desc, lang, frk, src, sg, frks);\n\n if (lang != null) {\n fetchColors.mockResolvedValue({\n [lang]: { color: \"the-color\", url: \"\" },\n });\n }\n\n const n = nock(\"https://api.github.com/repos\")\n .get(`/${slug}`)\n .reply(200, raw);\n\n await expect(getRepo(slug)).resolves.toStrictEqual(repo);\n\n n.done();\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/thislooksfun/svelte-repo-card/test/util/repo.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "thislooksfun/svelte-repo-card", "url": "https://github.com/thislooksfun/svelte-repo-card.git", "license": "MIT", "stars": 6, "forks": 1}, "metrics": null, "summary": "It verifies that transforming a repository data structure with various potential input combinations results in the expected output format when fetched from an external GitHub API.", "mode": "fast-check"} {"id": 54577, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\tawait handler(event, context);\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/warmup/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 54579, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\tawait handler(event, context);\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/http-partial-response/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 54580, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\tawait handler(event, context);\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/sts/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 54584, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\tawait handler(event, context);\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/http-urlencode-path-parser/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 54578, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\ttry {\n\t\t\t\tawait handler(event, context);\n\t\t\t} catch (e) {\n\t\t\t\tif (e.cause?.package !== \"@middy/validator\") {\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/validator/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": "The handler function processes various objects without errors, unless the error is specifically caused by the \"@middy/validator\" package.", "mode": "fast-check"} {"id": 57339, "name": "unknown", "code": "it(\"renders the card correctly\", async () => {\n await fc.assert(\n fc.asyncProperty(randomRepo(), async repo => {\n // Reset the DOM, to ensure a clean slate during fast-check.\n resetDOM();\n const slug = `thislooksfun/${repo.name}`;\n fetchRepo.mockResolvedValue(repo);\n\n const { getByTestId, queryByTestId } = render(RepoCard, { slug });\n\n // Loading\n const loading = getByTestId(\"loading\");\n expect(loading).toBeInTheDocument();\n await waitForElementToBeRemoved(loading);\n expect(loading).not.toBeInTheDocument();\n\n // Render\n const name = getByTestId(\"repo-name\");\n expect(name).toBeInTheDocument();\n expect(name.textContent).toEqual(repo.name);\n\n if (repo.isFork) {\n expect(getByTestId(\"fork\")).toBeInTheDocument();\n const link = getByTestId(\"fork-link\");\n expect(link).toBeInTheDocument();\n expect(link.getAttribute(\"href\")).toEqual(repo.sourceUrl);\n expect(link.textContent).toEqual(repo.sourceName);\n } else {\n expect(queryByTestId(\"fork\")).not.toBeInTheDocument();\n }\n\n if (repo.description) {\n const desc = getByTestId(\"description\");\n expect(desc).toBeInTheDocument();\n expect(desc.textContent).toEqual(repo.description);\n } else {\n expect(queryByTestId(\"description\")).not.toBeInTheDocument();\n }\n\n if (repo.language) {\n expect(getByTestId(\"language\")).toBeInTheDocument();\n const lang = getByTestId(\"lang-name\");\n expect(lang).toBeInTheDocument();\n expect(lang.textContent).toEqual(repo.language);\n } else {\n expect(queryByTestId(\"language\")).not.toBeInTheDocument();\n }\n\n if (repo.stars > 0) {\n expect(getByTestId(\"stars\")).toBeInTheDocument();\n const sc = getByTestId(\"star-count\");\n expect(sc).toBeInTheDocument();\n expect(sc.textContent).toEqual(`${repo.stars}`);\n } else {\n expect(queryByTestId(\"stars\")).not.toBeInTheDocument();\n }\n\n if (repo.forks > 0) {\n expect(getByTestId(\"forks\")).toBeInTheDocument();\n const fc = getByTestId(\"fork-count\");\n expect(fc).toBeInTheDocument();\n expect(fc.textContent).toEqual(`${repo.forks}`);\n } else {\n expect(queryByTestId(\"forks\")).not.toBeInTheDocument();\n }\n\n if (repo.homepage) {\n expect(getByTestId(\"homepage\")).toBeInTheDocument();\n const hl = getByTestId(\"homepage-link\");\n expect(hl).toBeInTheDocument();\n expect(hl.getAttribute(\"href\")).toEqual(repo.homepage);\n expect(hl.textContent).toEqual(repo.homepage);\n } else {\n expect(queryByTestId(\"homepage\")).not.toBeInTheDocument();\n }\n })\n );\n})", "language": "typescript", "source_file": "./repos/thislooksfun/svelte-repo-card/test/RepoCard.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "thislooksfun/svelte-repo-card", "url": "https://github.com/thislooksfun/svelte-repo-card.git", "license": "MIT", "stars": 6, "forks": 1}, "metrics": null, "summary": "RepoCard component renders a repository's information correctly, including name, fork status, description, language, stars, forks, and homepage, based on the given repository data.", "mode": "fast-check"} {"id": 54585, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\tawait handler(event, context);\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/http-event-normalizer/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": "The test runs the `handler` function with randomized `event` objects to ensure it handles various object structures without errors.", "mode": "fast-check"} {"id": 54588, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\tawait handler(event, context);\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/input-output-logger/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 54589, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\tawait handler(event, context);\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/service-discovery/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 54590, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\tawait handler(event, context);\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/secrets-manager/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 54591, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\tawait handler(event, context);\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/http-error-handler/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 54592, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\tawait handler(event, context);\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/http-header-normalizer/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 54594, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\tawait handler(event, context);\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/s3/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 54595, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\tawait handler(event, context);\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/appconfig/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 54593, "name": "unknown", "code": "test(\"fuzz `event` w/ `record`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(\n\t\t\tfc.record({\n\t\t\t\theaders: fc.object(),\n\t\t\t}),\n\t\t\tasync (event) => {\n\t\t\t\tawait handler(event, context);\n\t\t\t},\n\t\t),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/http-header-normalizer/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": "The `handler` function should process events with random header objects without throwing errors.", "mode": "fast-check"} {"id": 57340, "name": "unknown", "code": "it(\"shows an error if the loading failed\", async () => {\n await fc.assert(\n fc.asyncProperty(fc.string(), fc.string(), async (name, errMsg) => {\n // Reset the DOM, to ensure a clean slate during fast-check.\n resetDOM();\n const slug = `thislooksfun/${name}`;\n fetchRepo.mockRejectedValue(new Error(errMsg));\n\n const { getByTestId, queryByTestId } = render(RepoCard, { slug });\n\n // Loading\n const loading = getByTestId(\"loading\");\n expect(loading).toBeInTheDocument();\n expect(loading.textContent).toEqual(`Loading card for ${slug}...`);\n await waitForElementToBeRemoved(loading);\n expect(loading).not.toBeInTheDocument();\n\n // Error message\n expect(getByTestId(\"failed\")).toBeInTheDocument();\n\n if (errMsg) {\n const msg = getByTestId(\"errmsg\");\n expect(msg).toBeInTheDocument();\n expect(msg.textContent).toEqual(errMsg);\n } else {\n expect(queryByTestId(\"errmsg\")).not.toBeInTheDocument();\n }\n })\n );\n})", "language": "typescript", "source_file": "./repos/thislooksfun/svelte-repo-card/test/RepoCard.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "thislooksfun/svelte-repo-card", "url": "https://github.com/thislooksfun/svelte-repo-card.git", "license": "MIT", "stars": 6, "forks": 1}, "metrics": null, "summary": "An error message is displayed in the `RepoCard` component if loading a repository fails, with the error message content matching the rejection message, or no specific message if none is provided.", "mode": "fast-check"} {"id": 57341, "name": "unknown", "code": "xit(\"respects the chosen theme\", async () => {\n const repo: repo.Repo = {\n name: \"foo-bar\",\n url: \"http://example.com\",\n description: \"Hello world!\",\n language: \"typescript\",\n isFork: true,\n sourceName: \"boo-far\",\n sourceUrl: \"http://example.com/src\",\n stars: 42,\n forks: 24,\n };\n\n await fc.assert(\n fc.asyncProperty(randomTheme(), async theme => {\n // Reset the DOM, to ensure a clean slate during fast-check.\n resetDOM();\n const slug = `thislooksfun/${repo.name}`;\n fetchRepo.mockResolvedValue(repo);\n\n const { getByTestId, queryByTestId } = render(RepoCard, { slug, theme });\n\n // Loading\n const loading = getByTestId(\"loading\");\n expect(loading).toBeInTheDocument();\n const card = loading.parentElement;\n console.log(card?.style);\n if (card) console.log(window.getComputedStyle(card));\n expect(card).toHaveStyle({ color: theme.text });\n expect(loading.firstElementChild).toHaveStyle(`color: ${theme.link}`);\n await waitForElementToBeRemoved(loading);\n expect(loading).not.toBeInTheDocument();\n\n // Render\n const name = getByTestId(\"repo-name\");\n expect(name).toBeInTheDocument();\n expect(name.textContent).toEqual(repo.name);\n\n if (repo.isFork) {\n expect(getByTestId(\"fork\")).toBeInTheDocument();\n const link = getByTestId(\"fork-link\");\n expect(link).toBeInTheDocument();\n expect(link.getAttribute(\"href\")).toEqual(repo.sourceUrl);\n expect(link.textContent).toEqual(repo.sourceName);\n } else {\n expect(queryByTestId(\"fork\")).not.toBeInTheDocument();\n }\n\n if (repo.description) {\n const desc = getByTestId(\"description\");\n expect(desc).toBeInTheDocument();\n expect(desc.textContent).toEqual(repo.description);\n } else {\n expect(queryByTestId(\"description\")).not.toBeInTheDocument();\n }\n\n if (repo.language) {\n expect(getByTestId(\"language\")).toBeInTheDocument();\n const lang = getByTestId(\"lang-name\");\n expect(lang).toBeInTheDocument();\n expect(lang.textContent).toEqual(repo.language);\n } else {\n expect(queryByTestId(\"language\")).not.toBeInTheDocument();\n }\n\n if (repo.stars > 0) {\n expect(getByTestId(\"stars\")).toBeInTheDocument();\n const sc = getByTestId(\"star-count\");\n expect(sc).toBeInTheDocument();\n expect(sc.textContent).toEqual(`${repo.stars}`);\n } else {\n expect(queryByTestId(\"stars\")).not.toBeInTheDocument();\n }\n\n if (repo.forks > 0) {\n expect(getByTestId(\"forks\")).toBeInTheDocument();\n const fc = getByTestId(\"fork-count\");\n expect(fc).toBeInTheDocument();\n expect(fc.textContent).toEqual(`${repo.forks}`);\n } else {\n expect(queryByTestId(\"forks\")).not.toBeInTheDocument();\n }\n })\n );\n})", "language": "typescript", "source_file": "./repos/thislooksfun/svelte-repo-card/test/RepoCard.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "thislooksfun/svelte-repo-card", "url": "https://github.com/thislooksfun/svelte-repo-card.git", "license": "MIT", "stars": 6, "forks": 1}, "metrics": null, "summary": "The `RepoCard` component should correctly apply the specified theme to various elements when rendered with a given repository's data.", "mode": "fast-check"} {"id": 54600, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\tawait handler(event, context);\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/rds-signer/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57342, "name": "unknown", "code": "it('fails with a message', async () => {\n await fc.assert(fc.asyncProperty(fc.string(), async (s) => {\n await assert.isRejected(PromiseUtils.fail(s), s);\n }));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/utils/PromiseUtilsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "`PromiseUtils.fail` should reject with the provided string message.", "mode": "fast-check"} {"id": 54599, "name": "unknown", "code": "test(\"fuzz `event` w/ `record` ({version: 'vpc'})\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(\n\t\t\tfc.record({\n\t\t\t\tmethod: fc.constantFrom(\n\t\t\t\t\t\"HEAD\",\n\t\t\t\t\t\"OPTIONS\",\n\t\t\t\t\t\"GET\",\n\t\t\t\t\t\"POST\",\n\t\t\t\t\t\"PATCH\",\n\t\t\t\t\t\"DELETE\",\n\t\t\t\t\t\"TRACE\",\n\t\t\t\t\t\"CONNECT\",\n\t\t\t\t),\n\t\t\t\traw_path: fc.webPath(), // TODO webUrl({ withDomain:false, withPath: true, withQueryParameters:true})\n\t\t\t}),\n\t\t\tasync (event) => {\n\t\t\t\ttry {\n\t\t\t\t\tawait handler(event, context);\n\t\t\t\t} catch (e) {\n\t\t\t\t\tif (e.cause?.package !== \"@middy/http-router\") {\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [\n\t\t\t\t[{ method: \"valueOf\", raw_path: \"?/\" }],\n\t\t\t\t[{ method: \"GET\", raw_path: \"?valueOf\" }],\n\t\t\t],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/http-router/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": "The test verifies that the `handler` function processes events with various HTTP methods and raw paths without throwing exceptions unrelated to `@middy/http-router`.", "mode": "fast-check"} {"id": 57344, "name": "unknown", "code": "it('succeeds for right', async () => {\n await fc.assert(fc.asyncProperty(fc.integer(), async (i) => {\n const actual = await PromiseUtils.eitherToPromise(E.right(i));\n assert.equal(actual, i);\n }));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/utils/PromiseUtilsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "`PromiseUtils.eitherToPromise` should resolve to the same value contained in `E.right`.", "mode": "fast-check"} {"id": 57345, "name": "unknown", "code": "it('fails for left', async () => {\n await fc.assert(fc.asyncProperty(fc.string(), async (s) => {\n const p = PromiseUtils.eitherToPromise(E.left(s));\n await assert.isRejected(p, s);\n }));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/utils/PromiseUtilsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "`PromiseUtils.eitherToPromise` should return a rejected promise for inputs wrapped in `E.left` containing a string.", "mode": "fast-check"} {"id": 57346, "name": "unknown", "code": "it('succeeds for some', async () => {\n await fc.assert(fc.asyncProperty(fc.integer(), async (i) => {\n const actual = await PromiseUtils.optionToPromise(O.some(i));\n assert.equal(actual, i);\n }));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/utils/PromiseUtilsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "`PromiseUtils.optionToPromise` should resolve to the integer contained within an `O.some`.", "mode": "fast-check"} {"id": 57349, "name": "unknown", "code": "it('maps', async () => {\n await fc.assert(fc.asyncProperty(fc.array(fc.integer()), async (xs) => {\n await assert.becomes(\n PromiseUtils.filterMap(xs, (x) => PromiseUtils.succeed(x + 1)),\n xs.map((x) => x + 1)\n );\n }));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/utils/PromiseUtilsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "`PromiseUtils.filterMap` correctly transforms an array of integers by applying an asynchronous function to increment each element.", "mode": "fast-check"} {"id": 57355, "name": "unknown", "code": "it('is identity when all elements are right', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (xs) => {\n assert.deepEqual(\n EitherUtils.rights(xs.map(E.right)),\n xs\n );\n }));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/utils/EitherUtilsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "`EitherUtils.rights` returns the original array of integers when all elements are wrapped as right values.", "mode": "fast-check"} {"id": 54601, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\tawait handler(event, context);\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/do-not-wait-for-empty-event-loop/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 54602, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\tawait handler(event, context);\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/http-security-headers/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57356, "name": "unknown", "code": "it('returns empty array when all elements are left', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (xs) => {\n assert.deepEqual(\n EitherUtils.rights(xs.map(E.left)),\n []\n );\n }));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/utils/EitherUtilsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "`EitherUtils.rights` returns an empty array when all elements in the input array are left.", "mode": "fast-check"} {"id": 54603, "name": "unknown", "code": "test(\"fuzz `event` w/ `record` ({version: '1.0'})\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(\n\t\t\tfc.record({\n\t\t\t\thttpMethod: fc.constantFrom(\n\t\t\t\t\t\"HEAD\",\n\t\t\t\t\t\"OPTIONS\",\n\t\t\t\t\t\"GET\",\n\t\t\t\t\t\"POST\",\n\t\t\t\t\t\"PATCH\",\n\t\t\t\t\t\"DELETE\",\n\t\t\t\t\t\"TRACE\",\n\t\t\t\t\t\"CONNECT\",\n\t\t\t\t),\n\t\t\t\tpath: fc.webPath(),\n\t\t\t}),\n\t\t\tasync (event) => {\n\t\t\t\ttry {\n\t\t\t\t\tawait handler(event, context);\n\t\t\t\t} catch (e) {\n\t\t\t\t\tif (e.cause?.package !== \"@middy/http-multipart-body-parser\") {\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/http-security-headers/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": "The test checks if the handler can process events with various HTTP methods and paths without throwing exceptions unrelated to `@middy/http-multipart-body-parser`.", "mode": "fast-check"} {"id": 57360, "name": "unknown", "code": "it('parses a correct 3-point version with preRelease', async () => {\n await fc.assert(fc.asyncProperty(smallNat, smallNat, smallNat, smallNat, async (major, minor, patch, preRelease) => {\n const input = `${major}.${minor}.${patch}-${preRelease}`;\n const expected = { major, minor, patch, preRelease: String(preRelease), buildMetaData: undefined };\n await assert.becomes(Version.parseVersion(input), expected);\n }));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/core/VersionTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "A correctly formatted 3-point version with preRelease information is parsed into its expected components.", "mode": "fast-check"} {"id": 57361, "name": "unknown", "code": "it('parses a correct 3-point version with buildmeta', async () => {\n await fc.assert(fc.asyncProperty(smallNat, smallNat, smallNat, fc.integer({ min: 1, max: 100 }), async (major, minor, patch, buildMetaData) => {\n const input = `${major}.${minor}.${patch}+${buildMetaData}`;\n const actual = Version.parseVersion(input);\n const expected = { major, minor, patch, preRelease: undefined, buildMetaData: String(buildMetaData) };\n await assert.becomes(actual, expected);\n }));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/core/VersionTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "Parses a version string with major, minor, patch, and build metadata into its components, ensuring it matches the expected structure.", "mode": "fast-check"} {"id": 54605, "name": "unknown", "code": "test(\"fuzz `event` w/ `record` ({version: 'vpc'})\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(\n\t\t\tfc.record({\n\t\t\t\tmethod: fc.constantFrom(\n\t\t\t\t\t\"HEAD\",\n\t\t\t\t\t\"OPTIONS\",\n\t\t\t\t\t\"GET\",\n\t\t\t\t\t\"POST\",\n\t\t\t\t\t\"PATCH\",\n\t\t\t\t\t\"DELETE\",\n\t\t\t\t\t\"TRACE\",\n\t\t\t\t\t\"CONNECT\",\n\t\t\t\t),\n\t\t\t\traw_path: fc.webPath(), // TODO webUrl({ withDomain:false, withPath: true, withQueryParameters:true})\n\t\t\t}),\n\t\t\tasync (event) => {\n\t\t\t\ttry {\n\t\t\t\t\tawait handler(event, context);\n\t\t\t\t} catch (e) {\n\t\t\t\t\tif (e.cause?.package !== \"@middy/http-multipart-body-parser\") {\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/http-security-headers/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": "A handler processes various HTTP request methods and paths without throwing errors, except for those specifically caused by the `@middy/http-multipart-body-parser` package.", "mode": "fast-check"} {"id": 57363, "name": "unknown", "code": "it('round-trips', async () => {\n await fc.assert(fc.asyncProperty(smallNat, smallNat, async (major, minor) => {\n const s = `${major}.${minor}`;\n const v = await Version.parseMajorMinorVersion(s);\n assert.deepEqual(Version.majorMinorVersionToString(v), s);\n }));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/core/VersionTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "Parsing a string representation of a version into a major and minor structure and then converting it back should result in the original string.", "mode": "fast-check"} {"id": 57364, "name": "unknown", "code": "it('round-trips for 3-point version', async () => {\n await fc.assert(fc.asyncProperty(smallNat, smallNat, smallNat, async (major, minor, patch) => {\n const sVersion = `${major}.${minor}.${patch}`;\n const version = await Version.parseVersion(sVersion);\n const actual = Version.versionToString(version);\n assert.deepEqual(actual, sVersion);\n }));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/core/VersionTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "Parsing a 3-point version string into a version object and then converting it back to a string should yield the original version string.", "mode": "fast-check"} {"id": 57366, "name": "unknown", "code": "it('round-trips for version with buildmeta', async () => {\n await fc.assert(fc.asyncProperty(smallNat, smallNat, smallNat, smallNatString,\n async (major, minor, patch, buildMetaData) => {\n const input = `${major}.${minor}.${patch}+${buildMetaData}`;\n const version = await Version.parseVersion(input);\n const actual = Version.versionToString(version);\n assert.deepEqual(actual, input);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/core/VersionTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "Parsing and stringifying a version with build metadata should preserve the original format.", "mode": "fast-check"} {"id": 54610, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\tawait handler(event, context);\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/dynamodb/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 54611, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\tawait handler(event, context);\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/event-normalizer/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 54612, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\tawait handler(event, context);\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/http-response-serializer/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 54613, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\tawait handler(event, context);\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/http-content-negotiation/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57367, "name": "unknown", "code": "it('is reflexive for 3-point versions', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), fc.integer(), (major, minor, patch) => {\n assert.equal(Version.compareVersions({ major, minor, patch }, { major, minor, patch }), Comparison.EQ);\n }));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/core/VersionTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "`Version.compareVersions` returns `Comparison.EQ` when comparing identical versions represented by major, minor, and patch numbers.", "mode": "fast-check"} {"id": 54614, "name": "unknown", "code": "test(\"fuzz `event` w/ `record`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(\n\t\t\tfc.record({\n\t\t\t\theaders: fc.record({\n\t\t\t\t\t\"Accept-Charset\": fc.string(),\n\t\t\t\t\t\"Accept-Encoding\": fc.string(),\n\t\t\t\t\t\"Accept-Language\": fc.string(),\n\t\t\t\t\tAccept: fc.string(),\n\t\t\t\t}),\n\t\t\t}),\n\t\t\tasync (event) => {\n\t\t\t\tawait handler(event, context);\n\t\t\t},\n\t\t),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/http-content-negotiation/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": "The handler should correctly process events with randomly generated `Accept-*` headers.", "mode": "fast-check"} {"id": 57368, "name": "unknown", "code": "it('is reflexive for 3-point versions with prerelease', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), fc.integer(), fc.hexaString(), (major, minor, patch, preRelease) => {\n assert.equal(Version.compareVersions({ major, minor, patch, preRelease }, { major, minor, patch, preRelease }), Comparison.EQ);\n }));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/core/VersionTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "Comparing two identical 3-point versions with prerelease results in equality (`Comparison.EQ`).", "mode": "fast-check"} {"id": 57369, "name": "unknown", "code": "it('considers preRelease versions lower less than release versions of the same 3-point version', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), fc.integer(), fc.hexaString(), (major, minor, patch, preRelease) => {\n assert.equal(Version.compareVersions({ major, minor, patch, preRelease }, { major, minor, patch }), Comparison.LT);\n assert.equal(Version.compareVersions({ major, minor, patch }, { major, minor, patch, preRelease }), Comparison.GT);\n }));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/core/VersionTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "Pre-release versions are considered lower than release versions for the same major, minor, and patch version numbers.", "mode": "fast-check"} {"id": 54615, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\tawait handler(event, context);\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/http-cors/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 54616, "name": "unknown", "code": "test(\"fuzz `event` w/ `record`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(\n\t\t\tfc.record({\n\t\t\t\theaders: fc.object(),\n\t\t\t}),\n\t\t\tasync (event) => {\n\t\t\t\tawait handler(event, context);\n\t\t\t},\n\t\t),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/http-cors/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57371, "name": "unknown", "code": "it('compares minor versions', () => {\n fc.assert(fc.property(fc.integer(), fc.integer({ min: 0, max: 1000 }), fc.integer(), fc.integer(), fc.hexaString(), fc.hexaString(),\n (major, minor, patch1, patch2, preRelease1, preRelease2) => {\n assert.equal(Version.compareVersions(\n { major, minor, patch: patch1, preRelease: preRelease1 },\n { major, minor: minor + 1, patch: patch2, preRelease: preRelease2 }\n ), Comparison.LT);\n assert.equal(Version.compareVersions(\n { major, minor: minor + 1, patch: patch2, preRelease: preRelease2 },\n { major, minor, patch: patch1, preRelease: preRelease1 }\n ), Comparison.GT);\n }));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/core/VersionTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "Comparing versions where one version has a minor version increment results in the original version being less, and the incremented version being greater.", "mode": "fast-check"} {"id": 57372, "name": "unknown", "code": "it('compares patch versions', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), fc.integer({ min: 0, max: 1000 }), fc.hexaString(), fc.hexaString(),\n (major, minor, patch, preRelease1, preRelease2) => {\n assert.equal(Version.compareVersions(\n { major, minor, patch, preRelease: preRelease1 },\n { major, minor, patch: patch + 1, preRelease: preRelease2 }\n ), Comparison.LT);\n assert.equal(Version.compareVersions(\n { major, minor, patch: patch + 1, preRelease: preRelease2 },\n { major, minor, patch, preRelease: preRelease1 }\n ), Comparison.GT);\n }));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/core/VersionTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "`Version.compareVersions` correctly identifies a version with a higher patch number as greater, and a version with a lower patch number as lesser.", "mode": "fast-check"} {"id": 54617, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\ttry {\n\t\t\t\tawait handler(event, context);\n\t\t\t} catch (e) {\n\t\t\t\tif (e.cause?.package !== \"@middy/cloudformation-router\") {\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/cloudformation-router/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": "The test checks that the `handler` function processes an `event` object without throwing an error that does not originate from the `@middy/cloudformation-router` package.", "mode": "fast-check"} {"id": 57373, "name": "unknown", "code": "it('makes branch names (property)', () => {\n fc.assert(fc.property(fc.nat(1000), fc.nat(1000), (major, minor) => {\n assert.equal(getReleaseBranchName({ major, minor }), `release/${major}.${minor}`);\n }));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/core/BranchLogicTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "`getReleaseBranchName` generates branch names in the format `release/major.minor` for given major and minor version numbers.", "mode": "fast-check"} {"id": 57374, "name": "unknown", "code": "it('parses versions', async () => {\n await fc.assert(fc.asyncProperty(fc.nat(1000), fc.nat(1000), async (major, minor) => {\n await assert.becomes(\n versionFromReleaseBranch(`release/${major}.${minor}`),\n { major, minor }\n );\n }));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/core/BranchLogicTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "`versionFromReleaseBranch` correctly parses major and minor version numbers from release branch strings.", "mode": "fast-check"} {"id": 54619, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\tawait handler(event, context);\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/error-logger/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 54620, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\tawait handler(event, context);\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/core/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 54621, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\tawait handler(event, context);\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/http-content-encoding/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 54623, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\tawait handler(event, context);\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/cloudwatch-metrics/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 54622, "name": "unknown", "code": "test(\"fuzz `event` w/ `record`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(\n\t\t\tfc.record({\n\t\t\t\tbody: fc.anything(),\n\t\t\t}),\n\t\t\tasync (event) => {\n\t\t\t\tawait handler(event, context);\n\t\t\t},\n\t\t),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/http-content-encoding/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": "The handler processes events with arbitrary content in the `body` field without errors.", "mode": "fast-check"} {"id": 54624, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\tawait handler(event, context);\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/cloudformation-response/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57375, "name": "unknown", "code": "it('makes a timestamped version on feature branch', async () => {\n await fc.assert(fc.asyncProperty(fc.nat(), fc.nat(), async (major, minor) => {\n const patch = 0;\n const v = `${major}.${minor}.${patch}-main`;\n const actual = Stamp.chooseNewVersion(BranchState.Feature, await Version.parseVersion(v), 'b0d59ad', timeMillis);\n assert.equal(Version.versionToString(actual), `${major}.${minor}.${patch}-feature.${timeFormatted}.shab0d59ad`);\n }));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/commands/StampTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "A timestamped version should be generated on a feature branch, incorporating the major and minor numbers, patch zero, and specific formatting including a timestamp and SHA prefix.", "mode": "fast-check"} {"id": 57376, "name": "unknown", "code": "it('does not change version for release version', async () => {\n await fc.assert(fc.asyncProperty(fc.nat(), fc.nat(), fc.nat(), async (major, minor, patch) => {\n const v = `${major}.${minor}.${patch}`;\n const actual = Stamp.chooseNewVersion(BranchState.ReleaseReady, await Version.parseVersion(v), 'aorseitnoarsetn', timeMillis);\n assert.equal(Version.versionToString(actual), v);\n }));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/commands/StampTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "`Stamp.chooseNewVersion` retains the original version string for release versions.", "mode": "fast-check"} {"id": 54625, "name": "unknown", "code": "test('Should replace simple types', () => {\n fc.assert(\n fc.property(arb, fc.func(arb), (s, f) => {\n return replace(f, (t: string): t is any => true)(s) === f(s);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/alexrecuenco/typescript-eslint-prettier-jest-example/tests/replace.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "alexrecuenco/typescript-eslint-prettier-jest-example", "url": "https://github.com/alexrecuenco/typescript-eslint-prettier-jest-example.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Verifies that the `replace` function behaves like a simple identity function when the type predicate always returns true.", "mode": "fast-check"} {"id": 57377, "name": "unknown", "code": "it('succeeds for release command with major.minor arg', async () => {\n await fc.assert(fc.asyncProperty(fc.nat(100), fc.nat(100), async (major, minor) => {\n await assert.becomes(\n parseArgs([ 'release', `${major}.${minor}` ]),\n O.some(BeehiveArgs.releaseArgs(false, process.cwd(), O.none, O.none, `release/${major}.${minor}`, false, false, false, false))\n );\n await assert.becomes(\n parseArgs([ 'release', `${major}.${minor}`, '--dry-run' ]),\n O.some(BeehiveArgs.releaseArgs(true, process.cwd(), O.none, O.none, `release/${major}.${minor}`, false, false, false, false))\n );\n }));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/args/ParserTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "Parsing the 'release' command with a `major.minor` format should produce the expected `BeehiveArgs`, with and without the `--dry-run` option.", "mode": "fast-check"} {"id": 57379, "name": "unknown", "code": "it(\"Returns the same input always\", () => {\n fc.assert(\n fc.property(fc.anything(), fc.anything(), (input, x) =>\n expect(constant(input)(x)).toEqual(input),\n ),\n );\n })", "language": "typescript", "source_file": "./repos/jhbertra/data-grace/test/prelude.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "jhbertra/data-grace", "url": "https://github.com/jhbertra/data-grace.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": "The function `constant` returns the same input value regardless of the second argument.", "mode": "fast-check"} {"id": 57382, "name": "unknown", "code": "it(\"creates an object from the entries\", () => {\n fc.assert(\n fc.property(fc.array(fc.tuple(fc.string(), fc.anything())), entries => {\n const expected = entries.reduce((state, [key, value]) => ({ ...state, [key]: value }), {});\n expect(objectFromEntries<{ [key: string]: unknown }>(entries)).toEqual(expected);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/jhbertra/data-grace/test/prelude.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "jhbertra/data-grace", "url": "https://github.com/jhbertra/data-grace.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": "`objectFromEntries` creates an object from an array of key-value pairs, matching the expected object structure.", "mode": "fast-check"} {"id": 54627, "name": "unknown", "code": "test('Should replace only properties', () => {\n fc.assert(\n fc.property(fc.dictionary(fc.string(), arb), fc.func(arb), (obj, f) => {\n const realResult = Object.fromEntries(\n Object.entries(obj).map(([k, v]) => [k, f(v)]),\n );\n const obtainedResult = replace(\n f,\n (t): t is any => !Array.isArray(t) && typeof t !== 'object',\n )(obj);\n\n expect(obtainedResult).toStrictEqual(realResult);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/alexrecuenco/typescript-eslint-prettier-jest-example/tests/replace.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "alexrecuenco/typescript-eslint-prettier-jest-example", "url": "https://github.com/alexrecuenco/typescript-eslint-prettier-jest-example.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `replace` should transform only the properties of an object by applying a given function, resulting in an output that strictly matches the expected manually transformed object.", "mode": "fast-check"} {"id": 57383, "name": "unknown", "code": "it(\"returns the initial result if passed the output of objectToEntries\", () => {\n fc.assert(\n fc.property(fc.object(), (obj: object) => {\n expect(objectFromEntries(objectToEntries(obj))).toEqual(obj);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/jhbertra/data-grace/test/prelude.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "jhbertra/data-grace", "url": "https://github.com/jhbertra/data-grace.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": "The property should hold that converting an object to entries and then back to an object results in the original object.", "mode": "fast-check"} {"id": 57384, "name": "unknown", "code": "it(\"creates entries from an object\", () => {\n fc.assert(\n fc.property(fc.object(), (obj: any) => {\n const expected = Object.keys(obj).map(key => [key, obj[key]]);\n expect(objectToEntries(obj)).toEqual(expected);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/jhbertra/data-grace/test/prelude.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "jhbertra/data-grace", "url": "https://github.com/jhbertra/data-grace.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": "The function `objectToEntries` should convert an object into an array of key-value pairs matching the output of `Object.keys(obj).map(key => [key, obj[key]])`.", "mode": "fast-check"} {"id": 57448, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV6(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that when the input value is a valid IPv6 address, `checkValidity` returns true after updating.", "mode": "fast-check"} {"id": 57451, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9/]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that inputs not matching the regex pattern `/^[0-9/]*$/` are considered invalid.", "mode": "fast-check"} {"id": 57452, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV6(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test confirms that for valid IPv6 inputs, the input element passes the `checkValidity()` check after updating.", "mode": "fast-check"} {"id": 54631, "name": "unknown", "code": "test(\"fuzz sessionLookup w/ value\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (value) => {\n\t\t\ttry {\n\t\t\t\tawait sessionLookup(testSession.sid, value);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(value, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/session/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The `sessionLookup` function should handle any input value without producing errors other than specific expected errors.", "mode": "fast-check"} {"id": 57453, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv6), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Editing is not allowed for inputs that do not match a valid IPv6 format, ensuring `checkValidity` returns false for such cases.", "mode": "fast-check"} {"id": 57454, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n fc.hexaString({ minLength: 1, maxLength: 5 }),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that an input element maintains validity for hexadecimal strings with lengths between 1 and 5.", "mode": "fast-check"} {"id": 54633, "name": "unknown", "code": "test(\"fuzz sessionSelect w/ id\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (id) => {\n\t\t\ttry {\n\t\t\t\tawait sessionSelect(sub, id);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(id, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/session/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`sessionSelect` should handle inputs robustly by only allowing expected errors: \"400 Bad Request\", \"401 Unauthorized\", \"404 Not Found\", and \"409 Conflict\".", "mode": "fast-check"} {"id": 57455, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n invertedRegex(/^[0-9a-fA-F]{1,5}$/),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Editing is disallowed when the input does not match the hexadecimal pattern /^[0-9a-fA-F]{1,5}$/.", "mode": "fast-check"} {"id": 57458, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV6(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Editing is allowed for valid IPv6 inputs when `input.checkValidity()` returns true after updating.", "mode": "fast-check"} {"id": 57459, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv6), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Input should be invalid when not matching an IPv6 regex pattern, ensuring `checkValidity` returns false.", "mode": "fast-check"} {"id": 54635, "name": "unknown", "code": "test(\"fuzz sessionCreate w/ sub\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (sub) => {\n\t\t\ttry {\n\t\t\t\tawait sessionCreate(sub, testSession.value, testSession.values);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(sub, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/session/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The function `sessionCreate` should handle any input for `sub` without throwing unexpected errors.", "mode": "fast-check"} {"id": 57460, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV4(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Valid IPv4 inputs allow editing by ensuring `input.checkValidity()` returns true after an update.", "mode": "fast-check"} {"id": 57461, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv4), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Invalid IPv4 inputs should cause the `checkValidity` method to return false.", "mode": "fast-check"} {"id": 54636, "name": "unknown", "code": "test(\"fuzz sessionCreate w/ value\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (value) => {\n\t\t\ttry {\n\t\t\t\tawait sessionCreate(sub, value, testSession.values);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(value, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/session/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`sessionCreate` handles various input values without throwing unexpected errors.", "mode": "fast-check"} {"id": 57462, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(regExp.OSI, 1, 2), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures that for valid input matching a specific regular expression, the element allows editing, and `checkValidity` returns true.", "mode": "fast-check"} {"id": 57463, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Verifies that invalid input patterns do not pass the validity check and cannot be edited.", "mode": "fast-check"} {"id": 57464, "name": "unknown", "code": "it('edits name attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.abstractDataAttributeName, 1, 32),\n async name => {\n nameTextField.value = name;\n await nameTextField.requestUpdate();\n expect(nameTextField.checkValidity()).to.be.true;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/abstractda.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test confirms that the `nameTextField` only accepts valid inputs matching a specific regular expression pattern when editing the name attribute.", "mode": "fast-check"} {"id": 54637, "name": "unknown", "code": "test(\"fuzz sessionCheck w/ sub\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (sub) => {\n\t\t\ttry {\n\t\t\t\tawait sessionCheck(sub, testSession.value);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(sub, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/session/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`sessionCheck` handles a wide range of input values without throwing unexpected errors, allowing for expected HTTP errors.", "mode": "fast-check"} {"id": 57467, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tName, 1), async name => {\n parent.wizardUI.inputs[0].value = name;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/integration/editors/communication/subnetwork-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test verifies that the input field in the wizard UI is valid only when it matches the specified regular expression pattern.", "mode": "fast-check"} {"id": 57470, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal), async BitRate => {\n parent.wizardUI.inputs[3].value = BitRate;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[3].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/integration/editors/communication/subnetwork-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The validity check ensures the `wizardUI` input accepts only decimal strings by verifying the input's `checkValidity` method returns true.", "mode": "fast-check"} {"id": 57471, "name": "unknown", "code": "it('rejects edition for invalid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.decimal, 1),\n async BitRate => {\n parent.wizardUI.inputs[3].value = BitRate;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[3].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/integration/editors/communication/subnetwork-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The subnetwork editor should reject invalid inputs, specifically those that do not match the decimal format, ensuring `checkValidity()` returns false.", "mode": "fast-check"} {"id": 57472, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tName, 1), async name => {\n parent.wizardUI.inputs[0].value = name;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test verifies that the editor only accepts inputs matching a specified regular expression pattern, ensuring the input's validity.", "mode": "fast-check"} {"id": 54639, "name": "unknown", "code": "test(\"fuzz sessionExpire w/ sub\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (sub) => {\n\t\t\ttry {\n\t\t\t\tawait sessionExpire(sub, testSession.id);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(sub, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/session/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`sessionExpire` should handle various `sub` inputs without throwing unexpected errors, logging only the specified expected errors.", "mode": "fast-check"} {"id": 57473, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc), async desc => {\n parent.wizardUI.inputs[1].value = desc;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[1].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures the `wizardUI` input validity check returns true for strings matching a specified regex pattern.", "mode": "fast-check"} {"id": 57474, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.unsigned, 1), async nomFreq => {\n parent.wizardUI.inputs[2].value = nomFreq;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[2].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that the input value assigned to `wizardUI.inputs[2]` is valid if it matches the `unsigned` regex pattern.", "mode": "fast-check"} {"id": 54642, "name": "unknown", "code": "test(\"fuzz sessionRemove w/ id\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (id) => {\n\t\t\ttry {\n\t\t\t\tawait sessionRemove(sub, id);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(id, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/session/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The test examines the behavior of `sessionRemove` when provided with various types of input for `id`, ensuring that only specified error messages are caught and logged, while others are logged and thrown.", "mode": "fast-check"} {"id": 54644, "name": "unknown", "code": "test(\"fuzz emailAddressLookup w/ `username`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (username) => {\n\t\t\ttry {\n\t\t\t\tawait emailAddressLookup(username);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(username, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 10,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/messenger-email-address/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The function `emailAddressLookup` should handle any input, ignoring expected errors like \"400 Bad Request\", \"401 Unauthorized\", \"404 Not Found\", and \"409 Conflict\".", "mode": "fast-check"} {"id": 57475, "name": "unknown", "code": "it('rejects action for invalid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.unsigned, 1),\n async nomFreq => {\n parent.wizardUI.inputs[2].value = nomFreq;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[2].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The action is rejected when the `nomFreq` input does not match the valid pattern, ensuring `checkValidity()` returns false for invalid inputs.", "mode": "fast-check"} {"id": 57476, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(fc.integer(1, 255), async numPhases => {\n parent.wizardUI.inputs[3].value = String(numPhases);\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[3].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test verifies that setting the value of `wizardUI.inputs[3]` to a string representation of an integer between 1 and 255 results in `checkValidity()` returning true.", "mode": "fast-check"} {"id": 54645, "name": "unknown", "code": "test(\"fuzz emailAddressList w/ `sub`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (sub) => {\n\t\t\ttry {\n\t\t\t\tawait emailAddressList(sub);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(sub, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 10,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/messenger-email-address/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`emailAddressList` should handle inputs without throwing unexpected errors, only allowing specific expected error messages.", "mode": "fast-check"} {"id": 57477, "name": "unknown", "code": "it('rejects edition for invalid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.integer, 1),\n async nomFreq => {\n parent.wizardUI.inputs[3].value = nomFreq;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[3].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Edition is rejected for invalid inputs that do not match the integer regular expression in the voltage-level editor wizard.", "mode": "fast-check"} {"id": 57479, "name": "unknown", "code": "it('rejects edition for invalid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.decimal, 1),\n async voltage => {\n parent.wizardUI.inputs[4].value = voltage;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[4].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Inputting non-decimal values into the voltage input field should result in validity checks failing.", "mode": "fast-check"} {"id": 54647, "name": "unknown", "code": "test(\"fuzz emailAddressSelect w/ `id`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (id) => {\n\t\t\ttry {\n\t\t\t\tawait emailAddressSelect(sub, id);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(id, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 10,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/messenger-email-address/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The function `emailAddressSelect` should handle various inputs, allowing execution without throwing unexpected errors, as captured by specified expected error messages.", "mode": "fast-check"} {"id": 57480, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tName, 1), async name => {\n parent.wizardUI.inputs[0].value = name;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/integration/editors/substation/substation-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures that only valid `name` inputs can successfully pass the validity check in the `wizardUI` input field.", "mode": "fast-check"} {"id": 54648, "name": "unknown", "code": "test(\"fuzz emailAddressCreate w/ `sub`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (sub) => {\n\t\t\ttry {\n\t\t\t\tawait emailAddressCreate(sub, emailAddress);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(sub, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 10,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/messenger-email-address/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`emailAddressCreate` handles various input types for `sub`, and only expected errors should occur, which are not logged.", "mode": "fast-check"} {"id": 57481, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc), async desc => {\n parent.wizardUI.inputs[1].value = desc;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[1].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/integration/editors/substation/substation-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`wizardUI` accepts only valid `desc` inputs that satisfy the specified regex pattern.", "mode": "fast-check"} {"id": 57482, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tName, 1), async name => {\n parent.wizardUI.inputs[1].value = name;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/integration/editors/substation/conducting-equipment-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Editing should occur only when the inputs are valid according to specified conditions.", "mode": "fast-check"} {"id": 57483, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc), async desc => {\n parent.wizardUI.inputs[2].value = desc;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[1].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/integration/editors/substation/conducting-equipment-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Editing is performed only when the input for `wizardUI.inputs[2]` is valid, ensuring `wizardUI.inputs[1]` passes validity checks.", "mode": "fast-check"} {"id": 57484, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tName, 1), async name => {\n parent.wizardUI.inputs[0].value = name;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/integration/editors/substation/bay-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Editing is enabled only when input names match the specified regular expression pattern and are valid.", "mode": "fast-check"} {"id": 54649, "name": "unknown", "code": "test(\"fuzz emailAddressCreate w/ `username`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (username) => {\n\t\t\ttry {\n\t\t\t\tawait emailAddressCreate(sub, username);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(username, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 10,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/messenger-email-address/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`emailAddressCreate` handles exceptions appropriately, only ignoring specific expected errors during fuzz testing with arbitrary `username` values.", "mode": "fast-check"} {"id": 57491, "name": "unknown", "code": "UnitTest.test('ShadowDom - SelectorFind.descendant', () => {\n if (SugarShadowDom.isSupported()) {\n fc.assert(fc.property(htmlBlockTagName(), htmlInlineTagName(), fc.hexaString(), (block, inline, text) => {\n withShadowElement((ss) => {\n const id = 'theid';\n const inner = SugarElement.fromHtml(`<${block}>

hello<${inline} id=\"${id}\">${text}

`);\n Insert.append(ss, inner);\n\n const frog: SugarElement = SelectorFind.descendant(ss, `#${id}`).getOrDie('Element not found');\n Assert.eq('textcontent', text, frog.dom.textContent);\n });\n }));\n }\n})", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/sugar/src/test/ts/browser/ShadowDomTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "`SelectorFind.descendant` retrieves an element with a specific `id` from a shadow DOM, verifying that its text content matches the expected text.", "mode": "fast-check"} {"id": 57492, "name": "unknown", "code": "UnitTest.test('All valid floats are valid', () => {\n fc.assert(fc.property(fc.oneof(\n // small to medium floats\n fc.float(),\n // big floats\n fc.tuple(fc.float(), fc.integer(-20, 20)).map(([ mantissa, exponent ]) => mantissa * Math.pow(10, exponent))\n ), (num) => {\n const parsed = Dimension.parse(num.toString(), [ 'empty' ]).getOrDie();\n Assert.eq('Number is unchanged by stringifying and parsing', num, parsed.value);\n Assert.eq('Unit is empty', '', parsed.unit);\n return true;\n }));\n})", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/sugar/src/test/ts/atomic/DimensionParseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Valid floats, both small to medium and large with exponents, should remain unchanged and have an empty unit string after being stringified and parsed by `Dimension.parse`.", "mode": "fast-check"} {"id": 57493, "name": "unknown", "code": "UnitTest.test('All valid integers are valid', () => {\n fc.assert(fc.property(fc.integer(), (num) => {\n const parsed = Dimension.parse(num.toString(), [ 'empty' ]).getOrDie();\n Assert.eq('Number is unchanged by stringifying and parsing', num, parsed.value);\n Assert.eq('Unit is empty', '', parsed.unit);\n return true;\n }));\n})", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/sugar/src/test/ts/atomic/DimensionParseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Parsing a valid integer from its string representation should yield a dimension with an unchanged value and an empty unit.", "mode": "fast-check"} {"id": 54650, "name": "unknown", "code": "test(\"fuzz emailAddressCreate w/ `emailAddress`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.emailAddress(), async (emailAddress) => {\n\t\t\ttry {\n\t\t\t\tawait emailAddressCreate(sub, emailAddress);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(emailAddress, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 10,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/messenger-email-address/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Invoking `emailAddressCreate` with various email addresses should not produce unexpected errors outside the defined list: \"400 Bad Request,\" \"401 Unauthorized,\" \"404 Not Found,\" \"409 Conflict.\"", "mode": "fast-check"} {"id": 57494, "name": "unknown", "code": "UnitTest.test('KAssert.eqError: success (reflexivity)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n KAssert.eqError('eq', i, Result.error(i));\n KAssert.eqError('eq', i, Result.error(i), tBoom());\n KAssert.eqError('eq', i, Result.error(i), tBoom(), tNumber);\n }));\n})", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "`KAssert.eqError` confirms that an integer and a `Result.error` containing the same integer are considered equivalent, using reflexivity.", "mode": "fast-check"} {"id": 54655, "name": "unknown", "code": "test(\"fuzz accountLookup w/ sub\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (sub) => {\n\t\t\ttry {\n\t\t\t\tawait accountLookup(sub);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(sub, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/account/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The `accountLookup` function is tested to ensure it either executes or raises expected errors without causing unhandled exceptions across various inputs.", "mode": "fast-check"} {"id": 57495, "name": "unknown", "code": "UnitTest.test('KAssert.eqError: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('should throw if numbers differ #1', () => {\n KAssert.eqError('eq', a, Result.error(b));\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqError('eq', a, Result.error(b), tBoom());\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqError('eq', a, Result.error(b), tBoom(), tNumber);\n });\n }));\n\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.throws('should throw if value #1', () => {\n KAssert.eqError('eq', i, Result.value(s));\n });\n Assert.throws('should throw if value #2', () => {\n KAssert.eqError('eq', i, Result.value(s), tBoom());\n });\n Assert.throws('should throw if value #3', () => {\n KAssert.eqError('eq', i, Result.value(s), tBoom(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "`KAssert.eqError` throws an error when comparing two different numbers or when comparing an integer with a string value, using various configurations.", "mode": "fast-check"} {"id": 54658, "name": "unknown", "code": "test(\"fuzz accountUpdate w/ values\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.string(), async (values) => {\n\t\t\ttry {\n\t\t\t\tawait accountUpdate(sub, { name: values });\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(values, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/account/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The `accountUpdate` function should not throw unexpected errors when updating an account with string values for the `name` field.", "mode": "fast-check"} {"id": 57496, "name": "unknown", "code": "UnitTest.test('KAssert.eqError: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('should throw if numbers differ #1', () => {\n KAssert.eqError('eq', a, Result.error(b));\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqError('eq', a, Result.error(b), tBoom());\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqError('eq', a, Result.error(b), tBoom(), tNumber);\n });\n }));\n\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.throws('should throw if value #1', () => {\n KAssert.eqError('eq', i, Result.value(s));\n });\n Assert.throws('should throw if value #2', () => {\n KAssert.eqError('eq', i, Result.value(s), tBoom());\n });\n Assert.throws('should throw if value #3', () => {\n KAssert.eqError('eq', i, Result.value(s), tBoom(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "`KAssert.eqError` throws an error when a number differs from a `Result.error` value, and when a number does not match a `Result.value` containing a string.", "mode": "fast-check"} {"id": 54660, "name": "unknown", "code": "test(\"fuzz accountRemove w/ sub\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (sub) => {\n\t\t\ttry {\n\t\t\t\tawait accountRemove(sub);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(sub, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/account/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The `accountRemove` function should handle various input types without throwing unexpected errors, only allowing certain specified error messages.", "mode": "fast-check"} {"id": 54661, "name": "unknown", "code": "test(\"fuzz accessTokenAuthenticate w/ username\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (username) => {\n\t\t\ttry {\n\t\t\t\tawait accessTokenAuthenticate(username, testSecret.value);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(username, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/authn-access-token/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`accessTokenAuthenticate` should handle various inputs for `username` without throwing unexpected errors, as filtered by `catchError`.", "mode": "fast-check"} {"id": 57499, "name": "unknown", "code": "UnitTest.test('KAssert.eqValue: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('should throw if numbers differ #1', () => {\n KAssert.eqValue('eq', a, Result.value(b));\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqValue('eq', a, Result.value(b), tNumber);\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqValue('eq', a, Result.value(b), tNumber, tBoom());\n });\n }));\n\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.throws('should throw if error #1', () => {\n KAssert.eqValue('eq', i, Result.error(s));\n });\n Assert.throws('should throw if error #2', () => {\n KAssert.eqValue('eq', i, Result.error(s), tBoom());\n });\n Assert.throws('should throw if error #3', () => {\n KAssert.eqValue('eq', i, Result.error(s), tBoom(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "`KAssert.eqValue` should throw an error when comparing different numbers or when a result contains an error.", "mode": "fast-check"} {"id": 57500, "name": "unknown", "code": "UnitTest.test('KAssert.eqResult: success', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n KAssert.eqResult('eq', Result.value(i), Result.value(i));\n KAssert.eqResult('eq', Result.value(i), Result.value(i), tNumber);\n KAssert.eqResult('eq', Result.value(i), Result.value(i), tNumber, tBoom());\n KAssert.eqResult('eq', Result.error(i), Result.error(i));\n KAssert.eqResult('eq', Result.error(i), Result.error(i), tBoom());\n KAssert.eqResult('eq', Result.error(i), Result.error(i), tBoom(), tNumber);\n }));\n})", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "`KAssert.eqResult` checks that two `Result.value` or two `Result.error` objects with identical integer values are considered equal, optionally using additional transformation functions.", "mode": "fast-check"} {"id": 54662, "name": "unknown", "code": "test(\"fuzz accessTokenAuthenticate w/ secret\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (secret) => {\n\t\t\ttry {\n\t\t\t\tawait accessTokenAuthenticate(username, secret);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(secret, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/authn-access-token/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`accessTokenAuthenticate` should handle any type of input for the `secret` parameter without unexpected errors, only allowing specific error messages.", "mode": "fast-check"} {"id": 57501, "name": "unknown", "code": "UnitTest.test('KAssert.eqResult: fail', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('value(a) != (value(!a)) #1', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b));\n });\n Assert.throws('value(a) != (value(!a)) #2', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b), tNumber);\n });\n Assert.throws('value(a) != (value(!a)) #2', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b), tNumber, tBoom());\n });\n }));\n\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('error(a) != (error(!a)) #1', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b));\n });\n Assert.throws('error(a) != (error(!a)) #2', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b), tBoom());\n });\n Assert.throws('result(a) != (result(!a)) #2', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b), tBoom(), tNumber);\n });\n }));\n\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.throws('value != error #1', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s));\n });\n Assert.throws('value != error #2', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s), tBoom());\n });\n Assert.throws('value != error #3', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s), tBoom());\n });\n\n Assert.throws('error != value #1', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s));\n });\n Assert.throws('error != value #2', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s), tBoom());\n });\n Assert.throws('error != value #3', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s), tBoom(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "`KAssert.eqResult` throws errors when comparing two different result values or when comparing result types (`value` vs `error`) across various scenarios.", "mode": "fast-check"} {"id": 57502, "name": "unknown", "code": "UnitTest.test('KAssert.eqResult: fail', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('value(a) != (value(!a)) #1', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b));\n });\n Assert.throws('value(a) != (value(!a)) #2', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b), tNumber);\n });\n Assert.throws('value(a) != (value(!a)) #2', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b), tNumber, tBoom());\n });\n }));\n\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('error(a) != (error(!a)) #1', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b));\n });\n Assert.throws('error(a) != (error(!a)) #2', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b), tBoom());\n });\n Assert.throws('result(a) != (result(!a)) #2', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b), tBoom(), tNumber);\n });\n }));\n\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.throws('value != error #1', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s));\n });\n Assert.throws('value != error #2', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s), tBoom());\n });\n Assert.throws('value != error #3', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s), tBoom());\n });\n\n Assert.throws('error != value #1', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s));\n });\n Assert.throws('error != value #2', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s), tBoom());\n });\n Assert.throws('error != value #3', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s), tBoom(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Verifies that `KAssert.eqResult` correctly throws exceptions when comparing different `Result.value` or `Result.error` objects, as well as when comparing a `Result.value` with a `Result.error`.", "mode": "fast-check"} {"id": 54665, "name": "unknown", "code": "test(\"fuzz accessTokenLookup w/ username\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (username) => {\n\t\t\ttry {\n\t\t\t\tawait accessTokenLookup(username);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(username, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/authn-access-token/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The `accessTokenLookup` function should handle any input for `username` without causing unexpected errors, only allowing specific known errors.", "mode": "fast-check"} {"id": 57503, "name": "unknown", "code": "UnitTest.test('KAssert.eqResult: fail', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('value(a) != (value(!a)) #1', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b));\n });\n Assert.throws('value(a) != (value(!a)) #2', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b), tNumber);\n });\n Assert.throws('value(a) != (value(!a)) #2', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b), tNumber, tBoom());\n });\n }));\n\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('error(a) != (error(!a)) #1', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b));\n });\n Assert.throws('error(a) != (error(!a)) #2', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b), tBoom());\n });\n Assert.throws('result(a) != (result(!a)) #2', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b), tBoom(), tNumber);\n });\n }));\n\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.throws('value != error #1', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s));\n });\n Assert.throws('value != error #2', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s), tBoom());\n });\n Assert.throws('value != error #3', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s), tBoom());\n });\n\n Assert.throws('error != value #1', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s));\n });\n Assert.throws('error != value #2', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s), tBoom());\n });\n Assert.throws('error != value #3', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s), tBoom(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "`KAssert.eqResult` throws an error when comparing differing `Result.value` or `Result.error` objects, or when comparing a `Result.value` to a `Result.error` and vice versa.", "mode": "fast-check"} {"id": 57516, "name": "unknown", "code": "it('Check that if the filter always returns true, then everything is in \"pass\"', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n (arr) => {\n const output = Arr.partition(arr, Fun.always);\n assert.deepEqual(output.fail.length, 0);\n assert.deepEqual(output.pass, arr);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/PartitionTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "When the filter always returns true, all elements should be in the \"pass\" array, and the \"fail\" array should be empty.", "mode": "fast-check"} {"id": 54667, "name": "unknown", "code": "test(\"fuzz accessTokenSelect w/ id\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (id) => {\n\t\t\ttry {\n\t\t\t\tawait accessTokenSelect(sub, id);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(id, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/authn-access-token/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`accessTokenSelect` is expected not to throw errors other than \"400 Bad Request,\" \"401 Unauthorized,\" \"404 Not Found,\" or \"409 Conflict\" when executed with any value as `id`.", "mode": "fast-check"} {"id": 54669, "name": "unknown", "code": "test(\"fuzz accessTokenCreate w/ sub\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (sub) => {\n\t\t\ttry {\n\t\t\t\tawait accessTokenCreate(sub);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(sub, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/authn-access-token/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The function `accessTokenCreate` should not throw unexpected errors when invoked with arbitrary input, handling only specified error messages.", "mode": "fast-check"} {"id": 57517, "name": "unknown", "code": "it('Check that everything in fail fails predicate and everything in pass passes predicate', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n (arr) => {\n const predicate = (x: number) => x % 3 === 0;\n const output = Arr.partition(arr, predicate);\n return Arr.forall(output.fail, (x) => !predicate(x)) && Arr.forall(output.pass, predicate);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/PartitionTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "The partitioned arrays should ensure that elements in the `fail` array do not satisfy the predicate, while elements in the `pass` array do.", "mode": "fast-check"} {"id": 54670, "name": "unknown", "code": "test(\"fuzz accessTokenCreate w/ values\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.string(), async (values) => {\n\t\t\ttry {\n\t\t\t\tawait accessTokenCreate(sub, { name: values });\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(values, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/authn-access-token/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The `accessTokenCreate` function processes strings without causing errors, unless they match specific error messages defined by `catchError`.", "mode": "fast-check"} {"id": 57518, "name": "unknown", "code": "it('inductive case', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(1, 30), fc.integer()),\n fc.asciiString(1, 30),\n fc.integer(),\n (obj, k, v) => {\n const objWithoutK = Obj.filter(obj, (x, i) => i !== k);\n assert.deepEqual(Obj.size({ [k]: v, ...objWithoutK }), Obj.size(objWithoutK) + 1);\n }), {\n numRuns: 5000\n });\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/ObjSizeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "The size of an object increases by one when adding a new key-value pair, provided the key does not already exist in the object.", "mode": "fast-check"} {"id": 57519, "name": "unknown", "code": "it('only returns elements that are in the input', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.integer()), (obj) => {\n const keys = Obj.keys(obj);\n return Arr.forall(keys, (k) => obj.hasOwnProperty(k));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/ObjKeysTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "`Obj.keys` only returns keys that exist in the input object.", "mode": "fast-check"} {"id": 57522, "name": "unknown", "code": "it('Every odd element matches delimiter', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.integer(),\n (arr, delimiter) => {\n const actual = Jam.intersperse(arr, delimiter);\n return Arr.forall(actual, (x, i) => i % 2 === 1 ? x === delimiter : true);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/IntersperseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Every odd-indexed element in the result of `Jam.intersperse` matches the given delimiter.", "mode": "fast-check"} {"id": 57523, "name": "unknown", "code": "it('Filtering out delimiters (assuming different type to array to avoid removing original array) should equal original', () => {\n fc.assert(fc.property(\n fc.array(fc.nat()),\n arbNegativeInteger(),\n (arr, delimiter) => {\n const actual = Jam.intersperse(arr, delimiter);\n const filtered = Arr.filter(actual, (a) => a !== delimiter);\n assert.deepEqual(filtered, arr);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/IntersperseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Filtering delimiters from an interspersed array should result in the original array.", "mode": "fast-check"} {"id": 54673, "name": "unknown", "code": "test(\"fuzz accessTokenRemove w/ sub\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (sub) => {\n\t\t\ttry {\n\t\t\t\tawait accessTokenRemove(sub, testSecret.id);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(sub, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/authn-access-token/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`accessTokenRemove` should not throw unhandled errors (other than specific expected ones) when removing an access token with any possible `sub` input.", "mode": "fast-check"} {"id": 57525, "name": "unknown", "code": "it('Adjacent groups have different hashes, and everything in a group has the same hash', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.func(fc.asciiString()),\n (xs, f) => {\n const groups = Arr.groupBy(xs, (x) => f(x));\n\n /* Properties about groups\n * 1. No two adjacent groups can have the same g(..) value\n * 2. Each group must have the same g(..) value\n */\n\n const hasEmptyGroups = Arr.exists(groups, (g) => g.length === 0);\n\n if (hasEmptyGroups) {\n assert.fail('Should not have empty groups');\n }\n // No consecutive groups should have the same result of g.\n const values = Arr.map(groups, (group) => {\n const first = f(group[0]);\n const mapped = Arr.map(group, (g) => f(g));\n\n const isSame = Arr.forall(mapped, (m) => m === first);\n if (!isSame) {\n assert.fail('Not everything in a group has the same g(..) value');\n }\n return first;\n });\n\n const hasSameGroup = Arr.exists(values, (v, i) => i > 0 ? values[i - 1] === values[i] : false);\n\n if (hasSameGroup) {\n assert.fail('A group is next to another group with the same g(..) value');\n }\n return true;\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/GroupByTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Adjacent groups must have different hash values, and within a group, all elements must share the same hash value.", "mode": "fast-check"} {"id": 54675, "name": "unknown", "code": "test(\"fuzz webauthnAuthenticate w/ username\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (username) => {\n\t\t\ttry {\n\t\t\t\tawait webauthnAuthenticate(username, testSecret.value);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(username, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/authn-webauthn/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`webauthnAuthenticate` should handle any input for `username` without throwing unexpected errors, only allowing specific expected errors to pass silently.", "mode": "fast-check"} {"id": 57526, "name": "unknown", "code": "it('Flattening groups equals the original array', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.func(fc.string()),\n (xs, f) => {\n const groups = Arr.groupBy(xs, (x) => f(x));\n\n const output = Arr.flatten(groups);\n assert.deepEqual(output, xs);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/GroupByTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Flattening the groups formed by `Arr.groupBy` on an integer array should result in the original array.", "mode": "fast-check"} {"id": 57527, "name": "unknown", "code": "it('forall of a non-empty array with a predicate that always returns false is false', () => {\n fc.assert(fc.property(\n fc.array(fc.integer(), 1, 30),\n (xs) => {\n assert.isFalse(Arr.forall(xs, Fun.never));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/ForallTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "`Arr.forall` returns false when applied to a non-empty array with a predicate that always returns false.", "mode": "fast-check"} {"id": 57529, "name": "unknown", "code": "it('foldl concat [ ] xs === reverse(xs)', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n (arr) => {\n const output = Arr.foldl(arr, (b: number[], a: number) => [ a ].concat(b), []);\n assert.deepEqual(output, Arr.reverse(arr));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/FoldTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Folding a list from the left using concatenation should produce the reverse of the list.", "mode": "fast-check"} {"id": 57530, "name": "unknown", "code": "it('foldr concat [ ] xs === xs', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n (arr) => {\n const output = Arr.foldr(arr, (b: number[], a: number) => [ a ].concat(b), []);\n assert.deepEqual(output, arr);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/FoldTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Folding right over an array with the concat operation and an empty array should return the original array.", "mode": "fast-check"} {"id": 54676, "name": "unknown", "code": "test(\"fuzz webauthnAuthenticate w/ secret\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (secret) => {\n\t\t\ttry {\n\t\t\t\tawait webauthnAuthenticate(username, secret);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(secret, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/authn-webauthn/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`webauthnAuthenticate` handles various unexpected inputs for `secret` without resulting in unhandled errors, only allowing specific expected error messages.", "mode": "fast-check"} {"id": 57533, "name": "unknown", "code": "it('is consistent with chunking', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.integer(1, 5),\n (arr, chunkSize) => {\n const chunks = Arr.chunk(arr, chunkSize);\n const bound = Arr.flatten(chunks);\n assert.deepEqual(bound, arr);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/FlattenTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Chunking an array and then flattening it should return the original array.", "mode": "fast-check"} {"id": 57540, "name": "unknown", "code": "it('is consistent with find', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n const pred = (x: number) => x % 5 === 0;\n assertOptional(Arr.findIndex(arr, pred).map((x) => arr[x]), Arr.find(arr, pred));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/FindIndexTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "`Arr.findIndex` produces consistent results with `Arr.find` when applied to arrays of integers with a predicate for multiples of 5.", "mode": "fast-check"} {"id": 54678, "name": "unknown", "code": "test(\"fuzz webauthnList w/ sub\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (sub) => {\n\t\t\ttry {\n\t\t\t\tawait webauthnList(sub);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(sub, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/authn-webauthn/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`webauthnList` should handle or produce expected errors for a wide range of `sub` inputs without unexpected exceptions.", "mode": "fast-check"} {"id": 57542, "name": "unknown", "code": "it('Element exists in middle of array', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), fc.array(fc.integer()), (prefix, element, suffix) => {\n const arr2 = Arr.flatten([ prefix, [ element ], suffix ]);\n assert.isTrue(Arr.exists(arr2, eqc(element)));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/ExistsTest.ts", "start_line": null, "end_line": null, "dependencies": ["eqc"], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "An element exists in the middle of a flattened array composed of prefix, the element itself, and suffix arrays.", "mode": "fast-check"} {"id": 57544, "name": "unknown", "code": "it('Element does not exist in empty array', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (i) => {\n assert.isFalse(Arr.exists([], eqc(i)));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/ExistsTest.ts", "start_line": null, "end_line": null, "dependencies": ["eqc"], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "`Arr.exists` returns false when checking for any element in an empty array.", "mode": "fast-check"} {"id": 57546, "name": "unknown", "code": "it('Element exists in non-empty array when predicate always returns true', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), (xs, x) => {\n const arr = Arr.flatten([ xs, [ x ]]);\n assert.isTrue(Arr.exists(arr, always));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/ExistsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "An element exists in a non-empty array if a predicate always returns true.", "mode": "fast-check"} {"id": 54681, "name": "unknown", "code": "test(\"fuzz webauthnRemove w/ sub\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (sub) => {\n\t\t\ttry {\n\t\t\t\tawait webauthnRemove(sub, testSecret.id);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(sub, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/authn-webauthn/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The `webauthnRemove` function should not throw unexpected errors when called with various `sub` values.", "mode": "fast-check"} {"id": 57807, "name": "unknown", "code": "it('child transactions should always have a parent_id', async () => {\n await fc.assert(\n fc\n .asyncProperty(fc.array(messageArb, { maxLength: 100 }), async msgs => {\n const tracer = execTracer();\n tracer.start();\n const cleanup = addSyncListener((oldValues, newValues) => {\n const ts = newValues.get('transactions') as Map<\n string,\n { isChild: number; parent_id: string | null; id: string }\n >;\n if (\n ts &&\n [...ts.values()].find(\n t =>\n t.isChild === 1 && t.parent_id == null && t.id.includes('/'),\n )\n ) {\n } else {\n tracer.event('applied');\n }\n });\n\n await sendMessages(msgs);\n await tracer.expect('applied');\n\n const transactions = await db.all('SELECT * FROM transactions', []);\n for (const trans of transactions) {\n const transMsgs = msgs\n .filter(msg => msg.row === trans.id)\n .sort((m1, m2) => {\n const t1 = m1.timestamp.toString();\n const t2 = m2.timestamp.toString();\n if (t1 < t2) {\n return 1;\n } else if (t1 > t2) {\n return -1;\n }\n return 0;\n });\n const msg = transMsgs.find(m => m.column === 'parent_id');\n\n if (\n trans.isChild === 1 &&\n trans.id.includes('/') &&\n (msg == null || msg.value == null)\n ) {\n // This is a child transaction didn't have a `parent_id`\n // set in the messages. It should have gotten set from\n // the `id`\n const [parentId] = trans.id.split('/');\n expect(parentId).not.toBe(null);\n expect(trans.parent_id).toBe(parentId);\n } else if (msg) {\n // At least one message set `parent_id`\n expect(trans.parent_id).toBe(msg.value);\n } else {\n // `parent_id` should never have been set\n expect(trans.parent_id).toBe(null);\n }\n }\n\n cleanup();\n tracer.end();\n })\n .beforeEach(() => {\n return db.execQuery(`DELETE FROM transactions`);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/my2/actual/packages/loot-core/src/server/sync/migrate.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "my2/actual", "url": "https://github.com/my2/actual.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Child transactions must always have a `parent_id`, which is either set based on the transaction's `id` or populated from messages.", "mode": "fast-check"} {"id": 54683, "name": "unknown", "code": "test(\"fuzz recoveryCodesAuthenticate w/ username\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (username) => {\n\t\t\ttry {\n\t\t\t\tawait recoveryCodesAuthenticate(username, testSecret.value);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(username, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/authn-recovery-codes/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The test checks that `recoveryCodesAuthenticate`, when called with various `username` inputs, only throws expected errors such as \"400 Bad Request\", \"401 Unauthorized\", \"404 Not Found\", or \"409 Conflict\".", "mode": "fast-check"} {"id": 57810, "name": "unknown", "code": "it('aggregate queries work with `splits: grouped`', async () => {\n const payeeIds = ['payee1', 'payee2', 'payee3', 'payee4', 'payee5'];\n\n await fc.assert(\n fc\n .asyncProperty(\n arbs.makeTransactionArray({ splitFreq: 2, payeeIds, maxLength: 100 }),\n async arr => {\n await insertTransactions(arr, payeeIds);\n\n const aggQuery = q('transactions')\n .filter({\n $or: [{ amount: { $lt: -5 } }, { amount: { $gt: -2 } }],\n 'payee.name': { $gt: '' },\n })\n .options({ splits: 'grouped' })\n .calculate({ $sum: '$amount' });\n\n const { data } = await runQuery(aggQuery.serialize());\n\n const sum = aliveTransactions(arr).reduce((sum, trans) => {\n const amount = trans.amount || 0;\n const matched =\n (amount < -5 || amount > -2) && trans.payee != null;\n if (!trans.tombstone && !trans.is_parent && matched) {\n return sum + amount;\n }\n return sum;\n }, 0);\n\n expect(data).toBe(sum);\n },\n )\n .beforeEach(() => {\n setClock(null);\n setSyncingMode('import');\n return db.execQuery(`\n DELETE FROM transactions;\n DELETE FROM payees;\n DELETE FROM payee_mapping;\n `);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/my2/actual/packages/loot-core/src/server/aql/schema/executors.test.ts", "start_line": null, "end_line": null, "dependencies": ["insertTransactions", "aliveTransactions"], "repo": {"name": "my2/actual", "url": "https://github.com/my2/actual.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Aggregate queries with `splits: grouped` option should accurately calculate the sum of amounts from alive, non-tombstoned transactions filtered by specified criteria.", "mode": "fast-check"} {"id": 54684, "name": "unknown", "code": "test(\"fuzz recoveryCodesAuthenticate w/ secret\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (secret) => {\n\t\t\ttry {\n\t\t\t\tawait recoveryCodesAuthenticate(username, secret);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(secret, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/authn-recovery-codes/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`recoveryCodesAuthenticate` handles various inputs for `secret` without throwing unexpected errors.", "mode": "fast-check"} {"id": 54685, "name": "unknown", "code": "test(\"fuzz recoveryCodesCount w/ sub\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (sub) => {\n\t\t\ttry {\n\t\t\t\tawait recoveryCodesCount(sub);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(sub, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/authn-recovery-codes/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The `recoveryCodesCount` function executes without letting unexpected errors pass silently for any given input.", "mode": "fast-check"} {"id": 57812, "name": "unknown", "code": "it('child transactions should always have a parent_id', async () => {\n await fc.assert(\n fc\n .asyncProperty(fc.array(messageArb, { maxLength: 100 }), async msgs => {\n const tracer = execTracer();\n tracer.start();\n const cleanup = addSyncListener((oldValues, newValues) => {\n const ts = newValues.get('transactions') as Map<\n string,\n { isChild: number; parent_id: string | null; id: string }\n >;\n if (\n ts &&\n [...ts.values()].find(\n t =>\n t.isChild === 1 && t.parent_id == null && t.id.includes('/'),\n )\n ) {\n } else {\n tracer.event('applied');\n }\n });\n\n await sendMessages(msgs);\n await tracer.expect('applied');\n\n const transactions = await db.all('SELECT * FROM transactions', []);\n for (const trans of transactions) {\n const transMsgs = msgs\n .filter(msg => msg.row === trans.id)\n .sort((m1, m2) => {\n const t1 = m1.timestamp.toString();\n const t2 = m2.timestamp.toString();\n if (t1 < t2) {\n return 1;\n } else if (t1 > t2) {\n return -1;\n }\n return 0;\n });\n const msg = transMsgs.find(m => m.column === 'parent_id');\n\n if (\n trans.isChild === 1 &&\n trans.id.includes('/') &&\n (msg == null || msg.value == null)\n ) {\n // This is a child transaction didn't have a `parent_id`\n // set in the messages. It should have gotten set from\n // the `id`\n const [parentId] = trans.id.split('/');\n expect(parentId).not.toBe(null);\n expect(trans.parent_id).toBe(parentId);\n } else if (msg) {\n // At least one message set `parent_id`\n expect(trans.parent_id).toBe(msg.value);\n } else {\n // `parent_id` should never have been set\n expect(trans.parent_id).toBe(null);\n }\n }\n\n cleanup();\n tracer.end();\n })\n .beforeEach(() => {\n return db.execQuery(`DELETE FROM transactions`);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/Liuzizhang/actual-zh/packages/loot-core/src/server/sync/migrate.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Liuzizhang/actual-zh", "url": "https://github.com/Liuzizhang/actual-zh.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Child transactions must always have a valid `parent_id`, either set by message or derived from their `id`, with no `parent_id` for non-child transactions unless specified by a message.", "mode": "fast-check"} {"id": 54689, "name": "unknown", "code": "test(\"fuzz recoveryCodesRemove w/ sub\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (sub) => {\n\t\t\ttry {\n\t\t\t\tawait recoveryCodesRemove(sub, testSecret.id);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(sub, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/authn-recovery-codes/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`recoveryCodesRemove` should handle various inputs without causing unexpected errors, logging only when encountering non-expected error messages.", "mode": "fast-check"} {"id": 54691, "name": "unknown", "code": "test(\"fuzz accountUsernameExists w/ username\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (username) => {\n\t\t\ttry {\n\t\t\t\tawait accountUsernameExists(username);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(username, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/account-username/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`accountUsernameExists` should handle any input for `username`, with errors limited to expected HTTP statuses.", "mode": "fast-check"} {"id": 54692, "name": "unknown", "code": "test(\"fuzz accountUsernameLookup w/ username\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (username) => {\n\t\t\ttry {\n\t\t\t\tawait accountUsernameLookup(username);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(username, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/account-username/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`accountUsernameLookup` should handle any input without causing errors outside expected server-related errors.", "mode": "fast-check"} {"id": 57813, "name": "unknown", "code": "it('queries with `splits: inline` returns only non-parents', async () => {\n await fc.assert(\n fc.asyncProperty(\n arbs.makeTransactionArray({\n splitFreq: 2,\n minLength: 2,\n maxLength: 20,\n }),\n async arr => {\n await insertTransactions(arr);\n\n const { data } = await runQuery(\n q('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .options({ splits: 'inline' })\n .serialize(),\n );\n\n expect(data.filter(t => t.is_parent).length).toBe(0);\n expect(data.filter(t => t.tombstone).length).toBe(0);\n\n const { data: defaultData } = await runQuery(\n q('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .serialize(),\n );\n\n // inline should be the default\n expect(defaultData).toEqual(data);\n },\n ),\n { numRuns: 50 },\n );\n })", "language": "typescript", "source_file": "./repos/Liuzizhang/actual-zh/packages/loot-core/src/server/aql/schema/executors.test.ts", "start_line": null, "end_line": null, "dependencies": ["insertTransactions"], "repo": {"name": "Liuzizhang/actual-zh", "url": "https://github.com/Liuzizhang/actual-zh.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Queries using `splits: inline` should return only non-parent transactions, ensuring results are consistent with default query settings.", "mode": "fast-check"} {"id": 57814, "name": "unknown", "code": "it('queries with `splits: none` returns only parents', async () => {\n await fc.assert(\n fc.asyncProperty(\n arbs.makeTransactionArray({\n splitFreq: 2,\n minLength: 2,\n maxLength: 8,\n }),\n async arr => {\n await insertTransactions(arr);\n\n const { data } = await runQuery(\n q('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .options({ splits: 'none' })\n .serialize(),\n );\n\n expect(data.filter(t => t.is_child).length).toBe(0);\n },\n ),\n { numRuns: 50 },\n );\n })", "language": "typescript", "source_file": "./repos/Liuzizhang/actual-zh/packages/loot-core/src/server/aql/schema/executors.test.ts", "start_line": null, "end_line": null, "dependencies": ["insertTransactions"], "repo": {"name": "Liuzizhang/actual-zh", "url": "https://github.com/Liuzizhang/actual-zh.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Queries with `splits: none` should return only parent transactions, ensuring no child transactions are included in the results.", "mode": "fast-check"} {"id": 54695, "name": "unknown", "code": "test(\"fuzz accountUsernameUpdate w/ sub\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (sub) => {\n\t\t\ttry {\n\t\t\t\tawait accountUsernameUpdate(sub, username);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(sub, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/account-username/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`accountUsernameUpdate` function should handle any input without throwing unexpected errors, allowing for certain specified errors.", "mode": "fast-check"} {"id": 57815, "name": "unknown", "code": "it('aggregate queries work with `splits: grouped`', async () => {\n const payeeIds = ['payee1', 'payee2', 'payee3', 'payee4', 'payee5'];\n\n await fc.assert(\n fc\n .asyncProperty(\n arbs.makeTransactionArray({ splitFreq: 2, payeeIds, maxLength: 100 }),\n async arr => {\n await insertTransactions(arr, payeeIds);\n\n const aggQuery = q('transactions')\n .filter({\n $or: [{ amount: { $lt: -5 } }, { amount: { $gt: -2 } }],\n 'payee.name': { $gt: '' },\n })\n .options({ splits: 'grouped' })\n .calculate({ $sum: '$amount' });\n\n const { data } = await runQuery(aggQuery.serialize());\n\n const sum = aliveTransactions(arr).reduce((sum, trans) => {\n const amount = trans.amount || 0;\n const matched =\n (amount < -5 || amount > -2) && trans.payee != null;\n if (!trans.tombstone && !trans.is_parent && matched) {\n return sum + amount;\n }\n return sum;\n }, 0);\n\n expect(data).toBe(sum);\n },\n )\n .beforeEach(() => {\n setClock(null);\n setSyncingMode('import');\n return db.execQuery(`\n DELETE FROM transactions;\n DELETE FROM payees;\n DELETE FROM payee_mapping;\n `);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/Liuzizhang/actual-zh/packages/loot-core/src/server/aql/schema/executors.test.ts", "start_line": null, "end_line": null, "dependencies": ["insertTransactions", "aliveTransactions"], "repo": {"name": "Liuzizhang/actual-zh", "url": "https://github.com/Liuzizhang/actual-zh.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Aggregate queries with `splits: grouped` should correctly calculate the sum of transaction amounts that meet specific conditions, matching the expected result based on alive transactions.", "mode": "fast-check"} {"id": 57817, "name": "unknown", "code": "it('child transactions should always have a parent_id', async () => {\n await fc.assert(\n fc\n .asyncProperty(fc.array(messageArb, { maxLength: 100 }), async msgs => {\n const tracer = execTracer();\n tracer.start();\n const cleanup = addSyncListener((oldValues, newValues) => {\n const ts = newValues.get('transactions') as Map<\n string,\n { isChild: number; parent_id: string | null; id: string }\n >;\n if (\n ts &&\n [...ts.values()].find(\n t =>\n t.isChild === 1 && t.parent_id == null && t.id.includes('/'),\n )\n ) {\n } else {\n tracer.event('applied');\n }\n });\n\n await sendMessages(msgs);\n await tracer.expect('applied');\n\n const transactions = await db.all('SELECT * FROM transactions', []);\n for (const trans of transactions) {\n const transMsgs = msgs\n .filter(msg => msg.row === trans.id)\n .sort((m1, m2) => {\n const t1 = m1.timestamp.toString();\n const t2 = m2.timestamp.toString();\n if (t1 < t2) {\n return 1;\n } else if (t1 > t2) {\n return -1;\n }\n return 0;\n });\n const msg = transMsgs.find(m => m.column === 'parent_id');\n\n if (\n trans.isChild === 1 &&\n trans.id.includes('/') &&\n (msg == null || msg.value == null)\n ) {\n // This is a child transaction didn't have a `parent_id`\n // set in the messages. It should have gotten set from\n // the `id`\n const [parentId] = trans.id.split('/');\n expect(parentId).not.toBe(null);\n expect(trans.parent_id).toBe(parentId);\n } else if (msg) {\n // At least one message set `parent_id`\n expect(trans.parent_id).toBe(msg.value);\n } else {\n // `parent_id` should never have been set\n expect(trans.parent_id).toBe(null);\n }\n }\n\n cleanup();\n tracer.end();\n })\n .beforeEach(() => {\n return db.execQuery(`DELETE FROM transactions`);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dchaves93/richfamily/packages/loot-core/src/server/sync/migrate.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dchaves93/richfamily", "url": "https://github.com/dchaves93/richfamily.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Child transactions must always have a `parent_id` set, either derived from the transaction ID for child transactions with IDs containing '/', or specified directly in the message.", "mode": "fast-check"} {"id": 57818, "name": "unknown", "code": "it('queries with `splits: inline` returns only non-parents', async () => {\n await fc.assert(\n fc.asyncProperty(\n arbs.makeTransactionArray({\n splitFreq: 2,\n minLength: 2,\n maxLength: 20,\n }),\n async arr => {\n await insertTransactions(arr);\n\n const { data } = await runQuery(\n q('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .options({ splits: 'inline' })\n .serialize(),\n );\n\n expect(data.filter(t => t.is_parent).length).toBe(0);\n expect(data.filter(t => t.tombstone).length).toBe(0);\n\n const { data: defaultData } = await runQuery(\n q('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .serialize(),\n );\n\n // inline should be the default\n expect(defaultData).toEqual(data);\n },\n ),\n { numRuns: 50 },\n );\n })", "language": "typescript", "source_file": "./repos/dchaves93/richfamily/packages/loot-core/src/server/aql/schema/executors.test.ts", "start_line": null, "end_line": null, "dependencies": ["insertTransactions"], "repo": {"name": "dchaves93/richfamily", "url": "https://github.com/dchaves93/richfamily.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Queries with `splits: inline` should return only non-parent transactions without tombstone entries, identical to the default query result.", "mode": "fast-check"} {"id": 57819, "name": "unknown", "code": "it('queries with `splits: none` returns only parents', async () => {\n await fc.assert(\n fc.asyncProperty(\n arbs.makeTransactionArray({\n splitFreq: 2,\n minLength: 2,\n maxLength: 8,\n }),\n async arr => {\n await insertTransactions(arr);\n\n const { data } = await runQuery(\n q('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .options({ splits: 'none' })\n .serialize(),\n );\n\n expect(data.filter(t => t.is_child).length).toBe(0);\n },\n ),\n { numRuns: 50 },\n );\n })", "language": "typescript", "source_file": "./repos/dchaves93/richfamily/packages/loot-core/src/server/aql/schema/executors.test.ts", "start_line": null, "end_line": null, "dependencies": ["insertTransactions"], "repo": {"name": "dchaves93/richfamily", "url": "https://github.com/dchaves93/richfamily.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should ensure that querying transactions with the option `splits: none` returns only parent transactions, excluding any child transactions.", "mode": "fast-check"} {"id": 57820, "name": "unknown", "code": "it('aggregate queries work with `splits: grouped`', async () => {\n const payeeIds = ['payee1', 'payee2', 'payee3', 'payee4', 'payee5'];\n\n await fc.assert(\n fc\n .asyncProperty(\n arbs.makeTransactionArray({ splitFreq: 2, payeeIds, maxLength: 100 }),\n async arr => {\n await insertTransactions(arr, payeeIds);\n\n const aggQuery = q('transactions')\n .filter({\n $or: [{ amount: { $lt: -5 } }, { amount: { $gt: -2 } }],\n 'payee.name': { $gt: '' },\n })\n .options({ splits: 'grouped' })\n .calculate({ $sum: '$amount' });\n\n const { data } = await runQuery(aggQuery.serialize());\n\n const sum = aliveTransactions(arr).reduce((sum, trans) => {\n const amount = trans.amount || 0;\n const matched =\n (amount < -5 || amount > -2) && trans.payee != null;\n if (!trans.tombstone && !trans.is_parent && matched) {\n return sum + amount;\n }\n return sum;\n }, 0);\n\n expect(data).toBe(sum);\n },\n )\n .beforeEach(() => {\n setClock(null);\n setSyncingMode('import');\n return db.execQuery(`\n DELETE FROM transactions;\n DELETE FROM payees;\n DELETE FROM payee_mapping;\n `);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dchaves93/richfamily/packages/loot-core/src/server/aql/schema/executors.test.ts", "start_line": null, "end_line": null, "dependencies": ["insertTransactions", "aliveTransactions"], "repo": {"name": "dchaves93/richfamily", "url": "https://github.com/dchaves93/richfamily.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Aggregate queries with the option `splits: grouped` should correctly calculate the sum of `amount` for transactions that are alive, not marked as tombstones or parents, and meet specified filter conditions.", "mode": "fast-check"} {"id": 57822, "name": "unknown", "code": "it('child transactions should always have a parent_id', async () => {\n await fc.assert(\n fc\n .asyncProperty(fc.array(messageArb, { maxLength: 100 }), async msgs => {\n const tracer = execTracer();\n tracer.start();\n const cleanup = addSyncListener((oldValues, newValues) => {\n const ts = newValues.get('transactions') as Map<\n string,\n { isChild: number; parent_id: string | null; id: string }\n >;\n if (\n ts &&\n [...ts.values()].find(\n t =>\n t.isChild === 1 && t.parent_id == null && t.id.includes('/'),\n )\n ) {\n } else {\n tracer.event('applied');\n }\n });\n\n await sendMessages(msgs);\n await tracer.expect('applied');\n\n const transactions = await db.all(\n 'SELECT * FROM transactions',\n [],\n );\n for (const trans of transactions) {\n const transMsgs = msgs\n .filter(msg => msg.row === trans.id)\n .sort((m1, m2) => {\n const t1 = m1.timestamp.toString();\n const t2 = m2.timestamp.toString();\n if (t1 < t2) {\n return 1;\n } else if (t1 > t2) {\n return -1;\n }\n return 0;\n });\n const msg = transMsgs.find(m => m.column === 'parent_id');\n\n if (\n trans.isChild === 1 &&\n trans.id.includes('/') &&\n (msg == null || msg.value == null)\n ) {\n // This is a child transaction didn't have a `parent_id`\n // set in the messages. It should have gotten set from\n // the `id`\n const [parentId] = trans.id.split('/');\n expect(parentId).not.toBe(null);\n expect(trans.parent_id).toBe(parentId);\n } else if (msg) {\n // At least one message set `parent_id`\n expect(trans.parent_id).toBe(msg.value);\n } else {\n // `parent_id` should never have been set\n expect(trans.parent_id).toBe(null);\n }\n }\n\n cleanup();\n tracer.end();\n })\n .beforeEach(() => {\n return db.execQuery(`DELETE FROM transactions`);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/AppelBoomHD/actual/packages/loot-core/src/server/sync/migrate.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "AppelBoomHD/actual", "url": "https://github.com/AppelBoomHD/actual.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Child transactions should always have an associated `parent_id`, either derived from their `id` or set from messages, ensuring the consistency of transaction relationships in the database.", "mode": "fast-check"} {"id": 57823, "name": "unknown", "code": "it('queries with `splits: inline` returns only non-parents', async () => {\n await fc.assert(\n fc.asyncProperty(\n arbs.makeTransactionArray({\n splitFreq: 2,\n minLength: 2,\n maxLength: 20,\n }),\n async arr => {\n await insertTransactions(arr);\n\n const { data } = await aqlQuery(\n q('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .options({ splits: 'inline' })\n .serialize(),\n );\n\n expect(data.filter(t => t.is_parent).length).toBe(0);\n expect(data.filter(t => t.tombstone).length).toBe(0);\n\n const { data: defaultData } = await aqlQuery(\n q('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .serialize(),\n );\n\n // inline should be the default\n expect(defaultData).toEqual(data);\n },\n ),\n { numRuns: 50 },\n );\n })", "language": "typescript", "source_file": "./repos/AppelBoomHD/actual/packages/loot-core/src/server/aql/schema/executors.test.ts", "start_line": null, "end_line": null, "dependencies": ["insertTransactions"], "repo": {"name": "AppelBoomHD/actual", "url": "https://github.com/AppelBoomHD/actual.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Queries with `splits: inline` should return transactions excluding parents and tombstones, and produce results equal to the default query configuration.", "mode": "fast-check"} {"id": 54899, "name": "unknown", "code": "it('accepts valid usernames (4\u201331 chars, no leading/trailing whitespace)', () => {\n\t\tfc.assert(\n\t\t\tfc.property(\n\t\t\t\tfc.string({ minLength: 4, maxLength: 31 }).filter((s) => s.trim() === s && s.length > 0),\n\t\t\t\t(username) => {\n\t\t\t\t\texpect(verifyUsernameInput(username)).toBe(true);\n\t\t\t\t}\n\t\t\t),\n\t\t\t{ numRuns: 200 }\n\t\t);\n\t})", "language": "typescript", "source_file": "./repos/fdnd-agency/toolgankelijk/tests/property/verifyUsernameInput.property.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fdnd-agency/toolgankelijk", "url": "https://github.com/fdnd-agency/toolgankelijk.git", "license": "MIT", "stars": 0, "forks": 5}, "metrics": null, "summary": "`verifyUsernameInput` accepts usernames that are between 4 and 31 characters long, with no leading or trailing whitespace.", "mode": "fast-check"} {"id": 57824, "name": "unknown", "code": "it('queries with `splits: none` returns only parents', async () => {\n await fc.assert(\n fc.asyncProperty(\n arbs.makeTransactionArray({\n splitFreq: 2,\n minLength: 2,\n maxLength: 8,\n }),\n async arr => {\n await insertTransactions(arr);\n\n const { data } = await aqlQuery(\n q('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .options({ splits: 'none' })\n .serialize(),\n );\n\n expect(data.filter(t => t.is_child).length).toBe(0);\n },\n ),\n { numRuns: 50 },\n );\n })", "language": "typescript", "source_file": "./repos/AppelBoomHD/actual/packages/loot-core/src/server/aql/schema/executors.test.ts", "start_line": null, "end_line": null, "dependencies": ["insertTransactions"], "repo": {"name": "AppelBoomHD/actual", "url": "https://github.com/AppelBoomHD/actual.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Queries with the option `splits: none` should return only parent transactions and exclude child transactions.", "mode": "fast-check"} {"id": 57826, "name": "unknown", "code": "describe('transaction executors', () => {\n it('queries with `splits: inline` returns only non-parents', async () => {\n await fc.assert(\n fc.asyncProperty(\n arbs.makeTransactionArray({\n splitFreq: 2,\n minLength: 2,\n maxLength: 20,\n }),\n async arr => {\n await insertTransactions(arr);\n\n const { data } = await aqlQuery(\n q('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .options({ splits: 'inline' })\n .serialize(),\n );\n\n expect(data.filter(t => t.is_parent).length).toBe(0);\n expect(data.filter(t => t.tombstone).length).toBe(0);\n\n const { data: defaultData } = await aqlQuery(\n q('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .serialize(),\n );\n\n // inline should be the default\n expect(defaultData).toEqual(data);\n },\n ),\n { numRuns: 50 },\n );\n });\n\n it('queries with `splits: none` returns only parents', async () => {\n await fc.assert(\n fc.asyncProperty(\n arbs.makeTransactionArray({\n splitFreq: 2,\n minLength: 2,\n maxLength: 8,\n }),\n async arr => {\n await insertTransactions(arr);\n\n const { data } = await aqlQuery(\n q('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .options({ splits: 'none' })\n .serialize(),\n );\n\n expect(data.filter(t => t.is_child).length).toBe(0);\n },\n ),\n { numRuns: 50 },\n );\n });\n\n it('aggregate queries work with `splits: grouped`', async () => {\n const payeeIds = ['payee1', 'payee2', 'payee3', 'payee4', 'payee5'];\n\n await fc.assert(\n fc\n .asyncProperty(\n arbs.makeTransactionArray({ splitFreq: 2, payeeIds, maxLength: 100 }),\n async arr => {\n await insertTransactions(arr, payeeIds);\n\n const aggQuery = q('transactions')\n .filter({\n $or: [{ amount: { $lt: -5 } }, { amount: { $gt: -2 } }],\n 'payee.name': { $gt: '' },\n })\n .options({ splits: 'grouped' })\n .calculate({ $sum: '$amount' });\n\n const { data } = await aqlQuery(aggQuery.serialize());\n\n const sum = aliveTransactions(arr).reduce((sum, trans) => {\n const amount = trans.amount || 0;\n const matched =\n (amount < -5 || amount > -2) && trans.payee != null;\n if (!trans.tombstone && !trans.is_parent && matched) {\n return sum + amount;\n }\n return sum;\n }, 0);\n\n expect(data).toBe(sum);\n },\n )\n .beforeEach(() => {\n setClock(null);\n setSyncingMode('import');\n return db.execQuery(`\n DELETE FROM transactions;\n DELETE FROM payees;\n DELETE FROM payee_mapping;\n `);\n }),\n );\n }, 20_000);\n\n function runTest(makeQuery) {\n const payeeIds = ['payee1', 'payee2', 'payee3', 'payee4', 'payee5'];\n\n async function check(arr) {\n const orderFields = ['payee.name', 'amount', 'id'];\n\n // Insert transactions and get a list of all the alive\n // ones to make it easier to check the data later (don't\n // have to always be filtering out dead ones)\n await insertTransactions(arr, payeeIds);\n const allTransactions = aliveTransactions(arr);\n\n // Query time\n const { query, expectedIds, expectedMatchedIds } = makeQuery(arr);\n\n // First to a query without order to make sure the default\n // order works\n const { data: defaultOrderData } = await aqlQuery(query.serialize());\n expectTransactionOrder(defaultOrderData);\n expect(new Set(defaultOrderData.map(t => t.id))).toEqual(expectedIds);\n\n // Now do the full test, and add a custom order to make\n // sure that doesn't effect anything\n const orderedQuery = query.orderBy(orderFields);\n const { data } = await aqlQuery(orderedQuery.serialize());\n expect(new Set(data.map(t => t.id))).toEqual(expectedIds);\n\n // Validate paging and ordering\n await expectPagedData(orderedQuery, arr.length, data);\n expectTransactionOrder(data, orderFields);\n\n const matchedIds = new Set();\n\n // Check that all the subtransactions were returned\n for (const trans of data) {\n expect(trans.tombstone).toBe(false);\n\n if (expectedMatchedIds) {\n if (!trans._unmatched) {\n expect(expectedMatchedIds.has(trans.id)).toBe(true);\n matchedIds.add(trans.id);\n } else {\n expect(expectedMatchedIds.has(trans.id)).not.toBe(true);\n }\n }\n\n if (trans.is_parent) {\n // Parent transactions should never have a category\n expect(trans.category).toBe(null);\n\n expect(trans.subtransactions.length).toBe(\n allTransactions.filter(t => t.parent_id === trans.id).length,\n );\n\n // Subtransactions should be ordered as well\n expectTransactionOrder(trans.subtransactions, orderFields);\n\n trans.subtransactions.forEach(subtrans => {\n expect(subtrans.tombstone).toBe(false);\n\n if (expectedMatchedIds) {\n if (!subtrans._unmatched) {\n expect(expectedMatchedIds.has(subtrans.id)).toBe(true);\n matchedIds.add(subtrans.id);\n } else {\n expect(expectedMatchedIds.has(subtrans.id)).not.toBe(true);\n }\n }\n });\n }\n }\n\n if (expectedMatchedIds) {\n // Check that transactions that should be matched are\n // marked as such\n expect(matchedIds).toEqual(expectedMatchedIds);\n }\n }\n\n return fc.assert(\n fc\n .asyncProperty(\n arbs.makeTransactionArray({\n splitFreq: 0.1,\n payeeIds,\n maxLength: 100,\n }),\n check,\n )\n .beforeEach(() => {\n setClock(null);\n setSyncingMode('import');\n return db.execQuery(`\n DELETE FROM transactions;\n DELETE FROM payees;\n DELETE FROM payee_mapping;\n `);\n }),\n { numRuns: 300 },\n );\n }\n\n it('queries the correct transactions without filters', async () => {\n return runTest(arr => {\n const expectedIds = new Set(\n arr.filter(t => !t.tombstone && !t.is_child).map(t => t.id),\n );\n\n // Even though we're applying some filters, these are always\n // guaranteed to return the full split transaction so they\n // should take the optimized path\n const happyQuery = q('transactions')\n .filter({\n date: { $gt: '2017-01-01' },\n })\n .options({ splits: 'grouped' })\n .select(['*', 'payee.name']);\n\n // Make sure it's actually taking the happy path\n expect(isHappyPathQuery(happyQuery.serialize())).toBe(true);\n\n return {\n expectedIds,\n query: happyQuery,\n };\n });\n }, 20_000);\n\n it(`queries the correct transactions with a filter`, async () => {\n return runTest(arr => {\n const expectedIds = new Set();\n\n // let parents = toGroup(\n // arr.filter(t => t.is_parent),\n // new Map(Object.entries(groupById(arr.filter(t => t.parent_id))))\n // );\n\n const parents = groupById(arr.filter(t => t.is_parent && !t.tombstone));\n const matched = new Set();\n\n // Pick out some ids to query\n let ids = arr.reduce((ids, trans, idx) => {\n if (idx % 2 === 0) {\n const amount = trans.amount == null ? 0 : trans.amount;\n const matches = (amount < -2 || amount > -1) && trans.payee > '';\n\n if (matches && isAlive(trans, parents)) {\n expectedIds.add(trans.parent_id || trans.id);\n matched.add(trans.id);\n }\n\n ids.push(trans.id);\n }\n\n return ids;\n }, []);\n\n // Because why not? It should deduplicate them\n ids = repeat(ids, 100);\n\n const unhappyQuery = q('transactions')\n .filter({\n id: [{ $oneof: ids }],\n payee: { $gt: '' },\n $or: [{ amount: { $lt: -2 } }, { amount: { $gt: -1 } }],\n })\n .options({ splits: 'grouped' })\n .select(['*', 'payee.name'])\n // Using this because we want `payee` to have ids for the above\n // filter regardless if it points to a dead one or not\n .withoutValidatedRefs();\n\n expect(isHappyPathQuery(unhappyQuery.serialize())).toBe(false);\n\n return {\n expectedIds,\n expectedMatchedIds: matched,\n query: unhappyQuery,\n };\n });\n }, 20_000);\n})", "language": "typescript", "source_file": "./repos/AppelBoomHD/actual/packages/loot-core/src/server/aql/schema/executors.test.ts", "start_line": null, "end_line": null, "dependencies": ["insertTransactions", "aliveTransactions", "expectTransactionOrder", "expectPagedData", "isAlive", "repeat"], "repo": {"name": "AppelBoomHD/actual", "url": "https://github.com/AppelBoomHD/actual.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should ensure different query options (`inline`, `none`, `grouped`) correctly handle parent and child transactions, filtering them based on attributes such as tombstones, and verifying aggregation calculations, order consistency, and matching expected transaction IDs across pages.", "mode": "fast-check"} {"id": 57827, "name": "unknown", "code": "test('compare test framework to real framework', () => {\n // Generate a tree of TestConditions using fast-check\n fc.assert(\n fc.property(fc.integer({min: 1, max: 20}), numConditions => {\n const conditions: TestCondition[] = fc\n .sample(fc.boolean(), numConditions)\n .map(\n value =>\n ({\n type: 'simple',\n right: {value},\n }) as const,\n );\n\n const pivots = conditions.map(\n () => fc.sample(fc.integer({min: 0, max: 100}), 1)[0] > 50,\n );\n\n const expected = conditions.reduce((acc, value, i) => {\n if (acc === undefined) {\n return value;\n }\n return pivots[i] ? simpleAnd(acc, value) : simpleOr(acc, value);\n });\n\n const actualConditions = conditions.map(convertTestCondition);\n const actual = dnf(\n actualConditions.reduce((acc, value, i) => {\n if (acc === undefined) {\n return value;\n }\n return pivots[i] ? and(value, acc) : or(value, acc);\n }),\n );\n\n expect(evaluate(actual as TestCondition)).toBe(evaluate(expected));\n\n // check that the real framework produced a DNF\n // console.log(toStr(actual));\n if (actual.type === 'and') {\n // all conditions should be simple as nothing can nest\n // under an `AND` in DNF\n expect(actual.conditions.every(c => c.type === 'simple')).toBe(true);\n } else if (actual.type === 'or') {\n // below an or can only be `ands` or `simple` conditions.\n expect(\n actual.conditions.every(c => c.type === 'and' || c.type === 'simple'),\n ).toBe(true);\n expect(\n actual.conditions\n .filter(c => c.type === 'and')\n .every(c =>\n // all conditions must be simple as nothing can nest\n // under an `AND` in DNF\n c.conditions.every(c => c.type === 'simple'),\n ),\n ).toBe(true);\n }\n }),\n );\n\n function convertTestCondition(c: TestCondition): Condition {\n assert(c.type === 'simple');\n return {\n type: 'simple',\n right: {\n type: 'literal',\n value: c.right.value,\n },\n op: '=',\n left: {\n type: 'column',\n name: 'n/a',\n },\n };\n }\n})", "language": "typescript", "source_file": "./repos/johnnyhuynh-sportsbet/mono/packages/zql/src/query/expression.test.ts", "start_line": null, "end_line": null, "dependencies": ["simpleAnd", "simpleOr", "evaluate"], "repo": {"name": "johnnyhuynh-sportsbet/mono", "url": "https://github.com/johnnyhuynh-sportsbet/mono.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Evaluates whether a tree of `TestConditions` constructed with logical `and` and `or` operations matches the expected Disjunctive Normal Form (DNF), ensuring each condition's structure and evaluation result are correct.", "mode": "fast-check"} {"id": 57842, "name": "unknown", "code": "test('encode/decodeSecProtocols round-trip', () => {\n fc.assert(\n fc.property(\n fc.record({\n initConnectionMessage: fc.tuple(\n fc.constant<'initConnection'>('initConnection'),\n fc.record(\n {\n desiredQueriesPatch: fc.array(\n fc.oneof(\n fc.record(\n {\n op: fc.constant<'put'>('put'),\n hash: fc.string(),\n ast: fc.constant({\n table: 'table',\n }),\n ttl: fc.option(\n fc.double({\n noDefaultInfinity: true,\n noNaN: true,\n min: 0,\n }),\n {nil: undefined},\n ),\n },\n {requiredKeys: ['op', 'hash', 'ast']},\n ),\n fc.record({\n op: fc.constant<'del'>('del'),\n hash: fc.string(),\n }),\n ),\n ),\n deleted: fc.record(\n {\n clientIDs: fc.array(fc.string()),\n clientGroupIDs: fc.array(fc.string()),\n },\n {requiredKeys: []},\n ),\n },\n {requiredKeys: ['desiredQueriesPatch']},\n ),\n ),\n authToken: fc.option(\n fc.stringOf(\n fc.constantFrom(...'abcdefghijklmnopqrstuvwxyz0123456789-_.'),\n ),\n {nil: undefined},\n ),\n }),\n ({initConnectionMessage, authToken}) => {\n const encoded = encodeSecProtocols(initConnectionMessage, authToken);\n const {\n initConnectionMessage: decodedInitConnectionMessage,\n authToken: decodedAuthToken,\n } = decodeSecProtocols(encoded);\n expect(decodedInitConnectionMessage).toEqual(initConnectionMessage);\n expect(decodedAuthToken).toEqual(authToken);\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/johnnyhuynh-sportsbet/mono/packages/zero-protocol/src/connect.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "johnnyhuynh-sportsbet/mono", "url": "https://github.com/johnnyhuynh-sportsbet/mono.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The encode and decode functions for `SecProtocols` should maintain data consistency, ensuring that the original `initConnectionMessage` and `authToken` can be reconstructed without loss after a round-trip transformation.", "mode": "fast-check"} {"id": 57877, "name": "unknown", "code": "it('cell(x).get() === x', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n const cell = Cell(i);\n assert.equal(cell.get(), i);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/struct/CellTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `Cell` object, when initialized with an integer `x`, should return `x` when the `get` method is called.", "mode": "fast-check"} {"id": 57878, "name": "unknown", "code": "it('cell.get() === last set call', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), fc.integer(), (a, b, c) => {\n const cell = Cell(a);\n assert.equal(cell.get(), a);\n cell.set(b);\n assert.equal(cell.get(), b);\n cell.set(c);\n assert.equal(cell.get(), c);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/struct/CellTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "A `Cell` instance should return the most recent value set using `set()` when retrieved with `get()`.", "mode": "fast-check"} {"id": 57879, "name": "unknown", "code": "it('Error is thrown if not all arguments are supplied', () => {\n fc.assert(fc.property(arbAdt, fc.array(arbKeys, 1, 40), (subject, exclusions) => {\n const original = Arr.filter(allKeys, (k) => !Arr.contains(exclusions, k));\n\n try {\n const branches = Arr.mapToObject(original, () => Fun.identity);\n subject.match(branches);\n return false;\n } catch (err: any) {\n return err.message.indexOf('nothing') > -1;\n }\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "An error should be thrown when not all required arguments are supplied to the `match` function, and this error message should contain the word 'nothing'.", "mode": "fast-check"} {"id": 57880, "name": "unknown", "code": "it('adt.nothing.match should pass [ ]', () => {\n fc.assert(fc.property(arbNothing, (subject) => {\n const contents = subject.match({\n nothing: record,\n unknown: Fun.die('should not be unknown'),\n exact: Fun.die('should not be exact')\n });\n assert.deepEqual(contents, []);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`adt.nothing.match` should return an empty array when matched with `nothing`, avoiding other cases like `unknown` or `exact`.", "mode": "fast-check"} {"id": 57881, "name": "unknown", "code": "it('adt.nothing.match should be same as fold', () => {\n fc.assert(fc.property(arbNothing, (subject) => {\n const matched = subject.match({\n nothing: record,\n unknown: Fun.die('should not be unknown'),\n exact: Fun.die('should not be exact')\n });\n\n const folded = subject.fold(record, Fun.die('should not be unknown'), Fun.die('should not be exact'));\n assert.deepEqual(folded, matched);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Matching with `adt.nothing` should yield the same result as folding with the same function.", "mode": "fast-check"} {"id": 57882, "name": "unknown", "code": "it('adt.unknown.match should pass 1 parameter: [ guesses ]', () => {\n fc.assert(fc.property(arbUnknown, (subject) => {\n const contents = subject.match({\n nothing: Fun.die('should not be nothing'),\n unknown: record,\n exact: Fun.die('should not be exact')\n });\n assert.deepEqual(contents.length, 1);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`adt.unknown.match` should result in `unknown` being the only case receiving one parameter with the `guesses` array.", "mode": "fast-check"} {"id": 57883, "name": "unknown", "code": "it('adt.unknown.match should be same as fold', () => {\n fc.assert(fc.property(arbUnknown, (subject) => {\n const matched = subject.match({\n nothing: Fun.die('should not be nothing'),\n unknown: record,\n exact: Fun.die('should not be exact')\n });\n\n const folded = subject.fold(Fun.die('should not be nothing'), record, Fun.die('should not be exact'));\n assert.deepEqual(folded, matched);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`subject.match` with `unknown` and `subject.fold` using the same function should produce equivalent outcomes.", "mode": "fast-check"} {"id": 57884, "name": "unknown", "code": "it('adt.exact.match should pass 2 parameters [ value, precision ]', () => {\n fc.assert(fc.property(arbExact, (subject) => {\n const contents = subject.match({\n nothing: Fun.die('should not be nothing'),\n unknown: Fun.die('should not be unknown'),\n exact: record\n });\n assert.deepEqual(contents.length, 2);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`adt.exact.match` requires two parameters, `value` and `precision`, and the test ensures `contents` from matching contains exactly two elements.", "mode": "fast-check"} {"id": 57886, "name": "unknown", "code": "it('adt.match must have the right arguments, not just the right number', () => {\n fc.assert(fc.property(arbAdt, (subject) => {\n try {\n subject.match({\n not: Fun.identity,\n the: Fun.identity,\n right: Fun.identity\n });\n return false;\n } catch (err: any) {\n return err.message.indexOf('nothing') > -1;\n }\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that `adt.match` throws an error containing the message \"nothing\" if the match function is provided with arguments that are incorrect, rather than merely having the correct number of arguments.", "mode": "fast-check"} {"id": 57888, "name": "unknown", "code": "it('rightTrim(s + whitespace) === rightTrim(s)', () => {\n fc.assert(fc.property(\n fc.string(),\n (s) => {\n assert.equal(Strings.rTrim(s), Strings.rTrim(s + ' '));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/str/TrimTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Strings.rTrim` produces the same result for a string whether or not it ends with additional whitespace.", "mode": "fast-check"} {"id": 57889, "name": "unknown", "code": "it('trim(whitespace + s) === trim(s)', () => {\n fc.assert(fc.property(\n fc.string(),\n (s) => {\n assert.equal(Strings.trim(s), Strings.trim(' ' + s));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/str/TrimTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `Strings.trim` function should return the same result for a string whether or not it is prefixed with whitespace.", "mode": "fast-check"} {"id": 57890, "name": "unknown", "code": "it('trim(s + whitespace) === trim(s)', () => {\n fc.assert(fc.property(\n fc.string(),\n (s) => {\n assert.equal(Strings.trim(s), Strings.trim(s + ' '));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/str/TrimTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Strings.trim` should produce the same result for a string whether or not it is followed by additional whitespace.", "mode": "fast-check"} {"id": 57891, "name": "unknown", "code": "it('trim(whitespace + s + whitespace) === trim(s)', () => {\n fc.assert(fc.property(\n fc.string(),\n (s) => {\n assert.equal(Strings.trim(s), Strings.trim(' ' + s + ' '));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/str/TrimTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Trimming a string with surrounding whitespace should yield the same result as trimming the string without additional whitespace.", "mode": "fast-check"} {"id": 57918, "name": "unknown", "code": "it('value(x) = value(x)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n assertResult(Result.value(i), Result.value(i));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/ResultInstancesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property asserts that creating `Result` instances with the same integer value results in instances that are considered equal.", "mode": "fast-check"} {"id": 57919, "name": "unknown", "code": "it('error(x) = error(x)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n assertResult(Result.error(i), Result.error(i));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/ResultInstancesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Result.error` should produce identical error instances when given the same integer input.", "mode": "fast-check"} {"id": 57920, "name": "unknown", "code": "it('value(a) != error(e)', () => {\n fc.assert(fc.property(fc.integer(), fc.string(), (a, e) => {\n assert.isFalse(tResult(tNumber, tString).eq(\n Result.value(a),\n Result.error(e)\n ));\n\n assert.isFalse(tResult(tNumber, tString).eq(\n Result.error(e),\n Result.value(a)\n ));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/ResultInstancesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Result.value` and `Result.error` with the same generic parameters should not be considered equal.", "mode": "fast-check"} {"id": 57921, "name": "unknown", "code": "it('(a = b) = (value(a) = value(b))', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), (a, b) => {\n assert.equal(tResult(tNumber, tString).eq(\n Result.value(a),\n Result.value(b)\n ), a === b);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/ResultInstancesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `eq` function of `tResult(tNumber, tString)` returns true if and only if the `Result.value` of two numbers are equal, ensuring consistency with the equivalence of the numbers themselves.", "mode": "fast-check"} {"id": 54706, "name": "unknown", "code": "it('should handle all error types gracefully', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.oneof(\n fc.constant('network-error'),\n fc.constant('timeout'),\n fc.constant('invalid-response'),\n fc.constant('rate-limit'),\n fc.constant('server-error'),\n fc.constant('auth-error')\n ),\n async (errorType) => {\n // Mock different error scenarios\n switch (errorType) {\n case 'network-error':\n mockFetch.mockRejectedValue(new Error('Network error'));\n break;\n case 'timeout':\n mockFetch.mockRejectedValue(new Error('Request timeout'));\n break;\n case 'invalid-response':\n mockFetch.mockResolvedValue({\n ok: true,\n json: async () => { throw new Error('Invalid JSON'); }\n } as Response);\n break;\n case 'rate-limit':\n mockFetch.mockResolvedValue({\n ok: false,\n status: 429,\n json: async () => ({ error: { code: 'RATE_LIMIT_EXCEEDED', message: 'Rate limit exceeded' } })\n } as Response);\n break;\n case 'server-error':\n mockFetch.mockResolvedValue({\n ok: false,\n status: 500,\n json: async () => ({ error: { code: 'INTERNAL_ERROR', message: 'Server error' } })\n } as Response);\n break;\n case 'auth-error':\n mockFetch.mockResolvedValue({\n ok: false,\n status: 401,\n json: async () => ({ error: { code: 'UNAUTHORIZED', message: 'Invalid API key' } })\n } as Response);\n break;\n }\n\n const result = await adapter.search('test query')();\n \n // Error handling property: should always return Either, never throw\n expect(E.isRight(result) || E.isLeft(result)).toBe(true);\n \n // If Right, should indicate failure in response\n if (E.isRight(result)) {\n expect(result.right.success).toBe(false);\n expect(result.right.error).toBeDefined();\n }\n }\n ),\n { numRuns: 50 }\n );\n })", "language": "typescript", "source_file": "./repos/Angleito/Seiron/src/agents/adapters/__tests__/HiveIntelligenceAdapter.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Angleito/Seiron", "url": "https://github.com/Angleito/Seiron.git", "license": "MIT", "stars": 2, "forks": 1}, "metrics": null, "summary": "The adapter's `search` method should return an `Either` type, indicating failure, and not throw errors when handling various specified error scenarios.", "mode": "fast-check"} {"id": 57922, "name": "unknown", "code": "it('(a = b) = (error(a) = error(b))', () => {\n fc.assert(fc.property(fc.string(), fc.string(), (a, b) => {\n assert.equal(tResult(tNumber, tString).eq(\n Result.error(a),\n Result.error(b)\n ), a === b);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/ResultInstancesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Result.error` instances are considered equal if and only if their string error messages are identical.", "mode": "fast-check"} {"id": 57923, "name": "unknown", "code": "it('ResultInstances.pprint', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n assert.equal(Pprint.render(Result.value(i), tResult(tNumber, tString)), `Result.value(\n ${i}\n)`);\n\n assert.equal(Pprint.render(Result.error(i), tResult(tString, tNumber)), `Result.error(\n ${i}\n)`);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/ResultInstancesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Pprint.render` produces correctly formatted string representations for `Result.value` and `Result.error` given integer inputs.", "mode": "fast-check"} {"id": 57924, "name": "unknown", "code": "it('Optionals.cat of only nones should be an empty array', () => {\n fc.assert(fc.property(\n fc.array(ArbDataTypes.arbOptionalNone()),\n (options) => {\n const output = Optionals.cat(options);\n assert.deepEqual(output, []);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optionals.cat` returns an empty array when given an array containing only `none` values.", "mode": "fast-check"} {"id": 57925, "name": "unknown", "code": "it('Optionals.cat of only somes should have the same length', () => {\n fc.assert(fc.property(\n fc.array(ArbDataTypes.arbOptionalSome(fc.integer())),\n (options) => {\n const output = Optionals.cat(options);\n assert.lengthOf(output, options.length);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optionals.cat` applied to an array of `Some` values should produce an output array with the same length as the input array.", "mode": "fast-check"} {"id": 57927, "name": "unknown", "code": "it('Optionals.cat of somes and nones should have length <= original', () => {\n fc.assert(fc.property(\n fc.array(ArbDataTypes.arbOptional(fc.integer())),\n (arr) => {\n const output = Optionals.cat(arr);\n assert.isAtMost(output.length, arr.length);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optionals.cat` produces an array with a length less than or equal to the input array when combining optional integers.", "mode": "fast-check"} {"id": 57928, "name": "unknown", "code": "it('Optionals.cat of nones.concat(somes).concat(nones) should be somes', () => {\n fc.assert(fc.property(\n fc.array(fc.json()),\n fc.array(fc.json()),\n fc.array(fc.json()),\n (before, on, after) => {\n const beforeNones: Optional[] = Arr.map(before, Optional.none);\n const afterNones = Arr.map(after, Optional.none);\n const onSomes = Arr.map(on, Optional.some);\n const output = Optionals.cat(beforeNones.concat(onSomes).concat(afterNones));\n assert.deepEqual(output, on);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optionals.cat` retains only the elements wrapped in `Optional.some` when given a concatenated array of `Optional.none`, `Optional.some`, and `Optional.none`.", "mode": "fast-check"} {"id": 57932, "name": "unknown", "code": "it('Two some values', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), (n, m) => {\n assertOptional(Optionals.sequence([ Optional.some(n), Optional.some(m) ]), Optional.some([ n, m ]));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalsSequenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `Optionals.sequence` function should combine two `Optional.some` values into a single `Optional.some` containing an array of those values.", "mode": "fast-check"} {"id": 57933, "name": "unknown", "code": "it('Array of numbers', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (n) => {\n const someNumbers = Arr.map(n, (x) => Optional.some(x));\n assertOptional(Optionals.sequence(someNumbers), Optional.some(n));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalsSequenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optionals.sequence` combines an array of `Optional` numbers into `Optional.some` if all are `Optional.some`.", "mode": "fast-check"} {"id": 57934, "name": "unknown", "code": "it('Some then none', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (n) => {\n const someNumbers = Arr.map(n, (x) => Optional.some(x));\n assertNone(Optionals.sequence([ ...someNumbers, Optional.none() ]));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalsSequenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optionals.sequence` returns `None` when a sequence includes `None` among `Some` values.", "mode": "fast-check"} {"id": 58113, "name": "unknown", "code": "it('reverses 3 elements', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), fc.integer(), (a, b, c) => {\n assert.deepEqual(Arr.reverse([ a, b, c ]), [ c, b, a ]);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/ReverseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.reverse` should reverse an array of three integers.", "mode": "fast-check"} {"id": 58114, "name": "unknown", "code": "it('every element in the input is in the output, and vice-versa', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (xs) => {\n const rxs = Arr.reverse(xs);\n assert.isTrue(Arr.forall(rxs, (x) => Arr.contains(xs, x)));\n assert.isTrue(Arr.forall(xs, (x) => Arr.contains(rxs, x)));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/ReverseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Reversed array contains all elements from the original array and vice versa.", "mode": "fast-check"} {"id": 58148, "name": "unknown", "code": "it('every member of ys-xs is in ys', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.array(fc.integer()), (xs, ys) => {\n const diff = Arr.difference(ys, xs);\n return Arr.forall(diff, (d) => Arr.contains(ys, d));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/DifferenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Every element in the array resulting from `Arr.difference(ys, xs)` is contained in `ys`.", "mode": "fast-check"} {"id": 58149, "name": "unknown", "code": "it('returns true when element is in array', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), fc.array(fc.integer()), (prefix, element, suffix) => {\n const arr2 = [ ...prefix, element, ...suffix ];\n assert.isTrue(Arr.contains(arr2, element));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/ContainsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.contains` returns true when the specified element is present in the array composed of a prefix, the element, and a suffix.", "mode": "fast-check"} {"id": 58150, "name": "unknown", "code": "it('creates an array of the appropriate length except for the last one', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.nat(),\n (arr, rawChunkSize) => {\n // ensure chunkSize is at least one\n const chunkSize = rawChunkSize + 1;\n const chunks = Arr.chunk(arr, chunkSize);\n\n const numChunks = chunks.length;\n const firstParts = chunks.slice(0, numChunks - 1);\n\n for (const firstPart of firstParts) {\n assert.lengthOf(firstPart, chunkSize);\n }\n\n if (arr.length === 0) {\n assert.deepEqual(chunks, []);\n } else {\n assert.isAtMost(chunks[chunks.length - 1].length, chunkSize);\n }\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/ChunkTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Arrays are divided into chunks of a specified length, with all chunks except possibly the last having the exact specified length. If the array is empty, the result is an empty array.", "mode": "fast-check"} {"id": 58152, "name": "unknown", "code": "it('returns last element when non-empty', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), (init, last) => {\n const arr = init.concat([ last ]);\n assertSome(Arr.last(arr), last);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/ArrLastTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.last` returns the last element of a non-empty array.", "mode": "fast-check"} {"id": 58153, "name": "unknown", "code": "it('returns first element when nonEmpty', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), (t, h) => {\n const arr = [ h, ...t ];\n assertSome(Arr.head(arr), h);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/ArrHeadTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.head` returns the first element of a non-empty array.", "mode": "fast-check"} {"id": 58155, "name": "unknown", "code": "it('returns some for valid index (property test)', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), fc.integer(), (array, h, t) => {\n const arr = [ h ].concat(array);\n const length = arr.push(t);\n const midIndex = Math.round(arr.length / 2);\n\n assertSome(Arr.get(arr, 0), h);\n assertSome(Arr.get(arr, midIndex), arr[midIndex]);\n assertSome(Arr.get(arr, length - 1), t);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/ArrGetTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.get` returns a value wrapped in `Some` for valid indices: 0, middle, and last index of an array.", "mode": "fast-check"} {"id": 58156, "name": "unknown", "code": "it('finds a value in the array', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), fc.array(fc.integer()), (prefix, i, suffix) => {\n const arr = prefix.concat([ i ]).concat(suffix);\n const pred = (x: number) => x === i;\n const result = Arr.find(arr, pred);\n assertSome(result, i);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/ArrFindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `Arr.find` function should locate a specified integer within an array and return it using a predicate that matches the integer.", "mode": "fast-check"} {"id": 58157, "name": "unknown", "code": "it('cannot find a nonexistent value', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n const result = Arr.find(arr, Fun.never);\n assertNone(result);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/ArrFindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `Arr.find` should return `None` when searching for a value that does not exist in an array.", "mode": "fast-check"} {"id": 58159, "name": "unknown", "code": "it('Arr.findMap of non-empty is none if f is Optional.none', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n (arr) => {\n assertNone(Arr.findMap(arr, Optional.none));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/ArrFindMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.findMap` returns none when applied to a non-empty array with `Optional.none` as the mapping function.", "mode": "fast-check"} {"id": 54711, "name": "unknown", "code": "it('should maintain response structure invariants', async () => {\n const apiResponseGenerator = fc.record({\n success: fc.boolean(),\n data: fc.option(fc.array(fc.record({\n id: fc.string(),\n title: fc.string(),\n type: fc.constantFrom('transaction', 'address', 'token', 'protocol'),\n relevanceScore: fc.float({ min: 0, max: 1 })\n }))),\n error: fc.option(fc.record({\n code: fc.string(),\n message: fc.string()\n })),\n metadata: fc.option(fc.record({\n creditsUsed: fc.integer({ min: 0, max: 10 }),\n queryTime: fc.integer({ min: 1, max: 5000 }),\n resultCount: fc.integer({ min: 0, max: 1000 }),\n queryId: fc.string()\n }))\n });\n\n await fc.assert(\n fc.asyncProperty(\n apiResponseGenerator,\n async (mockResponse) => {\n mockFetch.mockResolvedValue(createMockResponse(mockResponse));\n\n const result = await adapter.search('invariant test')();\n \n // Invariant: Response should always be Either\n expect(E.isRight(result) || E.isLeft(result)).toBe(true);\n \n if (E.isRight(result)) {\n // Invariant: Response should have success field\n expect(typeof result.right.success).toBe('boolean');\n \n // Invariant: If success is true, data should be defined\n if (result.right.success) {\n expect(result.right.data).toBeDefined();\n }\n \n // Invariant: If success is false, error should be defined\n if (!result.right.success) {\n expect(result.right.error).toBeDefined();\n }\n }\n }\n ),\n { numRuns: 100 }\n );\n })", "language": "typescript", "source_file": "./repos/Angleito/Seiron/src/agents/adapters/__tests__/HiveIntelligenceAdapter.property.test.ts", "start_line": null, "end_line": null, "dependencies": ["createMockResponse"], "repo": {"name": "Angleito/Seiron", "url": "https://github.com/Angleito/Seiron.git", "license": "MIT", "stars": 2, "forks": 1}, "metrics": null, "summary": "The response from `adapter.search` should always be an Either type with a `success` field, and based on the `success` boolean, either `data` or `error` should be defined accordingly.", "mode": "fast-check"} {"id": 58160, "name": "unknown", "code": "it('Arr.findMap finds an element', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.integer(),\n fc.integer(),\n fc.array(fc.integer()),\n (prefix, element, ret, suffix) => {\n const arr = [ ...prefix, element, ...suffix ];\n assertSome(Arr.findMap(arr, (x) => Optionals.someIf(x === element, ret)), ret);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/ArrFindMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.findMap` should successfully locate an element in an array and return a mapped value when the element matches the specified condition.", "mode": "fast-check"} {"id": 58164, "name": "unknown", "code": "it('obeys left identity law', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), (i, j) => {\n const f = (x: number) => [ x, j, x + j ];\n assert.deepEqual(Arr.bind(Arr.pure(i), f), f(i));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/ArrBindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures that `Arr.bind` and `Arr.pure` together obey the left identity law, meaning binding a function `f` to a single-element array created by `Arr.pure(i)` produces the same result as applying `f` directly to `i`.", "mode": "fast-check"} {"id": 58166, "name": "unknown", "code": "it('is associative', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), (arr, j) => {\n const f = (x: number) => [ x, j, x + j ];\n const g = (x: number) => [ j, x, x + j ];\n assert.deepEqual(Arr.bind(Arr.bind(arr, f), g), Arr.bind(arr, (x) => Arr.bind(f(x), g)));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/ArrBindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Associativity test for the `Arr.bind` function, ensuring that binding nested functions produces equivalent results regardless of the nesting order.", "mode": "fast-check"} {"id": 58178, "name": "unknown", "code": "it('should parse a custom an error with an argument coming from the contract itself', async () => {\n const errorParser = await createErrorParser()\n\n await fc.assert(\n fc.asyncProperty(fc.string(), async (arg) => {\n const error = await assertFailed(contract.throwWithCustomErrorAndArgument(arg))\n const parsedError = await errorParser(error)\n\n expect(parsedError).toEqual(new CustomError('CustomErrorWithAnArgument', [arg]))\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/tests/devtools-evm-hardhat-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The error parser accurately identifies and interprets a custom error with an argument originating from the contract.", "mode": "fast-check"} {"id": 58179, "name": "unknown", "code": "it('should parse a custom an error with an argument coming from a nested contract', async () => {\n const errorParser = await createErrorParser()\n\n await fc.assert(\n fc.asyncProperty(fc.string(), async (arg) => {\n const error = await assertFailed(contract.throwNestedWithCustomErrorAndArgument(arg))\n const parsedError = await errorParser(error)\n\n expect(parsedError).toEqual(new CustomError('NestedCustomErrorWithAnArgument', [arg]))\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/tests/devtools-evm-hardhat-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Parses a custom error including an argument from a nested contract and verifies the parsed error matches `NestedCustomErrorWithAnArgument` with the provided argument.", "mode": "fast-check"} {"id": 58180, "name": "unknown", "code": "it('should parse a custom an error with an different arguments defined in more contracts coming from the contract itself', async () => {\n const errorParser = await createErrorParser()\n\n await fc.assert(\n fc.asyncProperty(fc.string(), async (arg) => {\n const error = await assertFailed(contract.throwWithCommonErrorAndArgument(arg))\n const parsedError = await errorParser(error)\n\n expect(parsedError).toEqual(new CustomError('CommonErrorWithAnArgument', [arg]))\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/tests/devtools-evm-hardhat-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Verifies that a custom error with varying arguments is correctly parsed from contracts, matching the expected `CustomError` structure.", "mode": "fast-check"} {"id": 54714, "name": "unknown", "code": "it('should preserve error types through Either chains', async () => {\n const errorChainProperty = fc.property(\n fc.oneof(\n fc.constant({ type: 'network_error', message: 'Connection failed' }),\n fc.constant({ type: 'slippage_exceeded', expected: '100', actual: '95', limit: '98' }),\n fc.constant({ type: 'insufficient_liquidity', pair: 'SEI/USDC', requested: '1000', available: '500' })\n ),\n (error) => {\n const errorEither = E.left(error);\n const chainedResult = pipe(\n errorEither,\n E.chain(() => E.right('success')),\n E.mapLeft(err => ({ ...err, enhanced: true }))\n );\n \n return E.isLeft(chainedResult) && chainedResult.left.type === error.type;\n }\n );\n\n await fc.assert(errorChainProperty, { numRuns: 100 });\n })", "language": "typescript", "source_file": "./repos/Angleito/Seiron/src/protocols/sei/__tests__/SymphonyProtocolWrapper.enhanced.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Angleito/Seiron", "url": "https://github.com/Angleito/Seiron.git", "license": "MIT", "stars": 2, "forks": 1}, "metrics": null, "summary": "Error types should remain unchanged through either chains, even when transformed or enhanced.", "mode": "fast-check"} {"id": 54716, "name": "unknown", "code": "it('should maintain reasonable memory usage', async () => {\n const memoryProperty = fc.property(\n fc.record({\n operationType: fc.oneof(\n fc.constant('batch_quotes'),\n fc.constant('route_calculation'),\n fc.constant('price_update')\n ),\n batchSize: fc.nat({ min: 1, max: 100 }),\n cacheSize: fc.nat({ min: 0, max: 1000 })\n }),\n (data) => {\n // Mock memory calculation\n const baseMemory = 1024 * 1024; // 1MB base\n const memoryPerItem = 1024; // 1KB per item\n const cacheMemory = data.cacheSize * 512; // 512B per cache entry\n \n const estimatedMemory = baseMemory + (data.batchSize * memoryPerItem) + cacheMemory;\n const memoryLimit = 50 * 1024 * 1024; // 50MB limit\n \n return estimatedMemory <= memoryLimit;\n }\n );\n\n await fc.assert(memoryProperty, { numRuns: 100 });\n })", "language": "typescript", "source_file": "./repos/Angleito/Seiron/src/protocols/sei/__tests__/SymphonyProtocolWrapper.enhanced.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Angleito/Seiron", "url": "https://github.com/Angleito/Seiron.git", "license": "MIT", "stars": 2, "forks": 1}, "metrics": null, "summary": "Memory usage should remain within a 50MB limit based on operation type, batch size, and cache size estimations.", "mode": "fast-check"} {"id": 58181, "name": "unknown", "code": "it('should parse a custom an error with different arguments defined in more contracts coming from a nested contract', async () => {\n const errorParser = await createErrorParser()\n\n await fc.assert(\n fc.asyncProperty(fc.integer({ min: 0 }), async (arg) => {\n const error = await assertFailed(contract.throwNestedWithCommonErrorAndArgument(arg))\n const parsedError = await errorParser(error)\n\n expect(parsedError).toEqual(new CustomError('CommonErrorWithAnArgument', [BigNumber.from(arg)]))\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/tests/devtools-evm-hardhat-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Verifies that an error from a nested contract with varying arguments is correctly parsed as a `CustomError` with the expected name and argument.", "mode": "fast-check"} {"id": 58191, "name": "unknown", "code": "it('should parse an Error', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, fc.string(), async (eid, message) => {\n const errorParser = await createContractErrorParser({ contract, eid })\n const error = new Error(message)\n const parsedError = await errorParser(error)\n\n expect(parsedError).toEqual(new UnknownError(`Unknown error: ${error}`))\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/tests/devtools-evm-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures that the error parser translates any given error into an `UnknownError` with the appropriate message format.", "mode": "fast-check"} {"id": 58194, "name": "unknown", "code": "it('should pass any additional properties through', () => {\n fc.assert(\n fc.property(\n oappNodeConfigArbitrary,\n fc.dictionary(fc.string(), fc.anything()),\n (config, extraProperties) => {\n const combined = Object.assign({}, extraProperties, config)\n\n expect(combined).toMatchObject(OAppNodeConfigSchema.parse(combined))\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools/test/oapp/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The schema should accept configurations with additional properties without error.", "mode": "fast-check"} {"id": 58196, "name": "unknown", "code": "it('should return true if the owner addresses match', async () => {\n await fc.assert(\n fc.asyncProperty(omniContractArbitrary, evmAddressArbitrary, async (omniContract, owner) => {\n omniContract.contract.owner.mockResolvedValue(owner)\n\n const sdk = new OApp(omniContract)\n const ownable = Object.assign(sdk, OwnableMixin)\n\n expect(await ownable.hasOwner(owner)).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools-evm/test/ownable/mixin.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that `hasOwner` returns true when the owner's address matches the address set in the mock contract.", "mode": "fast-check"} {"id": 58197, "name": "unknown", "code": "it('should return false if the owner addresses do not match', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n evmAddressArbitrary,\n evmAddressArbitrary,\n async (omniContract, owner, user) => {\n fc.pre(!areBytes32Equal(owner, user))\n\n omniContract.contract.owner.mockResolvedValue(owner)\n\n const sdk = new OApp(omniContract)\n const ownable = Object.assign(sdk, OwnableMixin)\n\n expect(await ownable.hasOwner(user)).toBeFalsy()\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools-evm/test/ownable/mixin.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test confirms that `hasOwner` returns false when given an address that does not match the owner address of the contract.", "mode": "fast-check"} {"id": 58198, "name": "unknown", "code": "it('should encode data for a transferOwnership call', async () => {\n await fc.assert(\n fc.asyncProperty(omniContractArbitrary, evmAddressArbitrary, async (omniContract, owner) => {\n const sdk = new OApp(omniContract)\n const ownable = Object.assign(sdk, OwnableMixin)\n const encodeFunctionData = omniContract.contract.interface.encodeFunctionData as jest.Mock\n\n encodeFunctionData.mockClear()\n\n await ownable.setOwner(owner)\n\n expect(encodeFunctionData).toHaveBeenCalledTimes(1)\n expect(encodeFunctionData).toHaveBeenCalledWith('transferOwnership', [owner])\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools-evm/test/ownable/mixin.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`OwnableMixin` correctly encodes the data for a `transferOwnership` call when setting a new owner.", "mode": "fast-check"} {"id": 58199, "name": "unknown", "code": "it('should call peers on the contract', async () => {\n await fc.assert(\n fc.asyncProperty(omniContractArbitrary, endpointArbitrary, async (omniContract, peerEid) => {\n const sdk = new OApp(omniContract)\n\n await sdk.getPeer(peerEid)\n\n expect(omniContract.contract.peers).toHaveBeenCalledTimes(1)\n expect(omniContract.contract.peers).toHaveBeenCalledWith(peerEid)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that calling `getPeer` on the `OApp` instance results in the `peers` method of the `omniContract.contract` being called once with the correct `peerEid` argument.", "mode": "fast-check"} {"id": 54719, "name": "unknown", "code": "test('should autocomplete queries (basic)', async () => {\n await fc.assert(\n fc\n .asyncProperty(fc.scheduler({ act }), async (s) => {\n // Arrange\n const allResults = ['apple', 'banana', 'orange', 'pineapple'];\n suggestionsFor.mockImplementation(\n s.scheduleFunction(async (query) => {\n return allResults.filter((r) => r.includes(query)).slice(0, 10);\n })\n );\n const userQuery = 'nan';\n const expectedResults = ['banana'];\n\n // Act\n const { getByRole, getAllByRole } = render();\n await act(async () => {\n await userEvent.type(getByRole('textbox'), userQuery, { allAtOnce: false, delay: 1 });\n });\n await s.waitAll();\n\n // Assert\n const displayedSuggestions = getAllByRole('listitem');\n expect(displayedSuggestions.map((el) => el.textContent)).toEqual(expectedResults);\n expect(suggestionsFor).toHaveBeenCalledTimes(userQuery.length);\n })\n .beforeEach(() => {\n jest.resetAllMocks();\n cleanup();\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/talk-react-europe-2020/autocomplete-case/src/Autocomplete.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/talk-react-europe-2020", "url": "https://github.com/dubzzz/talk-react-europe-2020.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Autocomplete suggestions should match expected results based on query input, ensuring each character triggers a suggestion lookup.", "mode": "fast-check"} {"id": 58200, "name": "unknown", "code": "it('should return undefined if peers() returns a zero address, null or undefined', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n evmEndpointArbitrary,\n nullishAddressArbitrary,\n async (omniContract, peerEid, peer) => {\n omniContract.contract.peers.mockResolvedValue(peer)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.getPeer(peerEid)).resolves.toBeUndefined()\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `getPeer` method should return undefined if the `peers()` function resolves to a zero address, null, or undefined.", "mode": "fast-check"} {"id": 58202, "name": "unknown", "code": "it('should return undefined if peers() returns a zero address, null or undefined', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n solanaEndpointArbitrary,\n nullishAddressArbitrary,\n async (omniContract, peerEid, peer) => {\n omniContract.contract.peers.mockResolvedValue(peer)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.getPeer(peerEid)).resolves.toBeUndefined()\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`getPeer` should return undefined if `peers()` resolves to a zero address, null, or undefined.", "mode": "fast-check"} {"id": 58203, "name": "unknown", "code": "it('should return an address if peers() returns a non-null bytes', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n evmEndpointArbitrary,\n solanaEndpointArbitrary,\n solanaAddressArbitrary,\n async (omniContract, eid, peerEid, peer) => {\n // For Solana we need to take the native address format and turn it into EVM bytes32\n //\n // We do this by normalizing the value into a UInt8Array,\n // then denormalizing it using an EVM eid\n const peerBytes = normalizePeer(peer, peerEid)\n const peerHex = makeBytes32(peerBytes)\n\n fc.pre(!isZero(peerHex))\n\n omniContract.contract.peers.mockResolvedValue(peerHex)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.getPeer(peerEid)).resolves.toBe(peer)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "An `OApp` instance should return the correct address when `peers()` returns non-null EVM bytes32 representations of Solana addresses.", "mode": "fast-check"} {"id": 58204, "name": "unknown", "code": "it('should return undefined if peers() returns a zero address, null or undefined', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n aptosEndpointArbitrary,\n nullishAddressArbitrary,\n async (omniContract, peerEid, peer) => {\n omniContract.contract.peers.mockResolvedValue(peer)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.getPeer(peerEid)).resolves.toBeUndefined()\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that `getPeer` returns `undefined` when `peers()` resolves to a zero address, `null`, or `undefined`.", "mode": "fast-check"} {"id": 58205, "name": "unknown", "code": "it('should return an address if peers() returns a non-null bytes', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n aptosEndpointArbitrary,\n aptosAddressArbitrary,\n async (omniContract, peerEid, peer) => {\n fc.pre(!isZero(peer))\n\n omniContract.contract.peers.mockResolvedValue(peer)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.getPeer(peerEid)).resolves.toBe(peer)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "An address should be returned if the `peers()` method returns non-null bytes for a given peer ID.", "mode": "fast-check"} {"id": 58206, "name": "unknown", "code": "it('should return true if peers returns a zero address', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n evmEndpointArbitrary,\n nullishAddressArbitrary,\n nullishAddressArbitrary,\n async (omniContract, peerEid, peer, probePeer) => {\n omniContract.contract.peers.mockResolvedValue(peer)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.hasPeer(peerEid, probePeer)).resolves.toBe(true)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`OApp.hasPeer` should return true when the peer address is resolved to a zero address by `contract.peers`.", "mode": "fast-check"} {"id": 58210, "name": "unknown", "code": "it('should return false if peers returns a different value', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n solanaEndpointArbitrary,\n solanaAddressArbitrary,\n solanaAddressArbitrary,\n async (omniContract, peerEid, peer, probePeer) => {\n fc.pre(\n !areBytes32Equal(normalizePeer(peer, peerEid), normalizePeer(probePeer, peerEid))\n )\n\n const peerHex = makeBytes32(normalizePeer(peer, peerEid))\n\n omniContract.contract.peers.mockResolvedValue(peerHex)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.hasPeer(peerEid, probePeer)).resolves.toBe(false)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`OApp.hasPeer` should return false when `peers` resolves with a different normalized peer value than the one being checked.", "mode": "fast-check"} {"id": 58214, "name": "unknown", "code": "it('should return true if peers() returns a matching bytes32', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n aptosEndpointArbitrary,\n aptosAddressArbitrary,\n async (omniContract, peerEid, peer) => {\n omniContract.contract.peers.mockResolvedValue(makeBytes32(peer))\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.hasPeer(peerEid, peer)).resolves.toBe(true)\n await expect(sdk.hasPeer(peerEid, makeBytes32(peer))).resolves.toBe(true)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The method `hasPeer` should return true when `peers()` returns a bytes32 value that matches the provided peer.", "mode": "fast-check"} {"id": 54723, "name": "unknown", "code": "it('queries with `splits: none` returns only parents', async () => {\n await fc.assert(\n fc.asyncProperty(\n arbs.makeTransactionArray({\n splitFreq: 2,\n minLength: 2,\n maxLength: 8\n }),\n async arr => {\n await insertTransactions(arr);\n\n let { data } = await runQuery(\n query('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .options({ splits: 'none' })\n .serialize()\n );\n\n expect(data.filter(t => t.is_child).length).toBe(0);\n }\n ),\n { numRuns: 50 }\n );\n })", "language": "typescript", "source_file": "./repos/TomAFrench/temp-actual/packages/loot-core/src/server/aql/schema/executors.test.js", "start_line": null, "end_line": null, "dependencies": ["insertTransactions"], "repo": {"name": "TomAFrench/temp-actual", "url": "https://github.com/TomAFrench/temp-actual.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Queries with the option `splits: none` should return only transactions that are not children, excluding any split transactions.", "mode": "fast-check"} {"id": 58215, "name": "unknown", "code": "it('should encode data for a setPeer call', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n evmEndpointArbitrary,\n evmAddressArbitrary,\n async (omniContract, peerEid, peerAddress) => {\n const sdk = new OApp(omniContract)\n const encodeFunctionData = omniContract.contract.interface.encodeFunctionData\n\n ;(encodeFunctionData as jest.Mock).mockClear()\n\n await sdk.setPeer(peerEid, peerAddress)\n\n expect(encodeFunctionData).toHaveBeenCalledTimes(1)\n expect(encodeFunctionData).toHaveBeenCalledWith('setPeer', [\n peerEid,\n makeBytes32(peerAddress),\n ])\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`setPeer` call correctly encodes data using `encodeFunctionData` with `peerEid` and a bytes32 formatted `peerAddress`.", "mode": "fast-check"} {"id": 58216, "name": "unknown", "code": "it('should return an OmniTransaction', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n evmEndpointArbitrary,\n evmAddressArbitrary,\n fc.string(),\n async (omniContract, peerEid, peerAddress, data) => {\n const encodeFunctionData = omniContract.contract.interface.encodeFunctionData as jest.Mock\n encodeFunctionData.mockReturnValue(data)\n\n const sdk = new OApp(omniContract)\n const transaction = await sdk.setPeer(peerEid, peerAddress)\n\n expect(transaction).toEqual({\n data,\n description: `Setting peer for eid ${peerEid} (${formatEid(peerEid)}) to address ${makeBytes32(peerAddress)}`,\n point: {\n eid: omniContract.eid,\n address: omniContract.contract.address,\n },\n })\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Returns an `OmniTransaction` object with correctly formatted data, description, and point properties after calling `setPeer` on an `OApp` instance with given inputs.", "mode": "fast-check"} {"id": 58217, "name": "unknown", "code": "it('should encode data for a setPeer call', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n solanaEndpointArbitrary,\n solanaAddressArbitrary,\n async (omniContract, peerEid, peerAddress) => {\n const sdk = new OApp(omniContract)\n const encodeFunctionData = omniContract.contract.interface.encodeFunctionData\n\n ;(encodeFunctionData as jest.Mock).mockClear()\n\n await sdk.setPeer(peerEid, peerAddress)\n\n expect(encodeFunctionData).toHaveBeenCalledTimes(1)\n expect(encodeFunctionData).toHaveBeenCalledWith('setPeer', [\n peerEid,\n makeBytes32(normalizePeer(peerAddress, peerEid)),\n ])\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that calling `setPeer` on an `OApp` instance results in exactly one call to `encodeFunctionData` with the appropriate `setPeer` function name and parameters consisting of `peerEid` and a normalized byte representation of `peerAddress` paired with `peerEid`.", "mode": "fast-check"} {"id": 58218, "name": "unknown", "code": "it('should return an OmniTransaction', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n solanaEndpointArbitrary,\n solanaAddressArbitrary,\n fc.string(),\n async (omniContract, peerEid, peerAddress, data) => {\n const encodeFunctionData = omniContract.contract.interface.encodeFunctionData as jest.Mock\n encodeFunctionData.mockReturnValue(data)\n\n const sdk = new OApp(omniContract)\n const transaction = await sdk.setPeer(peerEid, peerAddress)\n\n expect(transaction).toEqual({\n data,\n description: `Setting peer for eid ${peerEid} (${formatEid(peerEid)}) to address ${makeBytes32(normalizePeer(peerAddress, peerEid))}`,\n point: {\n eid: omniContract.eid,\n address: omniContract.contract.address,\n },\n })\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "An `OmniTransaction` should be returned with correctly structured data, a description including peer details, and point information after setting a peer.", "mode": "fast-check"} {"id": 58219, "name": "unknown", "code": "it('should encode data for a setPeer call', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n aptosEndpointArbitrary,\n aptosAddressArbitrary,\n async (omniContract, peerEid, peerAddress) => {\n const sdk = new OApp(omniContract)\n const encodeFunctionData = omniContract.contract.interface.encodeFunctionData\n\n ;(encodeFunctionData as jest.Mock).mockClear()\n\n await sdk.setPeer(peerEid, peerAddress)\n\n expect(encodeFunctionData).toHaveBeenCalledTimes(1)\n expect(encodeFunctionData).toHaveBeenCalledWith('setPeer', [\n peerEid,\n makeBytes32(peerAddress),\n ])\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Verifies that calling `setPeer` on an `OApp` instance invokes the `encodeFunctionData` method exactly once with the correct arguments: the string 'setPeer' and an array containing `peerEid` and a bytes32 representation of `peerAddress`.", "mode": "fast-check"} {"id": 58220, "name": "unknown", "code": "it('should return an OmniTransaction', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n aptosEndpointArbitrary,\n aptosAddressArbitrary,\n fc.string(),\n async (omniContract, peerEid, peerAddress, data) => {\n const encodeFunctionData = omniContract.contract.interface.encodeFunctionData as jest.Mock\n encodeFunctionData.mockReturnValue(data)\n\n const sdk = new OApp(omniContract)\n const transaction = await sdk.setPeer(peerEid, peerAddress)\n\n expect(transaction).toEqual({\n data,\n description: `Setting peer for eid ${peerEid} (${formatEid(peerEid)}) to address ${makeBytes32(peerAddress)}`,\n point: {\n eid: omniContract.eid,\n address: omniContract.contract.address,\n },\n })\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `setPeer` in `OApp` should return an `OmniTransaction` with correctly formatted data, description, and point, based on the provided peer ID and address inputs.", "mode": "fast-check"} {"id": 58221, "name": "unknown", "code": "it('should reject if the call to endpoint() rejects', async () => {\n await fc.assert(\n fc.asyncProperty(omniContractArbitrary, async (omniContract) => {\n omniContract.contract.endpoint.mockRejectedValue('No you did not')\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.getEndpointSDK()).rejects.toThrow(/Failed to get EndpointV2 address for OApp/)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`OApp` should reject with an error when `endpoint()` call is mocked to reject, indicating failure to get the EndpointV2 address.", "mode": "fast-check"} {"id": 58222, "name": "unknown", "code": "it('should reject if the call to endpoint() resolves with a zeroish address', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n nullishAddressArbitrary,\n async (omniContract, endpointAddress) => {\n omniContract.contract.endpoint.mockResolvedValue(endpointAddress)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.getEndpointSDK()).rejects.toThrow(\n /EndpointV2 cannot be instantiated: EndpointV2 address has been set to a zero value for OApp/\n )\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`OApp.getEndpointSDK` should reject with an error if `endpoint()` resolves to an address with a zero-like value.", "mode": "fast-check"} {"id": 58225, "name": "unknown", "code": "it('should return the contract symbol', async () => {\n await fc.assert(\n fc.asyncProperty(omniContractArbitrary, fc.string(), async (omniContract, symbol) => {\n omniContract.contract.symbol.mockResolvedValue(symbol)\n\n const sdk = new ERC20(omniContract)\n\n await expect(sdk.getSymbol()).resolves.toBe(symbol)\n\n expect(omniContract.contract.symbol).toHaveBeenCalledTimes(1)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools-evm/test/erc20/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `getSymbol` should retrieve the correct contract symbol by invoking `omniContract.contract.symbol` once, with the result matching a predefined string.", "mode": "fast-check"} {"id": 58226, "name": "unknown", "code": "it('should return the contract decimals', async () => {\n await fc.assert(\n fc.asyncProperty(omniContractArbitrary, fc.integer({ min: 1 }), async (omniContract, decimals) => {\n omniContract.contract.decimals.mockResolvedValue(decimals)\n\n const sdk = new ERC20(omniContract)\n\n await expect(sdk.getDecimals()).resolves.toBe(decimals)\n\n expect(omniContract.contract.decimals).toHaveBeenCalledTimes(1)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools-evm/test/erc20/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`ERC20` returns the correct contract decimals by invoking the `decimals` function exactly once on the contract.", "mode": "fast-check"} {"id": 58227, "name": "unknown", "code": "it('should return the user balance', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n evmAddressArbitrary,\n fc.bigInt({ min: BigInt(0) }),\n async (omniContract, user, balance) => {\n omniContract.contract.balanceOf.mockResolvedValue(BigNumber.from(balance))\n\n const sdk = new ERC20(omniContract)\n\n await expect(sdk.getBalanceOf(user)).resolves.toBe(balance)\n\n expect(omniContract.contract.balanceOf).toHaveBeenCalledTimes(1)\n expect(omniContract.contract.balanceOf).toHaveBeenCalledWith(user)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools-evm/test/erc20/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `getBalanceOf` method should return the correct user balance, with the `balanceOf` function being called once with the appropriate user address.", "mode": "fast-check"} {"id": 58228, "name": "unknown", "code": "it('should return the user balance', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n evmAddressArbitrary,\n evmAddressArbitrary,\n fc.bigInt({ min: BigInt(0) }),\n async (omniContract, owner, spender, allowance) => {\n omniContract.contract.allowance.mockResolvedValue(BigNumber.from(allowance))\n\n const sdk = new ERC20(omniContract)\n\n await expect(sdk.getAllowance(owner, spender)).resolves.toBe(allowance)\n\n expect(omniContract.contract.allowance).toHaveBeenCalledTimes(1)\n expect(omniContract.contract.allowance).toHaveBeenCalledWith(owner, spender)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools-evm/test/erc20/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`ERC20.getAllowance` returns the correct allowance for a given owner and spender, ensuring the contract's `allowance` function is called once with the correct parameters.", "mode": "fast-check"} {"id": 58229, "name": "unknown", "code": "it('should not attempt to register libraries multiple times', async () => {\n await fc.assert(\n fc.asyncProperty(\n pointArbitrary,\n pointArbitrary,\n pointArbitrary,\n addressArbitrary,\n async (pointA, pointB, pointC, libraryAddress) => {\n fc.pre(!arePointsEqual(pointA, pointB))\n fc.pre(!arePointsEqual(pointB, pointC))\n fc.pre(!arePointsEqual(pointC, pointA))\n\n const config: EndpointV2EdgeConfig = {\n defaultReceiveLibrary: libraryAddress,\n defaultSendLibrary: libraryAddress,\n }\n\n const graph: EndpointV2OmniGraph = {\n contracts: [],\n connections: [\n {\n vector: { from: pointA, to: pointB },\n config,\n },\n {\n vector: { from: pointA, to: pointC },\n config,\n },\n {\n vector: { from: pointB, to: pointA },\n config,\n },\n {\n vector: { from: pointB, to: pointC },\n config,\n },\n {\n vector: { from: pointC, to: pointA },\n config,\n },\n {\n vector: { from: pointC, to: pointB },\n config,\n },\n ],\n }\n\n const createSdk = jest.fn((point: OmniPoint) => new MockSDK(point) as unknown as IEndpointV2)\n const result = await configureEndpointV2RegisterLibraries(graph, createSdk)\n\n // The result should not contain any duplicate library registrations\n expect(result).toEqual([\n { point: pointA, data: `0xREGISTERLIBRARY ${libraryAddress}` },\n { point: pointB, data: `0xREGISTERLIBRARY ${libraryAddress}` },\n { point: pointC, data: `0xREGISTERLIBRARY ${libraryAddress}` },\n ])\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools/test/endpointv2/config.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `configureEndpointV2RegisterLibraries` should register each library once per unique point, ensuring no duplicate registrations in the output.", "mode": "fast-check"} {"id": 54725, "name": "unknown", "code": "describe('transaction executors', () => {\n it('queries with `splits: inline` returns only non-parents', async () => {\n await fc.assert(\n fc.asyncProperty(\n arbs.makeTransactionArray({\n splitFreq: 2,\n minLength: 2,\n maxLength: 20\n }),\n async arr => {\n await insertTransactions(arr);\n\n let { data } = await runQuery(\n query('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .options({ splits: 'inline' })\n .serialize()\n );\n\n expect(data.filter(t => t.is_parent).length).toBe(0);\n expect(data.filter(t => t.tombstone).length).toBe(0);\n\n let { data: defaultData } = await runQuery(\n query('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .serialize()\n );\n\n // inline should be the default\n expect(defaultData).toEqual(data);\n }\n ),\n { numRuns: 50 }\n );\n });\n\n it('queries with `splits: none` returns only parents', async () => {\n await fc.assert(\n fc.asyncProperty(\n arbs.makeTransactionArray({\n splitFreq: 2,\n minLength: 2,\n maxLength: 8\n }),\n async arr => {\n await insertTransactions(arr);\n\n let { data } = await runQuery(\n query('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .options({ splits: 'none' })\n .serialize()\n );\n\n expect(data.filter(t => t.is_child).length).toBe(0);\n }\n ),\n { numRuns: 50 }\n );\n });\n\n it('aggregate queries work with `splits: grouped`', async () => {\n let payeeIds = ['payee1', 'payee2', 'payee3', 'payee4', 'payee5'];\n\n await fc.assert(\n fc\n .asyncProperty(\n arbs.makeTransactionArray({ splitFreq: 2, payeeIds, maxLength: 100 }),\n async arr => {\n await insertTransactions(arr, payeeIds);\n\n let aggQuery = query('transactions')\n .filter({\n $or: [{ amount: { $lt: -5 } }, { amount: { $gt: -2 } }],\n 'payee.name': { $gt: '' }\n })\n .options({ splits: 'grouped' })\n .calculate({ $sum: '$amount' });\n\n let { data } = await runQuery(aggQuery.serialize());\n\n let sum = arr.reduce((sum, trans) => {\n let amount = trans.amount || 0;\n let matched = (amount < -5 || amount > -2) && trans.payee != null;\n if (!trans.tombstone && !trans.is_parent && matched) {\n return sum + amount;\n }\n return sum;\n }, 0);\n\n expect(data).toBe(sum);\n }\n )\n .beforeEach(() => {\n setClock(null);\n setSyncingMode('import');\n return db.execQuery(`\n DELETE FROM transactions;\n DELETE FROM payees;\n DELETE FROM payee_mapping;\n `);\n })\n );\n });\n\n function runTest(makeQuery) {\n let payeeIds = ['payee1', 'payee2', 'payee3', 'payee4', 'payee5'];\n\n async function check(arr) {\n let orderFields = ['payee.name', 'amount', 'id'];\n\n // Insert transactions and get a list of all the alive\n // ones to make it easier to check the data later (don't\n // have to always be filtering out dead ones)\n await insertTransactions(arr, payeeIds);\n let allTransactions = aliveTransactions(arr);\n\n // Query time\n let { query, expectedIds, expectedMatchedIds } = makeQuery(arr);\n\n // First to a query without order to make sure the default\n // order works\n let { data: defaultOrderData } = await runQuery(query.serialize());\n expectTransactionOrder(defaultOrderData);\n expect(new Set(defaultOrderData.map(t => t.id))).toEqual(expectedIds);\n\n // Now do the full test, and add a custom order to make\n // sure that doesn't effect anything\n let orderedQuery = query.orderBy(orderFields);\n let { data } = await runQuery(orderedQuery.serialize());\n expect(new Set(data.map(t => t.id))).toEqual(expectedIds);\n\n // Validate paging and ordering\n await expectPagedData(orderedQuery, arr.length, data);\n expectTransactionOrder(data, orderFields);\n\n let matchedIds = new Set();\n\n // Check that all the subtransactions were returned\n for (let trans of data) {\n expect(trans.tombstone).toBe(false);\n\n if (expectedMatchedIds) {\n if (!trans._unmatched) {\n expect(expectedMatchedIds.has(trans.id)).toBe(true);\n matchedIds.add(trans.id);\n } else {\n expect(expectedMatchedIds.has(trans.id)).not.toBe(true);\n }\n }\n\n if (trans.is_parent) {\n // Parent transactions should never have a category\n expect(trans.category).toBe(null);\n\n expect(trans.subtransactions.length).toBe(\n allTransactions.filter(t => t.parent_id === trans.id).length\n );\n\n // Subtransactions should be ordered as well\n expectTransactionOrder(trans.subtransactions, orderFields);\n\n trans.subtransactions.forEach(subtrans => {\n expect(subtrans.tombstone).toBe(false);\n\n if (expectedMatchedIds) {\n if (!subtrans._unmatched) {\n expect(expectedMatchedIds.has(subtrans.id)).toBe(true);\n matchedIds.add(subtrans.id);\n } else {\n expect(expectedMatchedIds.has(subtrans.id)).not.toBe(true);\n }\n }\n });\n }\n }\n\n if (expectedMatchedIds) {\n // Check that transactions that should be matched are\n // marked as such\n expect(matchedIds).toEqual(expectedMatchedIds);\n }\n }\n\n return fc.assert(\n fc\n .asyncProperty(\n arbs.makeTransactionArray({\n splitFreq: 0.1,\n payeeIds,\n maxLength: 100\n }),\n check\n )\n .beforeEach(() => {\n setClock(null);\n setSyncingMode('import');\n return db.execQuery(`\n DELETE FROM transactions;\n DELETE FROM payees;\n DELETE FROM payee_mapping;\n `);\n }),\n { numRuns: 300 }\n );\n }\n\n it('queries the correct transactions without filters', async () => {\n return runTest(arr => {\n let expectedIds = new Set(\n arr.filter(t => !t.tombstone && !t.is_child).map(t => t.id)\n );\n\n // Even though we're applying some filters, these are always\n // guaranteed to return the full split transaction so they\n // should take the optimized path\n let happyQuery = query('transactions')\n .filter({\n date: { $gt: '2017-01-01' }\n })\n .options({ splits: 'grouped' })\n .select(['*', 'payee.name']);\n\n // Make sure it's actually taking the happy path\n expect(isHappyPathQuery(happyQuery.serialize())).toBe(true);\n\n return {\n expectedIds,\n query: happyQuery\n };\n });\n });\n\n it(`queries the correct transactions with a filter`, async () => {\n return runTest(arr => {\n let expectedIds = new Set();\n\n // let parents = toGroup(\n // arr.filter(t => t.is_parent),\n // new Map(Object.entries(groupById(arr.filter(t => t.parent_id))))\n // );\n\n let parents = groupById(arr.filter(t => t.is_parent && !t.tombstone));\n let matched = new Set();\n\n // Pick out some ids to query\n let ids = arr.reduce((ids, trans, idx) => {\n if (idx % 2 === 0) {\n let amount = trans.amount == null ? 0 : trans.amount;\n let matches = (amount < -2 || amount > -1) && trans.payee > '';\n\n if (matches && isAlive(trans, parents)) {\n expectedIds.add(trans.parent_id || trans.id);\n matched.add(trans.id);\n }\n\n ids.push(trans.id);\n }\n\n return ids;\n }, []);\n\n // Because why not? It should deduplicate them\n ids = repeat(ids, 100);\n\n let unhappyQuery = query('transactions')\n .filter({\n id: [{ $oneof: ids }],\n payee: { $gt: '' },\n $or: [{ amount: { $lt: -2 } }, { amount: { $gt: -1 } }]\n })\n .options({ splits: 'grouped' })\n .select(['*', 'payee.name'])\n // Using this because we want `payee` to have ids for the above\n // filter regardless if it points to a dead one or not\n .withoutValidatedRefs();\n\n expect(isHappyPathQuery(unhappyQuery.serialize())).toBe(false);\n\n return {\n expectedIds,\n expectedMatchedIds: matched,\n query: unhappyQuery\n };\n });\n });\n})", "language": "typescript", "source_file": "./repos/TomAFrench/temp-actual/packages/loot-core/src/server/aql/schema/executors.test.js", "start_line": null, "end_line": null, "dependencies": ["insertTransactions", "aliveTransactions", "expectTransactionOrder", "expectPagedData", "isAlive", "repeat"], "repo": {"name": "TomAFrench/temp-actual", "url": "https://github.com/TomAFrench/temp-actual.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Queries with `splits: inline` return only non-parent transactions and filter out tombstones, with inline being the default option. Queries with `splits: none` return only parent transactions, excluding child transactions. Aggregate queries using `splits: grouped` accurately sum transaction amounts considering conditions on amounts and payee names, excluding tombstones and parents. A query without filters should return all non-child and non-tombstone transactions, maintaining expected ordering and paging behavior. A filtered query should effectively match transactions based on complex conditions, including deduplication of repeated IDs, ensuring matched and unmatched status correctness.", "mode": "fast-check"} {"id": 54726, "name": "unknown", "code": "test('int(BigInt) should be reversed by Integer.toBigInt', () => {\n fc.assert(\n fc.property(\n fc.bigInt({ max: Integer.MAX_SAFE_VALUE.toBigInt(), min: Integer.MIN_SAFE_VALUE.toBigInt() }),\n bigint => bigint === int(bigint).toBigInt()\n )\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/integer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Conversion of a `BigInt` to an `Integer` and back should return the original `BigInt`.", "mode": "fast-check"} {"id": 54727, "name": "unknown", "code": "test('int.toString() should match Integer.toString()', () => {\n fc.assert(fc.property(fc.integer(), i => i.toString() === int(i).toString()))\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/integer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "`int.toString()` should produce the same result as `Integer.toString()` when applied to the same integer value.", "mode": "fast-check"} {"id": 58230, "name": "unknown", "code": "it('should sort requiredDVNs and optionalDVNs before encoding', async () => {\n fc.assert(\n fc.property(dvnsArbitrary, (dvns) => {\n const sortedDvns = [...dvns].sort((a, b) => a.localeCompare(b))\n const ulnConfigUnsorted: UlnReadUlnConfig = {\n executor: AddressZero,\n optionalDVNThreshold: 0,\n optionalDVNs: dvns,\n requiredDVNs: dvns,\n }\n\n const ulnConfigSorted: UlnReadUlnConfig = {\n ...ulnConfigUnsorted,\n optionalDVNs: sortedDvns,\n requiredDVNs: sortedDvns,\n }\n\n const ulnConfigEncodedUnsorted = ulnSdk.encodeUlnConfig(ulnConfigUnsorted)\n const ulnConfigEncodedSorted = ulnSdk.encodeUlnConfig(ulnConfigSorted)\n expect(ulnConfigEncodedSorted).toBe(ulnConfigEncodedUnsorted)\n }),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The encoding of `ulnConfig` should be consistent regardless of whether `requiredDVNs` and `optionalDVNs` are sorted.", "mode": "fast-check"} {"id": 58231, "name": "unknown", "code": "it('should sort requiredDVNs and optionalDVNs', async () => {\n await fc.assert(\n fc.asyncProperty(channelIdArbitrary, dvnsArbitrary, async (eid, dvns) => {\n const sortedDvns = [...dvns].sort((a, b) => a.localeCompare(b))\n const ulnConfigUnsorted: UlnReadUlnConfig = {\n executor: AddressZero,\n optionalDVNThreshold: 0,\n optionalDVNs: dvns,\n requiredDVNs: dvns,\n }\n\n const ulnConfigSorted: UlnReadUlnConfig = {\n ...ulnConfigUnsorted,\n optionalDVNs: sortedDvns,\n requiredDVNs: sortedDvns,\n }\n\n // Let's check that both the sorted and the unsorted config produce the same transaction\n const transactionUnsorted = await ulnSdk.setDefaultUlnConfig(eid, ulnConfigUnsorted)\n const transactionsSorted = await ulnSdk.setDefaultUlnConfig(eid, ulnConfigSorted)\n expect(transactionUnsorted).toEqual(transactionsSorted)\n\n // And let's check that the encoding call is correct and the DVNs are sorted\n expect(transactionsSorted.data).toBe(\n ulnSdk.contract.contract.interface.encodeFunctionData('setDefaultReadLibConfigs', [\n [\n {\n eid,\n config: {\n executor: AddressZero,\n optionalDVNThreshold: 0,\n optionalDVNs: sortedDvns.map(addChecksum),\n requiredDVNs: sortedDvns.map(addChecksum),\n requiredDVNCount: sortedDvns.length,\n optionalDVNCount: sortedDvns.length,\n },\n },\n ],\n ])\n )\n }),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`ulnSdk.setDefaultUlnConfig` should produce identical transactions for unsorted and sorted DVNs, and the encoded data should have DVNs sorted.", "mode": "fast-check"} {"id": 54728, "name": "unknown", "code": "test('Integer.valueOf should be equivalent to the Integer.toBigInt', () => {\n fc.assert(\n fc.property(\n fc.bigInt({ max: Integer.MAX_SAFE_VALUE.toBigInt(), min: Integer.MIN_SAFE_VALUE.toBigInt() }),\n num => int(num).toBigInt() === int(num).valueOf()\n )\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/integer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "`Integer.valueOf` should return the same result as `Integer.toBigInt` for integers within the safe range.", "mode": "fast-check"} {"id": 54730, "name": "unknown", "code": "test('Integer should be able to be used in the string interpolation', () => {\n fc.assert(\n fc.property(\n fc.bigInt({ max: Integer.MAX_SAFE_VALUE.toBigInt(), min: Integer.MIN_SAFE_VALUE.toBigInt() }),\n num => `string${int(num)}str` === 'string' + int(num).toString() + 'str'\n )\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/integer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "The `Integer` type supports string interpolation, ensuring that converting a big integer and interpolating it into a string produces the same result as concatenating its string representation.", "mode": "fast-check"} {"id": 58232, "name": "unknown", "code": "it('should default the missing attributes', async () => {\n await fc.assert(\n fc.asyncProperty(channelIdArbitrary, dvnsArbitrary, async (eid, dvns) => {\n const sortedDvns = [...dvns].sort((a, b) => a.localeCompare(b))\n const ulnUserConfig: UlnReadUlnUserConfig = {\n requiredDVNs: dvns,\n }\n const ulnConfig: UlnReadUlnConfig = {\n requiredDVNs: dvns,\n executor: AddressZero,\n optionalDVNThreshold: 0,\n optionalDVNs: [],\n }\n\n // Let's check that both the sorted and the unsorted config produce the same transaction\n const transactionsWithDefaults = await ulnSdk.setDefaultUlnConfig(eid, ulnUserConfig)\n const transactionsWithFullConfig = await ulnSdk.setDefaultUlnConfig(eid, ulnConfig)\n expect(transactionsWithDefaults).toEqual(transactionsWithFullConfig)\n\n // And let's check that the encoding call is correct and the DVNs are sorted\n expect(transactionsWithDefaults.data).toBe(\n ulnSdk.contract.contract.interface.encodeFunctionData('setDefaultReadLibConfigs', [\n [\n {\n eid,\n config: {\n executor: ulnConfig.executor,\n optionalDVNThreshold: ulnConfig.optionalDVNThreshold,\n optionalDVNs: ulnConfig.optionalDVNs,\n requiredDVNs: sortedDvns.map(addChecksum),\n requiredDVNCount: ulnConfig.requiredDVNs.length,\n optionalDVNCount: ulnConfig.optionalDVNs.length,\n },\n },\n ],\n ])\n )\n }),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Tests that setting a user configuration with missing attributes defaults to producing the same transaction as a fully specified configuration, ensuring the encoding call sorts DVNs correctly.", "mode": "fast-check"} {"id": 58233, "name": "unknown", "code": "it('should return true if the configs are identical', async () => {\n await fc.assert(\n fc.asyncProperty(\n channelIdArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n async (channelId, oapp, ulnConfig) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(ulnSdk.hasAppUlnConfig(channelId, oapp, ulnConfig)).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `ulnSdk.hasAppUlnConfig` returns true if the configuration obtained for a given channel and app matches the provided configuration.", "mode": "fast-check"} {"id": 54734, "name": "unknown", "code": "test('Integer should be able to use / operator as bigint', () => {\n fc.assert(\n fc.property(\n fc.bigInt({ max: Integer.MAX_SAFE_VALUE.toBigInt(), min: Integer.MIN_SAFE_VALUE.toBigInt() }),\n fc.bigInt({ max: Integer.MAX_SAFE_VALUE.toBigInt(), min: Integer.MIN_SAFE_VALUE.toBigInt() }).filter(n => n !== BigInt(0)),\n (num1, num2) =>\n // @ts-expect-error\n num1 / int(num2) === num1 / num2 &&\n // @ts-expect-error\n int(num1) / num2 === num1 / num2 &&\n // @ts-expect-error\n int(num1) / int(num2) === num1 / num2\n ))\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/integer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "`Integer` division using the `/` operator should behave identically to `bigint` division within safe value ranges, without division by zero.", "mode": "fast-check"} {"id": 54735, "name": "unknown", "code": "test('int(string) should match int(Integer)', () => {\n fc.assert(fc.property(fc.integer(), i => int(i).equals(int(i.toString()))))\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/integer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Creating an integer from a string representation should yield the same result as creating it directly from an integer, verified by their equality.", "mode": "fast-check"} {"id": 58234, "name": "unknown", "code": "it('should return true if config has extra properties', async () => {\n await fc.assert(\n fc.asyncProperty(\n channelIdArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n fc.object(),\n async (channelId, oapp, ulnConfig, extra) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(channelId, oapp, {\n ...extra,\n ...ulnConfig,\n })\n ).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`ulnSdk.hasAppUlnConfig` returns true when the configuration includes extra properties in addition to the expected `ulnConfig`.", "mode": "fast-check"} {"id": 54739, "name": "unknown", "code": "test('Integer.multiply should be Commutative', () => {\n fc.assert(fc.property(arbitraryInteger(), arbitraryInteger(),\n (a, b) => a.multiply(b).equals(b.multiply(a))))\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/integer.test.ts", "start_line": null, "end_line": null, "dependencies": ["arbitraryInteger"], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "The multiplication operation of the `Integer` class should be commutative, meaning `a.multiply(b)` should equal `b.multiply(a)` for arbitrary integers `a` and `b`.", "mode": "fast-check"} {"id": 58235, "name": "unknown", "code": "it('should return true if configs with defaults are identical', async () => {\n await fc.assert(\n fc.asyncProperty(\n channelIdArbitrary,\n evmAddressArbitrary,\n dvnsArbitrary,\n async (channelId, oapp, dvns) => {\n const ulnUserConfig: UlnReadUlnUserConfig = {\n requiredDVNs: dvns,\n }\n const ulnConfig: UlnReadUlnConfig = {\n requiredDVNs: dvns,\n optionalDVNs: [],\n optionalDVNThreshold: 0,\n executor: AddressZero,\n }\n\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(ulnSdk.hasAppUlnConfig(channelId, oapp, ulnUserConfig)).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Configurations with defaults should be considered identical, resulting in `ulnSdk.hasAppUlnConfig` returning true.", "mode": "fast-check"} {"id": 54742, "name": "unknown", "code": "test('Integer.add should be Distributive', () => {\n fc.assert(fc.property(arbitraryInteger(), arbitraryInteger(), arbitraryInteger(),\n (a, b, c) => a.multiply(b.add(c)).equals(a.multiply(b).add(a.multiply(c)))))\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/integer.test.ts", "start_line": null, "end_line": null, "dependencies": ["arbitraryInteger"], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "`Integer.add` should distribute over multiplication, ensuring that `a * (b + c)` is equal to `a * b + a * c` for arbitrary integers `a`, `b`, and `c`.", "mode": "fast-check"} {"id": 58236, "name": "unknown", "code": "it('should return false if configs with defaults are not identical', async () => {\n await fc.assert(\n fc.asyncProperty(\n channelIdArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n async (channelId, oapp, ulnConfig) => {\n // We only want to test againsts configs that are not\n // equal to the default config\n fc.pre(\n ulnConfig.executor !== AddressZero ||\n ulnConfig.optionalDVNThreshold !== 0 ||\n ulnConfig.optionalDVNs.length !== 0\n )\n\n const ulnUserConfig: UlnReadUlnUserConfig = {\n requiredDVNs: ulnConfig.requiredDVNs,\n }\n\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(ulnSdk.hasAppUlnConfig(channelId, oapp, ulnUserConfig)).resolves.toBeFalsy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`ulnSdk.hasAppUlnConfig` should return false when non-default ulnConfig settings are used contrary to default configurations.", "mode": "fast-check"} {"id": 58237, "name": "unknown", "code": "it('should return true if the configs are identical except for the dvn casing', async () => {\n await fc.assert(\n fc.asyncProperty(\n channelIdArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n async (channelId, oapp, ulnConfig) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(channelId, oapp, {\n ...ulnConfig,\n requiredDVNs: ulnConfig.requiredDVNs.map(addChecksum),\n optionalDVNs: ulnConfig.optionalDVNs.map(addChecksum),\n })\n ).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that `ulnSdk.hasAppUlnConfig` returns true when two configurations are identical except for the casing in `requiredDVNs` and `optionalDVNs`.", "mode": "fast-check"} {"id": 54746, "name": "unknown", "code": "test('Integer.multiply should have 0 as identity', () => {\n fc.assert(fc.property(arbitraryInteger(), (a) => a.multiply(1).equals(a)))\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/integer.test.ts", "start_line": null, "end_line": null, "dependencies": ["arbitraryInteger"], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "`Integer.multiply` with 1 should return the original integer.", "mode": "fast-check"} {"id": 54747, "name": "unknown", "code": "test('Integer.div should have 0 as identity', () => {\n fc.assert(fc.property(arbitraryInteger(), (a) => a.div(1).equals(a)))\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/integer.test.ts", "start_line": null, "end_line": null, "dependencies": ["arbitraryInteger"], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Dividing an `Integer` by 1 should result in the original `Integer`.", "mode": "fast-check"} {"id": 58238, "name": "unknown", "code": "it('should return true if the configs are identical except for the dvn sorting and casing', async () => {\n await fc.assert(\n fc.asyncProperty(\n channelIdArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n async (channelId, oapp, ulnConfig) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(channelId, oapp, {\n ...ulnConfig,\n requiredDVNs: ulnConfig.requiredDVNs.map(addChecksum).sort(compareBytes32Ascending),\n optionalDVNs: ulnConfig.optionalDVNs.map(addChecksum).sort(compareBytes32Ascending),\n })\n ).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`ulnSdk.hasAppUlnConfig` returns true if two configurations are identical except for variations in sorting and casing of the DVNs.", "mode": "fast-check"} {"id": 54750, "name": "unknown", "code": "test('Integer.greaterThanOrEqual should return true if a - b is positive or ZERO', () => {\n fc.assert(fc.property(\n arbitrarySameSignIntegers(),\n ({ a, b }) => a.subtract(b).isPositive() || a.subtract(b).isZero() ? a.greaterThanOrEqual(b) : !a.greaterThanOrEqual(b)))\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/integer.test.ts", "start_line": null, "end_line": null, "dependencies": ["arbitrarySameSignIntegers"], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "`Integer.greaterThanOrEqual` returns true when the result of `a - b` is positive or zero.", "mode": "fast-check"} {"id": 54751, "name": "unknown", "code": "test('Integer.lessThanOrEqual should return true if a - b is ZERO or negative', () => {\n fc.assert(fc.property(\n arbitrarySameSignIntegers(),\n ({ a, b }) => a.subtract(b).isNegative() || a.subtract(b).isZero() ? a.lessThanOrEqual(b) : !a.lessThanOrEqual(b)))\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/integer.test.ts", "start_line": null, "end_line": null, "dependencies": ["arbitrarySameSignIntegers"], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "`Integer.lessThanOrEqual` should return true if the result of `a.subtract(b)` is zero or negative.", "mode": "fast-check"} {"id": 58240, "name": "unknown", "code": "it('should return false if the optionalDVNThresholds are different', async () => {\n await fc.assert(\n fc.asyncProperty(\n channelIdArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n fc.integer(),\n async (channelId, oapp, ulnConfig, optionalDVNThreshold) => {\n fc.pre(optionalDVNThreshold !== ulnConfig.optionalDVNThreshold)\n\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(channelId, oapp, {\n ...ulnConfig,\n optionalDVNThreshold,\n })\n ).resolves.toBeFalsy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Checks if `hasAppUlnConfig` returns false when `optionalDVNThreshold` differs from `ulnConfig.optionalDVNThreshold`.", "mode": "fast-check"} {"id": 54752, "name": "unknown", "code": "test('Integer.lessThanOrEqual should return true if a - b is ZERO or negative', () => {\n fc.assert(fc.property(\n arbitrarySameSignIntegers(),\n ({ a, b }) => a.subtract(b).isNegative() ? a.lessThan(b) : !a.lessThan(b)))\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/integer.test.ts", "start_line": null, "end_line": null, "dependencies": ["arbitrarySameSignIntegers"], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "`Integer.lessThanOrEqual` returns true when subtracting `b` from `a` results in zero or a negative value.", "mode": "fast-check"} {"id": 54754, "name": "unknown", "code": "test('Integer.greaterThanOrEqual should return true if a is positive or ZERO', () => {\n fc.assert(fc.property(\n arbitraryDiffSignIntegers(),\n ({ a, b }) => a.isPositive() || a.isZero() ? a.greaterThanOrEqual(b) : !a.greaterThanOrEqual(b)))\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/integer.test.ts", "start_line": null, "end_line": null, "dependencies": ["arbitraryDiffSignIntegers"], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "`Integer.greaterThanOrEqual` should return true when the first integer is positive or zero, and false otherwise.", "mode": "fast-check"} {"id": 58241, "name": "unknown", "code": "it('should return false if the requiredDVNs are different', async () => {\n await fc.assert(\n fc.asyncProperty(\n channelIdArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n dvnsArbitrary,\n async (channelId, oapp, ulnConfig, extraRequiredDVNs) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(channelId, oapp, {\n ...ulnConfig,\n requiredDVNs: [...ulnConfig.requiredDVNs, ...extraRequiredDVNs],\n })\n ).resolves.toBeFalsy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`ulnSdk.hasAppUlnConfig` should return false if `requiredDVNs` in the provided configuration differ from those in `ulnConfig`.", "mode": "fast-check"} {"id": 54755, "name": "unknown", "code": "test('Integer.lessThanOrEqual should return true if a is ZERO or negative', () => {\n fc.assert(fc.property(\n arbitraryDiffSignIntegers(),\n ({ a, b }) => a.isNegative() || a.isZero() ? a.lessThanOrEqual(b) : !a.lessThanOrEqual(b)))\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/integer.test.ts", "start_line": null, "end_line": null, "dependencies": ["arbitraryDiffSignIntegers"], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "`Integer.lessThanOrEqual` returns true when the first integer is zero or negative.", "mode": "fast-check"} {"id": 54756, "name": "unknown", "code": "test('Integer.lessThanOrEqual should return true if a is ZERO or negative', () => {\n fc.assert(fc.property(\n arbitraryDiffSignIntegers(),\n ({ a, b }) => a.isNegative() ? a.lessThan(b) : !a.lessThan(b)))\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/integer.test.ts", "start_line": null, "end_line": null, "dependencies": ["arbitraryDiffSignIntegers"], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "`Integer.lessThanOrEqual` should accurately return true when the first integer is zero or negative compared to the second integer's sign.", "mode": "fast-check"} {"id": 58243, "name": "unknown", "code": "it('should sort requiredDVNs and optionalDVNs before encoding', async () => {\n fc.assert(\n fc.property(dvnsArbitrary, (dvns) => {\n const sortedDvns = [...dvns].sort((a, b) => a.localeCompare(b))\n const ulnConfigUnsorted: Uln302UlnConfig = {\n confirmations: BigInt(100),\n optionalDVNThreshold: 0,\n optionalDVNs: dvns,\n requiredDVNs: dvns,\n }\n\n const ulnConfigSorted: Uln302UlnConfig = {\n ...ulnConfigUnsorted,\n optionalDVNs: sortedDvns,\n requiredDVNs: sortedDvns,\n }\n\n const ulnConfigEncodedUnsorted = ulnSdk.encodeUlnConfig(ulnConfigUnsorted)\n const ulnConfigEncodedSorted = ulnSdk.encodeUlnConfig(ulnConfigSorted)\n expect(ulnConfigEncodedSorted).toBe(ulnConfigEncodedUnsorted)\n }),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Encoding should yield identical results whether `requiredDVNs` and `optionalDVNs` are sorted or unsorted.", "mode": "fast-check"} {"id": 58244, "name": "unknown", "code": "it('should sort requiredDVNs and optionalDVNs', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, dvnsArbitrary, async (eid, dvns) => {\n const sortedDvns = [...dvns].sort((a, b) => a.localeCompare(b))\n const ulnConfigUnsorted: Uln302UlnConfig = {\n confirmations: BigInt(100),\n optionalDVNThreshold: 0,\n optionalDVNs: dvns,\n requiredDVNs: dvns,\n }\n\n const ulnConfigSorted: Uln302UlnConfig = {\n ...ulnConfigUnsorted,\n optionalDVNs: sortedDvns,\n requiredDVNs: sortedDvns,\n }\n\n // Let's check that both the sorted and the unsorted config produce the same transaction\n const transactionUnsorted = await ulnSdk.setDefaultUlnConfig(eid, ulnConfigUnsorted)\n const transactionsSorted = await ulnSdk.setDefaultUlnConfig(eid, ulnConfigSorted)\n expect(transactionUnsorted).toEqual(transactionsSorted)\n\n // And let's check that the encoding call is correct and the DVNs are sorted\n expect(transactionsSorted.data).toBe(\n ulnSdk.contract.contract.interface.encodeFunctionData('setDefaultUlnConfigs', [\n [\n {\n eid,\n config: {\n confirmations: BigInt(100),\n optionalDVNThreshold: 0,\n optionalDVNs: sortedDvns.map(addChecksum),\n requiredDVNs: sortedDvns.map(addChecksum),\n requiredDVNCount: sortedDvns.length,\n optionalDVNCount: sortedDvns.length,\n },\n },\n ],\n ])\n )\n }),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`ulnSdk.setDefaultUlnConfig` produces the same transaction for both sorted and unsorted `requiredDVNs` and `optionalDVNs`, and the encoding call includes sorted DVNs with checksums.", "mode": "fast-check"} {"id": 58245, "name": "unknown", "code": "it('should default the missing attributes', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, dvnsArbitrary, async (eid, dvns) => {\n const sortedDvns = [...dvns].sort((a, b) => a.localeCompare(b))\n const ulnUserConfig: Uln302UlnUserConfig = {\n requiredDVNs: dvns,\n }\n const ulnConfig: Uln302UlnConfig = {\n requiredDVNs: dvns,\n confirmations: BigInt(0),\n optionalDVNThreshold: 0,\n optionalDVNs: [],\n }\n\n // Let's check that both the sorted and the unsorted config produce the same transaction\n const transactionsWithDefaults = await ulnSdk.setDefaultUlnConfig(eid, ulnUserConfig)\n const transactionsWithFullConfig = await ulnSdk.setDefaultUlnConfig(eid, ulnConfig)\n expect(transactionsWithDefaults).toEqual(transactionsWithFullConfig)\n\n // And let's check that the encoding call is correct and the DVNs are sorted\n expect(transactionsWithDefaults.data).toBe(\n ulnSdk.contract.contract.interface.encodeFunctionData('setDefaultUlnConfigs', [\n [\n {\n eid,\n config: {\n confirmations: ulnConfig.confirmations,\n optionalDVNThreshold: ulnConfig.optionalDVNThreshold,\n optionalDVNs: ulnConfig.optionalDVNs,\n requiredDVNs: sortedDvns.map(addChecksum),\n requiredDVNCount: ulnConfig.requiredDVNs.length,\n optionalDVNCount: ulnConfig.optionalDVNs.length,\n },\n },\n ],\n ])\n )\n }),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Missing attributes in a user configuration are defaulted, and both sorted and unsorted configurations produce identical transactions with properly encoded data reflecting the sorted required DVNs.", "mode": "fast-check"} {"id": 58247, "name": "unknown", "code": "it('should return true if config has extra properties', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n fc.object(),\n async (eid, oapp, ulnConfig, extra) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(\n eid,\n oapp,\n {\n ...extra,\n ...ulnConfig,\n },\n Uln302ConfigType.Receive\n )\n ).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `hasAppUlnConfig` should return true when the configuration object contains additional properties beyond what is specified in `ulnConfig`.", "mode": "fast-check"} {"id": 58248, "name": "unknown", "code": "it('should return true if configs with defaults are identical', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, evmAddressArbitrary, dvnsArbitrary, async (eid, oapp, dvns) => {\n const ulnUserConfig: Uln302UlnUserConfig = {\n requiredDVNs: dvns,\n }\n const ulnConfig: Uln302UlnConfig = {\n requiredDVNs: dvns,\n optionalDVNs: [],\n optionalDVNThreshold: 0,\n confirmations: BigInt(0),\n }\n\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(eid, oapp, ulnUserConfig, Uln302ConfigType.Receive)\n ).resolves.toBeTruthy()\n }),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`ulnSdk.hasAppUlnConfig` should return true if the app's configuration matches the provided `ulnUserConfig` when defaults are applied.", "mode": "fast-check"} {"id": 58249, "name": "unknown", "code": "it('should return false if configs with defaults are not identical', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n async (eid, oapp, ulnConfig) => {\n // We only want to test againsts configs that are not\n // equal to the default config\n fc.pre(\n ulnConfig.confirmations !== BigInt(0) ||\n ulnConfig.optionalDVNThreshold !== 0 ||\n ulnConfig.optionalDVNs.length !== 0\n )\n\n const ulnUserConfig: Uln302UlnUserConfig = {\n requiredDVNs: ulnConfig.requiredDVNs,\n }\n\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(eid, oapp, ulnUserConfig, Uln302ConfigType.Receive)\n ).resolves.toBeFalsy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that the function `ulnSdk.hasAppUlnConfig` returns false when the user configuration does not match the default configuration values.", "mode": "fast-check"} {"id": 58250, "name": "unknown", "code": "it('should return true if the configs are identical except for the dvn casing', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n async (eid, oapp, ulnConfig) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(\n eid,\n oapp,\n {\n ...ulnConfig,\n requiredDVNs: ulnConfig.requiredDVNs.map(addChecksum),\n optionalDVNs: ulnConfig.optionalDVNs.map(addChecksum),\n },\n Uln302ConfigType.Receive\n )\n ).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property confirms that `hasAppUlnConfig` returns true when two configurations are identical except for the casing of `requiredDVNs` and `optionalDVNs` values.", "mode": "fast-check"} {"id": 58251, "name": "unknown", "code": "it('should return true if the configs are identical except for the dvn sorting and casing', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n async (eid, oapp, ulnConfig) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(\n eid,\n oapp,\n {\n ...ulnConfig,\n requiredDVNs: ulnConfig.requiredDVNs.map(addChecksum).sort(compareBytes32Ascending),\n optionalDVNs: ulnConfig.optionalDVNs.map(addChecksum).sort(compareBytes32Ascending),\n },\n Uln302ConfigType.Receive\n )\n ).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`ulnSdk.hasAppUlnConfig` should return true when two configurations are identical except for differences in DVN sorting and casing.", "mode": "fast-check"} {"id": 58252, "name": "unknown", "code": "it('should return false if the confirmations are different', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n fc.bigInt(),\n async (eid, oapp, ulnConfig, confirmations) => {\n fc.pre(confirmations !== ulnConfig.confirmations)\n\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(\n eid,\n oapp,\n {\n ...ulnConfig,\n confirmations,\n },\n Uln302ConfigType.Receive\n )\n ).resolves.toBeFalsy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `ulnSdk.hasAppUlnConfig` function should return false when the provided confirmations differ from those in `ulnConfig`.", "mode": "fast-check"} {"id": 58253, "name": "unknown", "code": "it('should return false if the optionalDVNThresholds are different', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n fc.integer(),\n async (eid, oapp, ulnConfig, optionalDVNThreshold) => {\n fc.pre(optionalDVNThreshold !== ulnConfig.optionalDVNThreshold)\n\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(\n eid,\n oapp,\n {\n ...ulnConfig,\n optionalDVNThreshold,\n },\n Uln302ConfigType.Receive\n )\n ).resolves.toBeFalsy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Returns false when `ulnSdk.hasAppUlnConfig` is called with an `optionalDVNThreshold` that differs from the one in `ulnConfig`.", "mode": "fast-check"} {"id": 58254, "name": "unknown", "code": "it('should return false if the requiredDVNs are different', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n dvnsArbitrary,\n async (eid, oapp, ulnConfig, extraRequiredDVNs) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(\n eid,\n oapp,\n {\n ...ulnConfig,\n requiredDVNs: [...ulnConfig.requiredDVNs, ...extraRequiredDVNs],\n },\n Uln302ConfigType.Receive\n )\n ).resolves.toBeFalsy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that `ulnSdk.hasAppUlnConfig` returns false when the `requiredDVNs` in the configuration differ from those in the `ulnConfig`.", "mode": "fast-check"} {"id": 58255, "name": "unknown", "code": "it('should return false if the optionalDVNs are different', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n dvnsArbitrary,\n async (eid, oapp, ulnConfig, extraOptionalDVNs) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(\n eid,\n oapp,\n {\n ...ulnConfig,\n optionalDVNs: [...ulnConfig.optionalDVNs, ...extraOptionalDVNs],\n },\n Uln302ConfigType.Receive\n )\n ).resolves.toBeFalsy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `hasAppUlnConfig` should return false if the `optionalDVNs` in the given configuration differ from the expected configuration.", "mode": "fast-check"} {"id": 58257, "name": "unknown", "code": "it('should return true if the configs are identical except for the executor casing', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n executorConfigArbitrary,\n async (eid, oapp, executorConfig) => {\n getAppExecutorConfigSpy.mockReset()\n getAppExecutorConfigSpy.mockResolvedValue(executorConfig)\n\n await expect(\n ulnSdk.hasAppExecutorConfig(eid, oapp, {\n ...executorConfig,\n executor: addChecksum(executorConfig.executor),\n })\n ).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `ulnSdk.hasAppExecutorConfig` should return true when configurations are identical except for the casing of the executor field.", "mode": "fast-check"} {"id": 58258, "name": "unknown", "code": "it('should return true if config has extra properties', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n executorConfigArbitrary,\n fc.object(),\n async (eid, oapp, executorConfig, extra) => {\n getAppExecutorConfigSpy.mockReset()\n getAppExecutorConfigSpy.mockResolvedValue(executorConfig)\n\n await expect(\n ulnSdk.hasAppExecutorConfig(eid, oapp, {\n ...extra,\n ...executorConfig,\n })\n ).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`ulnSdk.hasAppExecutorConfig` returns true when the configuration includes extra properties beyond the executor configuration.", "mode": "fast-check"} {"id": 58259, "name": "unknown", "code": "it('should reject if the address is a zeroish address', async () => {\n await fc.assert(\n fc.asyncProperty(pointArbitrary, zeroishAddressArbitrary, async (point, address) => {\n const provider = new JsonRpcProvider()\n const sdk = new EndpointV2(provider, point)\n\n await expect(sdk.getUln302SDK(address)).rejects.toThrow(\n /Uln302 cannot be instantiated: Uln302 address cannot be a zero value for Endpoint/\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/endpoint/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`EndpointV2.getUln302SDK` should throw an error if the provided address is a zeroish address.", "mode": "fast-check"} {"id": 58260, "name": "unknown", "code": "it('should return a ULN302 if the address is a non-zeroish address', async () => {\n await fc.assert(\n fc.asyncProperty(pointArbitrary, evmAddressArbitrary, async (point, address) => {\n fc.pre(!isZero(address))\n\n const provider = new JsonRpcProvider()\n\n const sdk = new EndpointV2(provider, point)\n const uln302 = await sdk.getUln302SDK(address)\n\n expect(uln302).toBeInstanceOf(Uln302)\n expect(uln302.point).toEqual({ eid: point.eid, address })\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/endpoint/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Returns an instance of `Uln302` with the correct `point` if the address is non-zero.", "mode": "fast-check"} {"id": 58261, "name": "unknown", "code": "it('should return a tuple if the call succeeds', async () => {\n await fc.assert(\n fc.asyncProperty(\n pointArbitrary,\n endpointArbitrary,\n evmAddressArbitrary,\n evmAddressArbitrary,\n fc.boolean(),\n async (point, eid, oappAddress, libraryAddress, isDefault) => {\n const provider = new JsonRpcProvider()\n const sdk = new EndpointV2(provider, point)\n\n jest.spyOn(provider, 'call').mockResolvedValue(\n sdk.contract.contract.interface.encodeFunctionResult('getReceiveLibrary', [\n libraryAddress,\n isDefault,\n ])\n )\n\n await expect(sdk.getReceiveLibrary(oappAddress, eid)).resolves.toEqual([\n addChecksum(libraryAddress),\n isDefault,\n ])\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/endpoint/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "A successful call to `sdk.getReceiveLibrary` should return a tuple containing the checksummed library address and a boolean indicating a default status.", "mode": "fast-check"} {"id": 58262, "name": "unknown", "code": "it('should return undefined as the default lib if the call fails with LZ_DefaultReceiveLibUnavailable', async () => {\n await fc.assert(\n fc.asyncProperty(\n pointArbitrary,\n endpointArbitrary,\n evmAddressArbitrary,\n async (point, eid, oappAddress) => {\n const provider = new JsonRpcProvider()\n const sdk = new EndpointV2(provider, point)\n // The LZ_DefaultReceiveLibUnavailable error\n const error = { data: '0x78e84d06' }\n\n jest.spyOn(provider, 'call').mockRejectedValue(error)\n\n await expect(sdk.getReceiveLibrary(oappAddress, eid)).resolves.toEqual([undefined, true])\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/endpoint/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "When a call fails with the specific error `LZ_DefaultReceiveLibUnavailable`, `sdk.getReceiveLibrary` should return `[undefined, true]`.", "mode": "fast-check"} {"id": 58263, "name": "unknown", "code": "it('should reject if call fails but not with LZ_DefaultReceiveLibUnavailable', async () => {\n await fc.assert(\n fc.asyncProperty(\n pointArbitrary,\n endpointArbitrary,\n evmAddressArbitrary,\n async (point, eid, oappAddress) => {\n const provider = new JsonRpcProvider()\n const sdk = new EndpointV2(provider, point)\n const error = { data: '0x86957466' }\n\n jest.spyOn(provider, 'call').mockRejectedValue(error)\n\n await expect(sdk.getReceiveLibrary(oappAddress, eid)).rejects.toEqual(error)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/endpoint/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that `sdk.getReceiveLibrary` rejects with a specific error when the provider's call fails, but not with the error `LZ_DefaultReceiveLibUnavailable`.", "mode": "fast-check"} {"id": 58264, "name": "unknown", "code": "it('should return an address if the call succeeds', async () => {\n await fc.assert(\n fc.asyncProperty(\n pointArbitrary,\n endpointArbitrary,\n evmAddressArbitrary,\n evmAddressArbitrary,\n async (point, eid, oappAddress, libraryAddress) => {\n const provider = new JsonRpcProvider()\n const sdk = new EndpointV2(provider, point)\n\n jest.spyOn(provider, 'call').mockResolvedValue(\n sdk.contract.contract.interface.encodeFunctionResult('getSendLibrary', [libraryAddress])\n )\n\n await expect(sdk.getSendLibrary(oappAddress, eid)).resolves.toEqual(addChecksum(libraryAddress))\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/endpoint/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`getSendLibrary` should return a checksummed address if `provider.call` succeeds with the expected encoded function result.", "mode": "fast-check"} {"id": 58265, "name": "unknown", "code": "it('should return undefined if the call fails with LZ_DefaultSendLibUnavailable', async () => {\n await fc.assert(\n fc.asyncProperty(\n pointArbitrary,\n endpointArbitrary,\n evmAddressArbitrary,\n async (point, eid, oappAddress) => {\n const provider = new JsonRpcProvider()\n const sdk = new EndpointV2(provider, point)\n // The LZ_DefaultReceiveLibUnavailable error\n const error = { data: '0x6c1ccdb5' }\n\n jest.spyOn(provider, 'call').mockRejectedValue(error)\n\n await expect(sdk.getSendLibrary(oappAddress, eid)).resolves.toEqual(undefined)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/endpoint/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`getSendLibrary` should return `undefined` if the provider call fails with the error `LZ_DefaultSendLibUnavailable`.", "mode": "fast-check"} {"id": 58266, "name": "unknown", "code": "it('should reject if call fails but not with LZ_DefaultSendLibUnavailable', async () => {\n await fc.assert(\n fc.asyncProperty(\n pointArbitrary,\n endpointArbitrary,\n evmAddressArbitrary,\n async (point, eid, oappAddress) => {\n const provider = new JsonRpcProvider()\n const sdk = new EndpointV2(provider, point)\n const error = { data: '0x86957466' }\n\n jest.spyOn(provider, 'call').mockRejectedValue(error)\n\n await expect(sdk.getSendLibrary(oappAddress, eid)).rejects.toEqual(error)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/endpoint/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Rejection occurs when a call fails but not due to `LZ_DefaultSendLibUnavailable`.", "mode": "fast-check"} {"id": 58267, "name": "unknown", "code": "it('should call onStart & onSuccess when the callback resolves', async () => {\n await fc.assert(\n fc.asyncProperty(fc.array(fc.anything()), fc.anything(), async (args, returnValue) => {\n const fn = jest.fn().mockResolvedValue(returnValue)\n const onStart = jest.fn().mockImplementation((logger: Logger) => logger.debug(`onStart`))\n const onSuccess = jest.fn().mockImplementation((logger: Logger) => logger.debug(`onSuccess`))\n\n await expect(withAsyncLogger(fn, { onStart, onSuccess })(...args)).resolves.toBe(returnValue)\n\n expect(onStart).toHaveBeenCalledWith(expect.anything(), args)\n expect(onSuccess).toHaveBeenCalledWith(expect.anything(), args, returnValue)\n expect(onStart).toHaveBeenCalledBefore(onSuccess)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/io-devtools/test/stdio/logger.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`withAsyncLogger` calls `onStart` and `onSuccess` with expected arguments and order when the provided callback resolves successfully.", "mode": "fast-check"} {"id": 58269, "name": "unknown", "code": "it('should resolve if onSuccess call throws', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.array(fc.anything()),\n fc.anything(),\n fc.anything(),\n async (args, returnValue, loggerError) => {\n const fn = jest.fn().mockResolvedValue(returnValue)\n const onStart = jest.fn().mockImplementation((logger: Logger) => logger.debug(`onStart`))\n const onSuccess = jest.fn().mockImplementation(() => {\n throw loggerError\n })\n\n await expect(withAsyncLogger(fn, { onStart, onSuccess })(...args)).resolves.toBe(\n returnValue\n )\n\n expect(onStart).toHaveBeenCalledWith(expect.anything(), args)\n expect(onSuccess).toHaveBeenCalledWith(expect.anything(), args, returnValue)\n expect(onStart).toHaveBeenCalledBefore(onSuccess)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/io-devtools/test/stdio/logger.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`withAsyncLogger` resolves to the function's return value even if `onSuccess` throws an error.", "mode": "fast-check"} {"id": 58270, "name": "unknown", "code": "it('should reject with the original error if onError callback throws', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.array(fc.anything()),\n fc.anything(),\n fc.anything(),\n async (args, error, loggerError) => {\n const fn = jest.fn().mockRejectedValue(error)\n const onStart = jest.fn().mockImplementation((logger: Logger) => logger.debug(`onStart`))\n const onError = jest.fn().mockImplementation(() => {\n throw loggerError\n })\n\n await expect(withAsyncLogger(fn, { onStart, onError })(...args)).rejects.toBe(error)\n\n expect(onStart).toHaveBeenCalledWith(expect.anything(), args)\n expect(onError).toHaveBeenCalledWith(expect.anything(), args, error)\n expect(onStart).toHaveBeenCalledBefore(onError)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/io-devtools/test/stdio/logger.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Rejects with the original error if the `onError` callback throws an error during its execution.", "mode": "fast-check"} {"id": 58272, "name": "unknown", "code": "it('should remove any nulls or undefineds', () => {\n fc.assert(\n fc.property(fc.array(fc.oneof(transactionArbitrary, nullableArbitrary)), (transactions) => {\n const flattened = flattenTransactions(transactions)\n\n for (const transaction of flattened) {\n expect(transaction).not.toBeNull()\n expect(transaction).not.toBeUndefined()\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/transactions/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures `flattenTransactions` removes all `null` and `undefined` values from an array of transactions.", "mode": "fast-check"} {"id": 58274, "name": "unknown", "code": "it('should return a map with containing all the transactions passed in', () => {\n fc.assert(\n fc.property(fc.array(transactionArbitrary), (transactions) => {\n const grouped = groupTransactionsByEid(transactions)\n\n for (const transaction of transactions) {\n expect(grouped.get(transaction.point.eid)).toContain(transaction)\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/transactions/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`groupTransactionsByEid` returns a map where each transaction is grouped under its corresponding `eid`.", "mode": "fast-check"} {"id": 58275, "name": "unknown", "code": "it('should preserve the order of transaction per group', () => {\n fc.assert(\n fc.property(fc.array(transactionArbitrary), (transactions) => {\n const grouped = groupTransactionsByEid(transactions)\n\n for (const transactionsForEid of grouped.values()) {\n // Here we want to make sure that within a group of transactions,\n // no transactions have changed order\n //\n // The logic here goes something like this:\n // - We look for the indices of transactions from the grouped array in the original array\n // - If two transactions swapped places, this array would then contain an inversion\n // (transaction at an earlier index in the grouped array would appear after a transaction\n // at a later index). So what we do is remove the inversions by sorting the array of indices\n // and make sure this sorted array matches the original one\n const transactionIndices = transactionsForEid.map((t) => transactions.indexOf(t))\n const sortedTransactionIndices = transactionIndices.slice().sort()\n\n expect(transactionIndices).toEqual(sortedTransactionIndices)\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/transactions/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The order of transactions is preserved within each group after grouping by EID.", "mode": "fast-check"} {"id": 58286, "name": "unknown", "code": "it('should not parse', () => {\n fc.assert(\n fc.property(pointArbitrary, bad, (point, config) => {\n expect(schema.safeParse({ point, config }).success).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Verifies that `schema.safeParse` fails when parsing objects containing specific `point` and `config` values.", "mode": "fast-check"} {"id": 58287, "name": "unknown", "code": "it('should parse successfully', () => {\n fc.assert(\n fc.property(vectorArbitrary, good, (vector, config) => {\n expect(schema.safeParse({ vector, config }).success).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Parsing should succeed when given a `vector` and `config` that conform to the schema.", "mode": "fast-check"} {"id": 58289, "name": "unknown", "code": "it('should work for non-negative bigints', () => {\n fc.assert(\n fc.property(fc.bigInt({ min: BigInt(0) }), (value) => {\n expect(UIntBigIntSchema.parse(value)).toBe(value)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`UIntBigIntSchema.parse` correctly processes non-negative bigint values, returning the original value.", "mode": "fast-check"} {"id": 58382, "name": "unknown", "code": "it('should call forEach correctly', () => {\n fc.assert(\n fc.property(fc.array(fc.tuple(keyArbitrary, valueArbitrary)), (entries) => {\n const map = new TestMap(entries)\n const callback = jest.fn()\n\n map.forEach(callback)\n\n // We'll get the entries from the map since the original entries\n // might contain duplicates\n const mapEntries = Array.from(map.entries())\n expect(callback).toHaveBeenCalledTimes(mapEntries.length)\n\n for (const [key, value] of mapEntries) {\n expect(callback).toHaveBeenCalledWith(value, key, map)\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/map.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `forEach` method should invoke the callback with each key-value pair and the map, matching the number of unique entries in the map.", "mode": "fast-check"} {"id": 58383, "name": "unknown", "code": "it('should use orElse if a key is not defined', () => {\n fc.assert(\n fc.property(keyArbitrary, valueArbitrary, valueArbitrary, (key, value, orElseValue) => {\n const map = new TestMap()\n const orElse = jest.fn().mockReturnValue(orElseValue)\n\n // Sanity check first\n expect(map.has(key)).toBeFalsy()\n\n // If the key has not been set, the map should use orElse\n expect(map.getOrElse(key, orElse)).toBe(orElseValue)\n\n // Set a value first\n map.set(key, value)\n\n // And check that orElse is not being used\n expect(map.getOrElse(key, orElse)).toBe(value)\n\n // Now delete the value\n map.delete(key)\n\n // And check that orElse is being used again\n expect(map.getOrElse(key, orElse)).toBe(orElseValue)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/map.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test confirms that `getOrElse` returns a fallback value via `orElse` if a key is not present in the map, and the actual value if the key is present.", "mode": "fast-check"} {"id": 58385, "name": "unknown", "code": "it('should normalize a peer correctly', () => {\n fc.assert(\n fc.property(evmEndpointArbitrary, evmAddressArbitrary, (eid, address) => {\n const normalized = normalizePeer(address, eid)\n const denormalized = denormalizePeer(normalized, eid)\n\n expect(denormalized).toBe(address)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`normalizePeer` and `denormalizePeer` should ensure the denormalized output matches the original address given the same endpoint.", "mode": "fast-check"} {"id": 58386, "name": "unknown", "code": "it('should normalize a nullish value to empty bytes', () => {\n fc.assert(\n fc.property(aptosEndpointArbitrary, nullishArbitrary, (eid, address) => {\n const normalized = normalizePeer(address, eid)\n const denormalized = denormalizePeer(normalized, eid)\n\n expect(normalized).toEqual(new Uint8Array(32))\n expect(isZero(normalized)).toBe(true)\n expect(isZero(denormalized)).toBe(true)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Normalization of a nullish value should result in an empty `Uint8Array` of size 32, and both normalized and denormalized outputs should consist only of zeros.", "mode": "fast-check"} {"id": 58387, "name": "unknown", "code": "it('should normalize a peer correctly', () => {\n fc.assert(\n fc.property(aptosEndpointArbitrary, aptosAddressArbitrary, (eid, address) => {\n const normalized = normalizePeer(address, eid)\n const denormalized = denormalizePeer(normalized, eid)\n\n expect(denormalized).toBe(address)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`normalizePeer` followed by `denormalizePeer` should return the original address when using the same endpoint ID.", "mode": "fast-check"} {"id": 58388, "name": "unknown", "code": "it('should normalize a nullish value to empty bytes', () => {\n fc.assert(\n fc.property(solanaEndpointArbitrary, nullishArbitrary, (eid, address) => {\n const normalized = normalizePeer(address, eid)\n const denormalized = denormalizePeer(normalized, eid)\n\n expect(normalized).toEqual(new Uint8Array(32))\n expect(isZero(normalized)).toBe(true)\n expect(isZero(denormalized)).toBe(true)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "A nullish value should be normalized to a 32-byte zero-filled `Uint8Array`, and its denormalization should also result in zero-filled data.", "mode": "fast-check"} {"id": 58389, "name": "unknown", "code": "it('should normalize a peer correctly', () => {\n fc.assert(\n fc.property(solanaEndpointArbitrary, solanaAddressArbitrary, (eid, address) => {\n const normalized = normalizePeer(address, eid)\n const denormalized = denormalizePeer(normalized, eid)\n\n expect(denormalized).toBe(address)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Normalizing and then denormalizing a peer with an address and endpoint should result in the original address.", "mode": "fast-check"} {"id": 58391, "name": "unknown", "code": "it('should return true for arrays containing the same values', () => {\n fc.assert(\n fc.property(arrayArbitrary, (array) => {\n expect(isDeepEqual(array, [...array])).toBeTruthy()\n expect(isDeepEqual([...array], array)).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/assertion.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`isDeepEqual` returns true for arrays containing identical values in the same order.", "mode": "fast-check"} {"id": 58392, "name": "unknown", "code": "it('should return false for arrays containing different values', () => {\n fc.assert(\n fc.property(arrayArbitrary, arrayArbitrary, (arrayA, arrayB) => {\n // We'll do a very simplified precondition - we'll only run tests when the first elements are different\n fc.pre(!isDeepEqual(arrayA[0], arrayB[0]))\n\n expect(isDeepEqual(arrayA, arrayB)).toBeFalsy()\n expect(isDeepEqual(arrayB, arrayA)).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/assertion.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`isDeepEqual` returns false for arrays with different first elements.", "mode": "fast-check"} {"id": 58393, "name": "unknown", "code": "it('should return false for arrays containing more values', () => {\n fc.assert(\n fc.property(arrayArbitrary, fc.anything(), (array, extraValue) => {\n expect(isDeepEqual(array, [...array, extraValue])).toBeFalsy()\n expect(isDeepEqual([...array, extraValue], array)).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/assertion.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`isDeepEqual` returns false when comparing an array to the same array with an additional value.", "mode": "fast-check"} {"id": 58394, "name": "unknown", "code": "it('should return true for sets containing the same values', () => {\n fc.assert(\n fc.property(arrayArbitrary, (array) => {\n const setA = new Set(array)\n const setB = new Set(array)\n\n expect(isDeepEqual(setA, setB)).toBeTruthy()\n expect(isDeepEqual(setB, setA)).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/assertion.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should hold that two sets created from the same array have deep equality.", "mode": "fast-check"} {"id": 58395, "name": "unknown", "code": "it('should return true for maps containing the same values', () => {\n fc.assert(\n fc.property(entriesArbitrary, (entries) => {\n const mapA = new Map(entries)\n const mapB = new Map(entries)\n\n expect(isDeepEqual(mapA, mapB)).toBeTruthy()\n expect(isDeepEqual(mapB, mapA)).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/assertion.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`isDeepEqual` returns true for two maps containing the same values.", "mode": "fast-check"} {"id": 58396, "name": "unknown", "code": "it('should return true for objects containing the same values', () => {\n fc.assert(\n fc.property(\n fc.record({\n value: fc.anything(),\n }),\n (object) => {\n expect(isDeepEqual(object, { ...object })).toBeTruthy()\n expect(isDeepEqual({ ...object }, object)).toBeTruthy()\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/assertion.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`isDeepEqual` returns true when comparing an object with itself, regardless of syntactic duplication.", "mode": "fast-check"} {"id": 58397, "name": "unknown", "code": "it('should return false for objects containing different values', () => {\n fc.assert(\n fc.property(\n fc.record({\n value: fc.anything(),\n }),\n fc.anything(),\n (object, value) => {\n fc.pre(!isDeepEqual(object.value, value))\n\n expect(isDeepEqual(object, { value })).toBeFalsy()\n expect(isDeepEqual({ value }, object)).toBeFalsy()\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/assertion.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Verifies that `isDeepEqual` returns false for objects with mismatched values compared to another value.", "mode": "fast-check"} {"id": 58398, "name": "unknown", "code": "it('should sign a transaction', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n solanaAddressArbitrary,\n keypairArbitrary,\n keypairArbitrary,\n async (eid, address, sender, recipient) => {\n const transfer = SystemProgram.transfer({\n fromPubkey: sender.publicKey,\n toPubkey: recipient.publicKey,\n lamports: 49,\n })\n\n const connection = new Connection('http://soyllama.com')\n const omniSigner = new OmniSignerSolana(eid, connection, sender)\n\n const transaction = new Transaction().add(transfer)\n transaction.recentBlockhash = 'EETubP5AKHgjPAhzPAFcb8BAY1hMH639CWCFTqi3hq1k'\n transaction.feePayer = sender.publicKey\n\n const omniTransaction: OmniTransaction = {\n point: { eid, address },\n data: serializeTransactionMessage(transaction),\n }\n\n const signature = await omniSigner.sign(omniTransaction)\n const serializedTransaction = (transaction.sign(sender), transaction.serialize())\n\n expect(deserializeTransactionBuffer(signature)).toEqual(serializedTransaction)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-solana/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "A transaction signed by `OmniSignerSolana` should match the serialized transaction signed manually by a `sender`.", "mode": "fast-check"} {"id": 58399, "name": "unknown", "code": "it('should sign and send a transaction', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n solanaAddressArbitrary,\n keypairArbitrary,\n keypairArbitrary,\n fc.string(),\n async (eid, address, sender, recipient, transactionHash) => {\n sendAndConfirmTransactionMock.mockResolvedValue(transactionHash)\n\n const transfer = SystemProgram.transfer({\n fromPubkey: sender.publicKey,\n toPubkey: recipient.publicKey,\n lamports: 49,\n })\n\n const connection = new Connection('http://soyllama.com')\n const omniSigner = new OmniSignerSolana(eid, connection, sender)\n\n const transaction = new Transaction().add(transfer)\n transaction.recentBlockhash = 'EETubP5AKHgjPAhzPAFcb8BAY1hMH639CWCFTqi3hq1k'\n transaction.feePayer = sender.publicKey\n\n const omniTransaction: OmniTransaction = {\n point: { eid, address },\n data: serializeTransactionMessage(transaction),\n }\n\n const response = await omniSigner.signAndSend(omniTransaction)\n expect(response).toEqual({\n transactionHash,\n wait: expect.any(Function),\n })\n\n expect(await response.wait()).toEqual({ transactionHash })\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-solana/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures that a transaction, signed by `OmniSignerSolana` using arbitrary endpoints, addresses, and keypairs, is successfully sent and that the response matches the expected transaction hash, including a wait function that confirms the transaction hash.", "mode": "fast-check"} {"id": 58400, "name": "unknown", "code": "it('should throw an error', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n solanaAddressArbitrary,\n keypairArbitrary,\n keypairArbitrary,\n async (eid, address, sender, recipient) => {\n const transfer = SystemProgram.transfer({\n fromPubkey: sender.publicKey,\n toPubkey: recipient.publicKey,\n lamports: 49,\n })\n\n const connection = new Connection('http://soyllama.com')\n const multiSigAddress = PublicKey.default\n const wallet = Keypair.generate()\n const omniSigner: OmniSigner = new OmniSignerSolanaSquads(\n eid,\n connection,\n multiSigAddress,\n wallet\n )\n\n const transaction = new Transaction().add(transfer)\n transaction.recentBlockhash = 'EETubP5AKHgjPAhzPAFcb8BAY1hMH639CWCFTqi3hq1k'\n transaction.feePayer = sender.publicKey\n\n const omniTransaction: OmniTransaction = {\n point: { eid, address },\n data: serializeTransactionMessage(transaction),\n }\n\n await expect(omniSigner.sign(omniTransaction)).rejects.toThrow(\n 'OmniSignerSolanaSquads does not support the sign() method. Please use signAndSend().'\n )\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-solana/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "An error should be thrown when attempting to call `sign` on `OmniSignerSolanaSquads`, indicating that the method is not supported and `signAndSend` should be used instead.", "mode": "fast-check"} {"id": 58401, "name": "unknown", "code": "it('should work', async () => {\n await fc.assert(\n fc.asyncProperty(keypairArbitrary, keypairArbitrary, async (sender, recipient) => {\n const transfer = SystemProgram.transfer({\n fromPubkey: sender.publicKey,\n toPubkey: recipient.publicKey,\n lamports: 49,\n })\n\n const transaction = new Transaction().add(transfer)\n\n // Transaction in Solana require a recent block hash to be set in order for them to be serialized\n transaction.recentBlockhash = 'EETubP5AKHgjPAhzPAFcb8BAY1hMH639CWCFTqi3hq1k'\n\n // Transactions in Solana require a fee payer to be set in order for them to be serialized\n transaction.feePayer = sender.publicKey\n\n // First we serialize the transaction\n const serializedTransaction = serializeTransactionMessage(transaction)\n // Then we deserialize it\n const deserializedTransaction = deserializeTransactionMessage(serializedTransaction)\n // And check that the fields match the original transaction\n //\n // The reason why we don't compare the transactions directly is that the signers will not match\n // after deserialization (the signers get stripped out of the original transaction)\n expect(deserializedTransaction.instructions).toEqual(transaction.instructions)\n expect(deserializedTransaction.recentBlockhash).toEqual(transaction.recentBlockhash)\n expect(deserializedTransaction.feePayer).toEqual(transaction.feePayer)\n\n // Now we serialize the deserialized transaction again and check that it fully matches the serialized transaction\n const reserializedTransaction = serializeTransactionMessage(deserializedTransaction)\n expect(reserializedTransaction).toEqual(serializedTransaction)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-solana/test/transactions/serde.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Serialization and deserialization of Solana transactions should preserve instructions, recent blockhash, and fee payer, and reserialization should match the original serialized transaction.", "mode": "fast-check"} {"id": 58402, "name": "unknown", "code": "it('should add a feePayer and the latest block hash to the transaction', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n solanaAddressArbitrary,\n keypairArbitrary,\n keypairArbitrary,\n solanaBlockhashArbitrary,\n async (eid, address, sender, recipient, blockhash) => {\n class TestOmniSDK extends OmniSDK {\n test() {\n const transfer = SystemProgram.transfer({\n fromPubkey: sender.publicKey,\n toPubkey: recipient.publicKey,\n lamports: 49,\n })\n const transaction = new Transaction().add(transfer)\n\n return this.createTransaction(transaction)\n }\n }\n\n const connection = new Connection('http://soyllama.com')\n jest.spyOn(connection, 'getLatestBlockhash').mockResolvedValue({\n blockhash,\n lastValidBlockHeight: NaN,\n })\n\n const sdk = new TestOmniSDK(connection, { eid, address }, sender.publicKey)\n const omniTransaction = await sdk.test()\n\n expect(omniTransaction).toEqual({\n data: expect.any(String),\n point: { eid, address },\n })\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-solana/test/omnigraph/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Adds a feePayer and the latest block hash to a transaction and verifies the transaction data and point properties.", "mode": "fast-check"} {"id": 58403, "name": "unknown", "code": "it('should reject if urlFactory throws', async () => {\n await fc.assert(\n fc.asyncProperty(errorArbitrary, endpointArbitrary, async (error, eid) => {\n const urlFactory = jest.fn().mockImplementation(() => {\n throw error\n })\n const providerFactory = createConnectionFactory(urlFactory)\n\n await expect(providerFactory(eid)).rejects.toBe(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-solana/test/connection/factory.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that when `urlFactory` throws an error, the `providerFactory` correctly rejects with that same error.", "mode": "fast-check"} {"id": 58404, "name": "unknown", "code": "it('should reject if urlFactory rejects', async () => {\n await fc.assert(\n fc.asyncProperty(errorArbitrary, endpointArbitrary, async (error, eid) => {\n const urlFactory = jest.fn().mockRejectedValue(error)\n const providerFactory = createConnectionFactory(urlFactory)\n\n await expect(providerFactory(eid)).rejects.toBe(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-solana/test/connection/factory.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function should reject when the `urlFactory` promise is rejected with an error.", "mode": "fast-check"} {"id": 58405, "name": "unknown", "code": "it('should resolve with Connection if urlFactory returns a URL', async () => {\n await fc.assert(\n fc.asyncProperty(urlArbitrary, endpointArbitrary, async (url, eid) => {\n const urlFactory = jest.fn().mockReturnValue(url)\n const connectionFactory = createConnectionFactory(urlFactory)\n const connection = await connectionFactory(eid)\n\n expect(connection).toBeInstanceOf(Connection)\n expect(connection.rpcEndpoint).toBe(url)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-solana/test/connection/factory.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "If the `urlFactory` returns a URL, the connection resolved should be an instance of `Connection` with the `rpcEndpoint` matching the URL.", "mode": "fast-check"} {"id": 58406, "name": "unknown", "code": "it('should resolve with JsonRpcProvider if urlFactory resolves with a URL', async () => {\n await fc.assert(\n fc.asyncProperty(urlArbitrary, endpointArbitrary, async (url, eid) => {\n const urlFactory = jest.fn().mockResolvedValue(url)\n const connectionFactory = createConnectionFactory(urlFactory)\n const connection = await connectionFactory(eid)\n\n expect(connection).toBeInstanceOf(Connection)\n expect(connection.rpcEndpoint).toBe(url)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-solana/test/connection/factory.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "A URL resolved by `urlFactory` should result in `createConnectionFactory` producing a `Connection` instance with the corresponding RPC endpoint.", "mode": "fast-check"} {"id": 58407, "name": "unknown", "code": "it('should throw an error for other endpoints', () => {\n fc.assert(\n fc.property(endpointArbitrary, (eid) => {\n fc.pre(eid !== EndpointId.SOLANA_V2_MAINNET)\n fc.pre(eid !== EndpointId.SOLANA_V2_TESTNET)\n fc.pre(eid !== EndpointId.SOLANA_MAINNET)\n fc.pre(eid !== EndpointId.SOLANA_TESTNET)\n\n expect(() => defaultRpcUrlFactory(eid)).toThrow(\n `Could not find a default Solana RPC URL for eid ${eid} (${formatEid(eid)})`\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-solana/test/connection/factory.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The connection factory should throw an error when given an endpoint ID that is not one of the predefined valid Solana endpoints.", "mode": "fast-check"} {"id": 58409, "name": "unknown", "code": "it('should not parse anything else', () => {\n fc.assert(\n fc.property(fc.anything(), (value) => {\n expect(() => BNBigIntSchema.parse(value)).toThrow(/Input not instance of BN/)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-solana/test/common/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`BNBigIntSchema.parse` throws an error when attempting to parse values that are not instances of `BN`.", "mode": "fast-check"} {"id": 58411, "name": "unknown", "code": "it('should not parse anything else', () => {\n fc.assert(\n fc.property(fc.anything(), (value) => {\n expect(() => PublicKeySchema.parse(value)).toThrow(/Input not instance of PublicKey/)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-solana/test/common/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`PublicKeySchema.parse` throws an error when given an input that is not an instance of `PublicKey`.", "mode": "fast-check"} {"id": 58412, "name": "unknown", "code": "it('should return undefined if the account has not been initialized', async () => {\n getAccountInfoMock.mockResolvedValue(null)\n\n await fc.assert(\n fc.asyncProperty(solanaEndpointArbitrary, keypairArbitrary, async (eid, keypair) => {\n fc.pre(eid !== EndpointId.SOLANA_V2_SANDBOX)\n\n const address = keypair.publicKey.toBase58()\n\n const connection = await connectionFactory(oftConfig.eid)\n const getAccountInfo = createGetAccountInfo(connection)\n\n expect(await getAccountInfo(address)).toBeUndefined()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-solana/test/common/accounts.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures that `getAccountInfo` returns `undefined` for uninitialized accounts when tested against various valid endpoints and keypairs.", "mode": "fast-check"} {"id": 58413, "name": "unknown", "code": "it('should reject if the eid of the transaction does not match the eid of the signer', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, transactionArbitrary, async (eid, transaction) => {\n fc.pre(eid !== transaction.point.eid)\n\n const signer = {} as Signer\n const omniSigner = new OmniSignerEVM(eid, signer)\n\n await expect(() => omniSigner.sign(transaction)).rejects.toThrow(/Could not use signer/)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm/test/signer/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "An `OmniSignerEVM` should reject a transaction if the transaction's eid does not match the eid of the signer, throwing an error indicating that the signer could not be used.", "mode": "fast-check"} {"id": 58414, "name": "unknown", "code": "it('should sign the transaction using the signer if the eids match', async () => {\n await fc.assert(\n fc.asyncProperty(\n transactionArbitrary,\n signedTransactionArbitrary,\n async (transaction, signedTransaction) => {\n const signTransaction = jest.fn().mockResolvedValue(signedTransaction)\n const signer = { signTransaction } as unknown as Signer\n const omniSigner = new OmniSignerEVM(transaction.point.eid, signer)\n\n expect(await omniSigner.sign(transaction)).toBe(signedTransaction)\n expect(signTransaction).toHaveBeenCalledWith({\n to: transaction.point.address,\n data: transaction.data,\n value: transaction.value,\n })\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm/test/signer/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `OmniSignerEVM` signs a transaction using a signer when the `eids` match.", "mode": "fast-check"} {"id": 58415, "name": "unknown", "code": "it('should reject if the eid of the transaction does not match the eid of the signer', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, transactionArbitrary, async (eid, transaction) => {\n fc.pre(eid !== transaction.point.eid)\n\n const signer = {} as Signer\n const omniSigner = new OmniSignerEVM(eid, signer)\n\n await expect(() => omniSigner.signAndSend(transaction)).rejects.toThrow(/Could not use signer/)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm/test/signer/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks if `OmniSignerEVM.signAndSend` rejects with an error when the `eid` of the transaction does not match the `eid` of the signer.", "mode": "fast-check"} {"id": 58416, "name": "unknown", "code": "it('should send the transaction using the signer if the eids match', async () => {\n await fc.assert(\n fc.asyncProperty(transactionArbitrary, transactionHashArbitrary, async (transaction, hash) => {\n const sendTransaction = jest.fn().mockResolvedValue({ hash })\n const signer = { sendTransaction } as unknown as Signer\n const omniSigner = new OmniSignerEVM(transaction.point.eid, signer)\n\n expect(await omniSigner.signAndSend(transaction)).toEqual({ transactionHash: hash })\n expect(sendTransaction).toHaveBeenCalledWith({\n to: transaction.point.address,\n data: transaction.data,\n value: transaction.value,\n })\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm/test/signer/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`OmniSignerEVM` sends a transaction using the signer if the transaction's `eid` matches, verifying that the transaction hash is returned and the signer is called with the correct parameters.", "mode": "fast-check"} {"id": 58417, "name": "unknown", "code": "it('should not be supported', async () => {\n await fc.assert(\n fc.asyncProperty(\n evmAddressArbitrary,\n endpointArbitrary,\n transactionArbitrary,\n async (safeAddress, eid, transaction) => {\n const signer = {} as Signer\n\n const apiKit = {\n getNextNonce: jest.fn(),\n } as unknown as SafeApiKit\n\n const safe = {\n createTransaction: jest.fn().mockResolvedValue({ data: 'transaction' }),\n getAddress: jest.fn().mockResolvedValue(safeAddress),\n signTransaction: jest.fn().mockResolvedValue({ data: { data: '0xsigned' } }),\n } as unknown as Safe\n\n const omniSigner = new GnosisOmniSignerEVM(eid, signer, '', {}, undefined, apiKit, safe)\n\n await expect(omniSigner.sign(transaction)).rejects.toThrow(\n /Signing transactions with safe is currently not supported, use signAndSend instead/\n )\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm/test/signer/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that attempting to sign a transaction using `GnosisOmniSignerEVM` throws an error indicating that signing with a safe is not supported, and suggests using `signAndSend` instead.", "mode": "fast-check"} {"id": 58418, "name": "unknown", "code": "it('should reject if the eid of the transaction does not match the eid of the signer', async () => {\n await fc.assert(\n fc.asyncProperty(\n evmAddressArbitrary,\n endpointArbitrary,\n transactionArbitrary,\n async (safeAddress, eid, transaction) => {\n fc.pre(eid !== transaction.point.eid)\n\n const signer = {} as Signer\n const safe = {\n createTransaction: jest.fn().mockResolvedValue({ data: 'transaction' }),\n getAddress: jest.fn().mockResolvedValue(safeAddress),\n signTransactionHash: jest.fn().mockResolvedValue({ data: 'signature' }),\n } as unknown as Safe\n const omniSigner = new GnosisOmniSignerEVM(eid, signer, '', {}, undefined, undefined, safe)\n\n await expect(() => omniSigner.signAndSend(transaction)).rejects.toThrow(\n /Could not use signer/\n )\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm/test/signer/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Rejection occurs if the transaction's `eid` does not match the signer's `eid` in `GnosisOmniSignerEVM`.", "mode": "fast-check"} {"id": 58419, "name": "unknown", "code": "it('should send the transaction using the signer if the eids match', async () => {\n await fc.assert(\n fc.asyncProperty(\n evmAddressArbitrary,\n transactionArbitrary,\n transactionHashArbitrary,\n async (safeAddress, transaction, transactionHash) => {\n const signer = { getAddress: jest.fn(), sendTransaction: jest.fn() } as unknown as Signer\n const apiKit = {\n proposeTransaction: jest.fn(),\n getNextNonce: jest.fn(),\n } as unknown as SafeApiKit\n const safe = {\n createTransaction: jest.fn().mockResolvedValue({ data: 'transaction' }),\n getTransactionHash: jest.fn().mockResolvedValue(transactionHash),\n getAddress: jest.fn().mockResolvedValue(safeAddress),\n signTransactionHash: jest.fn().mockResolvedValue({ data: 'signature' }),\n } as unknown as Safe\n\n const omniSigner = new GnosisOmniSignerEVM(\n transaction.point.eid,\n signer,\n '',\n {\n safeAddress,\n },\n undefined,\n apiKit,\n safe\n )\n\n const result = await omniSigner.signAndSend(transaction)\n expect(result.transactionHash).toEqual(transactionHash)\n\n expect(await result.wait()).toEqual({ transactionHash })\n\n expect(apiKit.getNextNonce).toHaveBeenCalledWith(safeAddress)\n expect(apiKit.proposeTransaction).toHaveBeenCalledWith({\n safeAddress,\n safeTransactionData: 'transaction',\n safeTxHash: transactionHash,\n senderAddress: undefined,\n senderSignature: 'signature',\n })\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm/test/signer/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Ensures that `GnosisOmniSignerEVM.signAndSend` sends a transaction using the signer when the eids match by verifying transaction hash and expected API calls.", "mode": "fast-check"} {"id": 54766, "name": "unknown", "code": "it('should create a date from the zoned date on a JS Date.', () => {\n fc.assert(\n fc.property(\n fc.date({\n max: temporalUtil.newDate(MAX_UTC_IN_MS - ONE_DAY_IN_MS),\n min: temporalUtil.newDate(MIN_UTC_IN_MS + ONE_DAY_IN_MS)\n }),\n standardDate => {\n const date = Date.fromStandardDateLocal(standardDate)\n const receivedDate = date.toStandardDate()\n\n expect(receivedDate.getUTCFullYear()).toEqual(standardDate.getFullYear())\n expect(receivedDate.getUTCMonth()).toEqual(standardDate.getMonth())\n expect(receivedDate.getUTCDate()).toEqual(standardDate.getDate())\n expect(receivedDate.getUTCHours()).toEqual(0)\n expect(receivedDate.getUTCMinutes()).toEqual(0)\n })\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/temporal-types.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Creating a date from a zoned date on a JavaScript Date should correctly match the UTC year, month, and date, with hours and minutes set to zero.", "mode": "fast-check"} {"id": 58420, "name": "unknown", "code": "it('should reject with no transactions', async () => {\n await fc.assert(\n fc.asyncProperty(evmAddressArbitrary, endpointArbitrary, async (safeAddress, eid) => {\n const signer = {} as Signer\n const safe = {} as unknown as Safe\n const omniSigner = new GnosisOmniSignerEVM(eid, signer, '', {}, undefined, undefined, safe)\n\n await expect(() => omniSigner.signAndSendBatch([])).rejects.toThrow(\n /signAndSendBatch received 0 transactions/\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm/test/signer/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`GnosisOmniSignerEVM.signAndSendBatch` throws an error when called with an empty transaction array.", "mode": "fast-check"} {"id": 54767, "name": "unknown", "code": "it('should be the reverse operation of toStandardDateUTC but losing time information', () => {\n fc.assert(\n fc.property(\n fc.date({\n max: temporalUtil.newDate(MAX_UTC_IN_MS - ONE_DAY_IN_MS),\n min: temporalUtil.newDate(MIN_UTC_IN_MS + ONE_DAY_IN_MS)\n }),\n standardDate => {\n const date = Date.fromStandardDateUTC(standardDate)\n const receivedDate = date.toStandardDate()\n\n expect(receivedDate.getUTCFullYear()).toEqual(standardDate.getUTCFullYear())\n expect(receivedDate.getUTCMonth()).toEqual(standardDate.getUTCMonth())\n expect(receivedDate.getUTCDate()).toEqual(standardDate.getUTCDate())\n expect(receivedDate.getUTCHours()).toEqual(0)\n expect(receivedDate.getUTCMinutes()).toEqual(0)\n })\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/temporal-types.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Converting a `standardDate` to a `Date` and back should preserve the year, month, and date, but reset the time to midnight UTC.", "mode": "fast-check"} {"id": 58421, "name": "unknown", "code": "it('should reject if at least one of the transaction eids do not match the signer eid', async () => {\n await fc.assert(\n fc.asyncProperty(\n evmAddressArbitrary,\n endpointArbitrary,\n fc.array(transactionArbitrary, { minLength: 1 }),\n async (safeAddress, eid, transactions) => {\n fc.pre(transactions.some((transaction) => eid !== transaction.point.eid))\n\n const signer = {} as Signer\n const safe = {\n createTransaction: jest.fn().mockResolvedValue({ data: 'transaction' }),\n getAddress: jest.fn().mockResolvedValue(safeAddress),\n signTransactionHash: jest.fn().mockResolvedValue({ data: 'signature' }),\n } as unknown as Safe\n const omniSigner = new GnosisOmniSignerEVM(eid, signer, '', {}, undefined, undefined, safe)\n\n await expect(() => omniSigner.signAndSendBatch(transactions)).rejects.toThrow(\n /Could not use signer/\n )\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm/test/signer/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Rejects if at least one transaction eid does not match the signer eid, by throwing an error when attempting to sign and send a batch of transactions.", "mode": "fast-check"} {"id": 54768, "name": "unknown", "code": "it('should be the reverse operation of fromStandardDate', () => {\n fc.assert(\n fc.property(fc.date(), (date) => {\n const localDatetime = LocalDateTime.fromStandardDate(date)\n const receivedDate = localDatetime.toStandardDate()\n\n expect(receivedDate).toEqual(date)\n })\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/temporal-types.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Converting a date to `LocalDateTime` and back should yield the original date.", "mode": "fast-check"} {"id": 54769, "name": "unknown", "code": "it('should be the reverse operation of fromStandardDate', () => {\n fc.assert(\n fc.property(\n fc.date({\n max: temporalUtil.newDate(MAX_UTC_IN_MS - ONE_DAY_IN_MS),\n min: temporalUtil.newDate(MIN_UTC_IN_MS + ONE_DAY_IN_MS)\n }), (date) => {\n const datetime = DateTime.fromStandardDate(date)\n const receivedDate = datetime.toStandardDate()\n\n expect(receivedDate).toEqual(date)\n })\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/temporal-types.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Converting a date to `DateTime` using `fromStandardDate` and back with `toStandardDate` should return the original date.", "mode": "fast-check"} {"id": 58422, "name": "unknown", "code": "it('should send the transaction using the signer if the eids match', async () => {\n await fc.assert(\n fc.asyncProperty(\n evmAddressArbitrary,\n endpointArbitrary,\n fc.array(transactionArbitrary, { minLength: 1 }),\n transactionHashArbitrary,\n async (safeAddress, eid, transactions, transactionHash) => {\n const nonce = 17\n const signer = { getAddress: jest.fn(), sendTransaction: jest.fn() } as unknown as Signer\n const apiKit = {\n proposeTransaction: jest.fn(),\n getNextNonce: jest.fn().mockResolvedValue(nonce),\n } as unknown as SafeApiKit\n const safe = {\n createTransaction: jest.fn().mockResolvedValue({ data: 'transaction' }),\n getTransactionHash: jest.fn().mockResolvedValue(transactionHash),\n getAddress: jest.fn().mockResolvedValue(safeAddress),\n signTransactionHash: jest.fn().mockResolvedValue({ data: 'signature' }),\n } as unknown as Safe\n\n const omniSigner = new GnosisOmniSignerEVM(\n eid,\n signer,\n '',\n {\n safeAddress,\n },\n undefined,\n apiKit,\n safe\n )\n\n const transactionsWithMatchingEids = transactions.map((t) => ({\n ...t,\n point: { ...t.point, eid },\n }))\n\n const result = await omniSigner.signAndSendBatch(transactionsWithMatchingEids)\n expect(result.transactionHash).toEqual(transactionHash)\n\n expect(await result.wait()).toEqual({ transactionHash })\n\n expect(safe.createTransaction).toHaveBeenCalledWith({\n safeTransactionData: transactions.map((t) => ({\n to: t.point.address,\n data: t.data,\n value: String(t.value ?? 0),\n operation: OperationType.Call,\n })),\n options: { nonce },\n })\n\n expect(apiKit.getNextNonce).toHaveBeenCalledWith(safeAddress)\n expect(apiKit.proposeTransaction).toHaveBeenCalledWith({\n safeAddress,\n safeTransactionData: 'transaction',\n safeTxHash: transactionHash,\n senderAddress: undefined,\n senderSignature: 'signature',\n })\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm/test/signer/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "When `eid`s match, the transaction should be sent using the signer, verifying that the transaction hash and the process of signing, proposing, and waiting for the transaction are correctly executed.", "mode": "fast-check"} {"id": 58423, "name": "unknown", "code": "it('should parse BigNumberish', () => {\n fc.assert(\n fc.property(bigNumberishArbitrary, (bigNumberish) => {\n expect(BigNumberishSchema.parse(bigNumberish)).toBe(bigNumberish)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm/test/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`BigNumberishSchema` correctly parses and returns the original `bigNumberish` input.", "mode": "fast-check"} {"id": 54771, "name": "unknown", "code": "it('should handle Integer with maxSafeInteger', () => {\n return fc.assert(\n fc.property(\n fc.maxSafeInteger().map(value => [int(value), value]),\n ([value, expectedValue]) => {\n const rawProfilePlan = {\n [field]: value\n }\n\n const profilePlan = new ProfiledPlan(rawProfilePlan)\n\n return profilePlan[field] === expectedValue\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/result-summary.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "`ProfiledPlan` should correctly handle `Integer` objects wrapped with `maxSafeInteger`, ensuring the field value matches the expected unwrapped integer.", "mode": "fast-check"} {"id": 54772, "name": "unknown", "code": "it('should handle Integer with arbitrary integer', () => {\n return fc.assert(\n fc.property(\n fc.integer().map(value => [int(value), value]),\n ([value, expectedValue]) => {\n const rawProfilePlan = {\n [field]: value\n }\n\n const profilePlan = new ProfiledPlan(rawProfilePlan)\n\n return profilePlan[field] === expectedValue\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/result-summary.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "The property verifies that `ProfiledPlan` correctly retains the value of an integer field converted to and from Neo4j's `int` type.", "mode": "fast-check"} {"id": 58424, "name": "unknown", "code": "it('should parse BigNumberish into a bigint', () => {\n fc.assert(\n fc.property(bigNumberishArbitrary, (bigNumberish) => {\n const parsed = BigNumberishBigIntSchema.parse(bigNumberish)\n\n expect(typeof parsed).toBe('bigint')\n expect(BigNumber.from(parsed)).toEqual(BigNumber.from(bigNumberish))\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm/test/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Parsing `BigNumberish` values should yield a `bigint` type, and the value should be equivalent when converted back using `BigNumber`.", "mode": "fast-check"} {"id": 58425, "name": "unknown", "code": "it('should parse BigNumberish into a number if within bounds', () => {\n fc.assert(\n fc.property(bigNumberishArbitrary, (bigNumberish) => {\n fc.pre(BigNumber.from(bigNumberish).abs().lte(BigInt(Number.MAX_SAFE_INTEGER)))\n\n const parsed = BigNumberishNumberSchema.parse(bigNumberish)\n\n expect(typeof parsed).toBe('number')\n expect(BigNumber.from(parsed)).toEqual(BigNumber.from(bigNumberish))\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm/test/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "BigNumberish values within the bounds of JavaScript's safe integer range are parsed into numbers without altering their value.", "mode": "fast-check"} {"id": 54773, "name": "unknown", "code": "it('should handle BigInt with maxSafeInteger', () => {\n return fc.assert(\n fc.property(\n fc.maxSafeInteger().map(value => [BigInt(value), value]),\n ([value, expectedValue]) => {\n const rawProfilePlan = {\n [field]: value\n }\n\n const profilePlan = new ProfiledPlan(rawProfilePlan)\n\n return profilePlan[field] === expectedValue\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/result-summary.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "A `ProfiledPlan` should handle `BigInt` values correctly, ensuring they equal their corresponding `maxSafeInteger` values.", "mode": "fast-check"} {"id": 54774, "name": "unknown", "code": "it('should handle Integer with arbitrary integer', () => {\n return fc.assert(\n fc.property(\n fc.integer().map(value => [BigInt(value), value]),\n ([value, expectedValue]) => {\n const rawProfilePlan = {\n [field]: value\n }\n\n const profilePlan = new ProfiledPlan(rawProfilePlan)\n\n return profilePlan[field] === expectedValue\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/result-summary.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "`ProfiledPlan` correctly handles properties where the field is set to both a `BigInt` and its original integer value, ensuring they are equivalent.", "mode": "fast-check"} {"id": 58426, "name": "unknown", "code": "it('should throw an error if there is an overflow', () => {\n fc.assert(\n fc.property(bigNumberishArbitrary, (bigNumberish) => {\n fc.pre(BigNumber.from(bigNumberish).abs().gt(BigInt(Number.MAX_SAFE_INTEGER)))\n\n expect(() => BigNumberishNumberSchema.parse(bigNumberish)).toThrow('overflow')\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm/test/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "An error should be thrown if `BigNumberishNumberSchema` attempts to parse a number larger than `Number.MAX_SAFE_INTEGER`.", "mode": "fast-check"} {"id": 58427, "name": "unknown", "code": "it('should reject if urlFactory throws', async () => {\n await fc.assert(\n fc.asyncProperty(errorArbitrary, endpointArbitrary, async (error, eid) => {\n const urlFactory = jest.fn().mockImplementation(() => {\n throw error\n })\n const providerFactory = createProviderFactory(urlFactory)\n\n await expect(providerFactory(eid)).rejects.toBe(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm/test/provider/factory.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "If `urlFactory` throws an error, `providerFactory` should reject with that same error.", "mode": "fast-check"} {"id": 54776, "name": "unknown", "code": "it('should handle Integer with maxSafeInteger', () => {\n return fc.assert(\n fc.property(\n fc.maxSafeInteger().map(value => [int(value), value]),\n ([value, expectedValue]) => {\n const stats = {\n [rawField]: value\n }\n\n const queryStatistics = new QueryStatistics(stats)\n\n return queryStatistics.updates()[field] === expectedValue\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/result-summary.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "`QueryStatistics` correctly returns `updates()` when handling integers with `maxSafeInteger`.", "mode": "fast-check"} {"id": 58428, "name": "unknown", "code": "it('should reject if urlFactory rejects', async () => {\n await fc.assert(\n fc.asyncProperty(errorArbitrary, endpointArbitrary, async (error, eid) => {\n const urlFactory = jest.fn().mockRejectedValue(error)\n const providerFactory = createProviderFactory(urlFactory)\n\n await expect(providerFactory(eid)).rejects.toBe(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm/test/provider/factory.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test confirms that if `urlFactory` rejects with an error, `providerFactory` is expected to reject with the same error.", "mode": "fast-check"} {"id": 54779, "name": "unknown", "code": "it('should handle Integer with arbitrary integer', () => {\n return fc.assert(\n fc.property(\n fc.integer().map(value => [BigInt(value), value]),\n ([value, expectedValue]) => {\n const stats = {\n [rawField]: value\n }\n\n const queryStatistics = new QueryStatistics(stats)\n\n return queryStatistics.updates()[field] === expectedValue\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/result-summary.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Handling of arbitrary integers with `QueryStatistics` ensures updates return the original integer value.", "mode": "fast-check"} {"id": 58429, "name": "unknown", "code": "it('should resolve with JsonRpcProvider if urlFactory returns a URL', async () => {\n await fc.assert(\n fc.asyncProperty(urlArbitrary, endpointArbitrary, async (url, eid) => {\n const urlFactory = jest.fn().mockReturnValue(url)\n const providerFactory = createProviderFactory(urlFactory)\n const provider = await providerFactory(eid)\n\n expect(provider).toBeInstanceOf(JsonRpcProvider)\n expect(provider.connection.url).toBe(url)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm/test/provider/factory.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that if `urlFactory` returns a URL, the `providerFactory` resolves to an instance of `JsonRpcProvider` with a connection URL matching the provided URL.", "mode": "fast-check"} {"id": 58431, "name": "unknown", "code": "it('should create an OmniPoint with the address of the contract', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, endpointArbitrary, (address, eid) => {\n const contract = new Contract(address, [])\n const omniContract: OmniContract = { eid, contract }\n\n expect(omniContractToPoint(omniContract)).toEqual({ eid, address })\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`omniContractToPoint` converts an `OmniContract` object to an `OmniPoint` with the same contract address and endpoint identifier (`eid`).", "mode": "fast-check"} {"id": 58435, "name": "unknown", "code": "it('should serialize correctly with a message', () => {\n fc.assert(\n fc.property(reasonArbitrary, messageArbitrary, (reason, message) => {\n fc.pre(message !== '')\n\n expect(String(new PanicError(reason, message))).toBe(`PanicError: ${message}. Error code ${reason}`)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm/test/errors/errors.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`PanicError` serialization includes the message and error code when the message is not empty.", "mode": "fast-check"} {"id": 54780, "name": "unknown", "code": "it('should pack and unpack DateTimeWithOffset', () => {\n fc.assert(\n fc.property(\n fc.date({\n min: temporalUtil.newDate(utils.MIN_UTC_IN_MS + utils.ONE_DAY_IN_MS),\n max: temporalUtil.newDate(utils.MAX_UTC_IN_MS - utils.ONE_DAY_IN_MS)\n }),\n fc.integer({ min: 0, max: 999_999 }),\n utils.arbitraryTimeZoneId(),\n (date, nanoseconds, timeZoneId) => {\n const object = new DateTime(\n date.getUTCFullYear(),\n date.getUTCMonth() + 1,\n date.getUTCDate(),\n date.getUTCHours(),\n date.getUTCMinutes(),\n date.getUTCSeconds(),\n date.getUTCMilliseconds() * 1_000_000 + nanoseconds,\n undefined,\n timeZoneId\n )\n const buffer = alloc(256)\n const loggerFunction = jest.fn()\n const protocol = new BoltProtocolV5x7(\n new utils.MessageRecordingConnection(),\n buffer,\n {\n disableLosslessIntegers: true\n },\n undefined,\n new Logger('debug', loggerFunction)\n )\n\n const packable = protocol.packable(object)\n\n expect(packable).not.toThrow()\n expect(loggerFunction)\n .toBeCalledWith('warn',\n 'DateTime objects without \"timeZoneOffsetSeconds\" property ' +\n 'are prune to bugs related to ambiguous times. For instance, ' +\n '2022-10-30T2:30:00[Europe/Berlin] could be GMT+1 or GMT+2.')\n\n buffer.reset()\n\n const unpacked = protocol.unpack(buffer)\n\n expect(unpacked.timeZoneOffsetSeconds).toBeDefined()\n\n const unpackedDateTimeWithoutOffset = new DateTime(\n unpacked.year,\n unpacked.month,\n unpacked.day,\n unpacked.hour,\n unpacked.minute,\n unpacked.second,\n unpacked.nanosecond,\n undefined,\n unpacked.timeZoneId\n )\n\n expect(unpackedDateTimeWithoutOffset).toEqual(object)\n })\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/bolt-connection/test/bolt/bolt-protocol-v5x7.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Packing and unpacking `DateTimeWithOffset` should preserve the original object properties, while managing potential issues related to missing `timeZoneOffsetSeconds` and logging a warning for ambiguous times.", "mode": "fast-check"} {"id": 58436, "name": "unknown", "code": "it('should serialize correctly when message is not passed', () => {\n fc.assert(\n fc.property(reasonArbitrary, (reason) => {\n expect(String(new RevertError(reason))).toBe(\n `RevertError: Contract reverted. Error reason '${reason}'`\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm/test/errors/errors.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`RevertError` serializes correctly into a string when a message is provided, showing the error reason.", "mode": "fast-check"} {"id": 58437, "name": "unknown", "code": "it('should serialize correctly when message is empty', () => {\n fc.assert(\n fc.property(reasonArbitrary, (reason) => {\n expect(String(new RevertError(reason, ''))).toBe(`RevertError. Error reason '${reason}'`)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm/test/errors/errors.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`RevertError` with an empty message serializes to `\"RevertError. Error reason '${reason}'\"`.", "mode": "fast-check"} {"id": 54781, "name": "unknown", "code": "it('should pack and unpack DateTimeWithZoneIdAndNoOffset', () => {\n fc.assert(\n fc.property(fc.date(), date => {\n const object = DateTime.fromStandardDate(date)\n const buffer = alloc(256)\n const loggerFunction = jest.fn()\n const protocol = new BoltProtocolV5x7(\n new utils.MessageRecordingConnection(),\n buffer,\n {\n disableLosslessIntegers: true\n },\n undefined,\n new Logger('debug', loggerFunction)\n )\n\n const packable = protocol.packable(object)\n\n expect(packable).not.toThrow()\n\n buffer.reset()\n\n const unpacked = protocol.unpack(buffer)\n\n expect(unpacked.timeZoneOffsetSeconds).toBeDefined()\n\n expect(unpacked).toEqual(object)\n })\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/bolt-connection/test/bolt/bolt-protocol-v5x7.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Packing and unpacking `DateTimeWithZoneIdAndNoOffset` with `BoltProtocolV5x7` should maintain equality with the original object, including a defined `timeZoneOffsetSeconds`.", "mode": "fast-check"} {"id": 58438, "name": "unknown", "code": "it('should serialize correctly with a message', () => {\n fc.assert(\n fc.property(reasonArbitrary, messageArbitrary, (reason, message) => {\n fc.pre(message !== '')\n\n expect(String(new RevertError(reason, message))).toBe(\n `RevertError: ${message}. Error reason '${reason}'`\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm/test/errors/errors.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "A `RevertError` object should serialize to a string format with the message displayed, provided the message is not empty.", "mode": "fast-check"} {"id": 58440, "name": "unknown", "code": "it('should serialize correctly when message is not passed', () => {\n fc.assert(\n fc.property(reasonArbitrary, argsArbitrary, (reason, args) => {\n const formattedArgs = args.map((arg) => printJson(arg, false))\n\n expect(String(new CustomError(reason, args))).toBe(\n `CustomError: Contract reverted with custom error. Error ${reason}(${formattedArgs})`\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm/test/errors/errors.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`CustomError` serialization without a message should match the format `CustomError: Contract reverted with custom error. Error ()`.", "mode": "fast-check"} {"id": 58441, "name": "unknown", "code": "it('should serialize correctly when message is empty', () => {\n fc.assert(\n fc.property(reasonArbitrary, argsArbitrary, (reason, args) => {\n const formattedArgs = args.map((arg) => printJson(arg, false))\n\n expect(String(new CustomError(reason, args, ''))).toBe(\n `CustomError. Error ${reason}(${formattedArgs})`\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm/test/errors/errors.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`CustomError` with an empty message should serialize to a string representation containing the error reason and formatted arguments.", "mode": "fast-check"} {"id": 58442, "name": "unknown", "code": "it('should serialize correctly with a message', () => {\n fc.assert(\n fc.property(reasonArbitrary, argsArbitrary, messageArbitrary, (reason, args, message) => {\n fc.pre(message !== '')\n\n const formattedArgs = args.map((arg) => printJson(arg, false))\n\n expect(String(new CustomError(reason, args, message))).toBe(\n `CustomError: ${message}. Error ${reason}(${formattedArgs})`\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm/test/errors/errors.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`CustomError` must serialize to a string format that includes a non-empty message, reason, and argument list formatted as JSON.", "mode": "fast-check"} {"id": 54782, "name": "unknown", "code": "it('should pack and unpack DateTimeWithOffset', () => {\n fc.assert(\n fc.property(\n fc.date({\n min: temporalUtil.newDate(utils.MIN_UTC_IN_MS + utils.ONE_DAY_IN_MS),\n max: temporalUtil.newDate(utils.MAX_UTC_IN_MS - utils.ONE_DAY_IN_MS)\n }),\n fc.integer({ min: 0, max: 999_999 }),\n utils.arbitraryTimeZoneId(),\n (date, nanoseconds, timeZoneId) => {\n const object = new DateTime(\n date.getUTCFullYear(),\n date.getUTCMonth() + 1,\n date.getUTCDate(),\n date.getUTCHours(),\n date.getUTCMinutes(),\n date.getUTCSeconds(),\n date.getUTCMilliseconds() * 1_000_000 + nanoseconds,\n undefined,\n timeZoneId\n )\n const buffer = alloc(256)\n const loggerFunction = jest.fn()\n const protocol = new BoltProtocolV5x6(\n new utils.MessageRecordingConnection(),\n buffer,\n {\n disableLosslessIntegers: true\n },\n undefined,\n new Logger('debug', loggerFunction)\n )\n\n const packable = protocol.packable(object)\n\n expect(packable).not.toThrow()\n expect(loggerFunction)\n .toBeCalledWith('warn',\n 'DateTime objects without \"timeZoneOffsetSeconds\" property ' +\n 'are prune to bugs related to ambiguous times. For instance, ' +\n '2022-10-30T2:30:00[Europe/Berlin] could be GMT+1 or GMT+2.')\n\n buffer.reset()\n\n const unpacked = protocol.unpack(buffer)\n\n expect(unpacked.timeZoneOffsetSeconds).toBeDefined()\n\n const unpackedDateTimeWithoutOffset = new DateTime(\n unpacked.year,\n unpacked.month,\n unpacked.day,\n unpacked.hour,\n unpacked.minute,\n unpacked.second,\n unpacked.nanosecond,\n undefined,\n unpacked.timeZoneId\n )\n\n expect(unpackedDateTimeWithoutOffset).toEqual(object)\n })\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/bolt-connection/test/bolt/bolt-protocol-v5x6.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Packing and unpacking `DateTimeWithOffset` should indicate a warning for potential bugs when `timeZoneOffsetSeconds` is missing, and correctly reconstruct the original `DateTime` object, filling in the necessary timezone offset information.", "mode": "fast-check"} {"id": 58445, "name": "unknown", "code": "it('should return a valid EVM address', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, (address) => {\n expect(isAddress(addChecksum(address))).toBe(true)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm/test/address.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`addChecksum` applied to an EVM address results in `isAddress` returning true.", "mode": "fast-check"} {"id": 58449, "name": "unknown", "code": "it('should resolve if the first task resolves', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, valuesArbitrary, async (value, errors) => {\n const task = jest.fn().mockResolvedValue(value)\n const tasks = errors.map((error) => jest.fn().mockRejectedValue(error))\n\n expect(await first([task, ...tasks])).toBe(value)\n\n // Make sure none of the other factories got called\n for (const factory of tasks) {\n expect(factory).not.toHaveBeenCalled()\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`first` resolves with the value of the first task that resolves, and ensures subsequent tasks are not called.", "mode": "fast-check"} {"id": 58451, "name": "unknown", "code": "it('should reject with the last rejected task error', async () => {\n await fc.assert(\n fc.asyncProperty(valuesArbitrary, valueArbitrary, async (errors, error) => {\n const tasks = errors.map((error) => jest.fn().mockRejectedValue(error))\n const task = jest.fn().mockRejectedValue(error)\n\n await expect(first([...tasks, task])).rejects.toBe(error)\n\n // Make sure all the tasks got called\n for (const factory of tasks) {\n expect(factory).toHaveBeenCalledTimes(1)\n }\n\n expect(task).toHaveBeenCalledTimes(1)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `first` should reject with the last task's rejection error, and all tasks should be called exactly once.", "mode": "fast-check"} {"id": 58452, "name": "unknown", "code": "it('should resolve if the first factory resolves', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, valuesArbitrary, async (value, values) => {\n const successful = jest.fn().mockResolvedValue(value)\n const successfulOther = values.map((value) => jest.fn().mockResolvedValue(value))\n const factory = firstFactory(successful, ...successfulOther)\n\n expect(await factory()).toBe(value)\n\n // Make sure none of the other factories got called\n for (const factory of successfulOther) {\n expect(factory).not.toHaveBeenCalled()\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "First factory function resolves successfully and no subsequent factories are invoked.", "mode": "fast-check"} {"id": 58453, "name": "unknown", "code": "it('should resolve with the first successful factory', async () => {\n await fc.assert(\n fc.asyncProperty(valuesArbitrary, valueArbitrary, async (errors, value) => {\n const failing = errors.map((error) => jest.fn().mockRejectedValue(error))\n const successful = jest.fn().mockResolvedValue(value)\n const factory = firstFactory(...failing, successful)\n\n expect(await factory()).toBe(value)\n\n // Make sure all the tasks got called\n for (const factory of failing) {\n expect(factory).toHaveBeenCalledTimes(1)\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`firstFactory` resolves with the value from the first successful promise factory after a series of failing ones, ensuring all factories are called once.", "mode": "fast-check"} {"id": 58454, "name": "unknown", "code": "it('should pass the input to factories', async () => {\n await fc.assert(\n fc.asyncProperty(valuesArbitrary, valueArbitrary, valuesArbitrary, async (errors, value, args) => {\n const failing = errors.map((error) => jest.fn().mockRejectedValue(error))\n const successful = jest.fn().mockResolvedValue(value)\n const factory = firstFactory(...failing, successful)\n\n expect(await factory(...args)).toBe(value)\n\n // Make sure all the tasks got called with the correct arguments\n for (const factory of failing) {\n expect(factory).toHaveBeenCalledTimes(1)\n expect(factory).toHaveBeenCalledWith(...args)\n }\n\n expect(successful).toHaveBeenCalledTimes(1)\n expect(successful).toHaveBeenCalledWith(...args)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The input is correctly passed to factories, ensuring that failing promises are executed once with the correct arguments before a successful promise returns a value.", "mode": "fast-check"} {"id": 58456, "name": "unknown", "code": "it('should resolve with the resolution value of an asynchronous task', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, async (value) => {\n const task = jest.fn().mockResolvedValue(value)\n const handleError = jest.fn()\n\n await expect(mapError(task, handleError)).resolves.toBe(value)\n expect(handleError).not.toHaveBeenCalled()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`mapError` resolves an asynchronous task to its resolution value without calling `handleError`.", "mode": "fast-check"} {"id": 54787, "name": "unknown", "code": "it('should pack and unpack DateTimeWithZoneIdAndNoOffset', () => {\n fc.assert(\n fc.property(fc.date(), date => {\n const object = DateTime.fromStandardDate(date)\n const buffer = alloc(256)\n const loggerFunction = jest.fn()\n const protocol = new BoltProtocolV6x0(\n new utils.MessageRecordingConnection(),\n buffer,\n {\n disableLosslessIntegers: true\n },\n undefined,\n new Logger('debug', loggerFunction)\n )\n\n const packable = protocol.packable(object)\n\n expect(packable).not.toThrow()\n\n buffer.reset()\n\n const unpacked = protocol.unpack(buffer)\n\n expect(unpacked.timeZoneOffsetSeconds).toBeDefined()\n\n expect(unpacked).toEqual(object)\n })\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/bolt-connection/test/bolt/bolt-protocol-v6x0.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Packing and unpacking a `DateTimeWithZoneIdAndNoOffset` should correctly handle conversion and reconstruction, ensuring the unpacked object matches the original.", "mode": "fast-check"} {"id": 58457, "name": "unknown", "code": "it('should reject and call the toError callback if a synchronous task throws', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, valueArbitrary, async (error, mappedError) => {\n const task = jest.fn().mockImplementation(() => {\n throw error\n })\n const handleError = jest.fn().mockReturnValue(mappedError)\n\n await expect(mapError(task, handleError)).rejects.toBe(mappedError)\n expect(handleError).toHaveBeenCalledOnce()\n expect(handleError).toHaveBeenCalledExactlyOnceWith(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "A synchronous task that throws should cause rejection, and the `toError` callback should be invoked once with the thrown error and return the mapped error.", "mode": "fast-check"} {"id": 58458, "name": "unknown", "code": "it('should reject and call the toError callback if an asynchronous task rejects', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, valueArbitrary, async (error, mappedError) => {\n const task = jest.fn().mockRejectedValue(error)\n const handleError = jest.fn().mockReturnValue(mappedError)\n\n await expect(mapError(task, handleError)).rejects.toBe(mappedError)\n expect(handleError).toHaveBeenCalledOnce()\n expect(handleError).toHaveBeenCalledExactlyOnceWith(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "When an asynchronous task rejects, `mapError` should reject with a mapped error from the `handleError` callback, ensuring the callback is invoked exactly once with the original error.", "mode": "fast-check"} {"id": 58460, "name": "unknown", "code": "it('should resolve with the resolution value of an asynchronous task', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, async (value) => {\n const task = jest.fn().mockResolvedValue(value)\n const handleError = jest.fn()\n\n await expect(tapError(task, handleError)).resolves.toBe(value)\n expect(handleError).not.toHaveBeenCalled()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`tapError` should resolve with the value of a successfully resolved asynchronous task and ensure `handleError` is not called.", "mode": "fast-check"} {"id": 58461, "name": "unknown", "code": "it('should reject and call the onError callback if a synchronous task throws', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, async (error) => {\n const task = jest.fn().mockImplementation(() => {\n throw error\n })\n const handleError = jest.fn()\n\n await expect(tapError(task, handleError)).rejects.toBe(error)\n expect(handleError).toHaveBeenCalledOnce()\n expect(handleError).toHaveBeenCalledExactlyOnceWith(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`tapError` should reject with the thrown error and invoke the `onError` callback exactly once when a task throws an error.", "mode": "fast-check"} {"id": 58462, "name": "unknown", "code": "it('should reject and call the onError callback if an asynchronous task rejects', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, async (error) => {\n const task = jest.fn().mockRejectedValue(error)\n const handleError = jest.fn()\n\n await expect(tapError(task, handleError)).rejects.toBe(error)\n expect(handleError).toHaveBeenCalledOnce()\n expect(handleError).toHaveBeenCalledExactlyOnceWith(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`tapError` function should reject with the same error an asynchronous task rejects with and call the `onError` callback once with that error.", "mode": "fast-check"} {"id": 54789, "name": "unknown", "code": "it('should pack and unpack DateTimeWithZoneIdAndNoOffset', () => {\n fc.assert(\n fc.property(fc.date(), date => {\n const object = DateTime.fromStandardDate(date)\n const buffer = alloc(256)\n const loggerFunction = jest.fn()\n const protocol = new BoltProtocolV5x8(\n new utils.MessageRecordingConnection(),\n buffer,\n {\n disableLosslessIntegers: true\n },\n undefined,\n new Logger('debug', loggerFunction)\n )\n\n const packable = protocol.packable(object)\n\n expect(packable).not.toThrow()\n\n buffer.reset()\n\n const unpacked = protocol.unpack(buffer)\n\n expect(unpacked.timeZoneOffsetSeconds).toBeDefined()\n\n expect(unpacked).toEqual(object)\n })\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/bolt-connection/test/bolt/bolt-protocol-v5x8.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Packing and unpacking of `DateTimeWithZoneIdAndNoOffset` should preserve the original object, including the defined `timeZoneOffsetSeconds`.", "mode": "fast-check"} {"id": 58464, "name": "unknown", "code": "it('should reject with the original error if the onError callback rejects', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, valueArbitrary, async (error, anotherError) => {\n const task = jest.fn().mockRejectedValue(error)\n const handleError = jest.fn().mockRejectedValue(anotherError)\n\n await expect(tapError(task, handleError)).rejects.toBe(error)\n expect(handleError).toHaveBeenCalledOnce()\n expect(handleError).toHaveBeenCalledExactlyOnceWith(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`tapError` should reject with the original error if the `onError` callback itself rejects, while ensuring the callback is called once with the original error.", "mode": "fast-check"} {"id": 58472, "name": "unknown", "code": "it('should not override user values if provided', () => {\n fc.assert(\n fc.property(\n fc.integer(),\n fc.string(),\n mnemonicArbitrary,\n fc.boolean(),\n (port, directory, mnemonic, overwriteAccounts) => {\n expect(\n resolveSimulationConfig(\n { port, directory, overwriteAccounts, anvil: { mnemonic } },\n hre.config\n )\n ).toEqual({\n port,\n directory: resolve(hre.config.paths.root, directory),\n overwriteAccounts,\n anvil: {\n host: '0.0.0.0',\n port: 8545,\n mnemonic,\n },\n })\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/simulation/config.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`resolveSimulationConfig` function preserves user-specified values for port, directory, mnemonic, and `overwriteAccounts` without overriding them.", "mode": "fast-check"} {"id": 54792, "name": "unknown", "code": "it('should pack and unpack DateTimeWithOffset', () => {\n fc.assert(\n fc.property(\n fc.date({\n min: temporalUtil.newDate(utils.MIN_UTC_IN_MS + utils.ONE_DAY_IN_MS),\n max: temporalUtil.newDate(utils.MAX_UTC_IN_MS - utils.ONE_DAY_IN_MS)\n }),\n fc.integer({ min: 0, max: 999_999 }),\n utils.arbitraryTimeZoneId(),\n (date, nanoseconds, timeZoneId) => {\n const object = new DateTime(\n date.getUTCFullYear(),\n date.getUTCMonth() + 1,\n date.getUTCDate(),\n date.getUTCHours(),\n date.getUTCMinutes(),\n date.getUTCSeconds(),\n date.getUTCMilliseconds() * 1_000_000 + nanoseconds,\n undefined,\n timeZoneId\n )\n const buffer = alloc(256)\n const loggerFunction = jest.fn()\n const protocol = new BoltProtocolV5x1(\n new utils.MessageRecordingConnection(),\n buffer,\n {\n disableLosslessIntegers: true\n },\n undefined,\n new Logger('debug', loggerFunction)\n )\n\n const packable = protocol.packable(object)\n\n expect(packable).not.toThrow()\n expect(loggerFunction)\n .toBeCalledWith('warn',\n 'DateTime objects without \"timeZoneOffsetSeconds\" property ' +\n 'are prune to bugs related to ambiguous times. For instance, ' +\n '2022-10-30T2:30:00[Europe/Berlin] could be GMT+1 or GMT+2.')\n\n buffer.reset()\n\n const unpacked = protocol.unpack(buffer)\n\n expect(unpacked.timeZoneOffsetSeconds).toBeDefined()\n\n const unpackedDateTimeWithoutOffset = new DateTime(\n unpacked.year,\n unpacked.month,\n unpacked.day,\n unpacked.hour,\n unpacked.minute,\n unpacked.second,\n unpacked.nanosecond,\n undefined,\n unpacked.timeZoneId\n )\n\n expect(unpackedDateTimeWithoutOffset).toEqual(object)\n })\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/bolt-connection/test/bolt/bolt-protocol-v5x1.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Packing and unpacking of `DateTimeWithOffset` should maintain equivalence with original, ensuring `timeZoneOffsetSeconds` is defined and logging a warning if missing.", "mode": "fast-check"} {"id": 58473, "name": "unknown", "code": "it('should work with anvil options', async () => {\n await fc.assert(\n fc.asyncProperty(anvilOptionsArbitrary, async (anvilOptions) => {\n const spec = serializeDockerComposeSpec({\n version: '3.9',\n services: {\n anvil: createEvmNodeServiceSpec(anvilOptions),\n },\n })\n\n await writeFile(SPEC_FILE_PATH, spec)\n\n const result = validateSpec()\n\n expect(result.stderr.toString('utf8')).toBe('')\n expect(result.status).toBe(0)\n }),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/simulation/compose.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Composition of the Docker Compose specification with Anvil options should produce a valid specification without errors.", "mode": "fast-check"} {"id": 54794, "name": "unknown", "code": "it('should pack and unpack DateTimeWithOffset', () => {\n fc.assert(\n fc.property(\n fc.date({\n min: temporalUtil.newDate(utils.MIN_UTC_IN_MS + utils.ONE_DAY_IN_MS),\n max: temporalUtil.newDate(utils.MAX_UTC_IN_MS - utils.ONE_DAY_IN_MS)\n }),\n fc.integer({ min: 0, max: 999_999 }),\n utils.arbitraryTimeZoneId(),\n (date, nanoseconds, timeZoneId) => {\n const object = new DateTime(\n date.getUTCFullYear(),\n date.getUTCMonth() + 1,\n date.getUTCDate(),\n date.getUTCHours(),\n date.getUTCMinutes(),\n date.getUTCSeconds(),\n date.getUTCMilliseconds() * 1_000_000 + nanoseconds,\n undefined,\n timeZoneId\n )\n\n buffer.reset()\n\n const packable = protocol.packable(object)\n\n expect(packable).not.toThrow()\n expect(loggerFunction)\n .toBeCalledWith('warn',\n 'DateTime objects without \"timeZoneOffsetSeconds\" property ' +\n 'are prune to bugs related to ambiguous times. For instance, ' +\n '2022-10-30T2:30:00[Europe/Berlin] could be GMT+1 or GMT+2.')\n\n buffer.reset()\n\n const unpacked = protocol.unpack(buffer)\n\n expect(unpacked.timeZoneOffsetSeconds).toBeDefined()\n\n const unpackedDateTimeWithoutOffset = new DateTime(\n unpacked.year,\n unpacked.month,\n unpacked.day,\n unpacked.hour,\n unpacked.minute,\n unpacked.second,\n unpacked.nanosecond,\n undefined,\n unpacked.timeZoneId\n )\n\n expect(unpackedDateTimeWithoutOffset).toEqual(object)\n })\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/bolt-connection/test/bolt/bolt-protocol-v4x3.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Packing and unpacking `DateTimeWithOffset` should correctly handle conversion, logging warnings for ambiguous times, while ensuring the `timeZoneOffsetSeconds` is defined and the unpacked `DateTime` matches the original.", "mode": "fast-check"} {"id": 58474, "name": "unknown", "code": "it('should work with anvil services', async () => {\n await fc.assert(\n fc.asyncProperty(portArbitrary, servicesArbitrary, async (port, services) => {\n const spec = serializeDockerComposeSpec({\n version: '3.9',\n services: {\n ...services,\n rpc: createEvmNodeProxyServiceSpec(port, services),\n },\n })\n\n await writeFile(SPEC_FILE_PATH, spec)\n\n const result = validateSpec()\n\n expect(result.stderr.toString('utf8')).toBe('')\n expect(result.status).toBe(0)\n }),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/simulation/compose.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Validating that serialized Docker Compose specs with EVM node proxy services, based on arbitrary ports and services, result in a successful validation without errors.", "mode": "fast-check"} {"id": 58739, "name": "unknown", "code": "it('should have addition, update and deletion working correctly', () => {\n fc.assert(\n fc.property(keyArbitrary, valueArbitrary, valueArbitrary, (key, value1, value2) => {\n const map = new TestMap()\n\n // Sanity check first\n expect(map.has(key)).toBeFalsy()\n\n // Set a value first\n map.set(key, value1)\n\n // Check whether the insertion worked\n expect(map.has(key)).toBeTruthy()\n expect(map.size).toBe(1)\n expect(map.get(key)).toBe(value1)\n expect(Array.from(map.keys())).toEqual([key])\n expect(Array.from(map.values())).toEqual([value1])\n expect(Array.from(map.entries())).toEqual([[key, value1]])\n\n // Now overwrite the value\n map.set(key, value2)\n\n // Check whether the insertion worked\n expect(map.has(key)).toBeTruthy()\n expect(map.size).toBe(1)\n expect(map.get(key)).toBe(value2)\n expect(Array.from(map.keys())).toEqual([key])\n expect(Array.from(map.values())).toEqual([value2])\n expect(Array.from(map.entries())).toEqual([[key, value2]])\n\n // Now delete the value\n map.delete(key)\n\n // And check that the deletion worked\n expect(map.has(key)).toBeFalsy()\n expect(map.size).toBe(0)\n expect(map.get(key)).toBeUndefined()\n expect(Array.from(map.keys())).toEqual([])\n expect(Array.from(map.values())).toEqual([])\n expect(Array.from(map.entries())).toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/map.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "The `TestMap` should correctly handle addition, update, and deletion of key-value pairs while maintaining accurate size and iterable properties.", "mode": "fast-check"} {"id": 54797, "name": "unknown", "code": "it('should pack and unpack DateTimeWithZoneIdAndNoOffset', () => {\n fc.assert(\n fc.property(fc.date(), date => {\n const object = DateTime.fromStandardDate(date)\n const buffer = alloc(256)\n const loggerFunction = jest.fn()\n const protocol = new BoltProtocolV5x0(\n new utils.MessageRecordingConnection(),\n buffer,\n {\n disableLosslessIntegers: true\n },\n undefined,\n new Logger('debug', loggerFunction)\n )\n\n const packable = protocol.packable(object)\n\n expect(packable).not.toThrow()\n\n buffer.reset()\n\n const unpacked = protocol.unpack(buffer)\n\n expect(unpacked.timeZoneOffsetSeconds).toBeDefined()\n\n expect(unpacked).toEqual(object)\n })\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/bolt-connection/test/bolt/bolt-protocol-v5x0.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "DateTime objects are correctly packed and unpacked, preserving time zone offset and equality.", "mode": "fast-check"} {"id": 58772, "name": "unknown", "code": "it('should serialize an internal message', () => {\n fc.assert(\n fc.property(fc.bigInt({ min: 0n, max: 1000n }), fc.boolean(), cellArbitrary, (value, bounce, body) => {\n const messageRelaxed = internal({\n value,\n to: wallet.address,\n bounce,\n body,\n })\n\n const serialized = serializeMessageRelaxed(messageRelaxed)\n const deserialized = deserializeMessageRelaxed(serialized)\n\n // FIXME Jest comparison operators don't work well with message objects\n // so a workaround expectation is used\n //\n // See https://github.com/ton-core/ton-core/blob/e0ed819973daf0484dfbacd0c30a0dcfe4714f8d/src/types/MessageRelaxed.spec.ts\n expect(Cell.fromBase64(serialized).equals(messageRelaxedToCell(messageRelaxed))).toBeTruthy()\n\n const reserialized = serializeMessageRelaxed(deserialized)\n expect(reserialized).toEqual(serialized)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-ton/test/transactions/serde.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Serializing and deserializing an internal message should result in equivalent serialized outputs.", "mode": "fast-check"} {"id": 58774, "name": "unknown", "code": "it('should serialize an external message', () => {\n fc.assert(\n fc.property(cellArbitrary, (body) => {\n const message = external({\n to: wallet.address,\n body,\n })\n\n const serialized = serializeMessage(message)\n const deserialized = deserialize(serialized)\n\n // FIXME Jest comparison operators don't work well with message objects\n // so a workaround expectation is used\n //\n // See https://github.com/ton-core/ton-core/blob/e0ed819973daf0484dfbacd0c30a0dcfe4714f8d/src/types/MessageRelaxed.spec.ts\n expect(Cell.fromBase64(serialized).equals(messageToCell(message))).toBeTruthy()\n\n const reserialized = serializeMessage(deserialized as Message)\n expect(reserialized).toEqual(serialized)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-ton/test/transactions/serde.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Serializing and deserializing an external message should yield consistent results, ensuring equality between the original and re-serialized messages.", "mode": "fast-check"} {"id": 54800, "name": "unknown", "code": "it('should pack and unpack DateTimeWithOffset', () => {\n fc.assert(\n fc.property(\n fc.date({\n min: temporalUtil.newDate(utils.MIN_UTC_IN_MS + utils.ONE_DAY_IN_MS),\n max: temporalUtil.newDate(utils.MAX_UTC_IN_MS - utils.ONE_DAY_IN_MS)\n }),\n fc.integer({ min: 0, max: 999_999 }),\n utils.arbitraryTimeZoneId(),\n (date, nanoseconds, timeZoneId) => {\n const object = new DateTime(\n date.getUTCFullYear(),\n date.getUTCMonth() + 1,\n date.getUTCDate(),\n date.getUTCHours(),\n date.getUTCMinutes(),\n date.getUTCSeconds(),\n date.getUTCMilliseconds() * 1_000_000 + nanoseconds,\n undefined,\n timeZoneId\n )\n\n buffer.reset()\n\n const packable = protocol.packable(object)\n\n expect(packable).not.toThrow()\n expect(loggerFunction)\n .toBeCalledWith('warn',\n 'DateTime objects without \"timeZoneOffsetSeconds\" property ' +\n 'are prune to bugs related to ambiguous times. For instance, ' +\n '2022-10-30T2:30:00[Europe/Berlin] could be GMT+1 or GMT+2.')\n\n buffer.reset()\n\n const unpacked = protocol.unpack(buffer)\n\n expect(unpacked.timeZoneOffsetSeconds).toBeDefined()\n\n const unpackedDateTimeWithoutOffset = new DateTime(\n unpacked.year,\n unpacked.month,\n unpacked.day,\n unpacked.hour,\n unpacked.minute,\n unpacked.second,\n unpacked.nanosecond,\n undefined,\n unpacked.timeZoneId\n )\n\n expect(unpackedDateTimeWithoutOffset).toEqual(object)\n })\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/bolt-connection/test/bolt/bolt-protocol-v4x4.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 54801, "name": "unknown", "code": "it('should pack and unpack DateTimeWithZoneIdAndNoOffset', () => {\n fc.assert(\n fc.property(fc.date(), date => {\n const object = DateTime.fromStandardDate(date)\n\n buffer.reset()\n\n const packable = protocol.packable(object)\n\n expect(packable).not.toThrow()\n\n buffer.reset()\n\n const unpacked = protocol.unpack(buffer)\n\n expect(unpacked.timeZoneOffsetSeconds).toBeDefined()\n\n expect(unpacked).toEqual(object)\n })\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/bolt-connection/test/bolt/bolt-protocol-v4x4.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58775, "name": "unknown", "code": "it('should serialize an internal message', () => {\n fc.assert(\n fc.property(fc.bigInt({ min: 0n, max: 1000n }), fc.boolean(), cellArbitrary, (value, bounce, body) => {\n const messageRelaxed = internal({\n value,\n to: wallet.address,\n bounce,\n body,\n })\n\n const serialized = serializeMessageRelaxed(messageRelaxed)\n const deserialized = deserialize(serialized)\n\n // FIXME Jest comparison operators don't work well with message objects\n // so a workaround expectation is used\n //\n // See https://github.com/ton-core/ton-core/blob/e0ed819973daf0484dfbacd0c30a0dcfe4714f8d/src/types/MessageRelaxed.spec.ts\n expect(Cell.fromBase64(serialized).equals(messageRelaxedToCell(messageRelaxed))).toBeTruthy()\n\n const reserialized = serializeMessage(deserialized as Message)\n expect(reserialized).toEqual(serialized)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-ton/test/transactions/serde.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Serialization and deserialization of an internal message should maintain consistency, producing equivalent serialized outputs.", "mode": "fast-check"} {"id": 58801, "name": "unknown", "code": "it('should return undefined if called with undefined definition', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, async (eid) => {\n await expect(createSignerAddressOrIndexFactory()(eid)).resolves.toBeUndefined()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Calling `createSignerAddressOrIndexFactory()` with an undefined definition should return undefined.", "mode": "fast-check"} {"id": 58802, "name": "unknown", "code": "it('should return address if called with address definition', async () => {\n await fc.assert(\n fc.asyncProperty(evmAddressArbitrary, endpointArbitrary, async (address, eid) => {\n await expect(createSignerAddressOrIndexFactory({ type: 'address', address })(eid)).resolves.toBe(\n address\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Calling `createSignerAddressOrIndexFactory` with an address definition should return the provided address.", "mode": "fast-check"} {"id": 58803, "name": "unknown", "code": "it('should return index if called with index definition', async () => {\n await fc.assert(\n fc.asyncProperty(fc.integer(), endpointArbitrary, async (index, eid) => {\n await expect(createSignerAddressOrIndexFactory({ type: 'index', index })(eid)).resolves.toBe(index)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "The `createSignerAddressOrIndexFactory` function should resolve with the given index when called with an index definition.", "mode": "fast-check"} {"id": 58804, "name": "unknown", "code": "it('should reject if called with a missing named definition', async () => {\n const mockGetNamedAccounts = jest.fn().mockResolvedValue({ wombat: '0xwombat' })\n const mockHre = {\n getNamedAccounts: mockGetNamedAccounts,\n }\n const hreFactory = jest.fn().mockResolvedValue(mockHre)\n\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, async (eid) => {\n await expect(\n createSignerAddressOrIndexFactory({ type: 'named', name: 'no-wombat' }, hreFactory)(eid)\n ).rejects.toThrow(`Missing named account 'no-wombat' for eid ${formatEid(eid)}`)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Calling `createSignerAddressOrIndexFactory` with a non-existent named definition should result in a rejection with a specific error message indicating the missing account.", "mode": "fast-check"} {"id": 58805, "name": "unknown", "code": "it('should resolve with an address if called with a defined named definition', async () => {\n const mockGetNamedAccounts = jest.fn().mockResolvedValue({ wombat: '0xwombat' })\n const mockHre = {\n getNamedAccounts: mockGetNamedAccounts,\n }\n const hreFactory = jest.fn().mockResolvedValue(mockHre)\n\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, async (eid) => {\n await expect(\n createSignerAddressOrIndexFactory({ type: 'named', name: 'wombat' }, hreFactory)(eid)\n ).resolves.toBe('0xwombat')\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "The function `createSignerAddressOrIndexFactory` should resolve to the specific address `'0xwombat'` when provided with a named definition of type `'named'` and name `'wombat'`.", "mode": "fast-check"} {"id": 58849, "name": "unknown", "code": "UnitTest.test('DialogChanges.init - no initial data', () => {\n const dialogChange = DialogChanges.init({ title: '', text: '' } as LinkDialogData, { } as LinkDialogCatalog);\n\n fc.assert(fc.property(fc.webUrl(), fc.asciiString(), fc.asciiString(), (url, title, text) => {\n const data = Fun.constant({ url: {\n value: url,\n meta: { title, text }\n }} as LinkDialogData);\n const dataNoMeta = Fun.constant({ url: {\n value: url,\n meta: { }\n }} as LinkDialogData);\n\n Assert.eq('on url change should include url title and text',\n Option.some>({ title, text }),\n dialogChange.onChange(data, { name: 'url' }),\n tOption()\n );\n\n Assert.eq('on url change should fallback to url for text',\n Option.some>({ title: '', text: url }),\n dialogChange.onChange(dataNoMeta, { name: 'url' }),\n tOption()\n );\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/tinymce/src/plugins/link/test/ts/atomic/DialogChangesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`DialogChanges.onChange` should update with title and text from metadata when present, and fall back to using the URL as text when metadata is missing.", "mode": "fast-check"} {"id": 58850, "name": "unknown", "code": "UnitTest.test('DialogChanges.init - with original data', () => {\n const dialogChange = DialogChanges.init({ title: 'orig title', text: 'orig text' } as LinkDialogData, { } as LinkDialogCatalog);\n const dialogChangeNoTitle = DialogChanges.init({ title: '', text: 'orig text' } as LinkDialogData, { } as LinkDialogCatalog);\n const dialogChangeNoText = DialogChanges.init({ title: 'orig title', text: '' } as LinkDialogData, { } as LinkDialogCatalog);\n\n fc.assert(fc.property(fc.webUrl(), fc.asciiString(), fc.asciiString(), (url, title, text) => {\n const data = Fun.constant({ url: {\n value: url,\n meta: { title, text }\n }} as LinkDialogData);\n\n Assert.eq('on url change should not try to change title and text',\n Option.none(),\n dialogChange.onChange(data, { name: 'url' }),\n tOption()\n );\n\n Assert.eq('No Title - on url change should only try to change title',\n Option.some>({ title }),\n dialogChangeNoTitle.onChange(data, { name: 'url' }),\n tOption()\n );\n\n Assert.eq('No Text - on url change should only try to change text',\n Option.some>({ text }),\n dialogChangeNoText.onChange(data, { name: 'url' }),\n tOption()\n );\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/tinymce/src/plugins/link/test/ts/atomic/DialogChangesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`DialogChanges.init` verifies that on a URL change, it neither alters the title nor text if both are initially provided, updates only the title if absent, and updates only the text if it is missing.", "mode": "fast-check"} {"id": 58854, "name": "unknown", "code": "UnitTest.test('KAssert.eqError: success (reflexivity)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n KAssert.eqError('eq', i, Result.error(i));\n KAssert.eqError('eq', i, Result.error(i), tBoom());\n KAssert.eqError('eq', i, Result.error(i), tBoom(), tNumber);\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`KAssert.eqError` ensures that comparing an integer with `Result.error` of the same integer succeeds, demonstrating reflexivity.", "mode": "fast-check"} {"id": 54814, "name": "unknown", "code": "t.test('toValue', t => {\n fc.assert(\n fc.property(fc.bigIntN(N), n => {\n t.equal(t_value(n), Number(n));\n }),\n {\n examples: [[0n], [1n], [0xffffffffn], [0xffffffffffffffffn]]\n }\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/to-value.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`t_value` correctly converts a bigint to its equivalent number representation.", "mode": "fast-check"} {"id": 54815, "name": "unknown", "code": "t.test('toU32', t => {\n fc.assert(\n fc.property(fc.bigIntN(N), n => {\n t.equal(t_u32(n), BigInt.asUintN(32, n));\n }),\n {\n examples: [\n [0n],\n [1n],\n [0xffffn],\n [0xffffffffn],\n [0xffffffffffffffffn],\n [-0xffffn],\n [-0xffffffffn],\n [-0xffffffffffffffffn]\n ]\n }\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/to-value.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The function `t_u32` should return the same result as `BigInt.asUintN(32, n)` for various big integers.", "mode": "fast-check"} {"id": 54816, "name": "unknown", "code": "t.test('toI32', t => {\n fc.assert(\n fc.property(fc.bigIntN(N), n => {\n t.equal(t_i32(n), BigInt.asIntN(32, n));\n }),\n {\n examples: [\n [0n],\n [1n],\n [0xffffn],\n [0xffffffffn],\n [0xffffffffffffffffn],\n [0xffffffffffff1234n],\n [-0xffffn],\n [-0xffffffffn],\n [-0xffffffffffffffffn],\n [-0xffffffffffff1234n]\n ]\n }\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/to-value.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The `t_i32` function should produce the same 32-bit integer result as `BigInt.asIntN(32, n)` for any given bigint `n`.", "mode": "fast-check"} {"id": 58855, "name": "unknown", "code": "UnitTest.test('KAssert.eqError: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('should throw if numbers differ #1', () => {\n KAssert.eqError('eq', a, Result.error(b));\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqError('eq', a, Result.error(b), tBoom());\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqError('eq', a, Result.error(b), tBoom(), tNumber);\n });\n }));\n\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.throws('should throw if value #1', () => {\n KAssert.eqError('eq', i, Result.value(s));\n });\n Assert.throws('should throw if value #2', () => {\n KAssert.eqError('eq', i, Result.value(s), tBoom());\n });\n Assert.throws('should throw if value #3', () => {\n KAssert.eqError('eq', i, Result.value(s), tBoom(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "KAssert.eqError should throw an error when comparing mismatched integers and when integers are compared with Result objects containing different numbers or strings.", "mode": "fast-check"} {"id": 54817, "name": "unknown", "code": "t.test('toU64', t => {\n fc.assert(\n fc.property(fc.bigIntN(N), n => {\n t.equal(t_u64(n), BigInt.asUintN(64, n));\n })\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/to-value.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`t_u64` should convert a big integer to its unsigned 64-bit representation, matching `BigInt.asUintN(64, n)`.", "mode": "fast-check"} {"id": 54818, "name": "unknown", "code": "t.test('toI64', t => {\n fc.assert(\n fc.property(fc.bigIntN(N), n => {\n t.equal(t_i64(n), BigInt.asIntN(64, n));\n })\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/to-value.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The function `t_i64` should return the same result as `BigInt.asIntN(64, n)` when applied to a big integer.", "mode": "fast-check"} {"id": 54819, "name": "unknown", "code": "t.test('asUintN', t => {\n fc.assert(\n fc.property(fc.bigIntN(N), fc.integer({ min: 0, max: N }), (n, m) => {\n // t.equal(t_asUintN(m, n), n & ((1n << BigInt(m)) - 1n));\n // t.equal(t_asUintN(m, n), mod(n, 1n << BigInt(m)));\n t.equal(t_asUintN(m, n), BigInt.asUintN(m, n));\n }),\n {\n examples: [\n [0n, 0],\n [1n, 0],\n [-1n, 0],\n [1n, 1],\n [-1n, 1]\n ]\n }\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/to-value.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`asUintN` should produce the same result as `BigInt.asUintN` when applied to a big integer and a width in bits.", "mode": "fast-check"} {"id": 58858, "name": "unknown", "code": "UnitTest.test('KAssert.eqValue: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('should throw if numbers differ #1', () => {\n KAssert.eqValue('eq', a, Result.value(b));\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqValue('eq', a, Result.value(b), tNumber);\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqValue('eq', a, Result.value(b), tNumber, tBoom());\n });\n }));\n\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.throws('should throw if error #1', () => {\n KAssert.eqValue('eq', i, Result.error(s));\n });\n Assert.throws('should throw if error #2', () => {\n KAssert.eqValue('eq', i, Result.error(s), tBoom());\n });\n Assert.throws('should throw if error #3', () => {\n KAssert.eqValue('eq', i, Result.error(s), tBoom(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`KAssert.eqValue` should throw an error when the actual result, either a different number or an error message, does not match the expected value.", "mode": "fast-check"} {"id": 58860, "name": "unknown", "code": "UnitTest.test('KAssert.eqResult: success', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n KAssert.eqResult('eq', Result.value(i), Result.value(i));\n KAssert.eqResult('eq', Result.value(i), Result.value(i), tNumber);\n KAssert.eqResult('eq', Result.value(i), Result.value(i), tNumber, tBoom());\n KAssert.eqResult('eq', Result.error(i), Result.error(i));\n KAssert.eqResult('eq', Result.error(i), Result.error(i), tBoom());\n KAssert.eqResult('eq', Result.error(i), Result.error(i), tBoom(), tNumber);\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`KAssert.eqResult` verifies the equality between `Result.value` and `Result.error` instances for the same integer, with optional type and testable checks.", "mode": "fast-check"} {"id": 54824, "name": "unknown", "code": "t.test('log2', t => {\n fc.assert(\n fc.property(fc.bigInt({ min: 1n, max: M }), n => {\n t.equal(t_log2(n), BigIntMath.log(2, n));\n })\n );\n\n // Identity\n fc.assert(\n fc.property(fc.bigInt(1n, 1000n), n => {\n t.equal(t_log2(2n ** n), n);\n })\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/log.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 54826, "name": "unknown", "code": "t.test('log10', t => {\n fc.assert(\n fc.property(fc.bigInt({ min: 1n, max: M }), n => {\n t.equal(t_log10(n), BigIntMath.log(10, n));\n })\n );\n\n // Identity\n fc.assert(\n fc.property(fc.bigInt(1n, 1000n), n => {\n t.equal(t_log10(10n ** n), n);\n })\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/log.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 54823, "name": "unknown", "code": "t.test('log2', t => {\n fc.assert(\n fc.property(fc.bigInt({ min: 1n, max: M }), n => {\n t.equal(t_log2(n), BigIntMath.log(2, n));\n })\n );\n\n // Identity\n fc.assert(\n fc.property(fc.bigInt(1n, 1000n), n => {\n t.equal(t_log2(2n ** n), n);\n })\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/log.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`log2` of a big integer `n` should match `BigIntMath.log(2, n)`, and for `2^n`, the result should be `n`.", "mode": "fast-check"} {"id": 58862, "name": "unknown", "code": "UnitTest.test('KAssert.eqResult: fail', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('value(a) != (value(!a)) #1', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b));\n });\n Assert.throws('value(a) != (value(!a)) #2', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b), tNumber);\n });\n Assert.throws('value(a) != (value(!a)) #2', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b), tNumber, tBoom());\n });\n }));\n\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('error(a) != (error(!a)) #1', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b));\n });\n Assert.throws('error(a) != (error(!a)) #2', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b), tBoom());\n });\n Assert.throws('result(a) != (result(!a)) #2', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b), tBoom(), tNumber);\n });\n }));\n\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.throws('value != error #1', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s));\n });\n Assert.throws('value != error #2', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s), tBoom());\n });\n Assert.throws('value != error #3', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s), tBoom());\n });\n\n Assert.throws('error != value #1', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s));\n });\n Assert.throws('error != value #2', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s), tBoom());\n });\n Assert.throws('error != value #3', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s), tBoom(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`KAssert.eqResult` throws an error when comparing differing `Result` types or values, verifying mismatches correctly trigger exceptions.", "mode": "fast-check"} {"id": 58863, "name": "unknown", "code": "UnitTest.test('KAssert.eqResult: fail', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('value(a) != (value(!a)) #1', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b));\n });\n Assert.throws('value(a) != (value(!a)) #2', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b), tNumber);\n });\n Assert.throws('value(a) != (value(!a)) #2', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b), tNumber, tBoom());\n });\n }));\n\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('error(a) != (error(!a)) #1', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b));\n });\n Assert.throws('error(a) != (error(!a)) #2', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b), tBoom());\n });\n Assert.throws('result(a) != (result(!a)) #2', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b), tBoom(), tNumber);\n });\n }));\n\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.throws('value != error #1', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s));\n });\n Assert.throws('value != error #2', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s), tBoom());\n });\n Assert.throws('value != error #3', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s), tBoom());\n });\n\n Assert.throws('error != value #1', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s));\n });\n Assert.throws('error != value #2', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s), tBoom());\n });\n Assert.throws('error != value #3', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s), tBoom(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Verifies that `KAssert.eqResult` throws an exception when comparing different `Result.value` and `Result.error` instances across various configurations and types.", "mode": "fast-check"} {"id": 54832, "name": "unknown", "code": "t.test('modulo', t => {\n fc.assert(\n fc.property(fc.bigIntN(N), fc.bigIntN(N), (n, m) => {\n // const a = t_mod(n, m);\n // const b = mod(n, m);\n // if (a !== b) {\n // console.log({ n, m, a, b });\n // }\n m = m || 1n;\n t.equal(t_mod(n, m), BigIntMath.mod(n, m));\n }),\n {\n examples: [\n [10n, 1n],\n [10n, -1n],\n [-10n, 1n],\n [-10n, -1n],\n [10000n, 7n],\n [10000n, -7n],\n [-10000n, 7n],\n [-10000n, -7n]\n ]\n }\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/mod-rem.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The modulo operation on randomly generated big integers should yield the same result for both `t_mod` and `BigIntMath.mod`, with specific examples to validate this behavior.", "mode": "fast-check"} {"id": 54833, "name": "unknown", "code": "t.test('toString(10)', t => {\n t.equal(t_string('0'), '0');\n t.equal(t_string('-0xbeef'), '-48879');\n t.equal(t_string('0xdeadbeef'), '3735928559');\n\n fc.assert(\n fc.property(fc.bigIntN(N), n => {\n t.equal(t_string(n), n.toString());\n })\n );\n\n t.end();\n })", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/to-string.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Converts integers to strings in base 10, ensuring output matches expected representations.", "mode": "fast-check"} {"id": 58865, "name": "unknown", "code": "UnitTest.test('KAssert.eqSome: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #1', () => {\n KAssert.eqSome('eq', a, Option.some(b));\n });\n }));\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #2', () => {\n KAssert.eqSome('eq', a, Option.some(b), tNumber);\n });\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`KAssert.eqSome` should throw an error when comparing two different numbers wrapped in `Option.some`.", "mode": "fast-check"} {"id": 58868, "name": "unknown", "code": "UnitTest.test('KAssert.eqOption: success (reflexivity)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n KAssert.eqOption('eq', Option.some(i), Option.some(i));\n KAssert.eqOption('eq', Option.some(i), Option.some(i), tNumber);\n }));\n KAssert.eqOption('eq', Option.none(), Option.none());\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`KAssert.eqOption` should confirm that two identical `Option` instances (either `some` with the same integer or `none`) are considered equal.", "mode": "fast-check"} {"id": 54834, "name": "unknown", "code": "t.test('toString(16)', t => {\n t.equal(t_string('0', 16), '0');\n t.equal(t_string('-0xbeef', 16), '-beef');\n t.equal(t_string('0xdeadbeef', 16), 'deadbeef');\n\n fc.assert(\n fc.property(fc.bigIntN(N), n => {\n t.equal(t_string(n, 16), n.toString(16));\n })\n );\n\n t.end();\n })", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/to-string.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The function `t_string` should correctly convert big integers to their hexadecimal string representation, matching the output of `n.toString(16)`.", "mode": "fast-check"} {"id": 58870, "name": "unknown", "code": "UnitTest.test('KAssert.eqOption: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #1', () => {\n KAssert.eqOption('eq', Option.some(a), Option.some(b));\n });\n }));\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #2', () => {\n KAssert.eqOption('eq', Option.some(a), Option.some(b), tNumber);\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('none != some(i) #1', () => {\n KAssert.eqOption('eq', Option.none(), Option.some(i));\n });\n Assert.throws('none != some(i) #2', () => {\n KAssert.eqOption('eq', Option.none(), Option.some(i), tBoom());\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('some(i) != none #1', () => {\n KAssert.eqOption('eq', Option.some(i), Option.none());\n });\n Assert.throws('some(i) != none #2', () => {\n KAssert.eqOption('eq', Option.some(i), Option.none(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`KAssert.eqOption` throws errors when comparing different `Option` values, verifying the detection of inequality between `some` and `none` or mismatched `some` values.", "mode": "fast-check"} {"id": 58903, "name": "unknown", "code": "UnitTest.test('capitalize: head is uppercase', () => {\n fc.assert(fc.property(fc.ascii(), fc.asciiString(30), (h, t) => {\n const actualH = Strings.capitalize(h + t).charAt(0);\n Assert.eq('head is uppercase', h.toUpperCase(), actualH, tString);\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/str/CapitalizeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Strings.capitalize` converts the first character of a string to uppercase.", "mode": "fast-check"} {"id": 58904, "name": "unknown", "code": "UnitTest.test('ResultInstances.eq: value(x) = value(x)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.eq(\n 'results should be equal',\n Result.value(i),\n Result.value(i),\n tResult(tNumber, tString)\n );\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/ResultInstancesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`ResultInstances.eq` ensures that two identical `Result.value` instances created with the same integer value are considered equal.", "mode": "fast-check"} {"id": 58905, "name": "unknown", "code": "UnitTest.test('ResultInstances.eq: error(x) = error(x)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.eq(\n 'results should be equal',\n Result.error(i),\n Result.error(i),\n tResult(tString, tNumber)\n );\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/ResultInstancesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`ResultInstances.eq` confirms that two `Result.error` instances with the same error value are considered equal.", "mode": "fast-check"} {"id": 54840, "name": "unknown", "code": "t.test('div_pow2', t => {\n fc.assert(\n fc.property(\n fc.bigIntN(N),\n fc.bigInt({ min: 0n, max: 2n ** 16n }),\n (n, m) => {\n t.equal(t_div_pow2(n, m), n / 2n ** m);\n }\n ),\n {\n examples: [\n [-1n, 1n],\n [1n, 1n],\n [0xdeadbeefn, 1n],\n [0xdeadbeefn, 8n],\n [0xdeadbeefn, 32n],\n [0xdeadbeefn, 64n],\n [-0xdeadbeefn, 64n]\n ]\n }\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/bits.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The function `t_div_pow2` should correctly divide a given big integer `n` by `2` raised to the power of `m`, matching the expected result of integer division.", "mode": "fast-check"} {"id": 54843, "name": "unknown", "code": "t.test('and', t => {\n fc.assert(\n fc.property(fc.bigIntN(N), fc.bigIntN(N), (n, m) => {\n t.equal(t_and(n, m), n & m);\n })\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/bits.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The bitwise `and` operation on two `bigIntN` values should match the result of using the `&` operator.", "mode": "fast-check"} {"id": 58906, "name": "unknown", "code": "UnitTest.test('ResultInstances.eq: value(a) != error(e)', () => {\n fc.assert(fc.property(fc.integer(), fc.string(), (a, e) => {\n Assert.eq(\n 'results should not be equal #1',\n false,\n tResult(tNumber, tString).eq(\n Result.value(a),\n Result.error(e)\n ));\n\n Assert.eq(\n 'results should not be equal #2',\n false,\n tResult(tNumber, tString).eq(\n Result.error(e),\n Result.value(a)\n ));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/ResultInstancesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that `ResultInstances.eq` correctly identifies `Result.value` and `Result.error` as not equal when one is a value and the other is an error, regardless of the order.", "mode": "fast-check"} {"id": 58907, "name": "unknown", "code": "UnitTest.test('ResultInstances.eq: (a = b) = (value(a) = value(b))', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), (a, b) => {\n Assert.eq(\n 'eq',\n a === b,\n tResult(tNumber, tString).eq(\n Result.value(a),\n Result.value(b)\n ));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/ResultInstancesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`ResultInstances.eq` checks if the equality of two `Result` values matches the equality of their contained integer values.", "mode": "fast-check"} {"id": 54844, "name": "unknown", "code": "t.test('or', t => {\n fc.assert(\n fc.property(fc.bigIntN(N), fc.bigIntN(N), (n, m) => {\n t.equal(t_or(n, m), n | m);\n })\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/bits.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Verifies that the `t_or` function produces the same result as the bitwise OR operation between two big integers.", "mode": "fast-check"} {"id": 54846, "name": "unknown", "code": "t.test('not', t => {\n fc.assert(\n fc.property(fc.bigIntN(N), n => {\n t.equal(t_not(n), ~n);\n })\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/bits.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The `t_not` function should produce the bitwise negation of a given integer.", "mode": "fast-check"} {"id": 58908, "name": "unknown", "code": "UnitTest.test('ResultInstances.eq: (a = b) = (error(a) = error(b))', () => {\n fc.assert(fc.property(fc.string(), fc.string(), (a, b) => {\n Assert.eq(\n 'eq',\n a === b,\n tResult(tNumber, tString).eq(\n Result.error(a),\n Result.error(b)\n ));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/ResultInstancesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`ResultInstances.eq` equates two `Result.error` instances based on the equality of their error values.", "mode": "fast-check"} {"id": 58910, "name": "unknown", "code": "UnitTest.test('Options.cat of only nones should be an empty array', () => {\n fc.assert(fc.property(\n fc.array(ArbDataTypes.arbOptionNone()),\n (options) => {\n const output = Options.cat(options);\n Assert.eq('eq', 0, output.length);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Options.cat` applied to an array of `None` options results in an empty array.", "mode": "fast-check"} {"id": 54848, "name": "unknown", "code": "t.test('identities', t => {\n fc.assert(\n fc.property(fc.bigIntN(N), n => {\n // identity ~(~x) = x\n t.equal(to(mpz.not(mpz.not(from(n)))), n);\n\n t.equal(t_and(n, n), n);\n t.equal(t_or(n, n), n);\n t.equal(t_xor(n, n), 0n);\n })\n );\n\n fc.assert(\n fc.property(fc.bigIntN(N), fc.bigInt({ min: 1n, max: 4096n }), (n, m) => {\n // a << b >> b = a\n t.equal(to(mpz.shr(mpz.shl(from(n), from(m)), from(m))), n);\n })\n );\n\n fc.assert(\n fc.property(fc.bigIntN(N), fc.bigIntN(N), (x, y) => {\n const X = from(x);\n const Y = from(y);\n\n t.equal(to(mpz.not(mpz.and(X, Y))), ~x | ~y); // ~(x & y) = ~x | ~y\n t.equal(to(mpz.not(mpz.or(X, Y))), ~x & ~y); // ~(x | y) = ~x & ~y\n // TODO: identity x^y == x|y &~ x&y\n })\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/bits.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 54849, "name": "unknown", "code": "t.test('identities', t => {\n fc.assert(\n fc.property(fc.bigIntN(N), n => {\n // identity ~(~x) = x\n t.equal(to(mpz.not(mpz.not(from(n)))), n);\n\n t.equal(t_and(n, n), n);\n t.equal(t_or(n, n), n);\n t.equal(t_xor(n, n), 0n);\n })\n );\n\n fc.assert(\n fc.property(fc.bigIntN(N), fc.bigInt({ min: 1n, max: 4096n }), (n, m) => {\n // a << b >> b = a\n t.equal(to(mpz.shr(mpz.shl(from(n), from(m)), from(m))), n);\n })\n );\n\n fc.assert(\n fc.property(fc.bigIntN(N), fc.bigIntN(N), (x, y) => {\n const X = from(x);\n const Y = from(y);\n\n t.equal(to(mpz.not(mpz.and(X, Y))), ~x | ~y); // ~(x & y) = ~x | ~y\n t.equal(to(mpz.not(mpz.or(X, Y))), ~x & ~y); // ~(x | y) = ~x & ~y\n // TODO: identity x^y == x|y &~ x&y\n })\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/bits.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58912, "name": "unknown", "code": "UnitTest.test('Options.cat of Arr.map(xs, Option.some) should be xs', () => {\n fc.assert(fc.property(\n fc.array(fc.json()),\n (arr) => {\n const options = Arr.map(arr, Option.some);\n const output = Options.cat(options);\n Assert.eq('eq', arr, output);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Options.cat` applied to an array of `Option.some` should return the original array.", "mode": "fast-check"} {"id": 58913, "name": "unknown", "code": "UnitTest.test('Options.cat of somes and nones should have length <= original', () => {\n fc.assert(fc.property(\n fc.array(ArbDataTypes.arbOption(fc.integer())),\n (arr) => {\n const output = Options.cat(arr);\n Assert.eq('eq', output.length <= arr.length, true);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Options.cat` should produce an array with a length less than or equal to the original when applied to arrays of optional integers.", "mode": "fast-check"} {"id": 58914, "name": "unknown", "code": "UnitTest.test('Options.cat of nones.concat(somes).concat(nones) should be somes', () => {\n fc.assert(fc.property(\n fc.array(fc.json()),\n fc.array(fc.json()),\n fc.array(fc.json()),\n (before, on, after) => {\n const beforeNones = Arr.map(before, Option.none);\n const afterNones = Arr.map(after, Option.none);\n const onSomes = Arr.map(on, Option.some);\n const output = Options.cat(beforeNones.concat(onSomes).concat(afterNones));\n Assert.eq('eq', on, output);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `Options.cat` function should return only the `somes` from concatenated arrays of `nones` and `somes`.", "mode": "fast-check"} {"id": 58915, "name": "unknown", "code": "UnitTest.test('Option.someIf: false -> none', () => {\n fc.assert(fc.property(fc.integer(), (n) => {\n Assert.eq('eq', Option.none(), Options.someIf(false, n), tOption());\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionsSomeIfTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Options.someIf` returns `Option.none()` when the condition is false, regardless of the integer provided.", "mode": "fast-check"} {"id": 54850, "name": "unknown", "code": "t.test('gcd', t => {\n fc.assert(\n fc.property(fc.bigIntN(N), fc.bigIntN(N), (n, m) => {\n t.equal(t_gcd(n, m), BigIntMath.gcd(n, m));\n })\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/gcd-lcm.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The test verifies that the `t_gcd` function produces the same result as `BigIntMath.gcd` for pairs of generated big integers.", "mode": "fast-check"} {"id": 54851, "name": "unknown", "code": "t.test('lcm', t => {\n fc.assert(\n fc.property(fc.bigIntN(N), fc.bigIntN(N), (n, m) => {\n t.equal(t_lcm(n, m), BigIntMath.lcm(n, m));\n })\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/gcd-lcm.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The least common multiple of two big integers should match the result of `BigIntMath.lcm`.", "mode": "fast-check"} {"id": 54853, "name": "unknown", "code": "t.test('inc', t => {\n fc.assert(\n fc.property(fc.bigIntN(N), n => {\n t.equal(t_inc(n), n + 1n);\n }),\n {\n examples: [[0n], [-1n], [1n]]\n }\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/add-sub.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`t_inc` increments a given big integer by 1.", "mode": "fast-check"} {"id": 54855, "name": "unknown", "code": "t.test('dec', t => {\n fc.assert(\n fc.property(fc.bigIntN(N), n => {\n t.equal(t_dec(n), n - 1n);\n }),\n {\n examples: [[0n], [-1n], [1n]]\n }\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/add-sub.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`dec` function correctly decrements a given big integer by one.", "mode": "fast-check"} {"id": 58916, "name": "unknown", "code": "UnitTest.test('Option.someIf: true -> some', () => {\n fc.assert(fc.property(fc.integer(), (n) => {\n Assert.eq('eq', Option.some(n), Options.someIf(true, n), tOption());\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionsSomeIfTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Options.someIf` returns `Option.some(n)` when the condition is true.", "mode": "fast-check"} {"id": 58917, "name": "unknown", "code": "UnitTest.test('Options.sequence: Single some value', () => {\n fc.assert(fc.property(fc.integer(), (n) => {\n Assert.eq('eq', Option.some([ n ]), Options.sequence([ Option.some(n) ]), tOption());\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionsSequenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Options.sequence` converts an array containing a single `Option.some` value into an `Option.some` array with the same value.", "mode": "fast-check"} {"id": 58918, "name": "unknown", "code": "UnitTest.test('Options.sequence: Two some values', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), (n, m) => {\n Assert.eq('eq', Option.some([ n, m ]), Options.sequence([ Option.some(n), Option.some(m) ]), tOption());\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionsSequenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Options.sequence` should return `Option.some` with an array of the input values when given an array of `Option.some` values.", "mode": "fast-check"} {"id": 54857, "name": "unknown", "code": "t.test('invariants', t => {\n fc.assert(\n fc.property(fc.bigIntN(N), n => {\n // -(-n) = n\n t.equal(to(mpz.negate(mpz.negate(from(n)))), n);\n\n // identity\n t.equal(t_add(n, 0n), n);\n t.equal(t_add(0n, n), n);\n t.equal(t_sub(n, 0n), n);\n t.equal(t_sub(0n, n), -n);\n })\n );\n\n fc.assert(\n fc.property(fc.bigIntN(N), fc.bigIntN(N), (n, m) => {\n // (n+m)-m = n\n t.equal(to(mpz.sub(mpz.add(from(n), from(m)), from(m))), n);\n\n // commutative\n t.equal(t_add(n, m), t_add(m, n));\n t.equal(t_sub(n, m), t_add(n, -m));\n })\n );\n\n fc.assert(\n fc.property(fc.bigIntN(N), fc.bigIntN(N), fc.bigIntN(N), (a, b, c) => {\n const A = from(a);\n const B = from(b);\n const C = from(c);\n\n // associative\n // (a+b)+c = a+(b+c)\n t.equal(to(mpz.add(mpz.add(A, B), C)), to(mpz.add(A, mpz.add(B, C))));\n // (a-b)-c = a-(b+c)\n t.equal(to(mpz.sub(mpz.sub(A, B), C)), to(mpz.sub(A, mpz.add(B, C))));\n // (a+b)-c = a+(b-c)\n t.equal(to(mpz.sub(mpz.add(A, B), C)), to(mpz.add(A, mpz.sub(B, C))));\n })\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/add-sub.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 54858, "name": "unknown", "code": "t.test('invariants', t => {\n fc.assert(\n fc.property(fc.bigIntN(N), n => {\n // -(-n) = n\n t.equal(to(mpz.negate(mpz.negate(from(n)))), n);\n\n // identity\n t.equal(t_add(n, 0n), n);\n t.equal(t_add(0n, n), n);\n t.equal(t_sub(n, 0n), n);\n t.equal(t_sub(0n, n), -n);\n })\n );\n\n fc.assert(\n fc.property(fc.bigIntN(N), fc.bigIntN(N), (n, m) => {\n // (n+m)-m = n\n t.equal(to(mpz.sub(mpz.add(from(n), from(m)), from(m))), n);\n\n // commutative\n t.equal(t_add(n, m), t_add(m, n));\n t.equal(t_sub(n, m), t_add(n, -m));\n })\n );\n\n fc.assert(\n fc.property(fc.bigIntN(N), fc.bigIntN(N), fc.bigIntN(N), (a, b, c) => {\n const A = from(a);\n const B = from(b);\n const C = from(c);\n\n // associative\n // (a+b)+c = a+(b+c)\n t.equal(to(mpz.add(mpz.add(A, B), C)), to(mpz.add(A, mpz.add(B, C))));\n // (a-b)-c = a-(b+c)\n t.equal(to(mpz.sub(mpz.sub(A, B), C)), to(mpz.sub(A, mpz.add(B, C))));\n // (a+b)-c = a+(b-c)\n t.equal(to(mpz.sub(mpz.add(A, B), C)), to(mpz.add(A, mpz.sub(B, C))));\n })\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/add-sub.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58919, "name": "unknown", "code": "UnitTest.test('Options.sequence: Array of numbers', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (n) => {\n const someNumbers = Arr.map(n, (x) => Option.some(x));\n Assert.eq('eq', Option.some(n), Options.sequence(someNumbers), tOption());\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionsSequenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Options.sequence` constructs an `Option` from an array of `Option`-wrapped numbers, ensuring it equals an `Option` of the original array of numbers.", "mode": "fast-check"} {"id": 58921, "name": "unknown", "code": "UnitTest.test('Options.sequence: None then some', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (n) => {\n const someNumbers = Arr.map(n, (x) => Option.some(x));\n Assert.eq('eq', Option.none(), Options.sequence([ Option.none(), ...someNumbers ]), tOption());\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionsSequenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Options.sequence` results in `Option.none` when the sequence starts with `Option.none`, regardless of subsequent `Option.some` values.", "mode": "fast-check"} {"id": 58922, "name": "unknown", "code": "UnitTest.test('Options.sequence: all some', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (n) =>\n Assert.eq('eq',\n Options.traverse(n, (x) => Option.some(x)),\n Options.sequence(Arr.map(n, (x) => Option.some(x))),\n tOption()\n )\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionsSequenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Options.sequence` should produce the same result as `Options.traverse` when both operate on an array of integers with all elements wrapped in `Option.some`.", "mode": "fast-check"} {"id": 58929, "name": "unknown", "code": "UnitTest.test('some !== none, for any predicate', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt1) => {\n Assert.eq('eq', false, opt1.equals_(Option.none(), boom));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`some` option is not equal to `none` option, regardless of the predicate used.", "mode": "fast-check"} {"id": 58930, "name": "unknown", "code": "UnitTest.test('none !== some, for any predicate', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt1) => {\n Assert.eq('eq', false, Option.none().equals_(opt1, boom));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Option.none()` is not equal to `Option.some()` for any integer value, confirmed by a predicate.", "mode": "fast-check"} {"id": 54863, "name": "unknown", "code": "t.test('mul-div invariants', t => {\n fc.assert(\n fc.property(fc.bigIntN(N), fc.bigIntN(N), (a, b) => {\n const n = mpz.from(a);\n const d = mpz.from(b || 1n);\n\n const q = mpz.div(n, d);\n const m = mpz.rem(n, d);\n const r = mpz.add(mpz.mul(q, d), m);\n t.equal(mpz.toHex(r), mpz.toHex(n));\n\n // commutative\n t.equal(t_mul(a, b), t_mul(b, a));\n })\n );\n\n // distributive\n // a*(b+c) = a*b + a*c\n\n fc.assert(\n fc.property(fc.bigIntN(N), n => {\n // identity\n t.equal(t_mul(n, 1n), n);\n t.equal(t_div(n, 1n), n);\n\n // inverse\n if (n !== 0n) {\n t.equal(t_div(n, n), 1n);\n }\n })\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/mul-div.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58931, "name": "unknown", "code": "UnitTest.test('Checking some(x).equals_(some(y), _, _ -> false) === false', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), arbOptionSome(fc.integer()), (opt1, opt2) => {\n Assert.eq('eq', false, opt1.equals_(opt2, Fun.constant(false)));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Two `some` options compared with a function that always returns false should result in `equals_` returning false.", "mode": "fast-check"} {"id": 58932, "name": "unknown", "code": "UnitTest.test('Checking some(x).equals_(some(y), _, _ -> true) === true', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), (a, b) => {\n const opt1 = Option.some(a);\n const opt2 = Option.some(b);\n Assert.eq('eq', true, opt1.equals_(opt2, Fun.constant(true)));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that `Option.some(x).equals_(Option.some(y), _, _ -> true)` always returns true, regardless of the integers `x` and `y`.", "mode": "fast-check"} {"id": 58933, "name": "unknown", "code": "UnitTest.test('Checking some(x).equals_(some(y), f) iff. f(x, y)', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), arbOptionSome(fc.integer()), fc.func(fc.boolean()), (a, b, f) => {\n const opt1 = Option.some(a);\n const opt2 = Option.some(b);\n return f(a, b) === opt1.equals_(opt2, f);\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Option.some(x).equals_(Option.some(y), f)` is true if and only if `f(x, y)` is true for integers `x` and `y`.", "mode": "fast-check"} {"id": 58934, "name": "unknown", "code": "UnitTest.test('Checking some(x).fold(die, id) === x', () => {\n fc.assert(fc.property(fc.integer(), (json) => {\n const opt = Option.some(json);\n const actual = opt.fold(Fun.die('Should not be none!'), Fun.identity);\n Assert.eq('eq', json, actual);\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property confirms that calling `fold` on `Option.some(x)` with an identity function returns `x`.", "mode": "fast-check"} {"id": 58935, "name": "unknown", "code": "UnitTest.test('Checking some(x).is(x) === true', () => {\n fc.assert(fc.property(fc.integer(), (json) => {\n const opt = Option.some(json);\n Assert.eq('eq', true, opt.is(json));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Option.some(x).is(x)` should return true for any integer `x`.", "mode": "fast-check"} {"id": 58936, "name": "unknown", "code": "UnitTest.test('Checking some(x).isSome === true', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => opt.isSome()));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`some(x).isSome` should return true for any integer value wrapped in an option.", "mode": "fast-check"} {"id": 58937, "name": "unknown", "code": "UnitTest.test('Checking some(x).isNone === false', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => !opt.isNone()));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`some(x).isNone` should always return false for any integer wrapped by `OptionSome`.", "mode": "fast-check"} {"id": 58943, "name": "unknown", "code": "UnitTest.test('Checking some(x).map(f) === some(f(x))', () => {\n fc.assert(fc.property(fc.integer(), fc.func(fc.integer()), (a, f) => {\n const opt = Option.some(a);\n const actual = opt.map(f);\n Assert.eq('eq', f(a), actual.getOrDie());\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Option.some(x).map(f)` should produce the same result as `Option.some(f(x))`.", "mode": "fast-check"} {"id": 58944, "name": "unknown", "code": "UnitTest.test('Checking some(x).each(f) === undefined and f gets x', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => {\n let hack: number | null = null;\n const actual = opt.each((x) => {\n hack = x;\n });\n Assert.eq('eq', undefined, actual);\n Assert.eq('hack', hack, opt.getOrDie());\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`some(x).each(f)` should return `undefined`, and `f` should be applied to `x`.", "mode": "fast-check"} {"id": 58945, "name": "unknown", "code": "UnitTest.test('Given f :: s -> some(b), checking some(x).bind(f) === some(b)', () => {\n fc.assert(fc.property(fc.integer(), fc.func(arbOptionSome(fc.integer())), (i, f) => {\n const actual = Option.some(i).bind(f);\n Assert.eq('eq', f(i), actual, tOption(tNumber));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Option.some(i).bind(f)` should be equivalent to `f(i)` when `f` is a function mapping integers to `Option.some` of integers.", "mode": "fast-check"} {"id": 58946, "name": "unknown", "code": "UnitTest.test('Given f :: s -> none, checking some(x).bind(f) === none', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), fc.func(arbOptionNone()), (opt, f) => {\n const actual = opt.bind(f);\n Assert.eq('eq', Option.none(), actual, tOption(tNumber));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property checks if binding a function returning `none` to an `Option` with some value results in `none`.", "mode": "fast-check"} {"id": 54868, "name": "unknown", "code": "it(\"should always return notice\", async () => {\n const file = \"foo.js\";\n const root = await tempFs.create({ [file]: \"\" });\n const wrapper = new StandardWrapper(\n {\n level: Levels.INFO,\n fix: false,\n root,\n files: [file],\n },\n {},\n );\n\n await fc.assert(\n fc.asyncProperty(\n fc.string({ unit: \"binary\" }),\n async (content) => {\n await fs.writeFile(file, content);\n\n const notices = await wrapper.lint(file);\n for (const notice of notices) {\n assert.equal(notice.file, file);\n assert.equal(notice.linter, \"standard\");\n }\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/regseb/metalint/test/fuzz/core/wrapper/standard.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "regseb/metalint", "url": "https://github.com/regseb/metalint.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "Ensures that the `StandardWrapper` linting function returns notices with the specified file name and \"standard\" as the linter for any binary string content written to the file.", "mode": "fast-check"} {"id": 58948, "name": "unknown", "code": "UnitTest.test('Checking some(x).exists(_ -> true) === true', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => opt.exists(Fun.constant(true))));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`OptionSome.exists` method returns true when applied with a constant true function on an option containing a value.", "mode": "fast-check"} {"id": 58949, "name": "unknown", "code": "UnitTest.test('Checking some(x).exists(f) iff. f(x)', () => {\n fc.assert(fc.property(fc.integer(), fc.func(fc.boolean()), (i, f) => {\n const opt = Option.some(i);\n if (f(i)) {\n Assert.eq('eq', true, opt.exists(f));\n } else {\n Assert.eq('eq', false, opt.exists(f));\n }\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Option.some(x).exists(f)` returns true if and only if the function `f` applied to `x` is true.", "mode": "fast-check"} {"id": 58950, "name": "unknown", "code": "UnitTest.test('Checking some(x).forall(_ -> false) === false', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => !opt.forall(Fun.constant(false))));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`some(x).forall(_ -> false)` should always be false for any integer wrapped in `OptionSome`.", "mode": "fast-check"} {"id": 54869, "name": "unknown", "code": "it(\"should always return notice\", async () => {\n const file = \"foo.yaml\";\n const root = await tempFs.create({ [file]: \"\" });\n const wrapper = new YAMLLintWrapper(\n {\n level: Levels.INFO,\n fix: false,\n root,\n files: [file],\n },\n {},\n );\n\n await fc.assert(\n fc.asyncProperty(\n fc.string({ unit: \"binary\" }),\n async (content) => {\n await fs.writeFile(file, content);\n\n const notices = await wrapper.lint(file);\n for (const notice of notices) {\n assert.equal(notice.file, file);\n assert.equal(notice.linter, \"yaml-lint\");\n }\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/regseb/metalint/test/fuzz/core/wrapper/yaml-lint.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "regseb/metalint", "url": "https://github.com/regseb/metalint.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "`YAMLLintWrapper` always produces notices tagged with the correct file and linter name when linting any binary string content in a YAML file.", "mode": "fast-check"} {"id": 58955, "name": "unknown", "code": "UnitTest.test('Checking none.fold(_ -> x, die) === x', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n const actual = Option.none().fold(Fun.constant(i), Fun.die('Should not die'));\n Assert.eq('eq', i, actual);\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property checks that `none.fold(_ -> x, die)` returns `x` for any integer `x`, without calling the die function.", "mode": "fast-check"} {"id": 58956, "name": "unknown", "code": "UnitTest.test('Checking none.is === false', () => {\n fc.assert(fc.property(fc.integer(), (v) => {\n Assert.eq('none is', false, Option.none().is(v));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Option.none().is(v)` should always be false for any integer `v`.", "mode": "fast-check"} {"id": 58959, "name": "unknown", "code": "UnitTest.test('Checking none.getOrDie() always throws', () => {\n // Require non empty string of msg falsiness gets in the way.\n fc.assert(fc.property(fc.string(1, 40), (s) => {\n Assert.throws('getOrDie', () => {\n Option.none().getOrDie(s);\n });\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Calling `getOrDie` on `Option.none()` always throws an error.", "mode": "fast-check"} {"id": 58960, "name": "unknown", "code": "UnitTest.test('Checking none.or(oSomeValue) === oSomeValue', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n const output = Option.none().or(Option.some(i));\n Assert.eq('eq', true, output.is(i));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Option.none().or(Option.some(i))` should equal `Option.some(i)`.", "mode": "fast-check"} {"id": 58961, "name": "unknown", "code": "UnitTest.test('Checking none.orThunk(_ -> v) === v', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n const output = Option.none().orThunk(() => Option.some(i));\n Assert.eq('eq', true, output.is(i));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Option.none().orThunk(() => Option.some(i))` should equal `Option.some(i)`.", "mode": "fast-check"} {"id": 58962, "name": "unknown", "code": "UnitTest.test('Option.isSome: none is not some', () => {\n Assert.eq('none is not some', false, Option.none().isSome());\n fc.assert(fc.property(fc.anything(), (x) => {\n Assert.eq('some is some', true, Option.some(x).isSome());\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionIsSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Option.none().isSome()` should return false, while `Option.some(x).isSome()` should return true for any value `x`.", "mode": "fast-check"} {"id": 58964, "name": "unknown", "code": "UnitTest.test('Option.getOr', () => {\n fc.assert(fc.property(fc.integer(), (x) => {\n Assert.eq('none', x, Option.none().getOr(x));\n Assert.eq('none', x, Option.none().getOrThunk(() => x));\n }));\n fc.assert(fc.property(fc.integer(), fc.integer(), (x, y) => {\n Assert.eq('some', x, Option.some(x).getOr(y));\n Assert.eq('some', x, Option.some(x).getOrThunk(Fun.die('boom')));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionGetOrTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Option.getOr` returns the provided default value or thunk result if the option is `none`, while `Option.some` ignores the default value and returns its own value.", "mode": "fast-check"} {"id": 58965, "name": "unknown", "code": "UnitTest.test('Option.getOr', () => {\n fc.assert(fc.property(fc.integer(), (x) => {\n Assert.eq('none', x, Option.none().getOr(x));\n Assert.eq('none', x, Option.none().getOrThunk(() => x));\n }));\n fc.assert(fc.property(fc.integer(), fc.integer(), (x, y) => {\n Assert.eq('some', x, Option.some(x).getOr(y));\n Assert.eq('some', x, Option.some(x).getOrThunk(Fun.die('boom')));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionGetOrTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Option.getOr` returns the provided default value for `Option.none`, and the contained value for `Option.some`.", "mode": "fast-check"} {"id": 58966, "name": "unknown", "code": "UnitTest.test('Checking some(x).filter(_ -> false) === none', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => {\n Assert.eq('eq', true, tOption().eq(\n none(),\n opt.filter(Fun.constant(false))));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionFilterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Filtering an `Option` with a predicate that always returns false results in `none()`.", "mode": "fast-check"} {"id": 58968, "name": "unknown", "code": "UnitTest.test('Checking some(x).filter(f) === some(x) iff. f(x)', () => {\n fc.assert(fc.property(fc.integer(), fc.func(fc.boolean()), (i, f) => {\n const opt = some(i);\n if (f(i)) {\n Assert.eq('filter true', Option.some(i), opt.filter(f), tOption(tNumber));\n } else {\n Assert.eq('filter false', Option.none(), opt.filter(f), tOption(tNumber));\n }\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionFilterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Applying a filter function `f` to `some(x)` should return `some(x)` if and only if `f(x)` is true; otherwise, it should return `none()`.", "mode": "fast-check"} {"id": 58970, "name": "unknown", "code": "UnitTest.test('Obj.map: map id obj = obj', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.integer()), (obj) => {\n const actual = Obj.map(obj, Fun.identity);\n Assert.eq('map id', obj, actual);\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/obj/ObjMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Mapping an identity function over an object with `Obj.map` should return the original object unchanged.", "mode": "fast-check"} {"id": 58971, "name": "unknown", "code": "UnitTest.test('map constant obj means that values(obj) are all the constant', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.integer()), fc.integer(), (obj, x) => {\n const output = Obj.map(obj, Fun.constant(x));\n const values = Obj.values(output);\n return Arr.forall(values, (v) => v === x);\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/obj/ObjMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Mapping all values in an object to a constant results in every value being equal to that constant.", "mode": "fast-check"} {"id": 58973, "name": "unknown", "code": "UnitTest.test('mapToArray is symmetric with tupleMap', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.integer()), (obj) => {\n const array = Obj.mapToArray(obj, (x, i) => ({ k: i, v: x }));\n\n const aKeys = Arr.map(array, (x) => x.k);\n const aValues = Arr.map(array, (x) => x.v);\n\n const keys = Obj.keys(obj);\n const values = Obj.values(obj);\n\n Assert.eq('same keys', Arr.sort(keys), Arr.sort(aKeys));\n Assert.eq('same values', Arr.sort(values), Arr.sort(aValues));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/obj/ObjMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Converting an object to an array using `mapToArray` should preserve the same keys and values as retrieved by `Obj.keys` and `Obj.values`.", "mode": "fast-check"} {"id": 58975, "name": "unknown", "code": "UnitTest.test('the value found by find always passes predicate', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(), fc.json()),\n fc.func(fc.boolean()),\n function (obj, pred) {\n // It looks like the way that fc.fun works is it cares about all of its arguments, so therefore\n // we have to only pass in one if we want it to be deterministic. Just an assumption\n const value = Obj.find(obj, function (v) {\n return pred(v);\n });\n return value.fold(function () {\n const values = Obj.values(obj);\n return !Arr.exists(values, function (v) {\n return pred(v);\n });\n }, function (v) {\n return pred(v);\n });\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/obj/ObjFindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The value found by `Obj.find` always satisfies the given predicate function.", "mode": "fast-check"} {"id": 58976, "name": "unknown", "code": "UnitTest.test('If predicate is always false, then find is always none', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(), fc.json()),\n function (obj) {\n const value = Obj.find(obj, Fun.constant(false));\n return value.isNone();\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/obj/ObjFindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "When a predicate is always false, `Obj.find` consistently returns none for any dictionary.", "mode": "fast-check"} {"id": 58977, "name": "unknown", "code": "UnitTest.test('If object is empty, find is always none', () => {\n fc.assert(fc.property(\n fc.func(fc.boolean()),\n function (pred) {\n const value = Obj.find({ }, pred);\n return value.isNone();\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/obj/ObjFindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Obj.find` should return none when searching within an empty object.", "mode": "fast-check"} {"id": 58978, "name": "unknown", "code": "UnitTest.test('If predicate is always true, then value is always the some(first), or none if dict is empty', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(), fc.json()),\n function (obj) {\n const value = Obj.find(obj, Fun.constant(true));\n // No order is specified, so we cannot know what \"first\" is\n return Obj.keys(obj).length === 0 ? value.isNone() : true;\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/obj/ObjFindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "When the predicate always returns true, `Obj.find` should return the first value as `some(first)`, or `none` if the dictionary is empty, independent of order.", "mode": "fast-check"} {"id": 58979, "name": "unknown", "code": "UnitTest.test('Each + set should equal the same object', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(), fc.json()),\n function (obj: Record) {\n const values = { };\n const output = Obj.each(obj, function (x, i) {\n values[i] = x;\n });\n Assert.eq('eq', obj, values);\n Assert.eq('output', undefined, output);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/obj/ObjEachTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Verifies that iterating over an object with `Obj.each` and collecting values results in an object identical to the original, and that `Obj.each` returns `undefined`.", "mode": "fast-check"} {"id": 58980, "name": "unknown", "code": "UnitTest.test('Merged with identity on left', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), function (obj) {\n Assert.eq('eq', obj, Merger.merge({}, obj));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Merging an object with an empty object on the left should result in the original object unchanged.", "mode": "fast-check"} {"id": 58984, "name": "unknown", "code": "UnitTest.test('Merge(a, b) contains all the keys of b', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), fc.dictionary(fc.asciiString(), fc.json()), function (a, b) {\n const output = Merger.merge(a, b);\n const keys = Obj.keys(b);\n const oKeys = Obj.keys(output);\n return Arr.forall(keys, function (k) {\n return Arr.contains(oKeys, k);\n });\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Merger.merge(a, b)` ensures that the resulting object contains all the keys present in object `b`.", "mode": "fast-check"} {"id": 58986, "name": "unknown", "code": "UnitTest.test('Deep-merged with identity on right', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), function (obj) {\n Assert.eq('eq', obj, Merger.deepMerge(obj, {}));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Merger.deepMerge` should return the original object when merged with an empty object on the right.", "mode": "fast-check"} {"id": 58987, "name": "unknown", "code": "UnitTest.test('Deep-merged with itself is itself', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), function (obj) {\n Assert.eq('eq', obj, Merger.deepMerge(obj, obj));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Deep-merging an object with itself should return the original object unchanged.", "mode": "fast-check"} {"id": 58988, "name": "unknown", "code": "UnitTest.test('Deep-merge(a, Deep-merge(b, c)) === Deep-merge(Deep-merge(a, b), c)', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), fc.dictionary(fc.asciiString(), fc.json()), fc.dictionary(fc.asciiString(), fc.json()), function (a, b, c) {\n const one = Merger.merge(a, Merger.merge(b, c));\n const other = Merger.merge(Merger.merge(a, b), c);\n Assert.eq('eq', one, other);\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The deep merge of dictionaries should be associative, meaning `Deep-merge(a, Deep-merge(b, c))` equals `Deep-merge(Deep-merge(a, b), c)`.", "mode": "fast-check"} {"id": 58989, "name": "unknown", "code": "UnitTest.test('Deep-merge(a, b) contains all the keys of b', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), fc.dictionary(fc.asciiString(), fc.json()), function (a, b) {\n const output = Merger.deepMerge(a, b);\n const keys = Obj.keys(b);\n const oKeys = Obj.keys(output);\n return Arr.forall(keys, function (k) {\n return Arr.contains(oKeys, k);\n });\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Deep-merge of objects `a` and `b` should result in an object that contains all keys from `b`.", "mode": "fast-check"} {"id": 58990, "name": "unknown", "code": "UnitTest.test('Check that if the filter always returns false, then everything is in \"f\"', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(), fc.string(1, 40)),\n (obj) => {\n const output = Obj.bifilter(obj, Fun.constant(false));\n Assert.eq('eq', Obj.keys(obj).length, Obj.keys(output.f).length);\n Assert.eq('eq', 0, Obj.keys(output.t).length);\n return true;\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/obj/BiFilterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "If the filter function always returns false, all elements of the object should be in the \"f\" part of the output, and \"t\" should be empty.", "mode": "fast-check"} {"id": 58992, "name": "unknown", "code": "UnitTest.test('Check that everything in f fails predicate and everything in t passes predicate', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(1, 30), fc.integer()),\n (obj) => {\n const predicate = (x) => x % 2 === 0;\n const output = Obj.bifilter(obj, predicate);\n\n const matches = (k) => predicate(obj[k]);\n\n const falseKeys = Obj.keys(output.f);\n const trueKeys = Obj.keys(output.t);\n\n Assert.eq('Something in \"f\" passed predicate', false, Arr.exists(falseKeys, matches));\n Assert.eq('Something in \"t\" failed predicate', true, Arr.forall(trueKeys, matches));\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/obj/BiFilterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Obj.bifilter` separates an object's entries such that all entries in `f` fail the predicate and all entries in `t` pass the predicate.", "mode": "fast-check"} {"id": 58993, "name": "unknown", "code": "UnitTest.test('Checking struct with right number of arguments', () => {\n fc.assert(fc.property(\n fc.array(fc.string(), 1, 40),\n (rawValues: string[]) => {\n // Remove duplications.\n const values = toUnique(rawValues);\n\n const struct = Struct.immutable.apply(undefined, values);\n const output = struct.apply(undefined, values);\n\n const evaluated = Obj.mapToArray(output, (v, _k) => v());\n\n Assert.eq('eq', evaluated, values);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/struct/ImmutableTest.ts", "start_line": null, "end_line": null, "dependencies": ["toUnique"], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Struct.immutable` correctly converts an array of unique strings into a structure that, when applied, produces functions yielding the original values.", "mode": "fast-check"} {"id": 58995, "name": "unknown", "code": "UnitTest.test('Checking struct with fewer arguments', () => {\n fc.assert(fc.property(\n fc.array(fc.string(), 1, 40),\n fc.integer(1, 10),\n (rawValues: string[], numToExclude: number) => {\n // Remove duplications.\n const values = toUnique(rawValues);\n\n const struct = Struct.immutable.apply(undefined, values);\n try {\n struct.apply(undefined, values.slice(numToExclude));\n return false;\n } catch (err) {\n return err.message.indexOf('Wrong number') > -1;\n }\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/struct/ImmutableTest.ts", "start_line": null, "end_line": null, "dependencies": ["toUnique"], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Verifies that invoking `Struct.immutable` with fewer arguments than it was created with throws an error containing the message \"Wrong number\".", "mode": "fast-check"} {"id": 58996, "name": "unknown", "code": "UnitTest.test('Checking struct with more arguments', () => {\n fc.assert(fc.property(\n fc.array(fc.string(), 1, 40),\n fc.array(fc.string(), 1, 40),\n (rawValues: string[], extra: string[]) => {\n // Remove duplications.\n const values = toUnique(rawValues);\n\n const struct = Struct.immutable.apply(undefined, values);\n try {\n struct.apply(undefined, values.concat(extra));\n return false;\n } catch (err) {\n return err.message.indexOf('Wrong number') > -1;\n }\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/struct/ImmutableTest.ts", "start_line": null, "end_line": null, "dependencies": ["toUnique"], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "When an immutable structure is created with a set of unique strings, applying it with additional arguments should throw an error indicating a wrong number of arguments.", "mode": "fast-check"} {"id": 58999, "name": "unknown", "code": "UnitTest.test('adt.nothing.match should be same as fold', () => {\n fc.assert(fc.property(arbNothing, (subject) => {\n const matched = subject.match({\n nothing: record,\n unknown: Fun.die('should not be unknown'),\n exact: Fun.die('should not be exact')\n });\n\n const folded = subject.fold(record, Fun.die('should not be unknown'), Fun.die('should not be exact'));\n Assert.eq('eq', matched, folded);\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`adt.nothing.match` and `fold` produce the same result when applied to a `nothing` subject, ensuring both methods yield equivalent outputs.", "mode": "fast-check"} {"id": 59002, "name": "unknown", "code": "UnitTest.test('adt.exact.match should pass 2 parameters [ value, precision ]', () => {\n fc.assert(fc.property(arbExact, (subject) => {\n const contents = subject.match({\n nothing: Fun.die('should not be nothing'),\n unknown: Fun.die('should not be unknown'),\n exact: record\n });\n Assert.eq('eq', 2, contents.length);\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`adt.exact.match` produces contents with exactly two elements when matched with \"exact\".", "mode": "fast-check"} {"id": 54874, "name": "unknown", "code": "it(\"should always return notice\", async () => {\n const file = \"foo.txt\";\n const root = await tempFs.create({ [file]: \"\" });\n const wrapper = new SecretlintWrapper(\n {\n level: Levels.INFO,\n fix: false,\n root,\n files: [file],\n },\n {},\n );\n\n await fc.assert(\n fc.asyncProperty(\n fc.string({ unit: \"binary\" }),\n async (content) => {\n await fs.writeFile(file, content);\n\n const notices = await wrapper.lint(file);\n for (const notice of notices) {\n assert.equal(notice.file, file);\n assert.equal(notice.linter, \"secretlint\");\n }\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/regseb/metalint/test/fuzz/core/wrapper/secretlint.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "regseb/metalint", "url": "https://github.com/regseb/metalint.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The test ensures that for any binary string written to \"foo.txt\", `SecretlintWrapper` generates notices correctly identifying the file and linter as \"secretlint\".", "mode": "fast-check"} {"id": 59006, "name": "unknown", "code": "UnitTest.test('CycleBy 0 has no effect', () => {\n fc.assert(fc.property(fc.nat(), fc.nat(), (value, delta) => {\n const actual = Num.cycleBy(value, 0, value, value + delta);\n Assert.eq('eq', value, actual);\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/num/NumCycleByTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Num.cycleBy` with a cycle value of 0 returns the original value.", "mode": "fast-check"} {"id": 59021, "name": "unknown", "code": "UnitTest.test('Check that values should be empty and errors should be all if we only generate errors', () => {\n fc.assert(fc.property(\n fc.array(arbResultError(fc.integer())),\n function (resErrors) {\n const actual = Results.partition(resErrors);\n if (actual.values.length !== 0) {\n Assert.fail('Values length should be 0');\n } else if (resErrors.length !== actual.errors.length) {\n Assert.fail('Errors length should be ' + resErrors.length);\n }\n return true;\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Results.partition` should return an empty `values` array and an `errors` array equal in length to the input when only generating error results.", "mode": "fast-check"} {"id": 59023, "name": "unknown", "code": "UnitTest.test('Check that the total number of values and errors matches the input size', () => {\n fc.assert(fc.property(\n fc.array(arbResult(fc.integer(), fc.string())),\n function (results) {\n const actual = Results.partition(results);\n Assert.eq('Total number should match size of input', results.length, actual.errors.length + actual.values.length);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The total number of values and errors from `Results.partition` should match the size of the input array.", "mode": "fast-check"} {"id": 59025, "name": "unknown", "code": "UnitTest.test('Check that error, value always equal comparison.firstError', () => {\n fc.assert(fc.property(\n arbResultError(fc.integer()),\n arbResultValue(fc.string()),\n function (r1, r2) {\n const comparison = Results.compare(r1, r2);\n return comparison.match({\n bothErrors: Fun.constant(false),\n firstError: Fun.constant(true),\n secondError: Fun.constant(false),\n bothValues: Fun.constant(false)\n });\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Results.compare` should identify the first result (`r1`) as an error, returning `firstError` as true in the comparison.", "mode": "fast-check"} {"id": 59039, "name": "unknown", "code": "UnitTest.test('Checking value.each(f) === undefined', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), fc.func(fc.json()), (res, f) => {\n const actual = res.each(f);\n Assert.eq('eq', undefined, actual);\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Calling `each(f)` on a `ResultValue` should return `undefined`.", "mode": "fast-check"} {"id": 59040, "name": "unknown", "code": "UnitTest.test('Given f :: s -> RV, checking value.bind(f).getOrDie() === f(value.getOrDie()).getOrDie()', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), fc.func(arbResultValue(fc.integer())), (res, f) => {\n Assert.eq('eq', res.bind(f).getOrDie(), f(res.getOrDie()).getOrDie());\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property requires that applying a function `f` to the result of `value.bind()` and comparing it with directly applying `f` to the unwrapped value produces the same outcome using `getOrDie()`.", "mode": "fast-check"} {"id": 59041, "name": "unknown", "code": "UnitTest.test('Given f :: s -> RE, checking value.bind(f).fold(id, die) === f(value.getOrDie()).fold(id, die)', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), fc.func(arbResultError(fc.integer())), (res, f) => {\n const toErrString = (r) => r.fold(Fun.identity, Fun.die('Not a Result.error'));\n Assert.eq('eq', toErrString(res.bind(f)), toErrString(f(res.getOrDie())));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should hold that applying a function `f` to a result using `bind` and folding it yields the same as applying `f` directly to the result's value and then folding it.", "mode": "fast-check"} {"id": 59042, "name": "unknown", "code": "UnitTest.test('Checking value.forall is true iff. f(value.getOrDie() === true)', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), fc.func(fc.boolean()), (res, f) => {\n Assert.eq('eq', f(res.getOrDie()), res.forall(f));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that `res.forall(f)` returns true if and only if `f(res.getOrDie())` is true.", "mode": "fast-check"} {"id": 59043, "name": "unknown", "code": "UnitTest.test('Checking value.exists is true iff. f(value.getOrDie() === true)', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), fc.func(fc.boolean()), (res, f) => {\n Assert.eq('eq', f(res.getOrDie()), res.exists(f));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should ensure that `value.exists` returns true if and only if applying function `f` to `value.getOrDie()` results in true.", "mode": "fast-check"} {"id": 59044, "name": "unknown", "code": "UnitTest.test('Checking value.toOption is always Option.some(value.getOrDie())', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), (res) => {\n Assert.eq('eq', res.getOrDie(), res.toOption().getOrDie());\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`value.toOption` converts a `ResultValue` into an `Option` and retrieves the same result using `getOrDie()`.", "mode": "fast-check"} {"id": 59045, "name": "unknown", "code": "UnitTest.test('Result.error: error.is === false', () => {\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.eq('eq', false, Result.error(s).is(i));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Result.error` should return an object where `is` method always evaluates to false for any integer input.", "mode": "fast-check"} {"id": 59046, "name": "unknown", "code": "UnitTest.test('Result.error: error.isValue === false', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), (res) => {\n Assert.eq('eq', false, res.isValue());\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Result.error` instances should return `false` for the `isValue` method.", "mode": "fast-check"} {"id": 59048, "name": "unknown", "code": "UnitTest.test('Result.error: error.getOr(v) === v', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), fc.json(), (res, json) => {\n Assert.eq('eq', json, res.getOr(json));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Result.error` returns the default value when accessing a result using `getOr`.", "mode": "fast-check"} {"id": 59049, "name": "unknown", "code": "UnitTest.test('Result.error: error.getOrDie() always throws', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), (res) => {\n Assert.throws('should throw', () => {\n res.getOrDie();\n });\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Result.error().getOrDie()` should always throw an error when accessed.", "mode": "fast-check"} {"id": 59051, "name": "unknown", "code": "UnitTest.test('Result.error: error.orThunk(_ -> v) === v', () => {\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.eq('eq', Result.value(i), Result.error(s).orThunk(() => Result.value(i)), tResult());\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Result.error.orThunk` applied to an error returns a value equal to the provided fallback value.", "mode": "fast-check"} {"id": 59052, "name": "unknown", "code": "UnitTest.test('Result.error: error.fold(_ -> x, die) === x', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), fc.json(), (res, json) => {\n const actual = res.fold(Fun.constant(json), Fun.die('Should not die'));\n Assert.eq('eq', json, actual);\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Result.error` should fold to the first function provided, returning the constant value without invoking the second function.", "mode": "fast-check"} {"id": 59056, "name": "unknown", "code": "UnitTest.test('Given f :: s -> RV, Result.error: error.bind(f) === error', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), fc.func(arbResultValue(fc.integer())), (res, f) => {\n const actual = res.bind(f);\n Assert.eq('eq', true, getErrorOrDie(res) === getErrorOrDie(actual));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": ["getErrorOrDie"], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Binding a function to a `Result.error` should return the same error.", "mode": "fast-check"} {"id": 59059, "name": "unknown", "code": "UnitTest.test('Result.error: error.exists === false', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.eq('eq', false, Result.error(i).exists(Fun.die('\u22a5')));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Result.error` returns an object where the `exists` method evaluates to false, given any integer input.", "mode": "fast-check"} {"id": 54877, "name": "unknown", "code": "it(\"should always return notice\", async () => {\n const file = \"foo.js\";\n const root = await tempFs.create({ [file]: \"\" });\n const wrapper = new PrettierWrapper(\n {\n level: Levels.INFO,\n fix: false,\n root,\n files: [file],\n },\n {},\n );\n\n await fc.assert(\n fc.asyncProperty(\n fc.string({ unit: \"binary\" }),\n async (content) => {\n await fs.writeFile(file, content);\n\n const notices = await wrapper.lint(file);\n for (const notice of notices) {\n assert.equal(notice.file, file);\n assert.equal(notice.linter, \"prettier\");\n }\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/regseb/metalint/test/fuzz/core/wrapper/prettier.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "regseb/metalint", "url": "https://github.com/regseb/metalint.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The test ensures that for any binary string content written to a file, the `PrettierWrapper` returns notices identifying the file and linter as \"prettier\".", "mode": "fast-check"} {"id": 59060, "name": "unknown", "code": "UnitTest.test('Result.error: error.toOption is always none', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), (res) => {\n Assert.eq('eq', Option.none(), res.toOption(), tOption());\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Result.error` ensures that calling `toOption` always returns `Option.none`.", "mode": "fast-check"} {"id": 59061, "name": "unknown", "code": "UnitTest.test('Id: Two ids should not be the same', () => {\n const arbId = fc.string(1, 30).map(Id.generate);\n fc.assert(fc.property(arbId, arbId, (id1, id2) => id1 !== id2));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/IdTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Generated IDs should be unique across two distinct generations.", "mode": "fast-check"} {"id": 59064, "name": "unknown", "code": "promiseTest('LazyValue: delayed, map', () =>\n fc.assert(fc.asyncProperty(fc.integer(), fc.func(fc.string()), (i, f) => new Promise((resolve, reject) => {\n LazyValue.nu((c) => {\n setTimeout(() => {\n c(i);\n }, 2);\n }).map(f).get((v) => {\n eqAsync('LazyValue.map', f(i), v, reject);\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/async/LazyValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "A `LazyValue` that is delayed maps an integer through a function to produce a string, and the result matches the expected transformed value.", "mode": "fast-check"} {"id": 59065, "name": "unknown", "code": "promiseTest('LazyValue: parallel spec', () => fc.assert(fc.asyncProperty(fc.array(fc.integer(), 0, 20), (vals) => new Promise((resolve, reject) => {\n const lazyVals = Arr.map(vals, LazyValue.pure);\n LazyValues.par(lazyVals).get((actual) => {\n eqAsync('pars', vals, actual, reject);\n resolve();\n });\n}))))", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/async/LazyValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`LazyValues.par` processes an array of `LazyValue` instances in parallel, ensuring the output matches the input array of integers.", "mode": "fast-check"} {"id": 59066, "name": "unknown", "code": "promiseTest('Future: pure get', () =>\n fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n Future.pure(i).get((ii) => {\n eqAsync('pure get', i, ii, reject, tNumber);\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Future.pure(i).get` correctly retrieves the value `i`, ensuring type consistency and equality.", "mode": "fast-check"} {"id": 59071, "name": "unknown", "code": "promiseTest('Future: parallel spec', () =>\n fc.assert(fc.asyncProperty(fc.array(fc.tuple(fc.integer(1, 10), fc.integer())), (tuples) => new Promise((resolve, reject) => {\n Futures.par(Arr.map(tuples, ([ timeout, value ]) => Future.nu((cb) => {\n setTimeout(() => {\n cb(value);\n }, timeout);\n }))).get((ii) => {\n eqAsync('pars', tuples.map(([ _, i ]) => i), ii, reject, tArray(tNumber));\n resolve();\n });\n })))\n)", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Futures.par` processes an array of futures derived from integer tuples where each tuple contains a timeout and a value, ensuring completion in order of the tuple values.", "mode": "fast-check"} {"id": 59074, "name": "unknown", "code": "promiseTest('FutureResult: fromFuture', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.fromFuture(Future.pure(i)).get((ii) => {\n eqAsync('eq', Result.value(i), ii, reject, tResult());\n resolve();\n });\n}))))", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`FutureResult.fromFuture` successfully retrieves the expected value from a resolved future using asynchronous comparison.", "mode": "fast-check"} {"id": 59081, "name": "unknown", "code": "promiseTest('FutureResult: error mapResult', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.error(i).mapResult(Fun.die('\u22a5')).get((ii) => {\n eqAsync('eq', Result.error(i), ii, reject, tResult());\n resolve();\n });\n}))))", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`FutureResult.error(i).mapResult` should return a result that matches `Result.error(i)`.", "mode": "fast-check"} {"id": 59082, "name": "unknown", "code": "promiseTest('FutureResult: value mapError', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.value(i).mapError(Fun.die('\u22a5')).get((ii) => {\n eqAsync('eq', Result.value(i), ii, reject, tResult());\n resolve();\n });\n}))))", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Mapping an error on a `FutureResult` containing a value should not affect the result.", "mode": "fast-check"} {"id": 59083, "name": "unknown", "code": "promiseTest('FutureResult: err mapError', () => {\n const f = (x) => x + 3;\n return fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.error(i).mapError(f).get((ii) => {\n eqAsync('eq', Result.error(f(i)), ii, reject, tResult());\n resolve();\n });\n })));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should ensure that mapping an error function over a `FutureResult.error` transforms the error value as expected.", "mode": "fast-check"} {"id": 59085, "name": "unknown", "code": "promiseTest('FutureResult: bindFuture: value bindFuture error', () => fc.assert(fc.asyncProperty(fc.integer(), fc.string(), (i, s) => new Promise((resolve, reject) => {\n FutureResult.value(i).bindFuture(() => FutureResult.error(s)).get((actual) => {\n eqAsync('bind result', Result.error(s), actual, reject, tResult(tNumber));\n resolve();\n });\n}))))", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`FutureResult.value` bound with `bindFuture` to `FutureResult.error` results in an error matching the second input.", "mode": "fast-check"} {"id": 59086, "name": "unknown", "code": "promiseTest('FutureResult: error bindFuture', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.error(i).bindFuture(Fun.die('\u22a5')).get((actual) => {\n eqAsync('bind result', Result.error(i), actual, reject, tResult(tNumber));\n resolve();\n });\n}))))", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`FutureResult.error` correctly binds to a future that results in an error when using `bindFuture`.", "mode": "fast-check"} {"id": 59099, "name": "unknown", "code": "UnitTest.test('Obj.filter: filter const true is identity', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.integer()), (obj) => {\n Assert.eq('id', obj, Obj.filter(obj, () => true));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ObjFilterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Obj.filter` returns the original object when the filter function always returns true.", "mode": "fast-check"} {"id": 59100, "name": "unknown", "code": "UnitTest.test('Length of interspersed = len(arr) + len(arr)-1', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.integer(),\n (arr, delimiter) => {\n const actual = Jam.intersperse(arr, delimiter);\n const expected = arr.length === 0 ? 0 : arr.length * 2 - 1;\n Assert.eq('eq', expected, actual.length);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/IntersperseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The length of the array returned by `Jam.intersperse` should be `2 * len(arr) - 1` if the array is not empty; otherwise, the length should be `0`.", "mode": "fast-check"} {"id": 59101, "name": "unknown", "code": "UnitTest.test('Every odd element matches delimiter', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.integer(),\n (arr, delimiter) => {\n const actual = Jam.intersperse(arr, delimiter);\n return Arr.forall(actual, (x, i) => i % 2 === 1 ? x === delimiter : true);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/IntersperseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Each odd-indexed element in the result of `Jam.intersperse` should match the delimiter.", "mode": "fast-check"} {"id": 59102, "name": "unknown", "code": "UnitTest.test('Filtering out delimiters (assuming different type to array to avoid removing original array) should equal original', () => {\n fc.assert(fc.property(\n fc.array(fc.nat()),\n arbNegativeInteger(),\n (arr, delimiter) => {\n const actual = Jam.intersperse(arr, delimiter);\n const filtered = Arr.filter(actual, (a) => a !== delimiter);\n Assert.eq('eq', arr, filtered);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/IntersperseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Filtering out the delimiter from an interspersed array should result in an array equal to the original array.", "mode": "fast-check"} {"id": 59104, "name": "unknown", "code": "UnitTest.test('Arr.groupBy: Adjacent groups have different hashes, and everything in a group has the same hash', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.func(fc.asciiString()),\n (xs, f) => {\n const groups = Arr.groupBy(xs, (x) => f(x));\n\n /* Properties about groups\n * 1. No two adjacent groups can have the same g(..) value\n * 2. Each group must have the same g(..) value\n */\n\n const hasEmptyGroups = Arr.exists(groups, (g) => g.length === 0);\n\n if (hasEmptyGroups) {\n Assert.fail('Should not have empty groups');\n }\n // No consecutive groups should have the same result of g.\n const values = Arr.map(groups, (group) => {\n const first = f(group[0]);\n const mapped = Arr.map(group, (g) => f(g));\n\n const isSame = Arr.forall(mapped, (m) => m === first);\n if (!isSame) {\n Assert.fail('Not everything in a group has the same g(..) value');\n }\n return first;\n });\n\n const hasSameGroup = Arr.exists(values, (v, i) => i > 0 ? values[i - 1] === values[i] : false);\n\n if (hasSameGroup) {\n Assert.fail('A group is next to another group with the same g(..) value');\n }\n return true;\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/GroupByTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Adjacent groups returned by `Arr.groupBy` have different hash values, and all elements within a group have the same hash value.", "mode": "fast-check"} {"id": 59105, "name": "unknown", "code": "UnitTest.test('Flattening groups equals the original array', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.func(fc.string()),\n (xs, f) => {\n const groups = Arr.groupBy(xs, (x) => f(x));\n\n const output = Arr.flatten(groups);\n Assert.eq('eq', xs, output);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/GroupByTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Flattening grouped arrays should result in an array equal to the original array.", "mode": "fast-check"} {"id": 59106, "name": "unknown", "code": "UnitTest.test('forall of a non-empty array with a predicate that always returns false is false', () => {\n fc.assert(fc.property(\n fc.array(fc.integer(), 1, 30),\n (xs) => {\n const output = Arr.forall(xs, Fun.constant(false));\n Assert.eq('eq', false, output);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ForallTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.forall` applied to a non-empty integer array with a predicate that always returns false should return false.", "mode": "fast-check"} {"id": 59107, "name": "unknown", "code": "UnitTest.test('forall of a non-empty array with a predicate that always returns true is true', () => {\n fc.assert(fc.property(\n fc.array(fc.integer(), 1, 30),\n (xs) => {\n const output = Arr.forall(xs, Fun.constant(true));\n Assert.eq('eq', true, output);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ForallTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.forall` returns true for non-empty arrays when the predicate always returns true.", "mode": "fast-check"} {"id": 59108, "name": "unknown", "code": "UnitTest.test('foldl concat [ ] xs === reverse(xs)', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n (arr: number[]) => {\n const output: number[] = Arr.foldl(arr, (b: number[], a: number) => [ a ].concat(b), [ ]);\n Assert.eq('eq', Arr.reverse(arr), output);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/FoldTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Folding an array with a concatenation function should produce the same result as reversing the array.", "mode": "fast-check"} {"id": 59109, "name": "unknown", "code": "UnitTest.test('foldr concat [ ] xs === xs', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n (arr: number[]) => {\n const output = Arr.foldr(arr, (b: number[], a: number) => [ a ].concat(b), [ ]);\n Assert.eq('eq', arr, output);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/FoldTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should hold that folding an array from the right using concatenation with an empty array results in the original array.", "mode": "fast-check"} {"id": 59110, "name": "unknown", "code": "UnitTest.test('foldr concat ys xs === xs ++ ys', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.array(fc.integer()),\n (xs, ys) => {\n const output = Arr.foldr(xs, (b, a) => [ a ].concat(b), ys);\n Assert.eq('eq', xs.concat(ys), output);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/FoldTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Concatenating two arrays using `foldr` should produce the same result as directly concatenating the arrays with `concat`.", "mode": "fast-check"} {"id": 59111, "name": "unknown", "code": "UnitTest.test('foldl concat ys xs === reverse(xs) ++ ys', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.array(fc.integer()),\n (xs, ys) => {\n const output = Arr.foldl(xs, (b, a) => [ a ].concat(b), ys);\n Assert.eq('eq', Arr.reverse(xs).concat(ys), output);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/FoldTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `foldl` combines two arrays by prepending the reversed first array to the second array, verifying that this operation results in the same outcome as reversing the first array and then concatenating it with the second array.", "mode": "fast-check"} {"id": 59112, "name": "unknown", "code": "UnitTest.test('Arr.flatten: consistent with chunking', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.integer(1, 5),\n (arr, chunkSize) => {\n const chunks = Arr.chunk(arr, chunkSize);\n const bound = Arr.flatten(chunks);\n return Assert.eq('chunking', arr, bound);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/FlattenTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.flatten` should produce an array identical to the original when applied to arrays that have been chunked and then flattened.", "mode": "fast-check"} {"id": 59113, "name": "unknown", "code": "UnitTest.test('Arr.flatten: Wrap then flatten array is identity', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n Assert.eq('wrap then flatten', Arr.flatten(Arr.pure(arr)), arr);\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/FlattenTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Flattening an array wrapped with `Arr.pure` results in the original array.", "mode": "fast-check"} {"id": 59114, "name": "unknown", "code": "UnitTest.test('Mapping pure then flattening array is identity', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n Assert.eq('map pure then flatten', Arr.flatten(Arr.map(arr, Arr.pure)), arr);\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/FlattenTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Mapping an array with `Arr.pure` and then flattening it should result in the original array.", "mode": "fast-check"} {"id": 59116, "name": "unknown", "code": "UnitTest.test('Arr.findIndex: find in middle of array', () => {\n fc.assert(fc.property(fc.array(fc.nat()), arbNegativeInteger(), fc.array(fc.nat()), (prefix, element, suffix) => {\n const arr = prefix.concat([ element ]).concat(suffix);\n Assert.eq(\n 'Element should be found immediately after the prefix array',\n Option.some(prefix.length),\n Arr.findIndex(arr, (x) => x === element),\n tOption(tNumber)\n );\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/FindIndexTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.findIndex` returns the index of a specified element placed immediately after a prefix array within a concatenated array.", "mode": "fast-check"} {"id": 59117, "name": "unknown", "code": "UnitTest.test('Arr.findIndex: Element found passes predicate', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n const pred = (x) => x % 3 === 0;\n return Arr.findIndex(arr, pred).forall((x) => pred(arr[x]));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/FindIndexTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.findIndex` returns an index where the element in the array satisfies the given predicate.", "mode": "fast-check"} {"id": 59118, "name": "unknown", "code": "UnitTest.test('Arr.findIndex: If predicate is always false, then index is always none', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n Assert.eq('should be none', Option.none(), Arr.findIndex(arr, () => false), tOption(tNumber));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/FindIndexTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.findIndex` should return `Option.none()` when the predicate function always evaluates to false for any array of integers.", "mode": "fast-check"} {"id": 59119, "name": "unknown", "code": "UnitTest.test('Arr.findIndex: consistent with find', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n const pred = (x) => x % 5 === 0;\n Assert.eq('findIndex vs find', Arr.find(arr, pred), Arr.findIndex(arr, pred).map((x) => arr[x]), tOption(tNumber));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/FindIndexTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.findIndex` and `Arr.find` should both locate elements satisfying a predicate for divisibility by 5, ensuring consistent results between the found element and its index.", "mode": "fast-check"} {"id": 59120, "name": "unknown", "code": "UnitTest.test('Arr.findIndex: consistent with exists', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n const pred = (x) => x % 6 === 0;\n Assert.eq('findIndex vs find', Arr.exists(arr, pred), Arr.findIndex(arr, pred).isSome());\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/FindIndexTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.findIndex` should return a result consistent with `Arr.exists`, where finding an index means the predicate is satisfied.", "mode": "fast-check"} {"id": 59121, "name": "unknown", "code": "UnitTest.test('Element exists in middle of array', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), fc.array(fc.integer()), (prefix, element, suffix) => {\n const arr2 = Arr.flatten([ prefix, [ element ], suffix ]);\n Assert.eq('in array', true, Arr.exists(arr2, eqc(element)));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ExistsTest.ts", "start_line": null, "end_line": null, "dependencies": ["eqc"], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "An element placed in the middle of a flattened array should be detected as existing within that array.", "mode": "fast-check"} {"id": 59122, "name": "unknown", "code": "UnitTest.test('Element exists in singleton array of itself', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (i) => {\n Assert.eq('in array', true, Arr.exists([ i ], eqc(i)));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ExistsTest.ts", "start_line": null, "end_line": null, "dependencies": ["eqc"], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.exists` should return true when checking if an integer exists in a singleton array containing that integer.", "mode": "fast-check"} {"id": 54880, "name": "unknown", "code": "it(\"should always return notice\", async () => {\n const file = \"foo.coffee\";\n const root = await tempFs.create({ [file]: \"\" });\n const wrapper = new CoffeeLintCliWrapper(\n {\n level: Levels.INFO,\n fix: false,\n root,\n files: [file],\n },\n {\n /* eslint-disable camelcase */\n no_tabs: { level: \"error\" },\n prefer_english_operator: { level: \"warn\" },\n /* eslint-enable camelcase */\n },\n );\n\n await fc.assert(\n fc.asyncProperty(\n fc.string({ unit: \"binary\" }),\n async (content) => {\n await fs.writeFile(file, content);\n\n const notices = await wrapper.lint(file);\n for (const notice of notices) {\n assert.equal(notice.file, file);\n assert.equal(notice.linter, \"coffeelint__cli\");\n }\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/regseb/metalint/test/fuzz/core/wrapper/coffeelint__cli.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "regseb/metalint", "url": "https://github.com/regseb/metalint.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "`CoffeeLintCliWrapper` should always return notices with the correct file and linter name when linting a file with any binary string content.", "mode": "fast-check"} {"id": 59123, "name": "unknown", "code": "UnitTest.test('Element does not exist in empty array', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (i) => {\n Assert.eq('not in empty array', false, Arr.exists([], eqc(i)));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ExistsTest.ts", "start_line": null, "end_line": null, "dependencies": ["eqc"], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Verifies that searching for any element in an empty array results in `Arr.exists` returning false.", "mode": "fast-check"} {"id": 59125, "name": "unknown", "code": "UnitTest.test('Element exists in non-empty array when predicate always returns true', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), (xs, x) => {\n const arr = Arr.flatten([ xs, [ x ]]);\n return Arr.exists(arr, always);\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ExistsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "An element exists in a non-empty array if the predicate always returns true.", "mode": "fast-check"} {"id": 59127, "name": "unknown", "code": "UnitTest.test('difference: \u2200 xs ys. x \u2208 (ys - xs) -> x \u2209 ys', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.array(fc.integer()), (xs, ys) => {\n const diff = Arr.difference(ys, xs);\n return Arr.forall(diff, (d) => Arr.contains(ys, d));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/DifferenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.difference` results in elements that are present in the first array but not in the second, ensuring every element in the result exists in the first array.", "mode": "fast-check"} {"id": 59129, "name": "unknown", "code": "UnitTest.test('Chunking should create an array of the appropriate length except for the last one', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.nat(),\n (arr, rawChunkSize) => {\n // ensure chunkSize is at least one\n const chunkSize = rawChunkSize + 1;\n const chunks = Arr.chunk(arr, chunkSize);\n\n const hasRightSize = (part) => part.length === chunkSize;\n\n const numChunks = chunks.length;\n const firstParts = chunks.slice(0, numChunks - 1);\n Assert.eq('Incorrect chunk size', true, Arr.forall(firstParts, hasRightSize));\n if (arr.length === 0) {\n Assert.eq('empty', [], chunks, tArray(tArray(tNumber)));\n } else {\n Assert.eq('nonEmpty', true, chunks[chunks.length - 1].length <= chunkSize);\n }\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ChunkTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Chunking an array should result in all chunks, except possibly the last one, having the specified length, and the last chunk should not exceed this length.", "mode": "fast-check"} {"id": 59131, "name": "unknown", "code": "UnitTest.test('Cell: cell(x).get() === x', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n const cell = Cell(i);\n Assert.eq('eq', i, cell.get());\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/struct/CellTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "A `Cell` initialized with an integer returns that integer when `get()` is called.", "mode": "fast-check"} {"id": 59132, "name": "unknown", "code": "UnitTest.test('Cell: cell.get() === last set call', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), fc.integer(), (a, b, c) => {\n const cell = Cell(a);\n Assert.eq('a', a, cell.get());\n cell.set(b);\n Assert.eq('b', b, cell.get());\n cell.set(c);\n Assert.eq('c', c, cell.get());\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/struct/CellTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "A `Cell` should return the value set by the most recent `set` call.", "mode": "fast-check"} {"id": 59133, "name": "unknown", "code": "UnitTest.test('Arr.last: nonEmpty', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), (init, last) => {\n const arr = init.concat([ last ]);\n Assert.eq('nonEmpty', Option.some(last), Arr.last(arr), tOption(tNumber));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ArrLastTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.last` retrieves the last element of a non-empty integer array, matching it with the expected value.", "mode": "fast-check"} {"id": 59134, "name": "unknown", "code": "UnitTest.test('Arr.head: nonEmpty', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), (t, h) => {\n const arr = [ h ].concat(t);\n Assert.eq('nonEmpty', Option.some(h), Arr.head(arr), tOption(tNumber));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ArrHeadTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.head` returns the first element of a non-empty array when a head element is prepended to an integer array.", "mode": "fast-check"} {"id": 59135, "name": "unknown", "code": "UnitTest.test('Arr.find: finds a value in the array', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), fc.array(fc.integer()), (prefix, i, suffix) => {\n const arr = prefix.concat([ i ]).concat(suffix);\n const pred = (x) => x === i;\n const result = Arr.find(arr, pred);\n Assert.eq('Element found in array', Option.some(i), result, tOption(tNumber));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ArrFindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.find` locates a specified integer within a concatenated array of integers, confirming the element is found.", "mode": "fast-check"} {"id": 59136, "name": "unknown", "code": "UnitTest.test('Arr.find: value not found', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n const result = Arr.find(arr, () => false);\n Assert.eq('Element not found in array', Option.none(), result, tOption(tNumber));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ArrFindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.find` should return `Option.none()` when no element satisfies the condition in the array.", "mode": "fast-check"} {"id": 59137, "name": "unknown", "code": "UnitTest.test('Arr.findMap of non-empty is first if f is Option.some', () => {\n fc.assert(fc.property(\n fc.integer(),\n fc.array(fc.integer()),\n (head, tail) => {\n const arr = [ head, ...tail ];\n Assert.eq('eq', Option.some(head), Arr.findMap(arr, Option.some), tOption());\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ArrFindMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.findMap` applied to a non-empty array should return the first element as `Option.some` if `f` consistently returns `Option.some`.", "mode": "fast-check"} {"id": 59138, "name": "unknown", "code": "UnitTest.test('Arr.findMap of non-empty is none if f is Option.none', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n (arr) => {\n Assert.eq('eq', Option.none(), Arr.findMap(arr, () => Option.none()), tOption());\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ArrFindMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.findMap` returns `Option.none` when applied to a non-empty array with a function that always returns `Option.none`.", "mode": "fast-check"} {"id": 59139, "name": "unknown", "code": "UnitTest.test('Arr.findMap finds an element', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.integer(),\n fc.integer(),\n fc.array(fc.integer()),\n (prefix, element, ret, suffix) => {\n const arr = [ ...prefix, element, ...suffix ];\n Assert.eq('eq', Option.some(ret), Arr.findMap(arr, (x) => Options.someIf(x === element, ret)), tOption());\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ArrFindMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.findMap` should return `Some(ret)` when it finds an element matching the condition in the array.", "mode": "fast-check"} {"id": 59140, "name": "unknown", "code": "UnitTest.test('Arr.findMap does not find an element', () => {\n fc.assert(fc.property(\n fc.array(fc.nat()),\n fc.nat(),\n (arr, ret) => {\n Assert.eq('eq', Option.none(), Arr.findMap(arr, (x) => Options.someIf(x === -1, ret)), tOption());\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ArrFindMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.findMap` returns `Option.none()` when it does not find an element matching a condition in an array of natural numbers.", "mode": "fast-check"} {"id": 59144, "name": "unknown", "code": "UnitTest.test('Arr.bind: Monad Law: right identity', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n Assert.eq('right id', arr, Arr.bind(arr, Arr.pure), tArray(tNumber));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ArrBindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.bind` satisfies the right identity monad law when binding an array with `Arr.pure` returns the original array.", "mode": "fast-check"} {"id": 59145, "name": "unknown", "code": "UnitTest.test('Arr.bind: Monad Law: associativity', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), (arr, j) => {\n const f = (x: number) => [ x, j, x + j ];\n const g = (x: number) => [ j, x, x + j ];\n Assert.eq('assoc', Arr.bind(arr, (x) => Arr.bind(f(x), g)), Arr.bind(Arr.bind(arr, f), g), tArray(tNumber));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ArrBindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Associativity for `Arr.bind` ensures that applying nested bindings with functions `f` and `g` to an array is equivalent to sequentially applying `f` and then `g`.", "mode": "fast-check"} {"id": 59146, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(MAC(), async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should ensure that when the input value is transformed to uppercase, the `input` element remains valid.", "mode": "fast-check"} {"id": 59147, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.MAC), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Editing is disallowed if the input value does not match the `regExp.MAC` pattern, resulting in `checkValidity()` returning false.", "mode": "fast-check"} {"id": 59148, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n hexaString({ minLength: 4, maxLength: 4 }),\n async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Editing is allowed when the input value is a valid uppercase hexadecimal string of length 4.", "mode": "fast-check"} {"id": 59149, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(hexaString({ minLength: 5 }), async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that input fields with invalid hexadecimal values do not pass validity checks after updating.", "mode": "fast-check"} {"id": 59150, "name": "unknown", "code": "it('does not allow to edit characters < 4', async () =>\n await fc.assert(\n fc.asyncProperty(\n hexaString({ minLength: 0, maxLength: 3 }),\n async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Editing is disallowed for hexadecimal strings with fewer than 4 characters, ensuring `checkValidity()` returns false for such inputs.", "mode": "fast-check"} {"id": 59152, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(hexaString({ minLength: 4 }), async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Editing is disallowed if the input value is an invalid uppercase hexadecimal string with a minimum length of four characters.", "mode": "fast-check"} {"id": 59153, "name": "unknown", "code": "it('does not allow to edit characters < 3', async () =>\n await fc.assert(\n fc.asyncProperty(\n hexaString({ minLength: 0, maxLength: 2 }),\n async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Input values with fewer than 3 characters are considered invalid.", "mode": "fast-check"} {"id": 59155, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 8 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Editing is disallowed for input values that are invalid, as determined by the `checkValidity` method.", "mode": "fast-check"} {"id": 59156, "name": "unknown", "code": "it('edits name attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tAsciName, 1, 32), async name => {\n inputs[0].value = name;\n await (inputs[0]).requestUpdate();\n expect(inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Checks that the name attribute is only edited for inputs matching a valid ASCII name pattern.", "mode": "fast-check"} {"id": 59157, "name": "unknown", "code": "it('rejects name attribute starting with decimals', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal, 1, 1), async name => {\n inputs[0].value = name;\n await (inputs[0]).requestUpdate();\n expect(inputs[0].checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The name attribute is invalid if it starts with a decimal.", "mode": "fast-check"} {"id": 59159, "name": "unknown", "code": "it('rejects smpRate attribute in case input is not unsigned int', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.uint, 1),\n async smpRate => {\n inputs[4].value = smpRate;\n await (inputs[4]).requestUpdate();\n expect(inputs[4].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Rejects `smpRate` attribute if input is not an unsigned integer.", "mode": "fast-check"} {"id": 59160, "name": "unknown", "code": "it('edits nofASDU attribute only for valid inputs', async () => {\n const input = inputs[5];\n input.nullSwitch?.click();\n await input.requestUpdate();\n\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 0 }).map(num => `${num}`),\n async nofASDU => {\n input.value = nofASDU;\n await input.requestUpdate();\n expect(input.checkValidity()).to.be.true;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Editing the `nofASDU` attribute maintains validity for non-negative integer inputs.", "mode": "fast-check"} {"id": 59161, "name": "unknown", "code": "it('rejects nofASDU attribute in case input is not unsigned int', async () => {\n const input = inputs[5];\n input.nullSwitch?.click();\n await input.requestUpdate();\n\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.uint, 1),\n async nofASDU => {\n input.value = nofASDU;\n await input.requestUpdate();\n expect(input.checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that the `nofASDU` attribute is invalid when the input value is not an unsigned integer.", "mode": "fast-check"} {"id": 59162, "name": "unknown", "code": "it('edits name attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tAsciName, 1, 32), async name => {\n inputs[0].value = name;\n await (inputs[0]).requestUpdate();\n expect(inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Edits to the name attribute are allowed only when the inputs meet the valid format specified by the `tAsciName` regular expression.", "mode": "fast-check"} {"id": 59163, "name": "unknown", "code": "it('rejects name attribute starting with decimals', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal, 1, 1), async name => {\n inputs[0].value = name;\n await (inputs[0]).requestUpdate();\n expect(inputs[0].checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures that a name attribute starting with a decimal value is considered invalid.", "mode": "fast-check"} {"id": 59165, "name": "unknown", "code": "it('rejects bufTime attribute starting with not being a unsigned int', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.uint, 1),\n async bufTime => {\n inputs[6].value = bufTime;\n await (inputs[6]).requestUpdate();\n expect(inputs[6].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Checks that a `bufTime` attribute starting with a non-unsigned integer is invalid.", "mode": "fast-check"} {"id": 59166, "name": "unknown", "code": "it('edits intgPd attribute only for valid inputs', async () => {\n const input = inputs[7];\n input.nullSwitch?.click();\n await input.requestUpdate();\n\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 0 }).map(num => `${num}`),\n async intgPd => {\n input.value = intgPd;\n await input.requestUpdate();\n expect(input.checkValidity()).to.be.true;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Edits the `intgPd` attribute only when the input is a valid non-negative integer string.", "mode": "fast-check"} {"id": 59167, "name": "unknown", "code": "it('rejects intgPd attribute starting with not being a unsigned int', async () => {\n const input = inputs[7];\n input.nullSwitch?.click();\n await input.requestUpdate();\n\n await fc.assert(\n fc.asyncProperty(regexString(inverseRegExp.uint, 1), async intgPd => {\n input.value = intgPd;\n await input.requestUpdate();\n expect(input.checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `intgPd` attribute should be rejected if it starts as a non-unsigned integer.", "mode": "fast-check"} {"id": 59168, "name": "unknown", "code": "it('edits prefix attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tAsciName, 1, 11), async name => {\n inputs[2].value = name;\n await (inputs[2]).requestUpdate();\n expect(inputs[2].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/lnode.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Editing the prefix attribute is valid only for inputs that match the specified regex pattern.", "mode": "fast-check"} {"id": 59169, "name": "unknown", "code": "it('rejects name attribute starting with decimals', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal, 1, 1), async name => {\n inputs[2].value = name;\n await (inputs[2]).requestUpdate();\n expect(inputs[2].checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/lnode.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Name attributes starting with decimals are rejected as invalid.", "mode": "fast-check"} {"id": 59170, "name": "unknown", "code": "it('edits name attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tAsciName, 1, 32), async name => {\n nameTextField.value = name;\n await nameTextField.requestUpdate();\n expect(nameTextField.checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/gsecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Editing the name attribute should only be successful for inputs that match the `regExp.tAsciName` pattern with lengths between 1 and 32 characters.", "mode": "fast-check"} {"id": 59178, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(regExp.OSI, 1, 8), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "An input value matching the specified regex pattern should be valid when edited.", "mode": "fast-check"} {"id": 59180, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSI, 1, 16),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The input value based on a specific regex pattern should always be valid for editing, ensuring `checkValidity` returns true.", "mode": "fast-check"} {"id": 59182, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSI, 1, 16),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Editing is allowed when the input value matches the regex pattern `regExp.OSI` and is of valid length (1 to 16 characters), ensuring `input.checkValidity()` returns true.", "mode": "fast-check"} {"id": 59184, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(regExp.OSIAPi, 1), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Editing is allowed when the input matches a specified OSIAP pattern.", "mode": "fast-check"} {"id": 59185, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSIAPi), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Editing is disallowed for invalid input when `input.checkValidity()` returns false.", "mode": "fast-check"} {"id": 59186, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSIid, 1, 5),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Valid input strings matching `regExp.OSIid` pattern enable editing by passing a validity check.", "mode": "fast-check"} {"id": 59187, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSIid), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Invalid input based on `OSIid` regex should not be editable as determined by `checkValidity` returning false.", "mode": "fast-check"} {"id": 59188, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSIid, 1, 5),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Editing should be allowed for inputs that match the valid OSI identifier pattern.", "mode": "fast-check"} {"id": 59189, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSIid), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Editing is disallowed for inputs that do not match the `OSIid` regular expression, ensuring `checkValidity` returns false.", "mode": "fast-check"} {"id": 59190, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSIid, 1, 5),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Editing is allowed for inputs matching the `OSIid` regular expression, when the input's validity is checked.", "mode": "fast-check"} {"id": 59191, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSIid), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Editing is disallowed for inputs that do not match a valid `OSIid` pattern.", "mode": "fast-check"} {"id": 59192, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSI, 1, 40),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that input values matching the `regExp.OSI` regex pattern are considered valid when edited, verifying `checkValidity` returns true.", "mode": "fast-check"} {"id": 59194, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(regExp.OSI, 3, 3), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Editing is allowed if the input value matches a specific OSI regex pattern.", "mode": "fast-check"} {"id": 59196, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(/^[0-7]$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Editing should be allowed for inputs consisting of single characters between '0' and '7'.", "mode": "fast-check"} {"id": 59200, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n nat({ max: 65535 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Input values between 0 and 65535 should be valid for editing, with `checkValidity()` returning true.", "mode": "fast-check"} {"id": 59250, "name": "unknown", "code": "UnitTest.test('DialogChanges.init - no initial data', () => {\n const dialogChange = DialogChanges.init({ title: '', text: '' } as LinkDialogData, { } as LinkDialogCatalog);\n\n fc.assert(fc.property(fc.webUrl(), fc.asciiString(), fc.asciiString(), (url, title, text) => {\n const data = Fun.constant({ url: {\n value: url,\n meta: { title, text }\n }} as LinkDialogData);\n const dataNoMeta = Fun.constant({ url: {\n value: url,\n meta: { }\n }} as LinkDialogData);\n\n Assert.eq('on url change should include url title and text',\n Optional.some>({ title, text }),\n dialogChange.onChange(data, { name: 'url' }),\n tOptional()\n );\n\n Assert.eq('on url change should fallback to url for text',\n Optional.some>({ title: '', text: url }),\n dialogChange.onChange(dataNoMeta, { name: 'url' }),\n tOptional()\n );\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/tinymce/src/plugins/link/test/ts/atomic/DialogChangesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`DialogChanges.init` processes `url` changes, updating with `title` and `text` from metadata or defaulting text to `url` if metadata is absent.", "mode": "fast-check"} {"id": 59251, "name": "unknown", "code": "UnitTest.test('DialogChanges.init - with original data', () => {\n const dialogChange = DialogChanges.init({ title: 'orig title', text: 'orig text' } as LinkDialogData, { } as LinkDialogCatalog);\n const dialogChangeNoTitle = DialogChanges.init({ title: '', text: 'orig text' } as LinkDialogData, { } as LinkDialogCatalog);\n const dialogChangeNoText = DialogChanges.init({ title: 'orig title', text: '' } as LinkDialogData, { } as LinkDialogCatalog);\n\n fc.assert(fc.property(fc.webUrl(), fc.asciiString(), fc.asciiString(), (url, title, text) => {\n const data = Fun.constant({ url: {\n value: url,\n meta: { title, text }\n }} as LinkDialogData);\n\n Assert.eq('on url change should not try to change title and text',\n Optional.none(),\n dialogChange.onChange(data, { name: 'url' }),\n tOptional()\n );\n\n Assert.eq('No Title - on url change should only try to change title',\n Optional.some>({ title }),\n dialogChangeNoTitle.onChange(data, { name: 'url' }),\n tOptional()\n );\n\n Assert.eq('No Text - on url change should only try to change text',\n Optional.some>({ text }),\n dialogChangeNoText.onChange(data, { name: 'url' }),\n tOptional()\n );\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/tinymce/src/plugins/link/test/ts/atomic/DialogChangesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `DialogChanges.init` function should handle original data such that changing the URL does not modify title or text if both are present, modifies only the title if the title is absent, and modifies only the text if the text is absent.", "mode": "fast-check"} {"id": 59289, "name": "unknown", "code": "UnitTest.test('leftTrim(whitespace + s) === leftTrim(s)', () => {\n fc.assert(fc.property(\n fc.string(),\n (s) => {\n Assert.eq('leftTrim', Strings.lTrim(' ' + s), Strings.lTrim(s), tString);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/str/TrimTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Strings.lTrim` should produce the same result whether or not the input string is preceded by a whitespace character.", "mode": "fast-check"} {"id": 54890, "name": "unknown", "code": "it(\"tanh forward pass property: tanh(a).data === Math.tanh(a.data)\", () => {\n // Avoid large inputs to tanh where output is exactly +/-1, might cause gradient issues if not handled carefully later\n const boundedValueArbitrary = fc\n .float({ min: -10, max: 10, noNaN: true })\n .map((n) => eng.value(n));\n fc.assert(\n fc.property(boundedValueArbitrary, (a) => {\n const result = eng.tanh(a);\n return closeTo(result.data, Math.tanh(a.data));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/ianchanning/neural-network-js/engine.test.js", "start_line": null, "end_line": null, "dependencies": ["closeTo"], "repo": {"name": "ianchanning/neural-network-js", "url": "https://github.com/ianchanning/neural-network-js.git", "license": "MIT", "stars": 9, "forks": 0}, "metrics": null, "summary": "The `tanh` forward pass should return a value close to `Math.tanh` for the same input data within a specified tolerance.", "mode": "fast-check"} {"id": 59290, "name": "unknown", "code": "UnitTest.test('rightTrim(s + whitespace) === rightTrim(s)', () => {\n fc.assert(fc.property(\n fc.string(),\n (s) => {\n Assert.eq('rightTrim', Strings.rTrim(s + ' '), Strings.rTrim(s), tString);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/str/TrimTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Strings.rTrim` should produce the same result whether whitespace is appended to the input string or not.", "mode": "fast-check"} {"id": 54891, "name": "unknown", "code": "it(\"add backward pass gradient property\", () => {\n fc.assert(\n fc.property(valueArbitrary, valueArbitrary, (a, b) => {\n // Need fresh values for each run to avoid grad accumulation across properties\n const fresh_a = eng.value(a.data);\n const fresh_b = eng.value(b.data);\n const result = eng.add(fresh_a, fresh_b);\n eng.backward(result);\n // Check gradients are approximately 1.0 (scaled by result.grad which is 1.0)\n return closeTo(fresh_a.grad, 1.0) && closeTo(fresh_b.grad, 1.0);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/ianchanning/neural-network-js/engine.test.js", "start_line": null, "end_line": null, "dependencies": ["closeTo"], "repo": {"name": "ianchanning/neural-network-js", "url": "https://github.com/ianchanning/neural-network-js.git", "license": "MIT", "stars": 9, "forks": 0}, "metrics": null, "summary": "The gradients computed during the backward pass after adding two values should be approximately 1.0 for each value.", "mode": "fast-check"} {"id": 59291, "name": "unknown", "code": "UnitTest.test('trim(whitespace + s) === trim(s)', () => {\n fc.assert(fc.property(\n fc.string(),\n (s) => {\n Assert.eq('trim', Strings.trim(' ' + s), Strings.trim(s), tString);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/str/TrimTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Trimming a string with leading whitespace should yield the same result as trimming the string without the whitespace.", "mode": "fast-check"} {"id": 59292, "name": "unknown", "code": "UnitTest.test('trim(s + whitespace) === trim(s)', () => {\n fc.assert(fc.property(\n fc.string(),\n (s) => {\n Assert.eq('trim', Strings.trim(s + ' '), Strings.trim(s), tString);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/str/TrimTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `trim` function should remove trailing whitespace from a string, resulting in the same output whether the string ends with whitespace or not.", "mode": "fast-check"} {"id": 59293, "name": "unknown", "code": "UnitTest.test('trim(whitespace + s + whitespace) === trim(s)', () => {\n fc.assert(fc.property(\n fc.string(),\n (s) => {\n Assert.eq('trim', Strings.trim(' ' + s + ' '), Strings.trim(s), tString);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/str/TrimTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Trimming whitespace from the beginning and end of a string should produce the same result as trimming the string alone.", "mode": "fast-check"} {"id": 59294, "name": "unknown", "code": "UnitTest.test('Strings.repeat: positive range', () => {\n fc.assert(fc.property(fc.char(), fc.integer(1, 100), (c, count) => {\n const actual = Strings.repeat(c, count);\n Assert.eq('length should be the same as count', count, actual.length);\n Assert.eq('first char should be the same', c, actual.charAt(0));\n Assert.eq('last char should be the same', c, actual.charAt(actual.length - 1));\n }));\n\n fc.assert(fc.property(fc.asciiString(5), fc.integer(1, 100), (s, count) => {\n const actual = Strings.repeat(s, count);\n Assert.eq('length should be count * original length', count * s.length, actual.length);\n Assert.eq('should start with string', 0, actual.indexOf(s));\n Assert.eq('should end with string', actual.length - s.length, actual.lastIndexOf(s));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/str/RepeatTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `Strings.repeat` function should produce a string with the correct length and identical start and end characters or substring, when repeating a single character or a string respectively.", "mode": "fast-check"} {"id": 54895, "name": "unknown", "code": "it(\"mul commutativity property (data only)\", () => {\n fc.assert(\n fc.property(valueArbitrary, valueArbitrary, (a, b) => {\n const res1 = eng.mul(a, b);\n const res2 = eng.mul(b, a);\n return closeTo(res1.data, res2.data);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/ianchanning/neural-network-js/engine.test.js", "start_line": null, "end_line": null, "dependencies": ["closeTo"], "repo": {"name": "ianchanning/neural-network-js", "url": "https://github.com/ianchanning/neural-network-js.git", "license": "MIT", "stars": 9, "forks": 0}, "metrics": null, "summary": "Multiplication is commutative, ensuring `eng.mul(a, b)` equals `eng.mul(b, a)` for their data properties within a specified tolerance.", "mode": "fast-check"} {"id": 59295, "name": "unknown", "code": "UnitTest.test('Strings.repeat: positive range', () => {\n fc.assert(fc.property(fc.char(), fc.integer(1, 100), (c, count) => {\n const actual = Strings.repeat(c, count);\n Assert.eq('length should be the same as count', count, actual.length);\n Assert.eq('first char should be the same', c, actual.charAt(0));\n Assert.eq('last char should be the same', c, actual.charAt(actual.length - 1));\n }));\n\n fc.assert(fc.property(fc.asciiString(5), fc.integer(1, 100), (s, count) => {\n const actual = Strings.repeat(s, count);\n Assert.eq('length should be count * original length', count * s.length, actual.length);\n Assert.eq('should start with string', 0, actual.indexOf(s));\n Assert.eq('should end with string', actual.length - s.length, actual.lastIndexOf(s));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/str/RepeatTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Strings.repeat` function correctly replicates characters or strings a specified number of times, maintaining expected length and preserving sequences at the start and end.", "mode": "fast-check"} {"id": 59296, "name": "unknown", "code": "UnitTest.test('Strings.repeat: negative range', () => {\n fc.assert(fc.property(fc.char(), fc.integer(-100, 0), (c, count) => {\n const actual = Strings.repeat(c, count);\n Assert.eq('length should be 0', 0, actual.length);\n Assert.eq('should be an empty string', '', actual);\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/str/RepeatTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Strings.repeat` with a negative or zero count produces an empty string with length 0.", "mode": "fast-check"} {"id": 54896, "name": "unknown", "code": "it('rejects usernames shorter than 4 characters', () => {\n\t\tfc.assert(\n\t\t\tfc.property(fc.string({ maxLength: 3 }), (username) => {\n\t\t\t\texpect(verifyUsernameInput(username)).toBe(false);\n\t\t\t}),\n\t\t\t{ numRuns: 200 } // fast-check default runs is 100\n\t\t);\n\t})", "language": "typescript", "source_file": "./repos/fdnd-agency/toolgankelijk/tests/property/verifyUsernameInput.property.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fdnd-agency/toolgankelijk", "url": "https://github.com/fdnd-agency/toolgankelijk.git", "license": "MIT", "stars": 0, "forks": 5}, "metrics": null, "summary": "Usernames shorter than 4 characters are rejected by `verifyUsernameInput`.", "mode": "fast-check"} {"id": 54897, "name": "unknown", "code": "it('rejects usernames longer than 31 characters', () => {\n\t\tfc.assert(\n\t\t\tfc.property(fc.string({ minLength: 32 }), (username) => {\n\t\t\t\texpect(verifyUsernameInput(username)).toBe(false);\n\t\t\t}),\n\t\t\t{ numRuns: 200 }\n\t\t);\n\t})", "language": "typescript", "source_file": "./repos/fdnd-agency/toolgankelijk/tests/property/verifyUsernameInput.property.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fdnd-agency/toolgankelijk", "url": "https://github.com/fdnd-agency/toolgankelijk.git", "license": "MIT", "stars": 0, "forks": 5}, "metrics": null, "summary": "`verifyUsernameInput` returns false for usernames longer than 31 characters.", "mode": "fast-check"} {"id": 59297, "name": "unknown", "code": "UnitTest.test('removeTrailing property', () => {\n fc.assert(fc.property(\n fc.asciiString(),\n fc.asciiString(),\n (prefix, suffix) => {\n Assert.eq('removeTrailing', prefix, Strings.removeTrailing(prefix + suffix, suffix));\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/str/RemoveTrailingTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`removeTrailing` should return the original prefix when it is concatenated with a suffix and the suffix is removed.", "mode": "fast-check"} {"id": 59300, "name": "unknown", "code": "UnitTest.test('ensureTrailing endsWith', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(),\n (s, suffix) => Strings.endsWith(Strings.ensureTrailing(s, suffix), suffix)\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/str/EnsureTrailingTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Strings.ensureTrailing` appends a suffix to a string if it's not already present, ensuring the result ends with the suffix.", "mode": "fast-check"} {"id": 59302, "name": "unknown", "code": "UnitTest.test('endsWith: A string added to a string (at the end) must have endsWith as true', () => {\n fc.assert(fc.property(\n fc.asciiString(),\n fc.asciiString(),\n (str, contents) => Strings.endsWith(str + contents, contents)\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/str/EndsWithTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "A string concatenated with another string at the end should have `endsWith` return true for the added string.", "mode": "fast-check"} {"id": 59303, "name": "unknown", "code": "UnitTest.test('A string with length 1 or larger should never be empty', () => {\n fc.assert(fc.property(fc.string(1, 40), (str) => {\n Assert.eq('isEmpty', false, Strings.isEmpty(str));\n Assert.eq('isNotEmpty', true, Strings.isNotEmpty(str));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/str/EmptyTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "A string with a length of 1 or more should not be identified as empty by both `Strings.isEmpty` and `Strings.isNotEmpty`.", "mode": "fast-check"} {"id": 59304, "name": "unknown", "code": "UnitTest.test('A string added to a string (at the end) must be contained within it', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(1, 40),\n (str, contents) => {\n const r = str + contents;\n Assert.eq('eq', true, Strings.contains(r, contents));\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/str/ContainsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Appending a string to another should result in the appended string being contained within the final string.", "mode": "fast-check"} {"id": 54901, "name": "unknown", "code": "test('should always include required headers', () => {\n fc.assert(\n fc.property(\n fc.webUrl(),\n fc.option(fc.dictionary(fc.string(), fc.string())),\n fc.option(fc.json()),\n async (url, headers, body) => {\n fetch.mockResolvedValue({\n ok: true,\n json: async () => ({})\n });\n\n await apiClient.request(url, {\n headers,\n body: body ? JSON.stringify(body) : undefined\n });\n\n const [, options] = fetch.mock.calls[0];\n \n // Should always have Content-Type\n expect(options.headers).toHaveProperty('Content-Type');\n \n // Should preserve custom headers\n if (headers) {\n Object.keys(headers).forEach(key => {\n expect(options.headers[key]).toBeDefined();\n });\n }\n }\n ),\n { numRuns: 100 }\n );\n })", "language": "typescript", "source_file": "./repos/rmusser01/tldw_BrowserExtension/Browser-Extension/tests/property/api-client.property.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "rmusser01/tldw_BrowserExtension", "url": "https://github.com/rmusser01/tldw_BrowserExtension.git", "license": "Apache-2.0", "stars": 1, "forks": 0}, "metrics": null, "summary": "The API client always includes the 'Content-Type' header and preserves any custom headers in requests.", "mode": "fast-check"} {"id": 59305, "name": "unknown", "code": "UnitTest.test('A string added to a string (at the start) must be contained within it', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(1, 40),\n (str, contents) => {\n const r = contents = str;\n Assert.eq('eq', true, Strings.contains(r, contents));\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/str/ContainsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "A string added at the start of another string should be contained within it.", "mode": "fast-check"} {"id": 59306, "name": "unknown", "code": "UnitTest.test('An empty string should contain nothing', () => {\n fc.assert(fc.property(\n fc.string(1, 40),\n (value) => !Strings.contains('', value)\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/str/ContainsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "An empty string should not contain any non-empty substring.", "mode": "fast-check"} {"id": 59307, "name": "unknown", "code": "UnitTest.test('capitalize: tail of the string is unchanged', () => {\n fc.assert(fc.property(fc.ascii(), fc.asciiString(30), (h, t) => {\n Assert.eq('tail', t, Strings.capitalize(h + t).substring(1), tString);\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/str/CapitalizeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test verifies that after capitalizing a string, the tail (all characters except the first one) remains unchanged.", "mode": "fast-check"} {"id": 59309, "name": "unknown", "code": "UnitTest.test('StringMatch.matches(StringMatch.starts(s1), s1 + s) === true', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(),\n (s, s1) => {\n Assert.eq('eq', true, StringMatch.matches(\n StringMatch.starts(s1, StringMatch.caseInsensitive),\n s1 + s\n ));\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`StringMatch.matches` should return true when a string starting with `s1` is concatenated with another string, ensuring a case-insensitive prefix match.", "mode": "fast-check"} {"id": 59314, "name": "unknown", "code": "UnitTest.test('StringMatch.matches(StringMatch.exact(s), s + s1) === false', () => {\n fc.assert(fc.property(\n fc.string(1, 40),\n fc.string(1, 40),\n (s, s1) => {\n Assert.eq('eq', false, StringMatch.matches(\n StringMatch.exact(s, StringMatch.caseInsensitive),\n s + s1\n ));\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`StringMatch.matches` returns false when checking if a string concatenated with another string matches exactly the original string.", "mode": "fast-check"} {"id": 59315, "name": "unknown", "code": "UnitTest.test('StringMatch.matches(StringMatch.exact(s), s1 + s) === false', () => {\n fc.assert(fc.property(\n fc.string(1, 40),\n fc.string(1, 40),\n (s, s1) => {\n Assert.eq('eq', false, StringMatch.matches(\n StringMatch.exact(s, StringMatch.caseInsensitive),\n s1 + s\n ));\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`StringMatch.matches` should return false when checking for an exact match of a string `s` at the end of another string `s1 + s`, indicating that `s` must be an exact match without any preceding characters.", "mode": "fast-check"} {"id": 59316, "name": "unknown", "code": "UnitTest.test('StringMatch.matches(StringMatch.exact(s), s) === true', () => {\n fc.assert(fc.property(\n fc.string(1, 40),\n (s) => {\n Assert.eq('eq', true, StringMatch.matches(\n StringMatch.exact(s, StringMatch.caseInsensitive),\n s\n ));\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Verifies that the `StringMatch.matches` function returns true when matching a string against itself using the `StringMatch.exact` method with case insensitivity.", "mode": "fast-check"} {"id": 59317, "name": "unknown", "code": "UnitTest.test('StringMatch.matches(StringMatch.exact(s), s) === false when different case and case-insensitive', () => {\n fc.assert(fc.property(\n fc.asciiString(1, 40),\n (s) => s.toUpperCase() === s.toLowerCase() || StringMatch.matches(\n StringMatch.exact(s.toLowerCase(), StringMatch.caseInsensitive),\n s.toUpperCase()\n )\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Verifies that `StringMatch.matches` returns false for exact matches when the strings have different cases, even with case-insensitivity enabled, unless the strings are identical when both are transformed to upper or lower case.", "mode": "fast-check"} {"id": 59318, "name": "unknown", "code": "UnitTest.test('StringMatch.matches(StringMatch.exact(s), s) === false when different case and case-sensitive', () => {\n fc.assert(fc.property(\n fc.asciiString(1, 40),\n (s) => s.toUpperCase() === s.toLowerCase() || !StringMatch.matches(\n StringMatch.exact(s.toLowerCase(), StringMatch.caseSensitive),\n s.toUpperCase()\n )\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`StringMatch.matches` returns false when comparing a lowercase string with its uppercase version if case-sensitive matching is specified.", "mode": "fast-check"} {"id": 59319, "name": "unknown", "code": "UnitTest.test('StringMatch.matches(StringMatch.all(s1), *) === true', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(),\n (s) => {\n Assert.eq('eq', true, StringMatch.matches(\n StringMatch.all(),\n s\n ));\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`StringMatch.matches` should always return true when using `StringMatch.all()` with any string.", "mode": "fast-check"} {"id": 59320, "name": "unknown", "code": "UnitTest.test('Optionals.cat of only nones should be an empty array', () => {\n fc.assert(fc.property(\n fc.array(ArbDataTypes.arbOptionalNone()),\n (options) => {\n const output = Optionals.cat(options);\n Assert.eq('eq', 0, output.length);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optionals.cat` returns an empty array when provided with an array of only `none` elements.", "mode": "fast-check"} {"id": 59321, "name": "unknown", "code": "UnitTest.test('Optionals.cat of only somes should have the same length', () => {\n fc.assert(fc.property(\n fc.array(ArbDataTypes.arbOptionalSome(fc.integer())),\n (options) => {\n const output = Optionals.cat(options);\n Assert.eq('eq', options.length, output.length);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optionals.cat` should output an array with the same length as the input array when composed only of `some` optional values.", "mode": "fast-check"} {"id": 59322, "name": "unknown", "code": "UnitTest.test('Optionals.cat of Arr.map(xs, Optional.some) should be xs', () => {\n fc.assert(fc.property(\n fc.array(fc.json()),\n (arr) => {\n const options = Arr.map(arr, Optional.some);\n const output = Optionals.cat(options);\n Assert.eq('eq', arr, output);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optionals.cat` applied to an array mapped with `Optional.some` should return the original array.", "mode": "fast-check"} {"id": 59323, "name": "unknown", "code": "UnitTest.test('Optionals.cat of somes and nones should have length <= original', () => {\n fc.assert(fc.property(\n fc.array(ArbDataTypes.arbOptional(fc.integer())),\n (arr) => {\n const output = Optionals.cat(arr);\n Assert.eq('eq', output.length <= arr.length, true);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optionals.cat` outputs an array whose length is less than or equal to the input array's length when composed of optional integers.", "mode": "fast-check"} {"id": 59325, "name": "unknown", "code": "UnitTest.test('Optionals.someIf: false -> none', () => {\n fc.assert(fc.property(fc.integer(), (n) => {\n Assert.eq('eq', Optional.none(), Optionals.someIf(false, n), tOptional());\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalsSomeIfTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optionals.someIf` should return `none` when the condition is false, regardless of the integer value provided.", "mode": "fast-check"} {"id": 59330, "name": "unknown", "code": "UnitTest.test('Optionals.sequence: Some then none', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (n) => {\n const someNumbers = Arr.map(n, (x) => Optional.some(x));\n Assert.eq('eq', Optional.none(), Optionals.sequence([ ...someNumbers, Optional.none() ]), tOptional());\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalsSequenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optionals.sequence` results in `Optional.none` when appending `Optional.none` to an array of `Optional.some` integers.", "mode": "fast-check"} {"id": 59331, "name": "unknown", "code": "UnitTest.test('Optionals.sequence: None then some', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (n) => {\n const someNumbers = Arr.map(n, (x) => Optional.some(x));\n Assert.eq('eq', Optional.none(), Optionals.sequence([ Optional.none(), ...someNumbers ]), tOptional());\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalsSequenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optionals.sequence` returns `Optional.none()` when the input array starts with `Optional.none()` followed by some `Optional.some()` values.", "mode": "fast-check"} {"id": 59332, "name": "unknown", "code": "UnitTest.test('Optionals.sequence: all some', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (n) =>\n Assert.eq('eq',\n Optionals.traverse(n, (x) => Optional.some(x)),\n Optionals.sequence(Arr.map(n, (x) => Optional.some(x))),\n tOptional()\n )\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalsSequenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Calling `Optionals.traverse` with a function returning `Optional.some` should be equivalent to calling `Optionals.sequence` with an array of `Optional.some` values.", "mode": "fast-check"} {"id": 59333, "name": "unknown", "code": "UnitTest.test('Optionals.flatten: some(some(x))', () => {\n fc.assert(fc.property(fc.integer(), function (n) {\n Assert.eq('eq', Optional.some(n), Optionals.flatten(Optional.some(Optional.some(n))), tOptional());\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalsFlattenTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Flattening a nested `Optional` object containing an integer should result in a non-nested `Optional` with the same integer.", "mode": "fast-check"} {"id": 59334, "name": "unknown", "code": "UnitTest.test('Optional.none() !== Optional.some(x)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.eq('eq', false, Optional.none().equals(Optional.some(i)));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optional.none()` is not equal to `Optional.some(x)` for any integer `x`.", "mode": "fast-check"} {"id": 54905, "name": "unknown", "code": "test('should safely handle any error response', () => {\n fc.assert(\n fc.property(\n fc.oneof(\n fc.constant(null),\n fc.constant(undefined),\n fc.string(),\n fc.object(),\n fc.array(fc.anything())\n ),\n fc.integer({ min: 400, max: 599 }),\n async (errorBody, statusCode) => {\n fetch.mockResolvedValue({\n ok: false,\n status: statusCode,\n json: async () => {\n if (errorBody === null || errorBody === undefined) {\n throw new Error('Invalid JSON');\n }\n return errorBody;\n }\n });\n\n await expect(apiClient.request('/test')).rejects.toThrow();\n \n // Should not crash on any input\n expect(true).toBe(true);\n }\n ),\n { numRuns: 100 }\n );\n })", "language": "typescript", "source_file": "./repos/rmusser01/tldw_BrowserExtension/Browser-Extension/tests/property/api-client.property.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "rmusser01/tldw_BrowserExtension", "url": "https://github.com/rmusser01/tldw_BrowserExtension.git", "license": "Apache-2.0", "stars": 1, "forks": 0}, "metrics": null, "summary": "`apiClient.request` should throw an error for any non-OK HTTP status code and varied error responses without crashing.", "mode": "fast-check"} {"id": 59335, "name": "unknown", "code": "UnitTest.test('Optional.some(x) !== Optional.none()', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.eq('eq', false, (Optional.some(i).equals(Optional.none())));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optional.some(x)` should not be equal to `Optional.none()`.", "mode": "fast-check"} {"id": 59338, "name": "unknown", "code": "UnitTest.test('Optional.some(x) !== Optional.some(x + y) where y is not identity', () => {\n fc.assert(fc.property(fc.string(), fc.string(1, 40), (a, b) => {\n Assert.eq('eq', false, Optional.some(a).equals(Optional.some(a + b)));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optional.some(x)` is not equal to `Optional.some(x + y)` when `y` is not an identity value.", "mode": "fast-check"} {"id": 54906, "name": "unknown", "code": "test('should handle network errors gracefully', () => {\n fc.assert(\n fc.property(\n fc.oneof(\n fc.constant(new Error('Network error')),\n fc.constant(new TypeError('Failed to fetch')),\n fc.constant(new Error('ECONNREFUSED')),\n fc.constant(new Error('ETIMEDOUT'))\n ),\n async (error) => {\n fetch.mockRejectedValue(error);\n\n await expect(apiClient.request('/test')).rejects.toThrow();\n \n // Should handle any network error type\n expect(true).toBe(true);\n }\n ),\n { numRuns: 50 }\n );\n })", "language": "typescript", "source_file": "./repos/rmusser01/tldw_BrowserExtension/Browser-Extension/tests/property/api-client.property.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "rmusser01/tldw_BrowserExtension", "url": "https://github.com/rmusser01/tldw_BrowserExtension.git", "license": "Apache-2.0", "stars": 1, "forks": 0}, "metrics": null, "summary": "`apiClient.request` should throw an error when any network error type occurs, ensuring it handles network errors gracefully.", "mode": "fast-check"} {"id": 59340, "name": "unknown", "code": "UnitTest.test('none !== some, for any predicate', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt1) => {\n Assert.eq('eq', false, Optional.none().equals_(opt1, boom));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optional.none()` is not equal to any `Some` value for any predicate.", "mode": "fast-check"} {"id": 59341, "name": "unknown", "code": "UnitTest.test('Checking some(x).equals_(some(y), _, _ -> false) === false', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), arbOptionSome(fc.integer()), (opt1, opt2) => {\n Assert.eq('eq', false, opt1.equals_(opt2, Fun.never));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Verifies that two distinct `Some` options, when compared using a function that always returns `false`, are considered unequal.", "mode": "fast-check"} {"id": 59344, "name": "unknown", "code": "UnitTest.test('Checking some(x).fold(die, id) === x', () => {\n fc.assert(fc.property(fc.integer(), (json) => {\n const opt = Optional.some(json);\n const actual = opt.fold(Fun.die('Should not be none!'), Fun.identity);\n Assert.eq('eq', json, actual);\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "For an `Optional` instance created with a value, `fold` with a function that returns the value should yield that original value.", "mode": "fast-check"} {"id": 54907, "name": "unknown", "code": "test('should handle any sequence of stream chunks', () => {\n fc.assert(\n fc.property(\n fc.array(\n fc.oneof(\n fc.string(),\n fc.constant(''),\n fc.constant('[DONE]')\n ),\n { minLength: 0, maxLength: 100 }\n ),\n async (chunks) => {\n const streamChunks = chunks.map((content, index) => \n content === '[DONE]' \n ? 'data: [DONE]\\n\\n'\n : `data: ${JSON.stringify(createMockStreamChunk(content, index === chunks.length - 1))}\\n\\n`\n );\n\n fetch.mockResolvedValue({\n ok: true,\n headers: new Headers({ 'content-type': 'text/event-stream' }),\n body: createMockStream(streamChunks)\n });\n\n const messages = [];\n await apiClient.streamRequest('/chat', {}, (message) => {\n messages.push(message);\n });\n\n // Should process all non-[DONE] chunks\n const expectedCount = chunks.filter(c => c !== '[DONE]').length;\n expect(messages.length).toBeLessThanOrEqual(expectedCount);\n }\n ),\n { numRuns: 50 }\n );\n })", "language": "typescript", "source_file": "./repos/rmusser01/tldw_BrowserExtension/Browser-Extension/tests/property/api-client.property.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "rmusser01/tldw_BrowserExtension", "url": "https://github.com/rmusser01/tldw_BrowserExtension.git", "license": "Apache-2.0", "stars": 1, "forks": 0}, "metrics": null, "summary": "`apiClient.streamRequest` should correctly process sequences of stream chunks, handling both standard and '[DONE]' markers in the input, and ensure that the number of processed messages does not exceed the count of non-'[DONE]' chunks.", "mode": "fast-check"} {"id": 59345, "name": "unknown", "code": "UnitTest.test('Checking some(x).is(x) === true', () => {\n fc.assert(fc.property(fc.integer(), (json) => {\n const opt = Optional.some(json);\n Assert.eq('eq', true, opt.is(json));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optional.some(x)` should return true when checked with `is(x)`.", "mode": "fast-check"} {"id": 59348, "name": "unknown", "code": "UnitTest.test('Checking some(x).getOr(v) === x', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), arbOptionSome(fc.integer()), (a, b) => {\n Assert.eq('eq', a, Optional.some(a).getOr(b));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optional.some(x).getOr(v)` should return `x`.", "mode": "fast-check"} {"id": 59349, "name": "unknown", "code": "UnitTest.test('Checking some(x).getOrThunk(_ -> v) === x', () => {\n fc.assert(fc.property(fc.integer(), fc.func(fc.integer()), (a, thunk) => {\n Assert.eq('eq', a, Optional.some(a).getOrThunk(thunk));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optional.some(a).getOrThunk(thunk)` should equal `a` for any integer `a` and any thunk function.", "mode": "fast-check"} {"id": 59350, "name": "unknown", "code": "UnitTest.test('Checking some.getOrDie() never throws', () => {\n fc.assert(fc.property(fc.integer(), fc.string(1, 40), (i, s) => {\n const opt = Optional.some(i);\n opt.getOrDie(s);\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optional.some(i).getOrDie(s)` does not throw an exception for any integer `i` and string `s`.", "mode": "fast-check"} {"id": 59351, "name": "unknown", "code": "UnitTest.test('Checking some(x).or(oSomeValue) === some(x)', () => {\n fc.assert(fc.property(fc.integer(), arbOptionSome(fc.integer()), (json, other) => {\n const output = Optional.some(json).or(other);\n Assert.eq('eq', true, output.is(json));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optional.some(x).or(oSomeValue)` should return `Optional.some(x)`.", "mode": "fast-check"} {"id": 59352, "name": "unknown", "code": "UnitTest.test('Checking some(x).orThunk(_ -> oSomeValue) === some(x)', () => {\n fc.assert(fc.property(fc.integer(), arbOptionSome(fc.integer()), (i, other) => {\n const output = Optional.some(i).orThunk(() => other);\n Assert.eq('eq', true, output.is(i));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optional.some(i).orThunk` returns the original `Optional.some(i)` when provided a secondary value wrapped in `Optional.some`.", "mode": "fast-check"} {"id": 59353, "name": "unknown", "code": "UnitTest.test('Checking some(x).map(f) === some(f(x))', () => {\n fc.assert(fc.property(fc.integer(), fc.func(fc.integer()), (a, f) => {\n const opt = Optional.some(a);\n const actual = opt.map(f);\n Assert.eq('eq', f(a), actual.getOrDie());\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optional.some(x).map(f)` should result in the same value as `some(f(x))`.", "mode": "fast-check"} {"id": 59355, "name": "unknown", "code": "UnitTest.test('Given f :: s -> some(b), checking some(x).bind(f) === some(b)', () => {\n fc.assert(fc.property(fc.integer(), fc.func(arbOptionSome(fc.integer())), (i, f) => {\n const actual = Optional.some(i).bind(f);\n Assert.eq('eq', f(i), actual, tOptional(tNumber));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property verifies that binding a function returning `Optional.some` to an `Optional.some` value results in the same outcome as directly applying the function to the value.", "mode": "fast-check"} {"id": 59356, "name": "unknown", "code": "UnitTest.test('Given f :: s -> none, checking some(x).bind(f) === none', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), fc.func(arbOptionNone()), (opt, f) => {\n const actual = opt.bind(f);\n Assert.eq('eq', Optional.none(), actual, tOptional(tNumber));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "For a given function \\( f \\) that maps some value to none, binding this function to an option containing a value should result in none.", "mode": "fast-check"} {"id": 59362, "name": "unknown", "code": "UnitTest.test('Checking some(x).forall(f) iff. f(x)', () => {\n fc.assert(fc.property(fc.integer(), fc.func(fc.boolean()), (i, f) => {\n const opt = Optional.some(i);\n if (f(i)) {\n Assert.eq('eq', true, opt.forall(f));\n } else {\n Assert.eq('eq', false, opt.forall(f));\n }\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures that `Optional.some(x).forall(f)` returns true if and only if the function `f(x)` returns true.", "mode": "fast-check"} {"id": 59363, "name": "unknown", "code": "UnitTest.test('Checking some(x).toArray equals [ x ]', () => {\n fc.assert(fc.property(fc.integer(), (json) => {\n Assert.eq('eq', [ json ], Optional.some(json).toArray());\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optional.some(x).toArray()` should convert the value `x` into a single-element array `[x]`.", "mode": "fast-check"} {"id": 59364, "name": "unknown", "code": "UnitTest.test('Checking some(x).toString equals \"some(x)\"', () => {\n fc.assert(fc.property(fc.integer(), (json) => {\n Assert.eq('toString', 'some(' + json + ')', Optional.some(json).toString());\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optional.some(x).toString` should equal `\"some(x)\"` for any integer `x`.", "mode": "fast-check"} {"id": 59365, "name": "unknown", "code": "UnitTest.test('Checking none.fold(_ -> x, die) === x', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n const actual = Optional.none().fold(Fun.constant(i), Fun.die('Should not die'));\n Assert.eq('eq', i, actual);\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optional.none().fold` should return a constant value without invoking the die function.", "mode": "fast-check"} {"id": 59366, "name": "unknown", "code": "UnitTest.test('Checking none.is === false', () => {\n fc.assert(fc.property(fc.integer(), (v) => {\n Assert.eq('none is', false, Optional.none().is(v));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optional.none().is(v)` should always return false for any integer `v`.", "mode": "fast-check"} {"id": 59367, "name": "unknown", "code": "UnitTest.test('Checking none.getOr(v) === v', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.eq('eq', i, Optional.none().getOr(i));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optional.none().getOr(i)` should return the integer `i`.", "mode": "fast-check"} {"id": 59369, "name": "unknown", "code": "UnitTest.test('Checking none.getOrDie() always throws', () => {\n // Require non empty string of msg falsiness gets in the way.\n fc.assert(fc.property(fc.string(1, 40), (s) => {\n Assert.throws('getOrDie', () => {\n Optional.none().getOrDie(s);\n });\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optional.none().getOrDie()` should always throw an exception regardless of the input string provided.", "mode": "fast-check"} {"id": 59371, "name": "unknown", "code": "UnitTest.test('Checking none.orThunk(_ -> v) === v', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n const output = Optional.none().orThunk(() => Optional.some(i));\n Assert.eq('eq', true, output.is(i));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optional.none().orThunk(() => Optional.some(i))` returns a result containing `i`.", "mode": "fast-check"} {"id": 59373, "name": "unknown", "code": "UnitTest.test('Optional.isNone', () => {\n Assert.eq('none is none', true, Optional.none().isNone());\n fc.assert(fc.property(fc.anything(), (x) => {\n Assert.eq('some is not none', false, Optional.some(x).isNone());\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalIsNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optional.none().isNone()` should return true, while `Optional.some(x).isNone()` should return false for any value `x`.", "mode": "fast-check"} {"id": 59376, "name": "unknown", "code": "UnitTest.test('Checking some(x).filter(_ -> false) === none', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => {\n Assert.eq('eq', true, tOptional().eq(\n none(),\n opt.filter(Fun.never)));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalFilterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Filtering `some(x)` with a condition that always returns false should result in `none`.", "mode": "fast-check"} {"id": 59378, "name": "unknown", "code": "UnitTest.test('Checking some(x).filter(f) === some(x) iff. f(x)', () => {\n fc.assert(fc.property(fc.integer(), fc.func(fc.boolean()), (i, f) => {\n const opt = some(i);\n if (f(i)) {\n Assert.eq('filter true', Optional.some(i), opt.filter(f), tOptional(tNumber));\n } else {\n Assert.eq('filter false', Optional.none(), opt.filter(f), tOptional(tNumber));\n }\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalFilterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "For an object `some(x)`, applying `filter(f)` should return `some(x)` if and only if the predicate `f(x)` is true; otherwise, it should return `none()`.", "mode": "fast-check"} {"id": 59405, "name": "unknown", "code": "UnitTest.test('Check that if the filter always returns false, then everything is in \"f\"', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(), fc.string(1, 40)),\n (obj) => {\n const output = Obj.bifilter(obj, Fun.never);\n Assert.eq('eq', Obj.keys(obj).length, Obj.keys(output.f).length);\n Assert.eq('eq', 0, Obj.keys(output.t).length);\n return true;\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/obj/BiFilterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "If the filter function always returns false for a dictionary, then all elements should be found in the \"f\" part of the `bifilter` output with the \"t\" part being empty.", "mode": "fast-check"} {"id": 59417, "name": "unknown", "code": "UnitTest.test('Check that error, value always equal comparison.firstError', () => {\n fc.assert(fc.property(\n arbResultError(fc.integer()),\n arbResultValue(fc.string()),\n function (r1, r2) {\n const comparison = Results.compare(r1, r2);\n return comparison.match({\n bothErrors: Fun.never,\n firstError: Fun.always,\n secondError: Fun.never,\n bothValues: Fun.never\n });\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The result of comparing two results, where one is an error and the other is a value, matches the case where the first result is an error.", "mode": "fast-check"} {"id": 59418, "name": "unknown", "code": "UnitTest.test('Check that value, error always equal comparison.secondError', () => {\n fc.assert(fc.property(\n arbResultValue(fc.integer()),\n arbResultError(fc.string()),\n function (r1, r2) {\n const comparison = Results.compare(r1, r2);\n return comparison.match({\n bothErrors: Fun.never,\n firstError: Fun.never,\n secondError: Fun.always,\n bothValues: Fun.never\n });\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that when using `Results.compare`, the comparison always matches `secondError` if it reaches that case.", "mode": "fast-check"} {"id": 59419, "name": "unknown", "code": "UnitTest.test('Check that value, value always equal comparison.bothValues', () => {\n fc.assert(fc.property(\n arbResultValue(fc.integer()),\n arbResultValue(fc.integer()),\n function (r1, r2) {\n const comparison = Results.compare(r1, r2);\n return comparison.match({\n bothErrors: Fun.never,\n firstError: Fun.never,\n secondError: Fun.never,\n bothValues: Fun.always\n });\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should consistently result in `bothValues` being matched when comparing two result values.", "mode": "fast-check"} {"id": 59421, "name": "unknown", "code": "UnitTest.test('Checking value.is(value.getOrDie()) === true', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), (res) => {\n Assert.eq('eq', true, res.is(res.getOrDie()));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `is` method should return true when called on the value retrieved using `getOrDie`.", "mode": "fast-check"} {"id": 59426, "name": "unknown", "code": "UnitTest.test('Checking value.or(oValue) === value', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), (a, b) => {\n Assert.eq('eq value', Result.value(a), Result.value(a).or(Result.value(b)), tResult());\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that `value.or(oValue)` returns the original `value` for any integers `a` and `b`.", "mode": "fast-check"} {"id": 59427, "name": "unknown", "code": "UnitTest.test('Checking error.or(value) === value', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), (a, b) => {\n Assert.eq('eq or', Result.value(b), Result.error(a).or(Result.value(b)), tResult());\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Result.error(a).or(Result.value(b))` should equal `Result.value(b)` when using the `or` method with an error and a value.", "mode": "fast-check"} {"id": 59429, "name": "unknown", "code": "UnitTest.test('Checking value.fold(die, id) === value.getOrDie()', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), (res) => {\n const actual = res.getOrDie();\n Assert.eq('eq', actual, res.fold(Fun.die('should not get here'), Fun.identity));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property verifies that for a given `ResultValue`, using `fold` with `die` and `identity` functions produces the same result as `getOrDie`.", "mode": "fast-check"} {"id": 59436, "name": "unknown", "code": "UnitTest.test('Checking value.toOptional is always Optional.some(value.getOrDie())', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), (res) => {\n Assert.eq('eq', res.getOrDie(), res.toOptional().getOrDie());\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`value.toOptional()` should always result in an `Optional` containing the same value as `value.getOrDie()`.", "mode": "fast-check"} {"id": 59452, "name": "unknown", "code": "UnitTest.test('Result.error: error.toOptional is always none', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), (res) => {\n Assert.eq('eq', Optional.none(), res.toOptional(), tOptional());\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Result.error: error.toOptional` should always return `none`.", "mode": "fast-check"} {"id": 59461, "name": "unknown", "code": "UnitTest.test('Check that if the filter always returns false, then everything is in \"fail\"', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n (arr) => {\n const output = Arr.partition(arr, Fun.never);\n Assert.eq('eq', 0, output.pass.length);\n Assert.eq('eq', arr, output.fail);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/PartitionTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "If the filter function always returns false, all elements of the array should be placed in the \"fail\" partition, with no elements in the \"pass\" partition.", "mode": "fast-check"} {"id": 59462, "name": "unknown", "code": "UnitTest.test('Check that if the filter always returns true, then everything is in \"pass\"', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n (arr) => {\n const output = Arr.partition(arr, Fun.always);\n Assert.eq('eq', 0, output.fail.length);\n Assert.eq('eq', arr, output.pass);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/PartitionTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "If the filter function always returns true, all elements of the array should be in the \"pass\" category, with \"fail\" being empty.", "mode": "fast-check"} {"id": 59470, "name": "unknown", "code": "UnitTest.test('Arr.indexOf: find in middle of array', () => {\n fc.assert(fc.property(fc.array(fc.nat()), arbNegativeInteger(), fc.array(fc.nat()), (prefix, element, suffix) => {\n const arr = prefix.concat([ element ]).concat(suffix);\n Assert.eq(\n 'Element should be found immediately after the prefix array',\n Optional.some(prefix.length),\n Arr.indexOf(arr, element),\n tOptional(tNumber)\n );\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/IndexOfTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `Arr.indexOf` should find an element at the index immediately following the prefix in a concatenated array.", "mode": "fast-check"} {"id": 59471, "name": "unknown", "code": "UnitTest.test('forall of a non-empty array with a predicate that always returns false is false', () => {\n fc.assert(fc.property(\n fc.array(fc.integer(), 1, 30),\n (xs) => {\n const output = Arr.forall(xs, Fun.never);\n Assert.eq('eq', false, output);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ForallTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "A non-empty array should return false when tested with a predicate that always returns false.", "mode": "fast-check"} {"id": 59481, "name": "unknown", "code": "UnitTest.test('Arr.findIndex: find in middle of array', () => {\n fc.assert(fc.property(fc.array(fc.nat()), arbNegativeInteger(), fc.array(fc.nat()), (prefix, element, suffix) => {\n const arr = prefix.concat([ element ]).concat(suffix);\n Assert.eq(\n 'Element should be found immediately after the prefix array',\n Optional.some(prefix.length),\n Arr.findIndex(arr, (x) => x === element),\n tOptional(tNumber)\n );\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/FindIndexTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.findIndex` should return the index immediately after the prefix where a specified element is inserted in an array.", "mode": "fast-check"} {"id": 59483, "name": "unknown", "code": "UnitTest.test('Arr.findIndex: If predicate is always false, then index is always none', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n Assert.eq('should be none', Optional.none(), Arr.findIndex(arr, () => false), tOptional(tNumber));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/FindIndexTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "If a predicate is always false, `Arr.findIndex` should consistently return `none`, indicating no index satisfies the condition.", "mode": "fast-check"} {"id": 59484, "name": "unknown", "code": "UnitTest.test('Arr.findIndex: consistent with find', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n const pred = (x) => x % 5 === 0;\n Assert.eq('findIndex vs find', Arr.find(arr, pred), Arr.findIndex(arr, pred).map((x) => arr[x]), tOptional(tNumber));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/FindIndexTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.findIndex` provides results consistent with `Arr.find` by comparing found values and their indices in integer arrays.", "mode": "fast-check"} {"id": 59491, "name": "unknown", "code": "UnitTest.test('Thunk.cached counter', () => {\n fc.assert(fc.property(fc.json(), fc.func(fc.json()), fc.json(), (a, f, b) => {\n let counter = 0;\n const thunk = Thunk.cached((x) => {\n counter++;\n return {\n counter,\n output: f(x)\n };\n });\n const value = thunk(a);\n const other = thunk(b);\n Assert.eq('eq', value, other);\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/fun/ThunkTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Thunk.cached` ensures that for given inputs `a` and `b`, the function is only evaluated once, as verified by a counter, and always returns the same result for subsequent calls.", "mode": "fast-check"} {"id": 59495, "name": "unknown", "code": "UnitTest.test('Check compose :: compose(f, g)(x) = f(g(x))', () => {\n fc.assert(fc.property(fc.string(), fc.func(fc.string()), fc.func(fc.string()), (x, f, g) => {\n const h = Fun.compose(f, g);\n Assert.eq('eq', f(g(x)), h(x));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Fun.compose` should combine two functions, `f` and `g`, such that applying the composed function to any input `x` yields the same result as applying `g` to `x` and then `f` to the result.", "mode": "fast-check"} {"id": 59496, "name": "unknown", "code": "UnitTest.test('Check compose1 :: compose1(f, g)(x) = f(g(x))', () => {\n fc.assert(fc.property(fc.string(), fc.func(fc.string()), fc.func(fc.string()), (x, f, g) => {\n const h = Fun.compose1(f, g);\n Assert.eq('eq', f(g(x)), h(x));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Fun.compose1` should return a function `h` such that `h(x)` is equivalent to applying `g` to `x` and then `f` to the result.", "mode": "fast-check"} {"id": 59497, "name": "unknown", "code": "UnitTest.test('Check constant :: constant(a)() === a', () => {\n fc.assert(fc.property(fc.json(), (json) => {\n Assert.eq('eq', json, Fun.constant(json)());\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that `Fun.constant(a)()` consistently returns `a` for any JSON value `a`.", "mode": "fast-check"} {"id": 59499, "name": "unknown", "code": "UnitTest.test('Check always :: f(x) === true', () => {\n fc.assert(fc.property(fc.json(), (json) => {\n Assert.eq('eq', true, Fun.always(json));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `Fun.always` should return true for any JSON input.", "mode": "fast-check"} {"id": 59500, "name": "unknown", "code": "UnitTest.test('Check never :: f(x) === false', () => {\n fc.assert(fc.property(fc.json(), (json) => {\n Assert.eq('eq', false, Fun.never(json));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Fun.never` should always return false for any JSON input.", "mode": "fast-check"} {"id": 59501, "name": "unknown", "code": "UnitTest.test('Check curry', () => {\n fc.assert(fc.property(fc.json(), fc.json(), fc.json(), fc.json(), (a, b, c, d) => {\n const f = (a, b, c, d) => [ a, b, c, d ];\n\n Assert.eq('curry 1', Fun.curry(f, a)(b, c, d), [ a, b, c, d ]);\n Assert.eq('curry 2', Fun.curry(f, a, b)(c, d), [ a, b, c, d ]);\n Assert.eq('curry 3', Fun.curry(f, a, b, c)(d), [ a, b, c, d ]);\n Assert.eq('curry 4', Fun.curry(f, a, b, c, d)(), [ a, b, c, d ]);\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `Fun.curry` should allow partial application of its arguments, such that when provided incrementally, the result remains consistent with the fully applied function `[a, b, c, d]`.", "mode": "fast-check"} {"id": 54917, "name": "unknown", "code": "it('createKeyFileContentLine', ctx => {\n console.log(`Testing ${ctx.task.name}...`)\n type TestParams = CreateKeyFileContentLineParams & {\n date: string\n }\n const toResult = (params: TestParams) => {\n return {\n fromJuce: execTestBin(\n 'create-key-file-content-line',\n JSON.stringify({ ...params })\n ),\n fromUtil: JuceKeyFileUtils.createKeyFileContentLine(\n {\n appName: params.appName,\n userEmail: params.userEmail,\n userName: params.userName,\n machineNumbers: params.machineNumbers,\n machineNumbersAttributeName:\n params.machineNumbersAttributeName\n },\n params.date\n )\n }\n }\n const baseDate = JuceKeyFileUtils.toHexStringMilliseconds(\n new Date('1970-01-01T00:00:00.000Z')\n )\n const baseString =\n `{\"appName\":\"'\",` +\n `\"userEmail\":\"a@a.a\",` +\n `\"userName\":\"&\",` +\n `\"machineNumbers\":\"\\\\\"\",` +\n `\"machineNumbersAttributeName\":\"mach\",` +\n `\"date\":\"${baseDate}\"}`\n const baseCase = JSON.parse(baseString)\n const baseResult = toResult(baseCase)\n console.log({ baseCase, baseResult })\n expect(baseResult.fromUtil).toBe(baseResult.fromJuce)\n const createKeyFileContentLineParamsArbitrary = ZodFastCheck().inputOf(\n createKeyFileContentLineParamsValidator.extend({\n date: z.date(),\n expiryTime: z.date()\n })\n )\n let latest\n fc.assert(\n fc.property(createKeyFileContentLineParamsArbitrary, input => {\n const result = toResult({\n ...input,\n date: JuceKeyFileUtils.toHexStringMilliseconds(input.date)\n })\n latest = { input, result }\n const parse =\n createKeyFileContentLineParamsValidator.safeParse(input)\n return !parse.success || result.fromUtil === result.fromJuce\n })\n )\n console.log(latest)\n })", "language": "typescript", "source_file": "./repos/ianacaburian/generate-key-file/src/test/JuceKeyFileUtils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "ianacaburian/generate-key-file", "url": "https://github.com/ianacaburian/generate-key-file.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The utility function `JuceKeyFileUtils.createKeyFileContentLine` produces output matching the result of executing the `create-key-file-content-line` binary, ensuring consistency across various input parameters.", "mode": "fast-check"} {"id": 59502, "name": "unknown", "code": "UnitTest.test('Check not :: not(f(x)) === !f(x)', () => {\n fc.assert(fc.property(fc.json(), fc.func(fc.boolean()), (x, f) => {\n const g = Fun.not(f);\n Assert.eq('eq', f(x), !g(x));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Fun.not(f)` should return a function `g` such that for any input `x`, `f(x)` is equal to the negation of `g(x)`.", "mode": "fast-check"} {"id": 59504, "name": "unknown", "code": "UnitTest.test('Check apply :: apply(constant(a)) === a', () => {\n fc.assert(fc.property(fc.json(), (x) => {\n Assert.eq('eq', x, Fun.apply(Fun.constant(x)));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Applying `Fun.constant(x)` with `Fun.apply` should return `x`.", "mode": "fast-check"} {"id": 59505, "name": "unknown", "code": "UnitTest.test('Check call :: apply(constant(a)) === undefined', () => {\n fc.assert(fc.property(fc.json(), (x) => {\n let hack: any = null;\n const output = Fun.call(() => {\n hack = x;\n });\n\n Assert.eq('eq', undefined, output);\n Assert.eq('eq', x, hack);\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that calling the function `Fun.call` with a constant function returns `undefined` and ensures that the constant function is executed and modifies `hack` to equal input `x`.", "mode": "fast-check"} {"id": 59508, "name": "unknown", "code": "UnitTest.test('Arr.last: nonEmpty', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), (init, last) => {\n const arr = init.concat([ last ]);\n Assert.eq('nonEmpty', Optional.some(last), Arr.last(arr), tOptional(tNumber));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ArrLastTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.last` returns the last element of a non-empty array as an `Optional`.", "mode": "fast-check"} {"id": 59509, "name": "unknown", "code": "UnitTest.test('Arr.head: nonEmpty', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), (t, h) => {\n const arr = [ h ].concat(t);\n Assert.eq('nonEmpty', Optional.some(h), Arr.head(arr), tOptional(tNumber));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ArrHeadTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.head` correctly returns the first element as an `Optional` from non-empty arrays.", "mode": "fast-check"} {"id": 59510, "name": "unknown", "code": "UnitTest.test('Arr.get: fc valid index', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), fc.integer(), (array, h, t) => {\n const arr = [ h ].concat(array);\n const length = arr.push(t);\n const midIndex = Math.round(arr.length / 2);\n\n Assert.eq('expected number', Optional.some(h), Arr.get(arr, 0), tOptional(tNumber));\n Assert.eq('expected number', Optional.some(arr[midIndex]), Arr.get(arr, midIndex), tOptional(tNumber));\n Assert.eq('expected number', Optional.some(t), Arr.get(arr, length - 1), tOptional(tNumber));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ArrGetTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.get` retrieves the correct element from an array at various valid indices, specifically the first, middle, and last positions, ensuring the expected values are returned as `Optional.some`.", "mode": "fast-check"} {"id": 59513, "name": "unknown", "code": "UnitTest.test('Arr.findMap of non-empty is first if f is Optional.some', () => {\n fc.assert(fc.property(\n fc.integer(),\n fc.array(fc.integer()),\n (head, tail) => {\n const arr = [ head, ...tail ];\n Assert.eq('eq', Optional.some(head), Arr.findMap(arr, Optional.some), tOptional());\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ArrFindMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.findMap` returns the first element as `Optional.some` when `f` is `Optional.some`, for a non-empty array.", "mode": "fast-check"} {"id": 59514, "name": "unknown", "code": "UnitTest.test('Arr.findMap of non-empty is none if f is Optional.none', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n (arr) => {\n Assert.eq('eq', Optional.none(), Arr.findMap(arr, () => Optional.none()), tOptional());\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ArrFindMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.findMap` applied to a non-empty array returns `Optional.none` if the function always returns `Optional.none`.", "mode": "fast-check"} {"id": 59522, "name": "unknown", "code": "UnitTest.test('zipToObject has matching keys and values', () => {\n fc.assert(fc.property(\n fc.array(fc.asciiString(1, 30)),\n (rawValues: string[]) => {\n const values = Unique.stringArray(rawValues);\n\n const keys = Arr.map(values, (v, i) => i);\n\n const output = Zip.zipToObject(keys, values);\n\n const oKeys = Obj.keys(output);\n Assert.eq('Output keys did not match', oKeys.length, values.length);\n\n Assert.eq('Output keys', true, Arr.forall(oKeys, (oKey) => {\n const index = parseInt(oKey, 10);\n const expected = values[index];\n return output[oKey] === expected;\n }));\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ZipTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`zipToObject` creates an object with keys matching the indices and values matching the corresponding elements in a string array, ensuring the output has matching keys and values.", "mode": "fast-check"} {"id": 59523, "name": "unknown", "code": "UnitTest.test('zipToTuples matches corresponding tuples', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.array(fc.integer()),\n (keys, values) => {\n if (keys.length !== values.length) {\n Assert.throws('Should throw with different lengths', () => Zip.zipToTuples(keys, values));\n } else {\n const output = Zip.zipToTuples(keys, values);\n Assert.eq('Output keys did not match', keys.length, output.length);\n Assert.eq('', true, Arr.forall(output, (x, i) => x.k === keys[i] && x.v === values[i]));\n }\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ZipTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`zipToTuples` should throw an error when input arrays have different lengths, and produce tuples matching corresponding keys and values when lengths are equal.", "mode": "fast-check"} {"id": 59524, "name": "unknown", "code": "UnitTest.test('KAssert.eqError: success (reflexivity)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n KAssert.eqError('eq', i, Result.error(i));\n KAssert.eqError('eq', i, Result.error(i), tBoom());\n KAssert.eqError('eq', i, Result.error(i), tBoom(), tNumber);\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`KAssert.eqError` verifies reflexivity by asserting that an integer and a `Result.error` containing the same integer are considered equal, even with additional testable contexts provided.", "mode": "fast-check"} {"id": 59525, "name": "unknown", "code": "UnitTest.test('KAssert.eqError: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('should throw if numbers differ #1', () => {\n KAssert.eqError('eq', a, Result.error(b));\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqError('eq', a, Result.error(b), tBoom());\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqError('eq', a, Result.error(b), tBoom(), tNumber);\n });\n }));\n\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.throws('should throw if value #1', () => {\n KAssert.eqError('eq', i, Result.value(s));\n });\n Assert.throws('should throw if value #2', () => {\n KAssert.eqError('eq', i, Result.value(s), tBoom());\n });\n Assert.throws('should throw if value #3', () => {\n KAssert.eqError('eq', i, Result.value(s), tBoom(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`KAssert.eqError` should throw an error when comparing a number with a different number or when comparing a number with a non-numeric value encapsulated in a `Result`.", "mode": "fast-check"} {"id": 59526, "name": "unknown", "code": "UnitTest.test('KAssert.eqError: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('should throw if numbers differ #1', () => {\n KAssert.eqError('eq', a, Result.error(b));\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqError('eq', a, Result.error(b), tBoom());\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqError('eq', a, Result.error(b), tBoom(), tNumber);\n });\n }));\n\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.throws('should throw if value #1', () => {\n KAssert.eqError('eq', i, Result.value(s));\n });\n Assert.throws('should throw if value #2', () => {\n KAssert.eqError('eq', i, Result.value(s), tBoom());\n });\n Assert.throws('should throw if value #3', () => {\n KAssert.eqError('eq', i, Result.value(s), tBoom(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Verifies that `KAssert.eqError` throws an error when numbers differ or when comparing an integer with a string encapsulated in a `Result.value`.", "mode": "fast-check"} {"id": 59527, "name": "unknown", "code": "UnitTest.test('KAssert.eqValue: success', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n KAssert.eqValue('eq', i, Result.value(i));\n KAssert.eqValue('eq', i, Result.value(i), tNumber);\n KAssert.eqValue('eq', i, Result.value(i), tNumber, tBoom());\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`KAssert.eqValue` confirms that an integer value matches the expected integer result across multiple test cases, optionally using additional type checks and a custom testable function.", "mode": "fast-check"} {"id": 59528, "name": "unknown", "code": "UnitTest.test('KAssert.eqValue: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('should throw if numbers differ #1', () => {\n KAssert.eqValue('eq', a, Result.value(b));\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqValue('eq', a, Result.value(b), tNumber);\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqValue('eq', a, Result.value(b), tNumber, tBoom());\n });\n }));\n\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.throws('should throw if error #1', () => {\n KAssert.eqValue('eq', i, Result.error(s));\n });\n Assert.throws('should throw if error #2', () => {\n KAssert.eqValue('eq', i, Result.error(s), tBoom());\n });\n Assert.throws('should throw if error #3', () => {\n KAssert.eqValue('eq', i, Result.error(s), tBoom(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`KAssert.eqValue` should throw an error when comparing two different values or when a result is an error, with additional custom test behaviors.", "mode": "fast-check"} {"id": 59529, "name": "unknown", "code": "UnitTest.test('KAssert.eqValue: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('should throw if numbers differ #1', () => {\n KAssert.eqValue('eq', a, Result.value(b));\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqValue('eq', a, Result.value(b), tNumber);\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqValue('eq', a, Result.value(b), tNumber, tBoom());\n });\n }));\n\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.throws('should throw if error #1', () => {\n KAssert.eqValue('eq', i, Result.error(s));\n });\n Assert.throws('should throw if error #2', () => {\n KAssert.eqValue('eq', i, Result.error(s), tBoom());\n });\n Assert.throws('should throw if error #3', () => {\n KAssert.eqValue('eq', i, Result.error(s), tBoom(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`KAssert.eqValue` throws an error if two different numbers are compared, or if an integer is compared against an error result containing a string.", "mode": "fast-check"} {"id": 59530, "name": "unknown", "code": "UnitTest.test('KAssert.eqResult: success', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n KAssert.eqResult('eq', Result.value(i), Result.value(i));\n KAssert.eqResult('eq', Result.value(i), Result.value(i), tNumber);\n KAssert.eqResult('eq', Result.value(i), Result.value(i), tNumber, tBoom());\n KAssert.eqResult('eq', Result.error(i), Result.error(i));\n KAssert.eqResult('eq', Result.error(i), Result.error(i), tBoom());\n KAssert.eqResult('eq', Result.error(i), Result.error(i), tBoom(), tNumber);\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`KAssert.eqResult` verifies equality of `Result.value` and `Result.error` outputs from integers across multiple invocations, using optional testable and printable transformations.", "mode": "fast-check"} {"id": 59532, "name": "unknown", "code": "UnitTest.test('KAssert.eqResult: fail', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('value(a) != (value(!a)) #1', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b));\n });\n Assert.throws('value(a) != (value(!a)) #2', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b), tNumber);\n });\n Assert.throws('value(a) != (value(!a)) #2', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b), tNumber, tBoom());\n });\n }));\n\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('error(a) != (error(!a)) #1', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b));\n });\n Assert.throws('error(a) != (error(!a)) #2', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b), tBoom());\n });\n Assert.throws('result(a) != (result(!a)) #2', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b), tBoom(), tNumber);\n });\n }));\n\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.throws('value != error #1', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s));\n });\n Assert.throws('value != error #2', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s), tBoom());\n });\n Assert.throws('value != error #3', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s), tBoom());\n });\n\n Assert.throws('error != value #1', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s));\n });\n Assert.throws('error != value #2', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s), tBoom());\n });\n Assert.throws('error != value #3', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s), tBoom(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Verifies that `KAssert.eqResult` throws an error when comparing unequal `Result` objects, whether they are of the `value` type with different numbers, `error` type with different numbers, or mixed `value` and `error` types.", "mode": "fast-check"} {"id": 59539, "name": "unknown", "code": "UnitTest.test('KAssert.eqOption: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #1', () => {\n KAssert.eqOptional('eq', Optional.some(a), Optional.some(b));\n });\n }));\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #2', () => {\n KAssert.eqOptional('eq', Optional.some(a), Optional.some(b), tNumber);\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('none != some(i) #1', () => {\n KAssert.eqOptional('eq', Optional.none(), Optional.some(i));\n });\n Assert.throws('none != some(i) #2', () => {\n KAssert.eqOptional('eq', Optional.none(), Optional.some(i), tBoom());\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('some(i) != none #1', () => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.none());\n });\n Assert.throws('some(i) != none #2', () => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.none(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`KAssert.eqOptional` throws an error when comparing different `Optional` values, specifically when comparing `some` with different values, `none` with `some`, and `some` with `none`.", "mode": "fast-check"} {"id": 59540, "name": "unknown", "code": "UnitTest.test('KAssert.eqOption: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #1', () => {\n KAssert.eqOptional('eq', Optional.some(a), Optional.some(b));\n });\n }));\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #2', () => {\n KAssert.eqOptional('eq', Optional.some(a), Optional.some(b), tNumber);\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('none != some(i) #1', () => {\n KAssert.eqOptional('eq', Optional.none(), Optional.some(i));\n });\n Assert.throws('none != some(i) #2', () => {\n KAssert.eqOptional('eq', Optional.none(), Optional.some(i), tBoom());\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('some(i) != none #1', () => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.none());\n });\n Assert.throws('some(i) != none #2', () => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.none(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`KAssert.eqOptional` should throw an exception when comparing different `Optional` values, such as `Optional.some(a)` with `Optional.some(b)`, or when comparing `Optional.none()` with `Optional.some(i)` and vice versa.", "mode": "fast-check"} {"id": 59541, "name": "unknown", "code": "UnitTest.test('KAssert.eqOption: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #1', () => {\n KAssert.eqOptional('eq', Optional.some(a), Optional.some(b));\n });\n }));\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #2', () => {\n KAssert.eqOptional('eq', Optional.some(a), Optional.some(b), tNumber);\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('none != some(i) #1', () => {\n KAssert.eqOptional('eq', Optional.none(), Optional.some(i));\n });\n Assert.throws('none != some(i) #2', () => {\n KAssert.eqOptional('eq', Optional.none(), Optional.some(i), tBoom());\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('some(i) != none #1', () => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.none());\n });\n Assert.throws('some(i) != none #2', () => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.none(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`KAssert.eqOptional` throws an error when comparing different `Optional` values, including cases of two different numbers, `none` versus `some`, and `some` versus `none`.", "mode": "fast-check"} {"id": 59542, "name": "unknown", "code": "UnitTest.test('KAssert.eqOption: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #1', () => {\n KAssert.eqOptional('eq', Optional.some(a), Optional.some(b));\n });\n }));\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #2', () => {\n KAssert.eqOptional('eq', Optional.some(a), Optional.some(b), tNumber);\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('none != some(i) #1', () => {\n KAssert.eqOptional('eq', Optional.none(), Optional.some(i));\n });\n Assert.throws('none != some(i) #2', () => {\n KAssert.eqOptional('eq', Optional.none(), Optional.some(i), tBoom());\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('some(i) != none #1', () => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.none());\n });\n Assert.throws('some(i) != none #2', () => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.none(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "KAssert.eqOptional throws an error when comparing different `Optional` values for equality.", "mode": "fast-check"} {"id": 59543, "name": "unknown", "code": "test.each([\n { label: 'ASCII', unit: 'binary-ascii' },\n { label: 'Printable characters', unit: 'grapheme' },\n { label: 'Full Unicode range', unit: 'binary' },\n {\n label: 'Special ASCII characters',\n unit: fc.constantFrom(...'-._~!$()*,;=:@/?[]{}\\\\|^')\n }\n ] as const)('Property-based fuzzy testing - $label', ({ unit }) => {\n fc.assert(\n fc.property(fc.string({ unit }), str => {\n const search = `?key=${encodeQueryValue(str)}`\n const expected = new URLSearchParams(search).get('key')\n expect(expected).toBe(str)\n })\n )\n })", "language": "typescript", "source_file": "./repos/47ng/nuqs/packages/nuqs/src/lib/url-encoding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "47ng/nuqs", "url": "https://github.com/47ng/nuqs.git", "license": "MIT", "stars": 7916, "forks": 182}, "metrics": null, "summary": "The encoding and decoding of query values should preserve the original string across various character sets.", "mode": "fast-check"} {"id": 59545, "name": "unknown", "code": "it('should return true for all string inputs', () => {\n fc.assert(\n fc.property(fc.string(), input => {\n const result = isString(input);\n expect(result).toBe(true);\n })\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/packages/types/test/validators.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "`isString` should return true for all string inputs.", "mode": "fast-check"} {"id": 59546, "name": "unknown", "code": "it('should consistently validate non-empty strings', () => {\n fc.assert(\n fc.property(fc.string(), input => {\n const result = isNonEmptyString(input);\n const expected = input.length > 0;\n expect(result).toBe(expected);\n })\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/packages/types/test/validators.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "`isNonEmptyString` correctly validates whether a given string is non-empty by matching the string's length greater than zero.", "mode": "fast-check"} {"id": 59547, "name": "unknown", "code": "it('should always return boolean for any input', () => {\n fc.assert(\n fc.property(fc.string(), input => {\n const result = isValidUuid(input);\n expect(typeof result).toBe('boolean');\n })\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/packages/types/test/validators.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "`isValidUuid` should always return a boolean for any string input.", "mode": "fast-check"} {"id": 59548, "name": "unknown", "code": "it('should always return boolean for any input', () => {\n fc.assert(\n fc.property(fc.string(), input => {\n const result = isValidEmail(input);\n expect(typeof result).toBe('boolean');\n })\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/packages/types/test/validators.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "`isValidEmail` always returns a boolean for any string input.", "mode": "fast-check"} {"id": 59549, "name": "unknown", "code": "it('should validate positive integers correctly', () => {\n fc.assert(\n fc.property(fc.integer({ min: 1, max: 1000 }), num => {\n const result = isPositiveInteger(num);\n expect(result).toBe(true);\n })\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/packages/types/test/validators.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "`isPositiveInteger` returns true for integers between 1 and 1000.", "mode": "fast-check"} {"id": 59552, "name": "unknown", "code": "it('should validate string lengths correctly', () => {\n fc.assert(\n fc.property(\n fc.tuple(\n fc.string({ minLength: 10, maxLength: 20 }),\n fc.integer({ min: 5, max: 15 })\n ),\n ([str, minLen]) => {\n const validator = createStringLengthValidator(minLen);\n const result = validator(str);\n const expected = str.length >= minLen;\n expect(result).toBe(expected);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/packages/types/test/validators.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "Validates that a string length validator correctly determines if a string meets a specified minimum length.", "mode": "fast-check"} {"id": 59554, "name": "unknown", "code": "it('should always return boolean', () => {\n fc.assert(\n fc.property(fc.string(), email => {\n const result = isValidEmail(email);\n return typeof result === 'boolean';\n })\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/examples/property-testing/validation-functions.example.ts", "start_line": null, "end_line": null, "dependencies": ["isValidEmail"], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "`isValidEmail` always returns a boolean value for any string input.", "mode": "fast-check"} {"id": 59555, "name": "unknown", "code": "it('should accept valid email format', () => {\n fc.assert(\n fc.property(generators.email(), email => {\n return isValidEmail(email) === true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/examples/property-testing/validation-functions.example.ts", "start_line": null, "end_line": null, "dependencies": ["isValidEmail"], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "`isValidEmail` returns true for valid email formats.", "mode": "fast-check"} {"id": 59557, "name": "unknown", "code": "it('should handle different currencies', () => {\n fc.assert(\n fc.property(\n fc.tuple(generators.money(), generators.currency()),\n ([amount, currency]) => {\n const result = formatCurrency(amount, currency);\n return typeof result === 'string' && result.length > 0;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/examples/property-testing/validation-functions.example.ts", "start_line": null, "end_line": null, "dependencies": ["formatCurrency"], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "The `formatCurrency` function should return a non-empty string when given any amount and valid currency.", "mode": "fast-check"} {"id": 59558, "name": "unknown", "code": "it('should include currency symbol', () => {\n fc.assert(\n fc.property(generators.money(), amount => {\n const result = formatCurrency(amount, 'USD');\n return result.includes('$');\n })\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/examples/property-testing/validation-functions.example.ts", "start_line": null, "end_line": null, "dependencies": ["formatCurrency"], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "The `formatCurrency` function should include the `$` symbol when formatting amounts in USD.", "mode": "fast-check"} {"id": 59560, "name": "unknown", "code": "it('should reject short passwords', () => {\n fc.assert(\n fc.property(fc.string({ maxLength: 7 }), password => {\n const result = validatePassword(password);\n return result.valid === false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/examples/property-testing/validation-functions.example.ts", "start_line": null, "end_line": null, "dependencies": ["validatePassword"], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "Passwords shorter than 8 characters should be rejected as invalid.", "mode": "fast-check"} {"id": 59562, "name": "unknown", "code": "it('should be monotonic with respect to item prices', () => {\n fc.assert(\n fc.property(cartGenerator, cart => {\n const originalTotal = calculateCartTotal(cart);\n\n // Increase all prices by 10%\n const increasedCart = {\n ...cart,\n items: cart.items.map(item => ({\n ...item,\n price: item.price * 1.1,\n })),\n };\n const increasedTotal = calculateCartTotal(increasedCart);\n\n // Higher prices should result in higher or equal total\n return increasedTotal >= originalTotal;\n })\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/examples/property-testing/business-logic.example.ts", "start_line": null, "end_line": null, "dependencies": ["calculateCartTotal"], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "Increasing all item prices by 10% should result in a total that is higher than or equal to the original cart total.", "mode": "fast-check"} {"id": 54933, "name": "unknown", "code": "t.test('should match \\\\p{L}', () => {\n fc.assert(\n fc.property(\n fc.string({ unit: 'grapheme', minLength: 1, maxLength: 1 }),\n // @ts-ignore\n str => {\n let cp = /** @type {number} */ (str.codePointAt(0));\n return isLetter(cp) === /\\p{L}/u.test(str);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/cometkim/unicode-segmenter/test/general.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "cometkim/unicode-segmenter", "url": "https://github.com/cometkim/unicode-segmenter.git", "license": "MIT", "stars": 77, "forks": 2}, "metrics": null, "summary": "The test verifies that a grapheme matches the Unicode property `\\p{L}` if and only if `isLetter` returns true for its code point.", "mode": "fast-check"} {"id": 54935, "name": "unknown", "code": "t.test('should match \\\\p{Alphabetic}(=\\\\p{Alpha})', () => {\n fc.assert(\n fc.property(\n fc.string({ unit: 'grapheme', minLength: 1, maxLength: 1 }),\n // @ts-ignore\n str => {\n let cp = /** @type {number} */ (str.codePointAt(0));\n return isAlphabetic(cp) === /\\p{Alpha}/u.test(str);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/cometkim/unicode-segmenter/test/general.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "cometkim/unicode-segmenter", "url": "https://github.com/cometkim/unicode-segmenter.git", "license": "MIT", "stars": 77, "forks": 2}, "metrics": null, "summary": "Verifies that a single grapheme's code point is alphabetic if and only if it matches the Unicode property `\\p{Alpha}`.", "mode": "fast-check"} {"id": 59563, "name": "unknown", "code": "it('should give discount when discount code is present', () => {\n fc.assert(\n fc.property(\n cartGenerator.filter(cart => cart.items.length > 0),\n cart => {\n const withoutDiscount = calculateCartTotal({\n ...cart,\n discountCode: undefined,\n });\n const withDiscount = calculateCartTotal({\n ...cart,\n discountCode: 'SAVE10',\n });\n\n // With discount should be less than or equal to without discount\n return withDiscount <= withoutDiscount;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/examples/property-testing/business-logic.example.ts", "start_line": null, "end_line": null, "dependencies": ["calculateCartTotal"], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "When a discount code is present, the total calculated should be less than or equal to the total without the discount.", "mode": "fast-check"} {"id": 54937, "name": "unknown", "code": "test('surrogate pairs', () => {\n fc.assert(\n fc.property(\n fc.integer({ min: 0xffff + 1, max: 0xeffff }),\n // @ts-ignore\n cp => {\n let ch = String.fromCodePoint(cp);\n let hi = ch.charCodeAt(0);\n let lo = ch.charCodeAt(1);\n return (\n isHighSurrogate(hi) &&\n isLowSurrogate(lo) &&\n cp === surrogatePairToCodePoint(hi, lo)\n );\n }\n )\n )\n})", "language": "typescript", "source_file": "./repos/cometkim/unicode-segmenter/test/utils.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "cometkim/unicode-segmenter", "url": "https://github.com/cometkim/unicode-segmenter.git", "license": "MIT", "stars": 77, "forks": 2}, "metrics": null, "summary": "Character pairs should correctly form surrogate pairs with high and low surrogate conditions holding true, ensuring their combined code point matches the original.", "mode": "fast-check"} {"id": 59564, "name": "unknown", "code": "it('should never increase the total', () => {\n fc.assert(\n fc.property(generators.items(), items => {\n const originalTotal = items.reduce(\n (sum, item) => sum + item.price * item.quantity,\n 0\n );\n const discountedTotal = applyBulkDiscount(items);\n\n return discountedTotal <= originalTotal;\n })\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/examples/property-testing/business-logic.example.ts", "start_line": null, "end_line": null, "dependencies": ["applyBulkDiscount"], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "The total amount after applying `applyBulkDiscount` should never exceed the original total amount.", "mode": "fast-check"} {"id": 59566, "name": "unknown", "code": "it('should respect minimum shipping cost', () => {\n fc.assert(\n fc.property(shippingGenerator, ([weight, distance]) => {\n const shipping = calculateShipping(weight, distance);\n return shipping >= 5.0; // Minimum base rate\n })\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/examples/property-testing/business-logic.example.ts", "start_line": null, "end_line": null, "dependencies": ["calculateShipping"], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "The `calculateShipping` function should always return a shipping cost that is at least the minimum base rate of $5.0.", "mode": "fast-check"} {"id": 59569, "name": "unknown", "code": "it('should handle email generator results consistently', () => {\n fc.assert(\n fc.property(generators.email(), email => {\n const result = isValidEmail(email);\n expect(typeof result).toBe('boolean');\n // Note: fast-check's email generator may produce emails that our\n // validator considers invalid due to different RFC compliance levels\n })\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/apps/backend-api/test/utils/validators.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "`isValidEmail` consistently returns a boolean for generated emails.", "mode": "fast-check"} {"id": 59570, "name": "unknown", "code": "it('should consistently return boolean values', () => {\n fc.assert(\n fc.property(fc.string(), input => {\n const result = isValidUrl(input);\n expect(typeof result).toBe('boolean');\n })\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/apps/backend-api/test/utils/validators.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "`isValidUrl` should consistently return boolean values for any string input.", "mode": "fast-check"} {"id": 54948, "name": "unknown", "code": "t.test('grapheme (composite)', () => {\n fc.assert(\n fc.property(\n fc.string({ unit: 'grapheme-composite' }),\n // @ts-ignore\n str => {\n assertObjectContaining(\n [...graphemeSegments(str)],\n [...intlSegmenter.segment(str)],\n );\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/cometkim/unicode-segmenter/test/grapheme.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "cometkim/unicode-segmenter", "url": "https://github.com/cometkim/unicode-segmenter.git", "license": "MIT", "stars": 77, "forks": 2}, "metrics": null, "summary": "Verifies that grapheme segments detected by `graphemeSegments` are consistent with those returned by `intlSegmenter.segment` for composite grapheme strings.", "mode": "fast-check"} {"id": 54949, "name": "unknown", "code": "t.test('should match \\\\p{Extended_Pictographic}', () => {\n fc.assert(\n fc.property(\n fc.string({ unit: 'grapheme', minLength: 1, maxLength: 1 }),\n // @ts-ignore\n str => {\n let cp = /** @type {number} */ (str.codePointAt(0));\n return isEmoji(cp) === isExtendedPictographic(cp);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/cometkim/unicode-segmenter/test/emoji.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "cometkim/unicode-segmenter", "url": "https://github.com/cometkim/unicode-segmenter.git", "license": "MIT", "stars": 77, "forks": 2}, "metrics": null, "summary": "The function `isEmoji` should return the same result as `isExtendedPictographic` for single grapheme strings.", "mode": "fast-check"} {"id": 59571, "name": "unknown", "code": "it('should handle valid URL protocols', () => {\n fc.assert(\n fc.property(\n fc.oneof(\n fc.constant('https://example.com'),\n fc.constant('http://test.org'),\n fc.constant('ftp://files.com'),\n fc.webUrl()\n ),\n url => {\n const result = isValidUrl(url);\n expect(typeof result).toBe('boolean');\n // Most of these should be valid\n expect(result).toBe(true);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/apps/backend-api/test/utils/validators.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "`isValidUrl` returns `true` for strings with valid URL protocols.", "mode": "fast-check"} {"id": 59572, "name": "unknown", "code": "it('should consistently return boolean values', () => {\n fc.assert(\n fc.property(fc.string(), input => {\n const result = isValidPhoneNumber(input);\n expect(typeof result).toBe('boolean');\n })\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/apps/backend-api/test/utils/validators.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "`isValidPhoneNumber` consistently returns a boolean value for string inputs.", "mode": "fast-check"} {"id": 59573, "name": "unknown", "code": "it('should handle valid phone number patterns', () => {\n fc.assert(\n fc.property(\n fc.oneof(\n fc.constant('(555) 123-4567'),\n fc.constant('555-123-4567'),\n fc.constant('5551234567')\n ),\n phone => {\n const result = isValidPhoneNumber(phone);\n expect(typeof result).toBe('boolean');\n // These known valid patterns should return true\n expect(result).toBe(true);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/apps/backend-api/test/utils/validators.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "`isValidPhoneNumber` returns true for known valid phone number patterns.", "mode": "fast-check"} {"id": 54951, "name": "unknown", "code": "t.test('should match \\\\p{Extended_Pictographic}', () => {\n fc.assert(\n fc.property(\n fc.string({ unit: 'grapheme', minLength: 1, maxLength: 1 }),\n // @ts-ignore\n str => {\n let cp = /** @type {number} */ (str.codePointAt(0));\n return isExtendedPictographic(cp) === /\\p{Extended_Pictographic}/u.test(str);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/cometkim/unicode-segmenter/test/emoji.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "cometkim/unicode-segmenter", "url": "https://github.com/cometkim/unicode-segmenter.git", "license": "MIT", "stars": 77, "forks": 2}, "metrics": null, "summary": "The function `isExtendedPictographic` should return true for code points that match the Unicode property `\\p{Extended_Pictographic}` for single graphemes.", "mode": "fast-check"} {"id": 59577, "name": "unknown", "code": "it('should compose correctly with array concatenation', () => {\n fc.assert(\n fc.property(\n generators.items(),\n generators.items(),\n (items1, items2) => {\n const total1 = calculateTotal(items1);\n const total2 = calculateTotal(items2);\n const combinedTotal = calculateTotal([...items1, ...items2]);\n\n expect(combinedTotal).toBeCloseTo(total1 + total2, 2);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/apps/backend-api/test/utils/enhanced-property-tests.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "The test ensures that combining two arrays of items and calculating their total results in a value close to the sum of the totals of each individual array.", "mode": "fast-check"} {"id": 59579, "name": "unknown", "code": "it('should be monotonic in discount percentage', () => {\n fc.assert(\n fc.property(\n fc.tuple(\n fc.float({ min: 0, max: 50, noNaN: true }),\n fc.float({ min: 0, max: 50, noNaN: true })\n ),\n ([percent1, percent2]) => {\n const [smaller, larger] = [\n Math.min(percent1, percent2),\n Math.max(percent1, percent2),\n ];\n\n const discount1 = calculateDiscount(100, smaller);\n const discount2 = calculateDiscount(100, larger);\n\n expect(discount2).toBeGreaterThanOrEqual(discount1);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/apps/backend-api/test/utils/enhanced-property-tests.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "The property verifies that increasing the discount percentage results in a discount that is greater than or equal to the discount from a smaller percentage.", "mode": "fast-check"} {"id": 59587, "name": "unknown", "code": "it('should equal base total when tax rate is zero', () => {\n fc.assert(\n fc.property(\n fc.array(\n fc.record({\n price: fc.float({ min: 0, max: Math.fround(100), noNaN: true }),\n quantity: fc.integer({ min: 0, max: 10 }),\n })\n ),\n items => {\n const baseTotal = calculateTotal(items);\n const totalWithTax = calculateTotalWithTax(items, 0);\n expect(totalWithTax).toBeCloseTo(baseTotal, 10);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/apps/backend-api/test/utils/calculations.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "The total with a zero tax rate should match the base total of the items.", "mode": "fast-check"} {"id": 54955, "name": "unknown", "code": "test('KtList', () => {\n fc.assert(\n fc.property(\n fc.commands(commandArb, {maxCommands: 5_000, size: 'max'}),\n function (cmds) {\n const initial = {\n model: [],\n real: {list: new KtList()},\n };\n fc.modelRun(() => ({...initial}), cmds);\n },\n ),\n {numRuns: 10, endOnFailure: true, verbose: true},\n );\n})", "language": "typescript", "source_file": "./repos/mwiencek/killer-trees/test/monkey/List.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mwiencek/killer-trees", "url": "https://github.com/mwiencek/killer-trees.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `KtList` implementation should behave consistently with the expected model when subjected to a sequence of commands.", "mode": "fast-check"} {"id": 59666, "name": "unknown", "code": "describe('helper/language', () => {\n after(async() => {\n await locale('en',);\n },);\n fc.assert(fc.property(fc.string(), (lang,) => {\n it(`no_tasks should return english string if set to ${ lang }`, async() => {\n if (\n lang.match(/^[a-z]{2}$/u,)\n && existsSync(process.cwd() + 'language/' + lang + '.yml',)\n ) {\n //skip\n return true;\n }\n await locale(lang,);\n expect(language('no_tasks',),).to.be.equal('Can\\'t measure zero tasks.',);\n return true;\n },);\n },),);\n fc.assert(fc.property(fc.string(), (key,) => {\n it(`${ key } should return a string`, () => {\n expect(language(key as languageKey,),).to.be.a('string',);\n },);\n },),);\n},)", "language": "typescript", "source_file": "./repos/idrinth-api-bench/framework/property/helper/language.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "idrinth-api-bench/framework", "url": "https://github.com/idrinth-api-bench/framework.git", "license": "MIT", "stars": 5, "forks": 5}, "metrics": null, "summary": "The property should ensure that calling `language('no_tasks')` returns the English string when the locale is set to an unsupported language, and that any key passed to `language` returns a string.", "mode": "fast-check"} {"id": 54956, "name": "unknown", "code": "test('KtSet', () => {\n fc.assert(\n fc.property(\n fc.commands(commandArb, {maxCommands: 5_000, size: 'max'}),\n function (cmds) {\n const initial = {\n model: {set: new Set()},\n real: {set: new KtSet()},\n };\n fc.modelRun(() => ({...initial}), cmds);\n },\n ),\n {numRuns: 10, endOnFailure: true, verbose: true},\n );\n})", "language": "typescript", "source_file": "./repos/mwiencek/killer-trees/test/monkey/Set.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mwiencek/killer-trees", "url": "https://github.com/mwiencek/killer-trees.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that a `KtSet` behaves consistently with JavaScript's native `Set` when exposed to a sequence of commands.", "mode": "fast-check"} {"id": 59668, "name": "unknown", "code": "it('is always the size of the smaller sequence', () => {\n fc.assert(\n fc.property(fc.array(fc.nat(), { minLength: 1 }), (lengths) => {\n const ranges = lengths.map((l) => Range(0, l));\n const first = ranges.shift();\n expectToBeDefined(first);\n const zipped = first.zip.apply(first, ranges);\n const shortestLength = Math.min.apply(Math, lengths);\n expect(zipped.size).toBe(shortestLength);\n })\n );\n })", "language": "typescript", "source_file": "./repos/immutable-js/immutable-js/__tests__/zip.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "immutable-js/immutable-js", "url": "https://github.com/immutable-js/immutable-js.git", "license": "MIT", "stars": 33051, "forks": 1777}, "metrics": null, "summary": "Zipping multiple sequences results in a sequence with a size equal to the smallest input sequence.", "mode": "fast-check"} {"id": 59670, "name": "unknown", "code": "it('has the same behavior as array splice', () => {\n fc.assert(\n fc.property(\n fc.array(fc.integer()),\n fc.integer(),\n fc.integer(),\n fc.array(fc.integer()),\n (values, index, removeNum, insertValues) => {\n const v = List(values);\n const a = values.slice(); // clone\n\n const splicedV = v.splice(index, removeNum, ...insertValues); // persistent\n a.splice(index, removeNum, ...insertValues); // mutative\n expect(splicedV.toArray()).toEqual(a);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/immutable-js/immutable-js/__tests__/splice.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "immutable-js/immutable-js", "url": "https://github.com/immutable-js/immutable-js.git", "license": "MIT", "stars": 33051, "forks": 1777}, "metrics": null, "summary": "Splicing a `List` should produce the same result as splicing an array.", "mode": "fast-check"} {"id": 54958, "name": "unknown", "code": "test('KtMap', () => {\n fc.assert(\n fc.property(\n fc.commands(commandArb, {maxCommands: 5_000, size: 'max'}),\n function (cmds) {\n const initial = {\n model: new Map(),\n real: {map: new KtMap()},\n };\n fc.modelRun(() => ({...initial}), cmds);\n },\n ),\n {numRuns: 10, endOnFailure: true, verbose: true},\n );\n})", "language": "typescript", "source_file": "./repos/mwiencek/killer-trees/test/monkey/Map.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mwiencek/killer-trees", "url": "https://github.com/mwiencek/killer-trees.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`KtMap` behavior should align with a standard `Map` across a sequence of operations represented by commands.", "mode": "fast-check"} {"id": 54959, "name": "unknown", "code": "it('works with anything', () => {\n fc.assert(\n fc.property(\n fc.anything().filter((x) => x !== undefined),\n (x) => {\n const id = Id.of(x)\n\n verify(id.fold(identity)).is(x)\n verify(map(identity)(id)).is(Id.of(x))\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/shahabkhalvati/funktx/__tests__/types/id.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "shahabkhalvati/funktx", "url": "https://github.com/shahabkhalvati/funktx.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "`Id.of(x)` should return an `Id` instance such that applying `fold(identity)` and `map(identity)` returns the original value.", "mode": "fast-check"} {"id": 59671, "name": "unknown", "code": "it('works like Array.prototype.slice', () => {\n fc.assert(\n fc.property(\n fc.integer({ min: -1000, max: 1000 }),\n fc.sparseArray(fc.integer({ min: -1000, max: 1000 }), { maxLength: 3 }),\n (valuesLen, args) => {\n const a = Range(0, valuesLen).toArray();\n const v = List(a);\n\n const slicedV = v.slice(...args);\n const slicedA = a.slice(...args);\n expect(slicedV.toArray()).toEqual(slicedA);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/immutable-js/immutable-js/__tests__/slice.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "immutable-js/immutable-js", "url": "https://github.com/immutable-js/immutable-js.git", "license": "MIT", "stars": 33051, "forks": 1777}, "metrics": null, "summary": "`List.slice` should produce the same result as `Array.prototype.slice` for identical start, end, and step arguments on arrays and lists.", "mode": "fast-check"} {"id": 59672, "name": "unknown", "code": "it('works like Array.prototype.slice on sparse array input', () => {\n fc.assert(\n fc.property(\n fc.array(fc.tuple(fc.nat(1000), fc.integer({ min: -1000, max: 1000 }))),\n fc.sparseArray(fc.integer({ min: -1000, max: 1000 }), { maxLength: 3 }),\n (entries, args) => {\n const a: Array = [];\n entries.forEach((entry) => (a[entry[0]] = entry[1]));\n const s = Seq(a);\n const slicedS = s.slice(...args);\n const slicedA = a.slice(...args);\n expect(slicedS.toArray()).toEqual(slicedA);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/immutable-js/immutable-js/__tests__/slice.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "immutable-js/immutable-js", "url": "https://github.com/immutable-js/immutable-js.git", "license": "MIT", "stars": 33051, "forks": 1777}, "metrics": null, "summary": "The property should hold that slicing a sequence created from a sparse array yields the same result as using Array.prototype.slice on the same sparse array with the same arguments.", "mode": "fast-check"} {"id": 54962, "name": "unknown", "code": "it('Converts correctly to Either', () => {\n fc.assert(\n fc.property(fc.anything().filter(isDefined), (x) => {\n verify(Nothing.of(x).toEither('default')).is(Left.of('default'))\n verify(Just.of(x).toEither('default')).is(Right.of(x))\n })\n )\n })", "language": "typescript", "source_file": "./repos/shahabkhalvati/funktx/__tests__/types/maybe.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "shahabkhalvati/funktx", "url": "https://github.com/shahabkhalvati/funktx.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "`Nothing.of(x).toEither('default')` returns `Left.of('default')`, and `Just.of(x).toEither('default')` returns `Right.of(x)`.", "mode": "fast-check"} {"id": 54964, "name": "unknown", "code": "it('works with anything', () => {\n fc.assert(\n fc.property(\n fc.anything().filter((x) => x !== undefined),\n (x) => {\n const JustX = Just.of(x)\n verify(JustX).is(Just.of(x))\n\n const onNothing = jest.fn()\n\n verify(JustX.fold(onNothing)(identity)).is(x)\n verify(map(identity)(JustX)).is(Just.of(x))\n verify(onNothing).isNotCalled()\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/shahabkhalvati/funktx/__tests__/types/maybe.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "shahabkhalvati/funktx", "url": "https://github.com/shahabkhalvati/funktx.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "`Just.of(x)` correctly encapsulates any non-undefined value and supports identity operations without calling `onNothing`.", "mode": "fast-check"} {"id": 59674, "name": "unknown", "code": "it('is not dependent on order', () => {\n fc.assert(\n fc.property(genHeterogeneousishArray, (vals) => {\n expect(\n is(\n Seq(shuffle(vals.slice())).max(),\n Seq(vals).max()\n )\n ).toEqual(true);\n })\n );\n })", "language": "typescript", "source_file": "./repos/immutable-js/immutable-js/__tests__/minmax.ts", "start_line": null, "end_line": null, "dependencies": ["shuffle"], "repo": {"name": "immutable-js/immutable-js", "url": "https://github.com/immutable-js/immutable-js.git", "license": "MIT", "stars": 33051, "forks": 1777}, "metrics": null, "summary": "`Seq.max()` should return the same value regardless of the order of elements in the array.", "mode": "fast-check"} {"id": 54966, "name": "unknown", "code": "it('works with anything', () => {\n fc.assert(\n fc.property(\n fc.anything().filter((x) => x !== undefined),\n (x) => {\n const RightX = Right.of(x)\n verify(RightX).is(Right.of(x))\n\n const onLeft = jest.fn()\n\n verify(RightX.fold(onLeft)(identity)).is(x)\n verify(map(identity)(RightX)).is(Right.of(x))\n verify(onLeft).isNotCalled()\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/shahabkhalvati/funktx/__tests__/types/either.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "shahabkhalvati/funktx", "url": "https://github.com/shahabkhalvati/funktx.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "`Right.of(x)` behaves consistently across various inputs, correctly applying `identity` and not invoking a left handler.", "mode": "fast-check"} {"id": 59678, "name": "unknown", "code": "it('shift removes the lowest index, just like array', () => {\n fc.assert(\n fc.property(fc.nat(100), (len) => {\n const a = arrayOfSize(len);\n let s = Stack(a);\n\n while (a.length) {\n expect(s.size).toBe(a.length);\n expect(s.toArray()).toEqual(a);\n s = s.shift();\n a.shift();\n }\n expect(s.size).toBe(a.length);\n expect(s.toArray()).toEqual(a);\n })\n );\n })", "language": "typescript", "source_file": "./repos/immutable-js/immutable-js/__tests__/Stack.ts", "start_line": null, "end_line": null, "dependencies": ["arrayOfSize"], "repo": {"name": "immutable-js/immutable-js", "url": "https://github.com/immutable-js/immutable-js.git", "license": "MIT", "stars": 33051, "forks": 1777}, "metrics": null, "summary": "Shifting elements in a `Stack` should remove the lowest index, matching the behavior of an array.", "mode": "fast-check"} {"id": 59679, "name": "unknown", "code": "it('unshift adds the next lowest index, just like array', () => {\n fc.assert(\n fc.property(fc.nat(100), (len) => {\n const a: Array = [];\n let s = Stack();\n\n for (let ii = 0; ii < len; ii++) {\n expect(s.size).toBe(a.length);\n expect(s.toArray()).toEqual(a);\n s = s.unshift(ii);\n a.unshift(ii);\n }\n expect(s.size).toBe(a.length);\n expect(s.toArray()).toEqual(a);\n })\n );\n })", "language": "typescript", "source_file": "./repos/immutable-js/immutable-js/__tests__/Stack.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "immutable-js/immutable-js", "url": "https://github.com/immutable-js/immutable-js.git", "license": "MIT", "stars": 33051, "forks": 1777}, "metrics": null, "summary": "`unshift` on a `Stack` adds elements at the beginning, maintaining correspondence with an array's behavior in terms of size and order.", "mode": "fast-check"} {"id": 54969, "name": "unknown", "code": "should('hexToBytes <=> bytesToHex roundtrip', () =>\n fc.assert(\n fc.property(hexaString({ minLength: 2, maxLength: 64 }), (hex) => {\n if (hex.length % 2 !== 0) return;\n deepStrictEqual(hex, bytesToHex(hexToBytes(hex)));\n deepStrictEqual(hex, bytesToHex(hexToBytes(hex.toUpperCase())));\n if (typeof Buffer !== 'undefined')\n deepStrictEqual(hexToBytes(hex), Uint8Array.from(Buffer.from(hex, 'hex')));\n })\n )\n )", "language": "typescript", "source_file": "./repos/paulmillr/scure-base/test/utils.test.js", "start_line": null, "end_line": null, "dependencies": ["hexaString"], "repo": {"name": "paulmillr/scure-base", "url": "https://github.com/paulmillr/scure-base.git", "license": "MIT", "stars": 141, "forks": 18}, "metrics": null, "summary": "Converting a hexadecimal string to bytes and back to a hexadecimal string should return the original string, regardless of case, and match the byte conversion using `Buffer` when available.", "mode": "fast-check"} {"id": 54972, "name": "unknown", "code": "it ( 'works with fc-generated strings', t => {\n\n const assert = str => t.true ( !Radix64.is ( str ) || ( Radix64.decodeStr ( Radix64.encodeStr ( str ) ) === str ) );\n const property = fc.property ( fc.fullUnicodeString (), assert );\n\n fc.assert ( property, { numRuns: 1000000 } );\n\n })", "language": "typescript", "source_file": "./repos/fabiospampinato/radix64-encoding/test/index.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fabiospampinato/radix64-encoding", "url": "https://github.com/fabiospampinato/radix64-encoding.git", "license": "MIT", "stars": 7, "forks": 1}, "metrics": null, "summary": "The encoding and decoding of a string using `Radix64` should return the original string if it is initially a valid `Radix64` string.", "mode": "fast-check"} {"id": 59680, "name": "unknown", "code": "it('unshifts multiple values to the front', () => {\n fc.assert(\n fc.property(fc.nat(100), fc.nat(100), (size1: number, size2: number) => {\n const a1 = arrayOfSize(size1);\n const a2 = arrayOfSize(size2);\n\n const s1 = Stack(a1);\n const s3 = s1.unshift.apply(s1, a2);\n\n const a3 = a1.slice();\n a3.unshift.apply(a3, a2);\n\n expect(s3.size).toEqual(a3.length);\n expect(s3.toArray()).toEqual(a3);\n })\n );\n })", "language": "typescript", "source_file": "./repos/immutable-js/immutable-js/__tests__/Stack.ts", "start_line": null, "end_line": null, "dependencies": ["arrayOfSize"], "repo": {"name": "immutable-js/immutable-js", "url": "https://github.com/immutable-js/immutable-js.git", "license": "MIT", "stars": 33051, "forks": 1777}, "metrics": null, "summary": "Unshifting multiple values to the front of a stack should result in the stack having the same size and order as an array unshifted with the same values.", "mode": "fast-check"} {"id": 59681, "name": "unknown", "code": "it('includes first, excludes last', () => {\n fc.assert(\n fc.property(shrinkInt, shrinkInt, (from, to) => {\n const isIncreasing = to >= from;\n const size = isIncreasing ? to - from : from - to;\n const r = Range(from, to);\n const a = r.toArray();\n expect(r.size).toBe(size);\n expect(a.length).toBe(size);\n expect(r.get(0)).toBe(size ? from : undefined);\n expect(a[0]).toBe(size ? from : undefined);\n const last = to + (isIncreasing ? -1 : 1);\n expect(r.last()).toBe(size ? last : undefined);\n if (size) {\n // eslint-disable-next-line jest/no-conditional-expect\n expect(a[a.length - 1]).toBe(last);\n }\n })\n );\n })", "language": "typescript", "source_file": "./repos/immutable-js/immutable-js/__tests__/Range.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "immutable-js/immutable-js", "url": "https://github.com/immutable-js/immutable-js.git", "license": "MIT", "stars": 33051, "forks": 1777}, "metrics": null, "summary": "A `Range` includes the starting value but excludes the last value, verifying that its size and contents match expected behavior for increasing and decreasing ranges.", "mode": "fast-check"} {"id": 54973, "name": "unknown", "code": "it ( 'works like Buffer', t => {\n\n const assert = str => Radix64.is ( str ) ? t.deepEqual ( Radix64.encodeStr ( str ), Buffer.from ( str ).toString ( 'base64' ) ) : t.pass ();\n const property = fc.property ( fc.fullUnicodeString (), assert );\n\n fc.assert ( property, { numRuns: 1000000 } );\n\n })", "language": "typescript", "source_file": "./repos/fabiospampinato/radix64-encoding/test/index.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fabiospampinato/radix64-encoding", "url": "https://github.com/fabiospampinato/radix64-encoding.git", "license": "MIT", "stars": 7, "forks": 1}, "metrics": null, "summary": "`Radix64.encodeStr` should produce the same result as `Buffer.from().toString('base64')` for valid strings; otherwise, the test should pass without assertion.", "mode": "fast-check"} {"id": 59684, "name": "unknown", "code": "it('works like an object', () => {\n fc.assert(\n fc.property(fc.object({ maxKeys: 50 }), (obj) => {\n let map = Map(obj);\n Object.keys(obj).forEach((key) => {\n expect(map.get(key)).toBe(obj[key]);\n expect(map.has(key)).toBe(true);\n });\n Object.keys(obj).forEach((key) => {\n expect(map.get(key)).toBe(obj[key]);\n expect(map.has(key)).toBe(true);\n map = map.remove(key);\n expect(map.get(key)).toBe(undefined);\n expect(map.has(key)).toBe(false);\n });\n })\n );\n })", "language": "typescript", "source_file": "./repos/immutable-js/immutable-js/__tests__/Map.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "immutable-js/immutable-js", "url": "https://github.com/immutable-js/immutable-js.git", "license": "MIT", "stars": 33051, "forks": 1777}, "metrics": null, "summary": "A `Map` constructed from an object should accurately retrieve, confirm existence, and then correctly remove keys, behaving like the original object.", "mode": "fast-check"} {"id": 59688, "name": "unknown", "code": "it('deletes from transient', () => {\n fc.assert(\n fc.property(fc.nat(100), (len) => {\n const map = Range(0, len).toMap().asMutable();\n for (let ii = 0; ii < len; ii++) {\n expect(map.size).toBe(len - ii);\n map.remove(ii);\n }\n expect(map.size).toBe(0);\n expect(map.toObject()).toEqual({});\n })\n );\n })", "language": "typescript", "source_file": "./repos/immutable-js/immutable-js/__tests__/Map.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "immutable-js/immutable-js", "url": "https://github.com/immutable-js/immutable-js.git", "license": "MIT", "stars": 33051, "forks": 1777}, "metrics": null, "summary": "Deleting elements from a mutable map reduces its size to zero and results in an empty object representation.", "mode": "fast-check"} {"id": 59689, "name": "unknown", "code": "it('iterates through all entries', () => {\n fc.assert(\n fc.property(fc.nat(100), (len) => {\n const v = Range(0, len).toMap();\n const a = v.toArray();\n const iter = v.entries();\n for (let ii = 0; ii < len; ii++) {\n delete a[iter.next().value[0]];\n }\n expect(a).toEqual(new Array(len));\n })\n );\n })", "language": "typescript", "source_file": "./repos/immutable-js/immutable-js/__tests__/Map.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "immutable-js/immutable-js", "url": "https://github.com/immutable-js/immutable-js.git", "license": "MIT", "stars": 33051, "forks": 1777}, "metrics": null, "summary": "The test ensures that iteration through all entries of a Map results in deleting all corresponding indices from an array, leaving it as an array of the original length filled with `undefined`.", "mode": "fast-check"} {"id": 54981, "name": "unknown", "code": "it ( 'works with fc-generated strings', t => {\n\n const assert = str => t.is ( U8.decode ( U8.encode ( str ) ), str );\n const property = fc.property ( fc.fullUnicodeString (), assert );\n\n fc.assert ( property, { numRuns: 1000000 } );\n\n })", "language": "typescript", "source_file": "./repos/fabiospampinato/uint8-encoding/test/index.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fabiospampinato/uint8-encoding", "url": "https://github.com/fabiospampinato/uint8-encoding.git", "license": "MIT", "stars": 4, "forks": 1}, "metrics": null, "summary": "Encoding and then decoding a full Unicode string with `U8` should return the original string.", "mode": "fast-check"} {"id": 59690, "name": "unknown", "code": "it('iterates equivalently', () => {\n fc.assert(\n fc.property(fc.array(fc.integer()), (ints: Array) => {\n const seq = Seq(ints);\n const keyed = seq.toKeyedSeq();\n\n const seqEntries = seq.entries();\n const keyedEntries = keyed.entries();\n\n let seqStep;\n let keyedStep;\n do {\n seqStep = seqEntries.next();\n keyedStep = keyedEntries.next();\n expect(keyedStep).toEqual(seqStep);\n } while (!seqStep.done);\n })\n );\n })", "language": "typescript", "source_file": "./repos/immutable-js/immutable-js/__tests__/KeyedSeq.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "immutable-js/immutable-js", "url": "https://github.com/immutable-js/immutable-js.git", "license": "MIT", "stars": 33051, "forks": 1777}, "metrics": null, "summary": "The test verifies that converting a sequence to a keyed sequence results in both iterating equivalently, yielding the same entries.", "mode": "fast-check"} {"id": 59691, "name": "unknown", "code": "it('has symmetric equality', () => {\n fc.assert(\n fc.property(genVal, genVal, (a, b) => {\n expect(is(a, b)).toBe(is(b, a));\n }),\n { numRuns: 1000 }\n );\n })", "language": "typescript", "source_file": "./repos/immutable-js/immutable-js/__tests__/Equality.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "immutable-js/immutable-js", "url": "https://github.com/immutable-js/immutable-js.git", "license": "MIT", "stars": 33051, "forks": 1777}, "metrics": null, "summary": "Symmetric equality should hold such that if `is(a, b)` is true, then `is(b, a)` should also be true, and vice versa.", "mode": "fast-check"} {"id": 59692, "name": "unknown", "code": "it('has hash symmetry', () => {\n fc.assert(\n fc.property(genVal, genVal, (a, b) => {\n if (is(a, b)) {\n // eslint-disable-next-line jest/no-conditional-expect\n expect(a.hashCode()).toBe(b.hashCode());\n }\n }),\n { numRuns: 1000 }\n );\n })", "language": "typescript", "source_file": "./repos/immutable-js/immutable-js/__tests__/Equality.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "immutable-js/immutable-js", "url": "https://github.com/immutable-js/immutable-js.git", "license": "MIT", "stars": 33051, "forks": 1777}, "metrics": null, "summary": "When two values are considered equal by the `is` function, they should have identical hash codes.", "mode": "fast-check"} {"id": 59694, "name": "unknown", "code": "it('pushes multiple values to the end', () => {\n fc.assert(\n fc.property(fc.nat(100), fc.nat(100), (s1, s2) => {\n const a1 = arrayOfSize(s1);\n const a2 = arrayOfSize(s2);\n\n const v1 = List(a1);\n const v3 = v1.push.apply(v1, a2);\n\n const a3 = a1.slice();\n a3.push.apply(a3, a2);\n\n expect(v3.size).toEqual(a3.length);\n expect(v3.toArray()).toEqual(a3);\n })\n );\n })", "language": "typescript", "source_file": "./repos/immutable-js/immutable-js/__tests__/List.ts", "start_line": null, "end_line": null, "dependencies": ["arrayOfSize"], "repo": {"name": "immutable-js/immutable-js", "url": "https://github.com/immutable-js/immutable-js.git", "license": "MIT", "stars": 33051, "forks": 1777}, "metrics": null, "summary": "Pushing multiple values to the end of a `List` should result in a list equivalent to pushing the same values to the end of a standard array in terms of size and content.", "mode": "fast-check"} {"id": 59696, "name": "unknown", "code": "it('push adds the next highest index, just like array', () => {\n fc.assert(\n fc.property(fc.nat(100), (len) => {\n const a: Array = [];\n let v = List();\n\n for (let ii = 0; ii < len; ii++) {\n expect(v.size).toBe(a.length);\n expect(v.toArray()).toEqual(a);\n v = v.push(ii);\n a.push(ii);\n }\n expect(v.size).toBe(a.length);\n expect(v.toArray()).toEqual(a);\n })\n );\n })", "language": "typescript", "source_file": "./repos/immutable-js/immutable-js/__tests__/List.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "immutable-js/immutable-js", "url": "https://github.com/immutable-js/immutable-js.git", "license": "MIT", "stars": 33051, "forks": 1777}, "metrics": null, "summary": "Pushing elements to a `List` should result in sequential indices, matching the behavior of a regular array in terms of size and content.", "mode": "fast-check"} {"id": 59697, "name": "unknown", "code": "it('unshifts multiple values to the front', () => {\n fc.assert(\n fc.property(fc.nat(100), fc.nat(100), (s1, s2) => {\n const a1 = arrayOfSize(s1);\n const a2 = arrayOfSize(s2);\n\n const v1 = List(a1);\n const v3 = v1.unshift.apply(v1, a2);\n\n const a3 = a1.slice();\n a3.unshift.apply(a3, a2);\n\n expect(v3.size).toEqual(a3.length);\n expect(v3.toArray()).toEqual(a3);\n })\n );\n })", "language": "typescript", "source_file": "./repos/immutable-js/immutable-js/__tests__/List.ts", "start_line": null, "end_line": null, "dependencies": ["arrayOfSize"], "repo": {"name": "immutable-js/immutable-js", "url": "https://github.com/immutable-js/immutable-js.git", "license": "MIT", "stars": 33051, "forks": 1777}, "metrics": null, "summary": "Unshifting a list with multiple values should result in a list equivalent in size and content to a standard array unshift operation.", "mode": "fast-check"} {"id": 54986, "name": "unknown", "code": "it('returns a string of the same length', () => {\n fc.assert(\n fc.property(fc.string(), text => {\n expect(typeof capitalize(text)).toBe('string');\n expect(capitalize(text)).toHaveLength(text.length);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/grigio/status-components-sandbox/packages/utils/helpers/__tests__/capitalize.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "grigio/status-components-sandbox", "url": "https://github.com/grigio/status-components-sandbox.git", "license": "MIT", "stars": 5, "forks": 2}, "metrics": null, "summary": "The `capitalize` function should return a string of the same length as the input string.", "mode": "fast-check"} {"id": 54987, "name": "unknown", "code": "it('returns the same result if applied twice', () => {\n fc.assert(\n fc.property(fc.string(), text => {\n expect(capitalize(capitalize(text))).toBe(capitalize(text));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/grigio/status-components-sandbox/packages/utils/helpers/__tests__/capitalize.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "grigio/status-components-sandbox", "url": "https://github.com/grigio/status-components-sandbox.git", "license": "MIT", "stars": 5, "forks": 2}, "metrics": null, "summary": "Applying `capitalize` twice to a string should return the same result as applying it once.", "mode": "fast-check"} {"id": 54988, "name": "unknown", "code": "it ( 'works with fc-generated strings', t => {\n\n const assert = str => t.is ( toUint8 ( Buffer.from ( str ).toString ( 'hex' ) ).join ( ',' ), Buffer.from ( Buffer.from ( str ).toString ( 'hex' ), 'hex' ).join ( ',' ) );\n const property = fc.property ( fc.fullUnicodeString (), assert );\n\n fc.assert ( property, { numRuns: 1000000 } );\n\n })", "language": "typescript", "source_file": "./repos/fabiospampinato/hex-to-uint8/test/index.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fabiospampinato/hex-to-uint8", "url": "https://github.com/fabiospampinato/hex-to-uint8.git", "license": "MIT", "stars": 3, "forks": 0}, "metrics": null, "summary": "Converting a full Unicode string to a hexadecimal representation and back should yield the same byte sequence.", "mode": "fast-check"} {"id": 59698, "name": "unknown", "code": "it('iterates through List', () => {\n fc.assert(\n fc.property(pInt, pInt, (start, len) => {\n const l1 = Range(0, start + len).toList();\n const l2: List = l1.slice(start, start + len);\n expect(l2.size).toBe(len);\n const valueIter = l2.values();\n const keyIter = l2.keys();\n const entryIter = l2.entries();\n for (let ii = 0; ii < len; ii++) {\n expect(valueIter.next().value).toBe(start + ii);\n expect(keyIter.next().value).toBe(ii);\n expect(entryIter.next().value).toEqual([ii, start + ii]);\n }\n })\n );\n })", "language": "typescript", "source_file": "./repos/immutable-js/immutable-js/__tests__/List.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "immutable-js/immutable-js", "url": "https://github.com/immutable-js/immutable-js.git", "license": "MIT", "stars": 33051, "forks": 1777}, "metrics": null, "summary": "Iterating through a sliced `List` produces expected values, keys, and entries, with the correct size and sequence.", "mode": "fast-check"} {"id": 59801, "name": "unknown", "code": "test(\"[prop] whatever value you initialize it with is what comes out\", () => {\n fc.assert(\n fc.property(\n anyObject,\n\n (value) => {\n const signal = new MutableSignal(value);\n expect(signal.get()).toBe(value);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/liveblocks/liveblocks/packages/liveblocks-core/src/lib/__tests__/signals/MutableSignal.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "liveblocks/liveblocks", "url": "https://github.com/liveblocks/liveblocks.git", "license": "Apache-2.0", "stars": 4080, "forks": 361}, "metrics": null, "summary": "Initializing a `MutableSignal` with a value should return the same value from `get()`.", "mode": "fast-check"} {"id": 54992, "name": "unknown", "code": "it ( 'can encode and decode fc-generated buffers', t => {\n\n const encoder = new TextEncoder ();\n const encode = str => encoder.encode ( str );\n const assert = str => t.deepEqual ( Archive.decode ( Archive.encode ( encode ( str ) ) ), encode ( str ) );\n const property = fc.property ( fc.fullUnicodeString (), assert );\n\n fc.assert ( property, { numRuns: 1_000_000 } );\n\n })", "language": "typescript", "source_file": "./repos/fabiospampinato/huffy/test/index.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fabiospampinato/huffy", "url": "https://github.com/fabiospampinato/huffy.git", "license": "MIT", "stars": 12, "forks": 0}, "metrics": null, "summary": "Encoding and decoding `fc`-generated buffers should preserve the original content, resulting in identical encoded and decoded outputs.", "mode": "fast-check"} {"id": 54993, "name": "unknown", "code": "it(\"add forward pass property: add(a, b).data === a.data + b.data\", () => {\n fc.assert(\n fc.property(valueArbitrary, valueArbitrary, (a, b) => {\n const result = eng.add(a, b);\n // Use closeTo due to potential floating point inaccuracies\n return closeTo(result.data, a.data + b.data);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/ianchanning/micrograd-js/engine.test.js", "start_line": null, "end_line": null, "dependencies": ["closeTo"], "repo": {"name": "ianchanning/micrograd-js", "url": "https://github.com/ianchanning/micrograd-js.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 54994, "name": "unknown", "code": "it(\"mul forward pass property: mul(a, b).data === a.data * b.data\", () => {\n fc.assert(\n fc.property(valueArbitrary, valueArbitrary, (a, b) => {\n const result = eng.mul(a, b);\n return closeTo(result.data, a.data * b.data);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/ianchanning/micrograd-js/engine.test.js", "start_line": null, "end_line": null, "dependencies": ["closeTo"], "repo": {"name": "ianchanning/micrograd-js", "url": "https://github.com/ianchanning/micrograd-js.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 54995, "name": "unknown", "code": "it(\"tanh forward pass property: tanh(a).data === Math.tanh(a.data)\", () => {\n // Avoid large inputs to tanh where output is exactly +/-1, might cause gradient issues if not handled carefully later\n const boundedValueArbitrary = fc\n .float({ min: -10, max: 10, noNaN: true })\n .map((n) => eng.value(n));\n fc.assert(\n fc.property(boundedValueArbitrary, (a) => {\n const result = eng.tanh(a);\n return closeTo(result.data, Math.tanh(a.data));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/ianchanning/micrograd-js/engine.test.js", "start_line": null, "end_line": null, "dependencies": ["closeTo"], "repo": {"name": "ianchanning/micrograd-js", "url": "https://github.com/ianchanning/micrograd-js.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59802, "name": "unknown", "code": "test(\"[prop] mutating works with any value\", () => {\n fc.assert(\n fc.property(\n anyObject,\n fc.anything(),\n\n (init, newVal) => {\n const signal = new MutableSignal(init);\n expect(signal.get()).toBe(init);\n\n signal.mutate((x) => {\n // @ts-expect-error deliberately mutate\n x.whatever = newVal;\n });\n expect(signal.get()).toBe(init);\n\n // But the mutation happened\n expect(\n // @ts-expect-error deliberately access\n signal.get().whatever\n ).toBe(newVal);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/liveblocks/liveblocks/packages/liveblocks-core/src/lib/__tests__/signals/MutableSignal.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "liveblocks/liveblocks", "url": "https://github.com/liveblocks/liveblocks.git", "license": "Apache-2.0", "stars": 4080, "forks": 361}, "metrics": null, "summary": "Mutating properties of a `MutableSignal` correctly reflects changes on the internal state while maintaining the initial object reference.", "mode": "fast-check"} {"id": 54996, "name": "unknown", "code": "it(\"add backward pass gradient property\", () => {\n fc.assert(\n fc.property(valueArbitrary, valueArbitrary, (a, b) => {\n // Need fresh values for each run to avoid grad accumulation across properties\n const fresh_a = eng.value(a.data);\n const fresh_b = eng.value(b.data);\n const result = eng.add(fresh_a, fresh_b);\n result.backward(); // Call the state-updating method.\n // Check gradients are approximately 1.0 (scaled by result.grad which is 1.0)\n return closeTo(fresh_a.grad, 1.0) && closeTo(fresh_b.grad, 1.0);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/ianchanning/micrograd-js/engine.test.js", "start_line": null, "end_line": null, "dependencies": ["closeTo"], "repo": {"name": "ianchanning/micrograd-js", "url": "https://github.com/ianchanning/micrograd-js.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The gradients of `fresh_a` and `fresh_b` should be approximately 1.0 after performing a backward pass on their sum.", "mode": "fast-check"} {"id": 54998, "name": "unknown", "code": "it(\"tanh backward pass gradient property\", () => {\n const boundedValueArbitrary = fc\n .float({ min: -10, max: 10, noNaN: true })\n .map((n) => eng.value(n));\n fc.assert(\n fc.property(boundedValueArbitrary, (a) => {\n const fresh_a = eng.value(a.data);\n const result = eng.tanh(fresh_a);\n result.backward(); // Call the method!\n const expected_grad = 1.0 - result.data * result.data; // 1 - tanh(a.data)^2\n return closeTo(fresh_a.grad, expected_grad);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/ianchanning/micrograd-js/engine.test.js", "start_line": null, "end_line": null, "dependencies": ["closeTo"], "repo": {"name": "ianchanning/micrograd-js", "url": "https://github.com/ianchanning/micrograd-js.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `tanh` backward pass should produce a gradient at each point that is close to \\(1 - \\text{tanh}(a.\\text{data})^2\\).", "mode": "fast-check"} {"id": 54999, "name": "unknown", "code": "it(\"add commutativity property (data only)\", () => {\n fc.assert(\n fc.property(valueArbitrary, valueArbitrary, (a, b) => {\n const res1 = eng.add(a, b);\n const res2 = eng.add(b, a);\n return closeTo(res1.data, res2.data);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/ianchanning/micrograd-js/engine.test.js", "start_line": null, "end_line": null, "dependencies": ["closeTo"], "repo": {"name": "ianchanning/micrograd-js", "url": "https://github.com/ianchanning/micrograd-js.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55000, "name": "unknown", "code": "it(\"mul commutativity property (data only)\", () => {\n fc.assert(\n fc.property(valueArbitrary, valueArbitrary, (a, b) => {\n const res1 = eng.mul(a, b);\n const res2 = eng.mul(b, a);\n return closeTo(res1.data, res2.data);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/ianchanning/micrograd-js/engine.test.js", "start_line": null, "end_line": null, "dependencies": ["closeTo"], "repo": {"name": "ianchanning/micrograd-js", "url": "https://github.com/ianchanning/micrograd-js.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59803, "name": "unknown", "code": "it(\"all equal scalars are shallowly equal\", () => {\n fc.assert(\n fc.property(\n // Inputs\n fc.clone(scalar(), 2),\n\n // Unit test\n ([scalar1, scalar2]) => {\n expect(shallow(scalar1, scalar2)).toBe(true);\n\n // If two values are shallowly equal, then those values wrapped in an\n // array (one level) should _also_ be considered shallowly equal\n expect(shallow([scalar1], [scalar2])).toBe(true);\n expect(shallow([scalar1, scalar1], [scalar2, scalar2])).toBe(true);\n\n // ...but wrapping twice is _never_ going to be equal\n expect(shallow([[scalar1]], [[scalar2]])).toBe(false);\n\n // Ditto for objects\n expect(shallow({ a: scalar1 }, { a: scalar2 })).toBe(true);\n expect(\n shallow({ a: scalar1, b: scalar1 }, { a: scalar2, b: scalar2 })\n ).toBe(true);\n\n // ...but nesting twice is _never_ going to be equal\n expect(shallow({ a: { b: scalar1 } }, { a: { b: scalar2 } })).toBe(\n false\n );\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/liveblocks/liveblocks/packages/liveblocks-core/src/lib/__tests__/shallow.test.ts", "start_line": null, "end_line": null, "dependencies": ["scalar"], "repo": {"name": "liveblocks/liveblocks", "url": "https://github.com/liveblocks/liveblocks.git", "license": "Apache-2.0", "stars": 4080, "forks": 361}, "metrics": null, "summary": "All equal scalar values are shallowly equal, whether alone, in single-level arrays, or in single-level objects, but not when nested beyond one level.", "mode": "fast-check"} {"id": 59804, "name": "unknown", "code": "it(\"different scalars are not shallowly equal\", () => {\n fc.assert(\n fc.property(\n // Inputs\n fc.tuple(scalar(), scalar()).filter(([x, y]) => x !== y),\n\n // Unit test\n ([scalar1, scalar2]) => {\n expect(shallow(scalar1, scalar2)).toBe(false);\n\n // If two values are shallowly unequal, then wrapping those in an\n // array (one level) should also always be shallowly unequal\n expect(shallow([scalar1], [scalar2])).toBe(false);\n\n // Ditto for objects\n expect(shallow({ k: scalar1 }, { k: scalar2 })).toBe(false);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/liveblocks/liveblocks/packages/liveblocks-core/src/lib/__tests__/shallow.test.ts", "start_line": null, "end_line": null, "dependencies": ["scalar"], "repo": {"name": "liveblocks/liveblocks", "url": "https://github.com/liveblocks/liveblocks.git", "license": "Apache-2.0", "stars": 4080, "forks": 361}, "metrics": null, "summary": "Different scalar values should not be shallowly equal, even when wrapped in arrays or objects.", "mode": "fast-check"} {"id": 55003, "name": "unknown", "code": "it('adds element to tree', () => {\n fc.assert(fc.property(fc.array(fc.integer()),\n nums => {\n const tree = nums.reduce(insert, null)\n\n return nums.map(n => search(tree, n))\n .every(result => !!result || result === 0)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Jamie-Rodriguez/data-structs-and-algos/binary-search-tree.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Jamie-Rodriguez/data-structs-and-algos", "url": "https://github.com/Jamie-Rodriguez/data-structs-and-algos.git", "license": "BSD-2-Clause", "stars": 0, "forks": 0}, "metrics": null, "summary": "Elements inserted into a binary search tree should be successfully found by the search function, returning a truthy result or zero for each inserted element.", "mode": "fast-check"} {"id": 59805, "name": "unknown", "code": "it(\"equal composite values\", () => {\n fc.assert(\n fc.property(\n // Inputs\n fc.clone(complex(), 2),\n\n // Unit test\n ([complex1, complex2]) => {\n // Property: _if_ two complex values are considered shallowly equal,\n // then wrapping them in an array (one level) will guarantee they're\n // not shallowly equal\n if (shallow(complex1, complex2)) {\n expect(shallow([complex1], [complex2])).toBe(false);\n }\n\n // Ditto for objects\n if (shallow(complex1, complex2)) {\n expect(shallow({ k: complex1 }, { k: complex2 })).toBe(false);\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/liveblocks/liveblocks/packages/liveblocks-core/src/lib/__tests__/shallow.test.ts", "start_line": null, "end_line": null, "dependencies": ["complex"], "repo": {"name": "liveblocks/liveblocks", "url": "https://github.com/liveblocks/liveblocks.git", "license": "Apache-2.0", "stars": 4080, "forks": 361}, "metrics": null, "summary": "If two complex values are shallowly equal, wrapping them in a one-level array or object ensures they are not shallowly equal.", "mode": "fast-check"} {"id": 55004, "name": "unknown", "code": "it('preserves property: left subtree < node < right subtree for all nodes in tree', () => {\n fc.assert(fc.property(fc.array(fc.integer()),\n nums => {\n const tree = nums.reduce(insert, null)\n\n return isBinarySearchTree(tree)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Jamie-Rodriguez/data-structs-and-algos/binary-search-tree.test.js", "start_line": null, "end_line": null, "dependencies": ["isBinarySearchTree"], "repo": {"name": "Jamie-Rodriguez/data-structs-and-algos", "url": "https://github.com/Jamie-Rodriguez/data-structs-and-algos.git", "license": "BSD-2-Clause", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55005, "name": "unknown", "code": "it('removes element from tree', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.array(fc.integer()),\n (remaining, removals) => {\n const nums = [...remaining, ...removals]\n const tree = nums.reduce(insert, null)\n\n const treePostRemovals = removals.reduce(remove, tree)\n\n return !removals.filter(\n key => search(treePostRemovals, key)\n ).length\n }),\n { verbose: 0 }\n )\n })", "language": "typescript", "source_file": "./repos/Jamie-Rodriguez/data-structs-and-algos/binary-search-tree.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Jamie-Rodriguez/data-structs-and-algos", "url": "https://github.com/Jamie-Rodriguez/data-structs-and-algos.git", "license": "BSD-2-Clause", "stars": 0, "forks": 0}, "metrics": null, "summary": "Removing elements from a binary search tree ensures they cannot be found afterward.", "mode": "fast-check"} {"id": 59806, "name": "unknown", "code": "it(\"consistency\", () => {\n fc.assert(\n fc.property(\n // Inputs\n fc.oneof(\n fc.tuple(anything(), anything()),\n\n // Add a few clones in the mix too, to ensure we'll have different and equal values\n fc.clone(anything(), 2)\n ),\n\n // Unit test\n ([value1, value2]) => {\n // _If_ sticking these values in an array makes them shallow-equal,\n // then they should also always be equal without the array wrappers\n if (shallow([value1], [value2])) {\n expect(shallow(value1, value2)).toBe(true);\n }\n\n if (shallow({ k: value1 }, { k: value2 })) {\n expect(shallow(value1, value2)).toBe(true);\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/liveblocks/liveblocks/packages/liveblocks-core/src/lib/__tests__/shallow.test.ts", "start_line": null, "end_line": null, "dependencies": ["anything"], "repo": {"name": "liveblocks/liveblocks", "url": "https://github.com/liveblocks/liveblocks.git", "license": "Apache-2.0", "stars": 4080, "forks": 361}, "metrics": null, "summary": "The property should hold that if two values are shallow-equal when wrapped in arrays or objects, they should be shallow-equal without the wrappers.", "mode": "fast-check"} {"id": 59807, "name": "unknown", "code": "it(\"argument ordering does not matter\", () => {\n fc.assert(\n fc.property(\n // Inputs\n fc.oneof(\n fc.tuple(anything(), anything()),\n\n // Add a few clones in the mix too, to ensure we'll have different and equal values\n fc.clone(anything(), 2)\n ),\n\n // Unit test\n ([value1, value2]) => {\n // Order doesn't matter when comparing\n expect(shallow(value1, value2)).toBe(shallow(value2, value1));\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/liveblocks/liveblocks/packages/liveblocks-core/src/lib/__tests__/shallow.test.ts", "start_line": null, "end_line": null, "dependencies": ["anything"], "repo": {"name": "liveblocks/liveblocks", "url": "https://github.com/liveblocks/liveblocks.git", "license": "Apache-2.0", "stars": 4080, "forks": 361}, "metrics": null, "summary": "The property verifies that the `shallow` comparison function produces the same result regardless of the order of its two arguments.", "mode": "fast-check"} {"id": 59808, "name": "unknown", "code": "it(\"date (and other non-pojos) are never considered equal\", () => {\n fc.assert(\n fc.property(\n // Inputs\n fc.oneof(\n fc.tuple(nonpojo(), nonpojo()),\n\n // Add a few clones in the mix too, to ensure we'll have different and equal values\n fc.clone(nonpojo(), 2)\n ),\n\n // Unit test\n ([v1, v2]) => {\n expect(shallow(v1, v2)).toBe(false);\n expect(shallow([v1], [v2])).toBe(false);\n expect(shallow({ k: v1 }, { k: v2 })).toBe(false);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/liveblocks/liveblocks/packages/liveblocks-core/src/lib/__tests__/shallow.test.ts", "start_line": null, "end_line": null, "dependencies": ["nonpojo"], "repo": {"name": "liveblocks/liveblocks", "url": "https://github.com/liveblocks/liveblocks.git", "license": "Apache-2.0", "stars": 4080, "forks": 361}, "metrics": null, "summary": "Non-plain old JavaScript objects (non-POJOs) such as Dates, Sets, and Maps are never considered equal by the `shallow` function, even when identical or cloned.", "mode": "fast-check"} {"id": 55007, "name": "unknown", "code": "it('preserves tree when attempting to remove non-existent key', () => {\n fc.assert(fc.property(splitUniqueArrayArbitrary,\n ([insertions, removals]) => {\n const tree = insertions.reduce(insert, null)\n\n const treePostRemovals = removals.reduce(remove, tree)\n\n const existentKeys = insertions.filter(\n key => search(treePostRemovals, key)\n )\n\n const originalSet = new Set(insertions)\n const removedSet = new Set(removals)\n\n return existentKeys.every(\n key => originalSet.has(key) && !removedSet.has(key)\n )\n }),\n { verbose: 0 }\n )\n })", "language": "typescript", "source_file": "./repos/Jamie-Rodriguez/data-structs-and-algos/binary-search-tree.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Jamie-Rodriguez/data-structs-and-algos", "url": "https://github.com/Jamie-Rodriguez/data-structs-and-algos.git", "license": "BSD-2-Clause", "stars": 0, "forks": 0}, "metrics": null, "summary": "Attempting to remove non-existent keys from a binary search tree preserves the existing keys.", "mode": "fast-check"} {"id": 59810, "name": "unknown", "code": "test(\"normal usage\", () => {\n fc.assert(\n fc.property(\n anything(),\n\n (payload) => {\n const callback = jest.fn();\n const hub = makeEventSource();\n\n hub.observable.subscribe(callback);\n hub.notify(payload);\n hub.notify(payload);\n hub.notify(payload);\n\n expect(callback).toHaveBeenCalledTimes(3);\n for (const [arg] of callback.mock.calls) {\n expect(arg).toBe(payload);\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/liveblocks/liveblocks/packages/liveblocks-core/src/lib/__tests__/EventSource.test.ts", "start_line": null, "end_line": null, "dependencies": ["anything"], "repo": {"name": "liveblocks/liveblocks", "url": "https://github.com/liveblocks/liveblocks.git", "license": "Apache-2.0", "stars": 4080, "forks": 361}, "metrics": null, "summary": "The `makeEventSource` should notify subscribers, calling the subscribed callback with the same payload for each notification.", "mode": "fast-check"} {"id": 55010, "name": "unknown", "code": "it('adds element to tree', () => {\n fc.assert(fc.property(fc.array(fc.integer()),\n nums => {\n const tree = nums.reduce(insert, null)\n\n return nums.map(n => search(tree, n))\n .every(result => !!result || result === 0)\n }),\n { verbose: 0 }\n )\n })", "language": "typescript", "source_file": "./repos/Jamie-Rodriguez/data-structs-and-algos/avl-tree.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Jamie-Rodriguez/data-structs-and-algos", "url": "https://github.com/Jamie-Rodriguez/data-structs-and-algos.git", "license": "BSD-2-Clause", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that after inserting elements into a tree, searching for each element returns a truthy result or zero.", "mode": "fast-check"} {"id": 59811, "name": "unknown", "code": "test(\"registering multiple callbacks\", () => {\n fc.assert(\n fc.property(\n anything(),\n\n (payload) => {\n const callback1 = jest.fn();\n const callback2 = jest.fn();\n const hub = makeEventSource();\n\n hub.observable.subscribe(callback1);\n hub.notify(payload);\n\n hub.observable.subscribe(callback2);\n hub.notify(payload);\n hub.notify(payload);\n\n expect(callback1).toHaveBeenCalledTimes(3);\n for (const [arg] of callback1.mock.calls) {\n expect(arg).toBe(payload);\n }\n\n expect(callback2).toHaveBeenCalledTimes(2);\n for (const [arg] of callback2.mock.calls) {\n expect(arg).toBe(payload);\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/liveblocks/liveblocks/packages/liveblocks-core/src/lib/__tests__/EventSource.test.ts", "start_line": null, "end_line": null, "dependencies": ["anything"], "repo": {"name": "liveblocks/liveblocks", "url": "https://github.com/liveblocks/liveblocks.git", "license": "Apache-2.0", "stars": 4080, "forks": 361}, "metrics": null, "summary": "Registering multiple callbacks ensures each callback is invoked the expected number of times with the correct payload.", "mode": "fast-check"} {"id": 59813, "name": "unknown", "code": "test(\"deregisering usage\", () => {\n fc.assert(\n fc.property(\n anything(),\n\n (payload) => {\n const callback1 = jest.fn();\n const callback2 = jest.fn();\n const hub = makeEventSource();\n\n const dereg1 = hub.observable.subscribe(callback1);\n\n // Registering the same function instance multiple times has no\n // observable effect\n const dereg2a = hub.observable.subscribe(callback2);\n const dereg2b = hub.observable.subscribe(callback2);\n\n hub.notify(payload);\n hub.notify(payload);\n\n expect(callback1).toHaveBeenCalledTimes(2); // Both get updates\n expect(callback2).toHaveBeenCalledTimes(2);\n\n // Deregister callback1\n dereg1();\n\n hub.notify(payload);\n hub.notify(payload);\n hub.notify(payload);\n\n expect(callback1).toHaveBeenCalledTimes(2); // Callback1 stopped getting updates\n expect(callback2).toHaveBeenCalledTimes(5); // Callback2 still receives updates\n\n // Deregister callback2\n dereg2a();\n\n hub.notify(payload);\n hub.notify(payload);\n hub.notify(payload);\n\n expect(callback1).toHaveBeenCalledTimes(2); // Callback1 already stopped getting updates before\n expect(callback2).toHaveBeenCalledTimes(5); // Callback2 now also stopped getting them\n\n // Deregister callback2 again (has no effect)\n dereg2b();\n\n hub.notify(payload);\n hub.notify(payload);\n hub.notify(payload);\n\n expect(callback1).toHaveBeenCalledTimes(2); // Callback1 already stopped getting updates before\n expect(callback2).toHaveBeenCalledTimes(5); // Callback2 already stopped getting updates before\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/liveblocks/liveblocks/packages/liveblocks-core/src/lib/__tests__/EventSource.test.ts", "start_line": null, "end_line": null, "dependencies": ["anything"], "repo": {"name": "liveblocks/liveblocks", "url": "https://github.com/liveblocks/liveblocks.git", "license": "Apache-2.0", "stars": 4080, "forks": 361}, "metrics": null, "summary": "The property ensures that `EventSource` correctly manages subscription and deregistration of callback functions, verifying that callbacks receive updates only when subscribed and stop receiving them when deregistered.", "mode": "fast-check"} {"id": 59814, "name": "unknown", "code": "test(\"pausing/continuing event delivery\", () => {\n fc.assert(\n fc.property(\n anything(),\n\n (payload) => {\n const callback = jest.fn();\n const hub = makeBufferableEventSource();\n\n const unsub = hub.observable.subscribe(callback);\n\n hub.pause();\n hub.notify(payload);\n hub.notify(payload);\n hub.notify(payload);\n\n expect(callback).not.toHaveBeenCalled(); // No events get delivered until unpaused\n\n hub.unpause();\n expect(callback).toHaveBeenCalledTimes(3); // Buffered events get delivered\n\n // Deregister callback\n unsub();\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/liveblocks/liveblocks/packages/liveblocks-core/src/lib/__tests__/EventSource.test.ts", "start_line": null, "end_line": null, "dependencies": ["anything"], "repo": {"name": "liveblocks/liveblocks", "url": "https://github.com/liveblocks/liveblocks.git", "license": "Apache-2.0", "stars": 4080, "forks": 361}, "metrics": null, "summary": "Pausing an event source prevents event delivery, and unpausing it delivers all buffered events.", "mode": "fast-check"} {"id": 59815, "name": "unknown", "code": "test(\"[prop] whatever value you initialize it with is what comes out\", () => {\n fc.assert(\n fc.property(\n fc.anything(),\n\n (value) => {\n const signal = new Signal(value);\n expect(signal.get()).toBe(value);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/liveblocks/liveblocks/packages/liveblocks-core/src/lib/__tests__/signals/Signal.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "liveblocks/liveblocks", "url": "https://github.com/liveblocks/liveblocks.git", "license": "Apache-2.0", "stars": 4080, "forks": 361}, "metrics": null, "summary": "Initializing a `Signal` with any value should result in `get()` returning that same value.", "mode": "fast-check"} {"id": 59816, "name": "unknown", "code": "test(\"[prop] setting works with any value\", () => {\n fc.assert(\n fc.property(\n fc.anything(),\n fc.anything(),\n\n (init, newVal) => {\n const signal = new Signal(init);\n expect(signal.get()).toBe(init);\n\n signal.set(newVal);\n expect(signal.get()).toBe(newVal);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/liveblocks/liveblocks/packages/liveblocks-core/src/lib/__tests__/signals/Signal.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "liveblocks/liveblocks", "url": "https://github.com/liveblocks/liveblocks.git", "license": "Apache-2.0", "stars": 4080, "forks": 361}, "metrics": null, "summary": "Setting a `Signal` object with any initial value and then updating it should correctly reflect the updated value.", "mode": "fast-check"} {"id": 55015, "name": "unknown", "code": "it('preserves tree when attempting to remove non-existent key', () => {\n fc.assert(fc.property(splitUniqueArrayArbitrary,\n ([insertions, removals]) => {\n const tree = insertions.reduce(insert, null)\n\n const treePostRemovals = removals.reduce(remove, tree)\n\n const existentKeys = insertions.filter(\n key => search(treePostRemovals, key)\n )\n\n const originalSet = new Set(insertions)\n const removedSet = new Set(removals)\n\n return existentKeys.every(\n key => originalSet.has(key) && !removedSet.has(key)\n )\n }),\n { verbose: 0 }\n )\n })", "language": "typescript", "source_file": "./repos/Jamie-Rodriguez/data-structs-and-algos/avl-tree.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Jamie-Rodriguez/data-structs-and-algos", "url": "https://github.com/Jamie-Rodriguez/data-structs-and-algos.git", "license": "BSD-2-Clause", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59817, "name": "unknown", "code": "test(\"[prop] will freeze all given values\", () => {\n fc.assert(\n fc.property(\n fc.anything().filter((x) => x !== null && x !== undefined),\n fc.anything().filter((x) => x !== null && x !== undefined),\n\n (init, newVal) => {\n // Freezes in constructor\n const signal = new Signal(init);\n expect(signal.get()).toBe(init);\n\n /* eslint-disable @typescript-eslint/no-unsafe-return */\n expect(() => {\n // @ts-expect-error - deliberately set invalid prop\n signal.get().abc = 123;\n }).toThrow(TypeError);\n\n // @ts-expect-error - get prop\n expect(signal.get().abc).toBe(undefined);\n\n // Freezes in setter\n signal.set(newVal);\n\n expect(() => {\n // @ts-expect-error - deliberately set invalid prop\n signal.get().xyz = 456;\n }).toThrow(TypeError);\n\n // @ts-expect-error - get prop\n expect(signal.get().xyz).toBe(undefined);\n /* eslint-enable @typescript-eslint/no-unsafe-return */\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/liveblocks/liveblocks/packages/liveblocks-core/src/lib/__tests__/signals/Signal.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "liveblocks/liveblocks", "url": "https://github.com/liveblocks/liveblocks.git", "license": "Apache-2.0", "stars": 4080, "forks": 361}, "metrics": null, "summary": "`Signal` should freeze all given non-null, non-undefined values, preventing modification of properties.", "mode": "fast-check"} {"id": 55019, "name": "unknown", "code": "test('Passwords which length is more than 20 should be rejected', () => {\r\n fc.assert(\r\n fc.property(fc.string(21,100),(password:string) => {\r\n ///console.log(password);\r\n expect(validate(password)).toBe(false);\r\n })\r\n );\r\n })", "language": "typescript", "source_file": "./repos/freddiefujiwara/fast-check-password-validator-example/__tests__/password_validator.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "freddiefujiwara/fast-check-password-validator-example", "url": "https://github.com/freddiefujiwara/fast-check-password-validator-example.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Passwords with a length greater than 20 characters should be rejected by the `validate` function.", "mode": "fast-check"} {"id": 59820, "name": "unknown", "code": "it(\"matchW\", () => {\n const f = Weather.matchW({\n Rain: n => `${n}mm`,\n [_]: () => null,\n })\n\n fc.assert(\n fc.property(fc.integer(), n =>\n expect(f(Weather.mk.Rain(n))).toBe(`${n}mm`),\n ),\n )\n\n expect(f(Weather.mk.Sun)).toBeNull()\n })", "language": "typescript", "source_file": "./repos/unsplash/sum-types/test/unit/index.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "unsplash/sum-types", "url": "https://github.com/unsplash/sum-types.git", "license": "MIT", "stars": 44, "forks": 2}, "metrics": null, "summary": "`Weather.matchW` maps a Rain variant with an integer to a string formatted as `${n}mm` and returns null for a Sun variant.", "mode": "fast-check"} {"id": 59822, "name": "unknown", "code": "it(\"matchXW\", () => {\n const f = Weather.matchXW({\n Rain: \"rained\",\n [_]: null,\n })\n\n fc.assert(\n fc.property(fc.integer(), n =>\n expect(f(Weather.mk.Rain(n))).toBe(\"rained\"),\n ),\n )\n\n expect(f(Weather.mk.Sun)).toBeNull()\n })", "language": "typescript", "source_file": "./repos/unsplash/sum-types/test/unit/index.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "unsplash/sum-types", "url": "https://github.com/unsplash/sum-types.git", "license": "MIT", "stars": 44, "forks": 2}, "metrics": null, "summary": "`Weather.matchXW` resolves `Weather.mk.Rain` to \"rained\" and other weather types to null.", "mode": "fast-check"} {"id": 59824, "name": "unknown", "code": "it('should authenticate successfully with the same username and password', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.string({ minLength: 4, maxLength: 16 })\n .filter(s => /^[a-zA-Z][a-zA-Z0-9]+$/.test(s)),\n async (value) => {\n try {\n const result = await srpRegisterAndAuthenticate(value, value);\n return result === true;\n } catch (e) {\n // Skip cases where jsrp throws due to internal limitations\n return true;\n }\n }\n ),\n { numRuns: 10 }\n );\n })", "language": "typescript", "source_file": "./repos/mariogalea/qualitymatters-ts-fastcheck/tests/srpAuth.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mariogalea/qualitymatters-ts-fastcheck", "url": "https://github.com/mariogalea/qualitymatters-ts-fastcheck.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`srpRegisterAndAuthenticate` should return true when the same valid username and password are used for both registration and authentication.", "mode": "fast-check"} {"id": 59827, "name": "unknown", "code": "it('should return false for a string and its reverse if they are not palindromes', () => {\n fc.assert(\n fc.property(fc.string(), (s) => {\n // Skip palindromes\n const normalized = s.replace(/[^a-zA-Z0-9]/g, '').toLowerCase();\n const reversed = normalized.split('').reverse().join('');\n if (normalized.length > 0 && normalized !== reversed) {\n return isPalindrome(s) === false || isPalindrome(s.split('').reverse().join('')) === false;\n }\n return true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/mariogalea/qualitymatters-ts-fastcheck/tests/isPalindrome.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mariogalea/qualitymatters-ts-fastcheck", "url": "https://github.com/mariogalea/qualitymatters-ts-fastcheck.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Verifies that `isPalindrome` returns false for a string and its reverse when neither is a palindrome, while ignoring non-alphanumeric characters and case differences.", "mode": "fast-check"} {"id": 59828, "name": "unknown", "code": "it('should return an array of posts with required properties', async () => {\n const posts = (await fetchPosts()) as Array;\n expect(Array.isArray(posts)).toBe(true);\n expect(posts.length).toBeGreaterThan(0);\n // Property-based: every post has userId, id, title, and body\n fc.assert(\n fc.property(fc.integer({ min: 0, max: posts.length - 1 }), (i) => {\n const post = posts[i];\n return (\n typeof post.userId === 'number' &&\n typeof post.id === 'number' &&\n typeof post.title === 'string' &&\n typeof post.body === 'string'\n );\n })\n );\n })", "language": "typescript", "source_file": "./repos/mariogalea/qualitymatters-ts-fastcheck/tests/fetchPosts.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mariogalea/qualitymatters-ts-fastcheck", "url": "https://github.com/mariogalea/qualitymatters-ts-fastcheck.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `fetchPosts` should return an array where every post contains `userId`, `id` as numbers, and `title`, `body` as strings.", "mode": "fast-check"} {"id": 59830, "name": "unknown", "code": "it('should not deliver events to unsubscribed handlers', () => {\n fc.assert(\n fc.property(fc.array(fc.string()), (events) => {\n const bus = new EventBus();\n const received: string[] = [];\n const handler = (e: string) => received.push(e);\n bus.subscribe(handler);\n bus.unsubscribe(handler);\n for (const event of events) {\n bus.publish(event);\n }\n // No events should be received after unsubscribe\n return received.length === 0;\n })\n );\n })", "language": "typescript", "source_file": "./repos/mariogalea/qualitymatters-ts-fastcheck/tests/eventBus.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mariogalea/qualitymatters-ts-fastcheck", "url": "https://github.com/mariogalea/qualitymatters-ts-fastcheck.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Events should not be delivered to handlers that have been unsubscribed from the `EventBus`.", "mode": "fast-check"} {"id": 59831, "name": "unknown", "code": "it('should echo back any string sent by the client', async () => {\n await fc.assert(\n fc.asyncProperty(fc.string(), async (msg) => {\n await new Promise((resolve, reject) => {\n const ws = new WebSocket(`ws://localhost:${port}`);\n ws.on('open', () => {\n ws.send(msg);\n });\n ws.on('message', (data) => {\n expect(data.toString()).toBe(msg);\n ws.close();\n resolve();\n });\n ws.on('error', reject);\n });\n }),\n { numRuns: 20 }\n );\n })", "language": "typescript", "source_file": "./repos/mariogalea/qualitymatters-ts-fastcheck/tests/echoWebSocketServer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mariogalea/qualitymatters-ts-fastcheck", "url": "https://github.com/mariogalea/qualitymatters-ts-fastcheck.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "An echo WebSocket server returns the same string sent by the client.", "mode": "fast-check"} {"id": 59832, "name": "unknown", "code": "it('Should always generate values within the range [from ; to]', () =>\n fc.assert(\n fc.property(fc.integer().noShrink(), fc.maxSafeInteger(), fc.maxSafeInteger(), (seed, a, b) => {\n const [from, to] = a < b ? [a, b] : [b, a];\n const [v, _nrng] = uniformIntDistribution(from, to)(mersenne(seed));\n return v >= from && v <= to;\n })\n ))", "language": "typescript", "source_file": "./repos/deepin-community/node-pure-rand/test/unit/distribution/UniformIntDistribution.noreg.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "deepin-community/node-pure-rand", "url": "https://github.com/deepin-community/node-pure-rand.git", "license": "MIT", "stars": 0, "forks": 2}, "metrics": null, "summary": "Generated values must always lie within the specified range \\([from; to]\\).", "mode": "fast-check"} {"id": 55031, "name": "unknown", "code": "it('should not change the outcome if whitespace is added', () => {\n const property = (str: string) => string.isBlank(str) === string.isBlank(` ${str} `);\n fc.assert(fc.property(fc.string(), property));\n })", "language": "typescript", "source_file": "./repos/CodeExpertETH/CodeExpertSync/packages/prelude/string.tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "CodeExpertETH/CodeExpertSync", "url": "https://github.com/CodeExpertETH/CodeExpertSync.git", "license": "MIT", "stars": 3, "forks": 3}, "metrics": null, "summary": "Adding whitespace to a string should not affect the outcome of `string.isBlank`.", "mode": "fast-check"} {"id": 59833, "name": "unknown", "code": "it('Should always generate values within the range [from ; to]', () =>\n fc.assert(\n fc.property(fc.integer().noShrink(), arrayIntArb(), arrayIntArb(), (seed, a, b) => {\n const [from, to] = arrayIntToBigInt(a) < arrayIntToBigInt(b) ? [a, b] : [b, a];\n const [v, _nrng] = uniformArrayIntDistribution(from, to)(mersenne(seed));\n const vBigInt = arrayIntToBigInt(v);\n return vBigInt >= arrayIntToBigInt(from) && vBigInt <= arrayIntToBigInt(to);\n })\n ))", "language": "typescript", "source_file": "./repos/deepin-community/node-pure-rand/test/unit/distribution/UniformArrayIntDistribution.noreg.spec.ts", "start_line": null, "end_line": null, "dependencies": ["arrayIntArb", "arrayIntToBigInt"], "repo": {"name": "deepin-community/node-pure-rand", "url": "https://github.com/deepin-community/node-pure-rand.git", "license": "MIT", "stars": 0, "forks": 2}, "metrics": null, "summary": "Generated values should always fall within the specified range [from; to].", "mode": "fast-check"} {"id": 59834, "name": "unknown", "code": "it('Should always trim the zeros from the resulting value', () =>\n fc.assert(\n fc.property(fc.integer().noShrink(), arrayIntArb(), arrayIntArb(), (seed, a, b) => {\n const [from, to] = arrayIntToBigInt(a) < arrayIntToBigInt(b) ? [a, b] : [b, a];\n const [v, _nrng] = uniformArrayIntDistribution(from, to)(mersenne(seed));\n expect(v.data).not.toHaveLength(0);\n if (v.data.length !== 1) {\n expect(v.data[0]).not.toBe(0); // do not start by zero when data has multiple values\n } else if (v.data[0] === 0) {\n expect(v.sign).toBe(1); // zero has sign=1\n }\n })\n ))", "language": "typescript", "source_file": "./repos/deepin-community/node-pure-rand/test/unit/distribution/UniformArrayIntDistribution.noreg.spec.ts", "start_line": null, "end_line": null, "dependencies": ["arrayIntArb", "arrayIntToBigInt"], "repo": {"name": "deepin-community/node-pure-rand", "url": "https://github.com/deepin-community/node-pure-rand.git", "license": "MIT", "stars": 0, "forks": 2}, "metrics": null, "summary": "The result from `uniformArrayIntDistribution` should not start with zeros unless it represents zero, which then must have a positive sign.", "mode": "fast-check"} {"id": 55032, "name": "unknown", "code": "it ( 'works with fc-generated strings', t => {\n\n const assert = str => t.true ( Buffer.from ( toHex ( encoder.encode ( str ) ), 'hex' ).toString () === str );\n const property = fc.property ( fc.fullUnicodeString (), assert );\n\n fc.assert ( property, { numRuns: 1000000 } );\n\n })", "language": "typescript", "source_file": "./repos/fabiospampinato/uint8-to-hex/test/index.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fabiospampinato/uint8-to-hex", "url": "https://github.com/fabiospampinato/uint8-to-hex.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "Encoding a full Unicode string to hex and back should result in the original string.", "mode": "fast-check"} {"id": 55033, "name": "unknown", "code": "test(name, () => {\n const arbitrary = ZodFastCheck().inputOf(schema);\n return fc.assert(\n fc.asyncProperty(arbitrary, async (value) => {\n await schema.parse(value);\n })\n );\n })", "language": "typescript", "source_file": "./repos/DavidTimms/zod-fast-check/tests/zod-fast-check.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/zod-fast-check", "url": "https://github.com/DavidTimms/zod-fast-check.git", "license": "MIT", "stars": 118, "forks": 12}, "metrics": null, "summary": "`ZodFastCheck` generates inputs for a schema, ensuring that each input can be successfully parsed by the schema.", "mode": "fast-check"} {"id": 55037, "name": "unknown", "code": "test(\"doubling transformer\", () => {\n // Above this, doubling the number makes it too big to represent,\n // so it gets rounded to infinity.\n const MAX = 1e307;\n const MIN = -MAX;\n\n const targetSchema = z\n .number()\n .int()\n .refine((x) => x % 2 === 0);\n const schema = z\n .number()\n .int()\n .refine((x) => x < MAX && x > MIN)\n .transform((x) => x * 2);\n\n const arbitrary = ZodFastCheck().outputOf(schema);\n\n return fc.assert(\n fc.property(arbitrary, (value) => {\n targetSchema.parse(value);\n })\n );\n })", "language": "typescript", "source_file": "./repos/DavidTimms/zod-fast-check/tests/zod-fast-check.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/zod-fast-check", "url": "https://github.com/DavidTimms/zod-fast-check.git", "license": "MIT", "stars": 118, "forks": 12}, "metrics": null, "summary": "The `transform` operation on an integer within a specified range (MIN to MAX) should result in an even integer that satisfies the target schema.", "mode": "fast-check"} {"id": 59835, "name": "unknown", "code": "it('Should always produce valid ArrayInt', () =>\n fc.assert(\n fc.property(fc.integer().noShrink(), arrayIntArb(), arrayIntArb(), (seed, a, b) => {\n const [from, to] = arrayIntToBigInt(a) < arrayIntToBigInt(b) ? [a, b] : [b, a];\n const [v, _nrng] = uniformArrayIntDistribution(from, to)(mersenne(seed));\n expect([-1, 1]).toContainEqual(v.sign); // sign is either 1 or -1\n expect(v.data).not.toHaveLength(0); // data is never empty\n for (const d of v.data) {\n // data in [0 ; 0xffffffff]\n expect(d).toBeGreaterThanOrEqual(0);\n expect(d).toBeLessThanOrEqual(0xffffffff);\n }\n })\n ))", "language": "typescript", "source_file": "./repos/deepin-community/node-pure-rand/test/unit/distribution/UniformArrayIntDistribution.noreg.spec.ts", "start_line": null, "end_line": null, "dependencies": ["arrayIntArb", "arrayIntToBigInt"], "repo": {"name": "deepin-community/node-pure-rand", "url": "https://github.com/deepin-community/node-pure-rand.git", "license": "MIT", "stars": 0, "forks": 2}, "metrics": null, "summary": "The test ensures that `uniformArrayIntDistribution` produces a valid `ArrayInt` with a sign of either 1 or -1, a non-empty data array, and each element in the data array within the range [0, 0xffffffff].", "mode": "fast-check"} {"id": 55038, "name": "unknown", "code": "test(\"schema with default value\", () => {\n // Unlike the input arbitrary, the output arbitrary should never\n // produce \"undefined\" for a schema with a default.\n const targetSchema = z.string();\n const schema = z.string().default(\"hello\");\n\n const arbitrary = ZodFastCheck().outputOf(schema);\n\n return fc.assert(\n fc.property(arbitrary, (value) => {\n targetSchema.parse(value);\n })\n );\n })", "language": "typescript", "source_file": "./repos/DavidTimms/zod-fast-check/tests/zod-fast-check.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/zod-fast-check", "url": "https://github.com/DavidTimms/zod-fast-check.git", "license": "MIT", "stars": 118, "forks": 12}, "metrics": null, "summary": "A schema with a default value should produce outputs that never contain \"undefined\", ensuring validity when parsed against the target schema.", "mode": "fast-check"} {"id": 59836, "name": "unknown", "code": "test('uniqueness', () => {\n fc.assert(\n fc.property(elementModQ(context), fc.string(), (seed, s) => {\n const nonces = new Nonces(seed, s);\n const [na, nb, nc, nd] = nonces;\n const nBigints = [\n na.toBigint(),\n nb.toBigint(),\n nc.toBigint(),\n nd.toBigint(),\n ];\n\n expect(new Set(nBigints).size).toEqual(4);\n })\n );\n })", "language": "typescript", "source_file": "./repos/shreyasminocha/egts/test/electionguard/core/nonces.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "shreyasminocha/egts", "url": "https://github.com/shreyasminocha/egts.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Generated nonces from given seeds should produce unique BigInt values.", "mode": "fast-check"} {"id": 59837, "name": "unknown", "code": "test(\"Submitting ciphertext ballots doesn't affect their properties\", () => {\n fc.assert(\n fc.property(\n electionAndBallots(groupContext, 1),\n elementModQ(groupContext),\n elementModQ(groupContext),\n (eb, prev, seed) => {\n const timestamp = Math.floor(Date.now() / 1000);\n const nonces = new Nonces(seed);\n const encryptionState = new EncryptionState(\n groupContext,\n eb.manifest,\n eb.electionContext,\n true\n );\n\n const [ballot] = eb.ballots;\n const ciphertextBallot = encryptBallot(\n encryptionState,\n ballot,\n prev,\n nonces.get(0),\n timestamp\n );\n const submittedBallot = ciphertextBallot.submit(BallotState.CAST);\n\n expect(submittedBallot.ballotId).toBe(ciphertextBallot.ballotId);\n expect(submittedBallot.ballotStyleId).toBe(\n ciphertextBallot.ballotStyleId\n );\n expect(\n submittedBallot.manifestHash.equals(ciphertextBallot.manifestHash)\n ).toBe(true);\n expect(\n submittedBallot.codeSeed.equals(ciphertextBallot.codeSeed)\n ).toBe(true);\n expect(submittedBallot.code.equals(ciphertextBallot.code)).toBe(true);\n // expect(\n // submittedBallot.contests.every((c, i) =>\n // c.equals(ciphertextBallot.contests[i])\n // )\n // ).toBe(true);\n expect(submittedBallot.timestamp).toBe(ciphertextBallot.timestamp);\n expect(\n submittedBallot.cryptoHashElement.equals(\n ciphertextBallot.cryptoHash\n )\n ).toBe(true);\n }\n ),\n fcFastConfig\n );\n })", "language": "typescript", "source_file": "./repos/shreyasminocha/egts/test/electionguard/ballot/submitted-ballot.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "shreyasminocha/egts", "url": "https://github.com/shreyasminocha/egts.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Submitting ciphertext ballots maintains their properties unchanged after they become submitted ballots.", "mode": "fast-check"} {"id": 55043, "name": "unknown", "code": "test(\"using custom UUID arbitrary\", () => {\n const arbitrary = ZodFastCheck().override(UUID, fc.uuid()).inputOf(UUID);\n\n return fc.assert(\n fc.property(arbitrary, (value) => {\n UUID.parse(value);\n })\n );\n })", "language": "typescript", "source_file": "./repos/DavidTimms/zod-fast-check/tests/zod-fast-check.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/zod-fast-check", "url": "https://github.com/DavidTimms/zod-fast-check.git", "license": "MIT", "stars": 118, "forks": 12}, "metrics": null, "summary": "The custom UUID arbitrary generates values that are parsable by `UUID.parse`.", "mode": "fast-check"} {"id": 55045, "name": "unknown", "code": "test(\"using custom integer arbitrary for IntAsString input\", () => {\n const arbitrary = ZodFastCheck()\n .override(IntAsString, fc.integer())\n .inputOf(IntAsString);\n\n return fc.assert(\n fc.property(arbitrary, (value) => {\n z.number().int().parse(value);\n })\n );\n })", "language": "typescript", "source_file": "./repos/DavidTimms/zod-fast-check/tests/zod-fast-check.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/zod-fast-check", "url": "https://github.com/DavidTimms/zod-fast-check.git", "license": "MIT", "stars": 118, "forks": 12}, "metrics": null, "summary": "The property verifies that the `IntAsString` inputs, generated using a custom integer arbitrary, can be parsed as integers using `z.number().int()`.", "mode": "fast-check"} {"id": 55046, "name": "unknown", "code": "test(\"using custom integer arbitrary for IntAsString output\", () => {\n const arbitrary = ZodFastCheck()\n .override(IntAsString, fc.integer())\n .outputOf(IntAsString);\n\n return fc.assert(\n fc.property(arbitrary, (value) => {\n expect(typeof value).toBe(\"string\");\n expect(Number(value) === parseInt(value, 10));\n })\n );\n })", "language": "typescript", "source_file": "./repos/DavidTimms/zod-fast-check/tests/zod-fast-check.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/zod-fast-check", "url": "https://github.com/DavidTimms/zod-fast-check.git", "license": "MIT", "stars": 118, "forks": 12}, "metrics": null, "summary": "The property ensures that when using a custom integer arbitrary for `IntAsString`, the output is a string that, when converted back to a number, matches the original integer value.", "mode": "fast-check"} {"id": 59838, "name": "unknown", "code": "test(\"Shuffling contests and selections doesn't affect equality\", () => {\n fc.assert(\n fc.property(electionAndBallots(groupContext, 1), eb => {\n const [ballot] = eb.ballots;\n const copy = new PlaintextBallot(\n ballot.ballotId,\n ballot.ballotStyleId,\n shuffleArray(\n ballot.contests.map(\n contest =>\n new PlaintextContest(\n contest.contestId,\n shuffleArray(contest.selections)\n )\n )\n )\n );\n expect(copy.equals(ballot)).toBe(true);\n })\n );\n })", "language": "typescript", "source_file": "./repos/shreyasminocha/egts/test/electionguard/ballot/plaintext-ballot.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "shreyasminocha/egts", "url": "https://github.com/shreyasminocha/egts.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Shuffling contests and selections within a `PlaintextBallot` does not affect the equality comparison with the original ballot.", "mode": "fast-check"} {"id": 55049, "name": "unknown", "code": "expect(() =>\n fc.assert(\n fc.property(arbitrary, (value) => {\n return true;\n })\n )\n )", "language": "typescript", "source_file": "./repos/DavidTimms/zod-fast-check/tests/zod-fast-check.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/zod-fast-check", "url": "https://github.com/DavidTimms/zod-fast-check.git", "license": "MIT", "stars": 118, "forks": 12}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55047, "name": "unknown", "code": "test(\"using a function to lazily define an override\", () => {\n const NumericString = z.string().regex(/^\\d+$/);\n\n const zfc = ZodFastCheck().override(NumericString, (zfc) =>\n zfc.inputOf(z.number().int().nonnegative()).map(String)\n );\n\n const arbitrary = zfc.outputOf(NumericString);\n\n return fc.assert(\n fc.property(arbitrary, (value) => {\n expect(value).toMatch(/^\\d+$/);\n })\n );\n })", "language": "typescript", "source_file": "./repos/DavidTimms/zod-fast-check/tests/zod-fast-check.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/zod-fast-check", "url": "https://github.com/DavidTimms/zod-fast-check.git", "license": "MIT", "stars": 118, "forks": 12}, "metrics": null, "summary": "The property verifies that the override function for `NumericString` generates output values consisting only of digit characters.", "mode": "fast-check"} {"id": 55048, "name": "unknown", "code": "expect(() =>\n fc.assert(\n fc.property(arbitrary, (value) => {\n return true;\n })\n )\n )", "language": "typescript", "source_file": "./repos/DavidTimms/zod-fast-check/tests/zod-fast-check.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/zod-fast-check", "url": "https://github.com/DavidTimms/zod-fast-check.git", "license": "MIT", "stars": 118, "forks": 12}, "metrics": null, "summary": "The test checks that all generated values from the `arbitrary` parameter cause no errors during property assertion.", "mode": "fast-check"} {"id": 59839, "name": "unknown", "code": "test('Normalization works', () => {\n fc.assert(\n fc.property(electionAndBallots(groupContext, 1), eb => {\n const [ballot] = eb.ballots;\n const normalizedBallot = normalizeBallot(ballot, eb.manifest);\n\n normalizedBallot.contests.forEach(contest => {\n const mcontest = eb.manifest.getContest(contest.contestId);\n expect(mcontest).toBeTruthy();\n\n expect(contest.selections.map(s => s.selectionId)).toStrictEqual(\n mcontest?.selections.map(s => s.selectionId)\n );\n });\n }),\n fcFastConfig\n );\n\n // idempotent\n fc.assert(\n fc.property(electionAndBallots(groupContext, 1), eb => {\n const [ballot] = eb.ballots;\n expect(\n normalizeBallot(\n normalizeBallot(ballot, eb.manifest),\n eb.manifest\n ).equals(normalizeBallot(ballot, eb.manifest))\n ).toBe(true);\n }),\n fcFastConfig\n );\n })", "language": "typescript", "source_file": "./repos/shreyasminocha/egts/test/electionguard/ballot/plaintext-ballot.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "shreyasminocha/egts", "url": "https://github.com/shreyasminocha/egts.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Normalization ensures that the contests in a ballot match the manifest's selections and that applying normalization twice is equivalent to applying it once.", "mode": "fast-check"} {"id": 55051, "name": "unknown", "code": "expect(() =>\n fc.assert(\n fc.property(arbitrary, (value) => {\n return true;\n })\n )\n )", "language": "typescript", "source_file": "./repos/DavidTimms/zod-fast-check/tests/zod-fast-check.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/zod-fast-check", "url": "https://github.com/DavidTimms/zod-fast-check.git", "license": "MIT", "stars": 118, "forks": 12}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55052, "name": "unknown", "code": "it('should complete if all resolved', () =>\n\t\tfc.assert(\n\t\t\tfc.asyncProperty(fc.nat({ max: 100 }), fc.nat({ max: 100 }), async (errs, succs) => {\n\t\t\t\tconst waiter = new MutableWaiter();\n\t\t\t\tconst errors = new Array(errs).fill(new Error());\n\t\t\t\terrors.forEach((err) => waiter.wait(Promise.reject(err)));\n\t\t\t\tnew Array(succs).fill(waiter.wait(Promise.resolve()));\n\t\t\t\treturn expect(waiter.isCompleted()).resolves.toStrictEqual(errors);\n\t\t\t})\n\t\t))", "language": "typescript", "source_file": "./repos/proti-iac/proti/proti-core/test/mutable-waiter.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "proti-iac/proti", "url": "https://github.com/proti-iac/proti.git", "license": "Apache-2.0", "stars": 9, "forks": 0}, "metrics": null, "summary": "`MutableWaiter` should resolve as completed when all promises, both rejected and resolved, are processed, meeting the expected error results.", "mode": "fast-check"} {"id": 55053, "name": "unknown", "code": "it('should complete if not resolved yet', () =>\n\t\tfc.assert(\n\t\t\tfc.asyncProperty(fc.nat({ max: 1000 }), async (n) => {\n\t\t\t\tconst waiter = new MutableWaiter();\n\t\t\t\tconst resolves = new Array(n)\n\t\t\t\t\t.fill(() => {\n\t\t\t\t\t\tconst r = { resolve: undefined as ((v: any) => void) | undefined };\n\t\t\t\t\t\twaiter.wait(\n\t\t\t\t\t\t\tnew Promise((resolve) => {\n\t\t\t\t\t\t\t\tr.resolve = resolve;\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn r;\n\t\t\t\t\t})\n\t\t\t\t\t.map((f) => f());\n\t\t\t\tconst completed = waiter.isCompleted();\n\t\t\t\tresolves.forEach((resolve) => resolve.resolve());\n\t\t\t\treturn expect(completed).resolves.toStrictEqual([]);\n\t\t\t})\n\t\t))", "language": "typescript", "source_file": "./repos/proti-iac/proti/proti-core/test/mutable-waiter.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "proti-iac/proti", "url": "https://github.com/proti-iac/proti.git", "license": "Apache-2.0", "stars": 9, "forks": 0}, "metrics": null, "summary": "The `MutableWaiter` should return an empty list when checked for completion before any promises are resolved.", "mode": "fast-check"} {"id": 59840, "name": "unknown", "code": "test('Normalization works', () => {\n fc.assert(\n fc.property(electionAndBallots(groupContext, 1), eb => {\n const [ballot] = eb.ballots;\n const normalizedBallot = normalizeBallot(ballot, eb.manifest);\n\n normalizedBallot.contests.forEach(contest => {\n const mcontest = eb.manifest.getContest(contest.contestId);\n expect(mcontest).toBeTruthy();\n\n expect(contest.selections.map(s => s.selectionId)).toStrictEqual(\n mcontest?.selections.map(s => s.selectionId)\n );\n });\n }),\n fcFastConfig\n );\n\n // idempotent\n fc.assert(\n fc.property(electionAndBallots(groupContext, 1), eb => {\n const [ballot] = eb.ballots;\n expect(\n normalizeBallot(\n normalizeBallot(ballot, eb.manifest),\n eb.manifest\n ).equals(normalizeBallot(ballot, eb.manifest))\n ).toBe(true);\n }),\n fcFastConfig\n );\n })", "language": "typescript", "source_file": "./repos/shreyasminocha/egts/test/electionguard/ballot/plaintext-ballot.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "shreyasminocha/egts", "url": "https://github.com/shreyasminocha/egts.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "The normalization of a ballot aligns contest selections with those in the manifest, and performing normalization twice yields an equivalent result as a single normalization.", "mode": "fast-check"} {"id": 55057, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55058, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55055, "name": "unknown", "code": "testFn(`${label} (with seed=${customParams.seed})`, async () => {\n await fc.assert((fc.asyncProperty as any)(...(arbitraries as any), promiseProp), params);\n })", "language": "typescript", "source_file": "./repos/scayle/components/src/fast-check-utils.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "scayle/components", "url": "https://github.com/scayle/components.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Asserts that a property holds true for generated test cases defined by the provided arbitraries and `promiseProp`, with custom parameters.", "mode": "fast-check"} {"id": 55056, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": "The test confirms that `equivalentToSecp256k1Node` performs without throwing any errors.", "mode": "fast-check"} {"id": 55059, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(reversesUncompress);\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": "The test ensures that the properties `reversesUncompress`, `equivalentToSecp256k1Node`, and `equivalentToElliptic` hold true without throwing exceptions.", "mode": "fast-check"} {"id": 55060, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(reversesUncompress);\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55061, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(reversesUncompress);\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55063, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(isEquivalentToDeriveUncompressedThenCompress);\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55064, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(isEquivalentToDeriveUncompressedThenCompress);\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55066, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(isEquivalentToDeriveCompressedThenUncompress);\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55067, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(isEquivalentToDeriveCompressedThenUncompress);\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55069, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(malleationIsJustNegation);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55070, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59841, "name": "unknown", "code": "test(\"Shuffling arrays doesn't affect equality\", () => {\n fc.assert(\n fc.property(electionDescription(groupContext), manifest => {\n const copy = new Manifest(\n groupContext,\n manifest.electionScopeId,\n manifest.specVersion,\n manifest.electionType,\n manifest.startDate,\n manifest.endDate,\n shuffleArray(manifest.geopoliticalUnits),\n shuffleArray(manifest.parties),\n shuffleArray(manifest.candidates),\n shuffleArray(manifest.contests),\n shuffleArray(manifest.ballotStyles),\n manifest.name,\n manifest.contactInformation\n );\n\n expect(copy.equals(manifest)).toBe(true);\n }),\n fcFastConfig\n );\n })", "language": "typescript", "source_file": "./repos/shreyasminocha/egts/test/electionguard/ballot/manifest.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "shreyasminocha/egts", "url": "https://github.com/shreyasminocha/egts.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Shuffling arrays of geopolitical units, parties, candidates, contests, and ballot styles in a `Manifest` does not affect its equality with the original.", "mode": "fast-check"} {"id": 55068, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(malleationIsJustNegation);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": "The property ensures that the operation `malleationIsJustNegation` completes without throwing any errors.", "mode": "fast-check"} {"id": 59844, "name": "unknown", "code": "test('Generators yield valid contests', () => {\n fc.assert(\n fc.property(electionAndBallots(groupContext), eb => {\n const contests = eb.manifest.contests;\n const contestsValid = contests.every(c => c.isValid());\n expect(contestsValid).toBe(true);\n }),\n fcFastConfig\n );\n })", "language": "typescript", "source_file": "./repos/shreyasminocha/egts/test/electionguard/ballot/encrypt.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "shreyasminocha/egts", "url": "https://github.com/shreyasminocha/egts.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Generators produce contests that are always valid.", "mode": "fast-check"} {"id": 55071, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55072, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55074, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(malleateThenNormalizeEqualsInitial);\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55073, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(malleateThenNormalizeEqualsInitial);\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": "The properties being tested ensure that operations malleate and normalize maintain consistency with the initial input, and results are equivalent to the `secp256k1` node calculations without throwing exceptions.", "mode": "fast-check"} {"id": 55075, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(malleateThenNormalizeEqualsInitial);\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55076, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(malleateThenNormalizeEqualsInitial);\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55077, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55078, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55080, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55081, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55082, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55083, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55085, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(reversesCompress);\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55086, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55087, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55088, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55089, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55090, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55091, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55092, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55093, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55094, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55097, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToNative);\n fc.assert(equivalentToHashJs);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/hash.spec.helper.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55100, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55101, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55102, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55103, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59845, "name": "unknown", "code": "test('Encryption/decryption inverses', () => {\n fc.assert(\n fc.property(\n electionAndBallots(groupContext),\n elementModQ(groupContext),\n elementModQ(groupContext),\n (eb, prev, seed) => {\n const nonces = new Nonces(seed);\n // This ends up running the verification twice: once while encrypting, and once while decrypting.\n // This is fine, because we'd like to catch verification errors at encryption time, if possible,\n // but we'll take them wherever we can get them.\n\n const encryptionState = new EncryptionState(\n groupContext,\n eb.manifest,\n eb.electionContext,\n true\n );\n const submittedBallots = eb.ballots.map((b, i) =>\n encryptBallot(encryptionState, b, prev, nonces.get(i)).submit(\n BallotState.CAST\n )\n );\n const decryptedBallots = submittedBallots.map(sb =>\n decryptAndVerifyBallot(\n eb.manifest,\n eb.electionContext.cryptoExtendedBaseHash,\n eb.keypair,\n sb\n )\n );\n\n expect(\n matchingArraysOfAnyElectionObjects(\n eb.ballots.map(ballot => normalizeBallot(ballot, eb.manifest)),\n decryptedBallots\n )\n ).toBe(true);\n }\n ),\n fcFastConfig\n );\n })", "language": "typescript", "source_file": "./repos/shreyasminocha/egts/test/electionguard/ballot/encrypt.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "shreyasminocha/egts", "url": "https://github.com/shreyasminocha/egts.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Encrypting and then decrypting ballots should preserve their original state, ensuring that the decrypted ballots match the normalized original ballots.", "mode": "fast-check"} {"id": 55104, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55105, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55106, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59846, "name": "unknown", "code": "test('Encryption serialization/deserialization', () => {\n fc.assert(\n fc.property(\n electionAndBallots(groupContext, 1),\n elementModQ(groupContext),\n elementModQ(groupContext),\n (eb, codeSeed, encryptionSeed) => {\n const bCodecs = getBallotCodecsForContext(groupContext);\n const encryptionState = new EncryptionState(\n groupContext,\n eb.manifest,\n eb.electionContext,\n false\n );\n const submittedBallot = encryptBallot(\n encryptionState,\n eb.ballots[0],\n codeSeed,\n encryptionSeed\n ).submit(BallotState.CAST);\n\n const serializedBallot =\n bCodecs.submittedBallotCodec.encode(submittedBallot);\n\n const deserializedBallotMaybe =\n bCodecs.submittedBallotCodec.decode(serializedBallot);\n\n const deserializedBallot = eitherRightOrFail(deserializedBallotMaybe);\n\n expect(submittedBallot.equals(deserializedBallot)).toBe(true);\n }\n ),\n fcFastConfig\n );\n })", "language": "typescript", "source_file": "./repos/shreyasminocha/egts/test/electionguard/ballot/encrypt.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "shreyasminocha/egts", "url": "https://github.com/shreyasminocha/egts.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Serialization and deserialization of encrypted ballots should yield equivalent ballot objects after encoding and decoding processes.", "mode": "fast-check"} {"id": 55107, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55108, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55109, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55110, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55111, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55112, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55113, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59847, "name": "unknown", "code": "test('Encrypt the same election twice; identical result', () => {\n fc.assert(\n fc.property(\n electionAndBallots(groupContext),\n elementModQ(groupContext),\n elementModQ(groupContext),\n (eb, prev, seed) => {\n const timestamp = Math.floor(Date.now() / 1000);\n const nonces = new Nonces(seed);\n\n const encryptionState = new EncryptionState(\n groupContext,\n eb.manifest,\n eb.electionContext,\n false\n );\n const submittedBallots1 = eb.ballots.map((b, i) =>\n encryptBallot(\n encryptionState,\n b,\n prev,\n nonces.get(i),\n timestamp\n ).submit(BallotState.CAST)\n );\n const submittedBallots2 = eb.ballots.map((b, i) =>\n encryptBallot(\n encryptionState,\n b,\n prev,\n nonces.get(i),\n timestamp\n ).submit(BallotState.CAST)\n );\n const matching = matchingArraysOfAnyElectionObjects(\n submittedBallots1,\n submittedBallots2\n );\n expect(matching).toBe(true);\n }\n ),\n fcFastConfig\n );\n })", "language": "typescript", "source_file": "./repos/shreyasminocha/egts/test/electionguard/ballot/encrypt.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "shreyasminocha/egts", "url": "https://github.com/shreyasminocha/egts.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Encrypting the same election twice results in identical submitted ballots.", "mode": "fast-check"} {"id": 59848, "name": "unknown", "code": "test('Encryption nonces are all unique', () => {\n fc.assert(\n fc.property(\n electionAndBallots(groupContext),\n elementModQ(groupContext),\n elementModQ(groupContext),\n (eb, prev, seed) => {\n const nonces = new Nonces(seed);\n\n const encryptionState = new EncryptionState(\n groupContext,\n eb.manifest,\n eb.electionContext,\n false\n );\n\n const selectionHashes = eb.manifest.contests.flatMap(contest =>\n contest.selections.map(selection =>\n selection.cryptoHashElement.toBigint()\n )\n );\n\n expect(noRepeatingBigints(selectionHashes)).toBe(true);\n\n const encryptedBallots = eb.ballots.map((b, i) =>\n encryptBallot(encryptionState, b, prev, nonces.get(i))\n );\n\n const elGamalPads = encryptedBallots.flatMap(ballot =>\n ballot.contests.flatMap(contest =>\n contest.selections.map(selection =>\n selection.ciphertext.pad.toBigint()\n )\n )\n );\n\n expect(noRepeatingBigints(elGamalPads)).toBe(true);\n\n const selectionNonces: bigint[] = encryptedBallots.flatMap(ballot =>\n ballot.contests.flatMap(contest =>\n contest.selections.map(selection => {\n if (selection.selectionNonce === undefined) {\n throw new Error('selectionNonce should not be undefined');\n } else {\n return selection.selectionNonce.toBigint();\n }\n })\n )\n );\n\n const contestNonces: bigint[] = encryptedBallots.flatMap(ballot =>\n ballot.contests.flatMap(contest => contest.contestNonce.toBigint())\n );\n\n const ballotNonces: bigint[] = encryptedBallots.map(ballot =>\n ballot.ballotEncryptionSeed.toBigint()\n );\n\n const allBallotNonces = selectionNonces\n .concat(contestNonces)\n .concat(ballotNonces);\n\n expect(noRepeatingBigints(allBallotNonces)).toBe(true);\n\n const chaumPedersenBigintsCR = encryptedBallots.flatMap(ballot =>\n ballot.contests.flatMap(contest =>\n contest.selections.flatMap(selection => [\n selection.proof.proof0.c.toBigint(),\n selection.proof.proof0.r.toBigint(),\n selection.proof.proof1.c.toBigint(),\n selection.proof.proof1.r.toBigint(),\n ])\n )\n );\n\n const chaumPedersenBigintsA = encryptedBallots.flatMap(ballot =>\n ballot.contests.flatMap(contest =>\n contest.selections.flatMap(selection => [\n selection.proof.proof0.a.toBigint(),\n selection.proof.proof1.a.toBigint(),\n ])\n )\n );\n\n const chaumPedersenBigintsB = encryptedBallots.flatMap(ballot =>\n ballot.contests.flatMap(contest =>\n contest.selections.flatMap(selection => [\n selection.proof.proof0.b.toBigint(),\n selection.proof.proof1.b.toBigint(),\n ])\n )\n );\n\n expect(noRepeatingBigints(chaumPedersenBigintsCR)).toBe(true);\n expect(\n noRepeatingBigints(\n chaumPedersenBigintsB.concat(chaumPedersenBigintsA)\n )\n ).toBe(true);\n\n const absolutelyEverything = elGamalPads\n .concat(allBallotNonces)\n .concat(chaumPedersenBigintsA)\n .concat(chaumPedersenBigintsB)\n .concat(chaumPedersenBigintsCR);\n\n expect(noRepeatingBigints(absolutelyEverything)).toBe(true);\n }\n ),\n fcFastConfig\n );\n })", "language": "typescript", "source_file": "./repos/shreyasminocha/egts/test/electionguard/ballot/encrypt.test.ts", "start_line": null, "end_line": null, "dependencies": ["noRepeatingBigints"], "repo": {"name": "shreyasminocha/egts", "url": "https://github.com/shreyasminocha/egts.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "All encryption-related bigints involved in the election process, including selection hashes, ElGamal pads, nonces, and Chaum-Pedersen proofs, must be unique across all processed ballots.", "mode": "fast-check"} {"id": 55114, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55115, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55116, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55117, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55118, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55119, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55120, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55121, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55122, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59849, "name": "unknown", "code": "test(\"Shuffling plaintext doesn't affect ciphertext ballots\", () => {\n fc.assert(\n fc.property(\n electionAndBallots(groupContext, 1),\n elementModQ(groupContext),\n elementModQ(groupContext),\n (eb, prev, seed) => {\n const timestamp = Math.floor(Date.now() / 1000);\n const nonces = new Nonces(seed);\n const encryptionState = new EncryptionState(\n groupContext,\n eb.manifest,\n eb.electionContext,\n true\n );\n\n const [ballot] = eb.ballots;\n const ciphertextBallot = encryptBallot(\n encryptionState,\n ballot,\n prev,\n nonces.get(0),\n timestamp\n );\n\n const copy = new PlaintextBallot(\n ballot.ballotId,\n ballot.ballotStyleId,\n shuffleArray(\n ballot.contests.map(\n contest =>\n new PlaintextContest(\n contest.contestId,\n shuffleArray(contest.selections)\n )\n )\n )\n );\n const copyCiphertextBallot = encryptBallot(\n encryptionState,\n copy,\n prev,\n nonces.get(0),\n timestamp\n );\n\n expect(copyCiphertextBallot.equals(ciphertextBallot)).toBe(true);\n }\n ),\n fcFastConfig\n );\n })", "language": "typescript", "source_file": "./repos/shreyasminocha/egts/test/electionguard/ballot/encrypt.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "shreyasminocha/egts", "url": "https://github.com/shreyasminocha/egts.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Shuffling the plaintext contests and selections in a ballot does not alter the resulting encrypted ciphertext ballot.", "mode": "fast-check"} {"id": 55123, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(correctsUpToTwoErrors(20));\n fc.assert(correctsUpToTwoErrors(24));\n fc.assert(correctsUpToTwoErrors(28));\n fc.assert(correctsUpToTwoErrors(32));\n fc.assert(correctsUpToTwoErrors(40));\n fc.assert(correctsUpToTwoErrors(48));\n fc.assert(correctsUpToTwoErrors(56));\n fc.assert(correctsUpToTwoErrors(64));\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": "The `correctsUpToTwoErrors` function should not throw exceptions when handling input lengths of 20, 24, 28, 32, 40, 48, 56, and 64.", "mode": "fast-check"} {"id": 55124, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(correctsUpToTwoErrors(20));\n fc.assert(correctsUpToTwoErrors(24));\n fc.assert(correctsUpToTwoErrors(28));\n fc.assert(correctsUpToTwoErrors(32));\n fc.assert(correctsUpToTwoErrors(40));\n fc.assert(correctsUpToTwoErrors(48));\n fc.assert(correctsUpToTwoErrors(56));\n fc.assert(correctsUpToTwoErrors(64));\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55125, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(correctsUpToTwoErrors(20));\n fc.assert(correctsUpToTwoErrors(24));\n fc.assert(correctsUpToTwoErrors(28));\n fc.assert(correctsUpToTwoErrors(32));\n fc.assert(correctsUpToTwoErrors(40));\n fc.assert(correctsUpToTwoErrors(48));\n fc.assert(correctsUpToTwoErrors(56));\n fc.assert(correctsUpToTwoErrors(64));\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55126, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(correctsUpToTwoErrors(20));\n fc.assert(correctsUpToTwoErrors(24));\n fc.assert(correctsUpToTwoErrors(28));\n fc.assert(correctsUpToTwoErrors(32));\n fc.assert(correctsUpToTwoErrors(40));\n fc.assert(correctsUpToTwoErrors(48));\n fc.assert(correctsUpToTwoErrors(56));\n fc.assert(correctsUpToTwoErrors(64));\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59850, "name": "unknown", "code": "test('Ballots with extraneous contests result in errors', () => {\n fc.assert(\n fc.property(\n electionAndBallots(groupContext, 1),\n elementModQ(groupContext),\n elementModQ(groupContext),\n fc.string(),\n (eb, prev, seed, bogusContestId) => {\n const nonces = new Nonces(seed);\n const encryptionState = new EncryptionState(\n groupContext,\n eb.manifest,\n eb.electionContext,\n true\n );\n const [ballot] = eb.ballots;\n\n fc.pre(\n !ballot.contests.map(c => c.contestId).includes(bogusContestId)\n );\n\n const ballotExtraneousContests = new PlaintextBallot(\n ballot.ballotId,\n ballot.ballotStyleId,\n [...ballot.contests, new PlaintextContest(bogusContestId, [])]\n );\n expect(() =>\n encryptBallot(\n encryptionState,\n ballotExtraneousContests,\n prev,\n nonces.get(0)\n )\n ).toThrow();\n }\n ),\n fcFastConfig\n );\n })", "language": "typescript", "source_file": "./repos/shreyasminocha/egts/test/electionguard/ballot/encrypt.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "shreyasminocha/egts", "url": "https://github.com/shreyasminocha/egts.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Ballots containing extraneous contests that are not part of the expected contest IDs result in encryption errors.", "mode": "fast-check"} {"id": 55127, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(correctsUpToTwoErrors(20));\n fc.assert(correctsUpToTwoErrors(24));\n fc.assert(correctsUpToTwoErrors(28));\n fc.assert(correctsUpToTwoErrors(32));\n fc.assert(correctsUpToTwoErrors(40));\n fc.assert(correctsUpToTwoErrors(48));\n fc.assert(correctsUpToTwoErrors(56));\n fc.assert(correctsUpToTwoErrors(64));\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55128, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(correctsUpToTwoErrors(20));\n fc.assert(correctsUpToTwoErrors(24));\n fc.assert(correctsUpToTwoErrors(28));\n fc.assert(correctsUpToTwoErrors(32));\n fc.assert(correctsUpToTwoErrors(40));\n fc.assert(correctsUpToTwoErrors(48));\n fc.assert(correctsUpToTwoErrors(56));\n fc.assert(correctsUpToTwoErrors(64));\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55129, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(correctsUpToTwoErrors(20));\n fc.assert(correctsUpToTwoErrors(24));\n fc.assert(correctsUpToTwoErrors(28));\n fc.assert(correctsUpToTwoErrors(32));\n fc.assert(correctsUpToTwoErrors(40));\n fc.assert(correctsUpToTwoErrors(48));\n fc.assert(correctsUpToTwoErrors(56));\n fc.assert(correctsUpToTwoErrors(64));\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55130, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(correctsUpToTwoErrors(20));\n fc.assert(correctsUpToTwoErrors(24));\n fc.assert(correctsUpToTwoErrors(28));\n fc.assert(correctsUpToTwoErrors(32));\n fc.assert(correctsUpToTwoErrors(40));\n fc.assert(correctsUpToTwoErrors(48));\n fc.assert(correctsUpToTwoErrors(56));\n fc.assert(correctsUpToTwoErrors(64));\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59851, "name": "unknown", "code": "test('Encrypt conventionally & with async; identical result', async () => {\n await fc.assert(\n fc.asyncProperty(\n electionAndBallots(groupContext, 1),\n elementModQ(groupContext),\n elementModQ(groupContext),\n async (eb, prev, seed) => {\n const timestamp = Math.floor(Date.now() / 1000);\n const encryptionState = new EncryptionState(\n groupContext,\n eb.manifest,\n eb.electionContext,\n true\n );\n\n // log.info('encrypt-async-test', 'starting conventional encryption');\n for (const plaintextBallot of eb.ballots) {\n const normalizedBallot = normalizeBallot(\n plaintextBallot,\n eb.manifest\n );\n\n const encryptedBallot = encryptBallot(\n encryptionState,\n normalizedBallot,\n prev,\n seed,\n timestamp\n );\n\n const bCodecs = getBallotCodecsForContext(groupContext);\n const cCodecs = getCoreCodecsForContext(groupContext);\n\n const manifestJson = bCodecs.manifestCodec.encode(\n eb.manifest\n ) as object;\n const electionContextJson = cCodecs.electionContextCodec.encode(\n eb.electionContext\n ) as object;\n\n /* const manifestDecoded = */ eitherRightOrFail(\n bCodecs.manifestCodec.decode(manifestJson)\n );\n const electionContextDecoded = eitherRightOrFail(\n cCodecs.electionContextCodec.decode(electionContextJson)\n );\n\n expect(\n electionContextDecoded.jointPublicKey.element.isValidResidue()\n ).toBe(true);\n\n // log.info('encrypt-async-test', 'initializing async encryption');\n const asyncEncryptor = AsyncBallotEncryptor.create(\n groupContext,\n manifestJson,\n electionContextJson,\n true,\n normalizedBallot.ballotStyleId,\n normalizedBallot.ballotId,\n prev,\n seed,\n timestamp\n );\n\n // log.info('encrypt-async-test', 'launching async encryption');\n // launches encryption on each contest: note the absence of return values\n normalizedBallot.contests.forEach(contest =>\n asyncEncryptor.encrypt(contest)\n );\n\n const encryptedBallot2 = await asyncEncryptor.getEncryptedBallot();\n // log.info('encrypt-async-test', 'async tasks complete');\n\n expect(encryptedBallot.equals(encryptedBallot2)).toBe(true);\n\n // now, fetch the result from the serialized version and compare\n const encryptedBallot3 =\n await asyncEncryptor.getSerializedEncryptedBallot();\n\n const deserializedSubmittedBallot = eitherRightOrFail(\n bCodecs.submittedBallotCodec.decode(\n encryptedBallot3.serializedEncryptedBallot\n )\n );\n\n expect(\n deserializedSubmittedBallot.equals(\n encryptedBallot2.submit(BallotState.CAST)\n )\n ).toBe(true);\n }\n }\n ),\n fcFastConfig\n );\n })", "language": "typescript", "source_file": "./repos/shreyasminocha/egts/test/electionguard/ballot/encrypt-async.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "shreyasminocha/egts", "url": "https://github.com/shreyasminocha/egts.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Encryption results of ballots should be identical when done conventionally and asynchronously, including after serialization and deserialization.", "mode": "fast-check"} {"id": 59852, "name": "unknown", "code": "test('An assertion does not throw for an infallible property', () => {\n fc.assert(\n fc.property(fc.nat().noShrink(), (seed) => {\n const g = dev.Gen.integer();\n const p = dev.property(g, () => true);\n\n const error = tryAssert(p, { seed });\n\n expect(error).toBeNull();\n }),\n );\n})", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Runners/Assert.test.ts", "start_line": null, "end_line": null, "dependencies": ["tryAssert"], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Assertions do not throw an error when testing an infallible property that always returns true.", "mode": "fast-check"} {"id": 59853, "name": "unknown", "code": "test('An assertion throws for a fallible predicate property', () => {\n fc.assert(\n fc.property(fc.nat().noShrink(), (seed) => {\n const g = dev.Gen.integer();\n const p = dev.property(g, (x) => x < 5);\n\n const error = tryAssert(p, { seed });\n\n expect(error).not.toBeNull();\n expect(error!.message).toMatch(\n new RegExp(\n [\n '^Property failed after \\\\d+ test\\\\(s\\\\)',\n 'Reproduction: \\\\{ \\\\\"seed\\\\\": \\\\d+, \\\\\"size\\\\\": \\\\d+(, \\\\\"path\\\\\": \\\\\".*\\\\\")? \\\\}',\n 'Counterexample: \\\\[5\\\\]$',\n ].join('\\n'),\n 'g',\n ),\n );\n }),\n );\n})", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Runners/Assert.test.ts", "start_line": null, "end_line": null, "dependencies": ["tryAssert"], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "An assertion throws an error when a property with a predicate that fails (`x < 5`) is tested, and the error message matches the expected pattern.", "mode": "fast-check"} {"id": 59854, "name": "unknown", "code": "test('An assertion throws for a fallible throwing property', () => {\n fc.assert(\n fc.property(fc.nat().noShrink(), (seed) => {\n const g = dev.Gen.integer();\n const p = dev.property(g, (x) => {\n expect(x).toBeLessThan(5);\n });\n\n const error = tryAssert(p, { seed });\n\n expect(error).not.toBeNull();\n expect(error!.message).toMatch(\n new RegExp(\n [\n '^Property failed after \\\\d+ test\\\\(s\\\\)',\n 'Reproduction: \\\\{ \\\\\"seed\\\\\": \\\\d+, \\\\\"size\\\\\": \\\\d+(, \\\\\"path\\\\\": \\\\\".*\\\\\")? \\\\}',\n 'Counterexample: \\\\[5\\\\]',\n ].join('\\n'),\n 'g',\n ),\n );\n }),\n );\n})", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Runners/Assert.test.ts", "start_line": null, "end_line": null, "dependencies": ["tryAssert"], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "An assertion should throw an error if a property fails with a generated integer that is not less than 5, including appropriate error details in the message.", "mode": "fast-check"} {"id": 59856, "name": "unknown", "code": "test('Given a succeeding property function, it returns unfalsified', () => {\n fc.assert(\n fc.property(domainGen.checkConfig(), domainGen.gens(), domainGen.passingFunc(), (config, gens, f) => {\n const checkResult = dev.check(dev.property(...gens, f), config);\n\n const expectedCheckResult: dev.CheckResult<[]> = {\n kind: 'unfalsified',\n iterations: expect.anything(),\n discards: expect.anything(),\n };\n expect(checkResult).toEqual(expectedCheckResult);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Property/Property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "A succeeding property function results in a `check` function returning `unfalsified`.", "mode": "fast-check"} {"id": 59858, "name": "unknown", "code": "it('returns the same falsification when repeated with the resulting parameters', () => {\n fc.assert(\n fc.property(domainGen.checkConfig(), domainGen.gens(), domainGen.fallibleFunc(), (config, gens, f) => {\n const p = dev.property(...gens, f);\n\n const checkResult0 = dev.check(p, { ...config, iterations: 100 });\n if (checkResult0.kind !== 'falsified') return failwith('expected falsified');\n\n const checkResult1 = dev.check(p, {\n seed: checkResult0.seed,\n size: checkResult0.size,\n path: checkResult0.counterexample.path,\n });\n if (checkResult1.kind !== 'falsified') return failwith('expected falsified');\n\n expect(checkResult1.counterexample).toEqual(checkResult0.counterexample);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Property/Property.Repeat.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Re-checking a falsified property with the same parameters should return the identical counterexample.", "mode": "fast-check"} {"id": 55137, "name": "unknown", "code": "test(\"should yield zero\", () => {\n fc.assert(\n fc.property(ZeroBigIntArbitrary, (num) => {\n assert.ok(ZeroBigInt.is(num));\n }),\n {\n verbose: true,\n numRuns: 100,\n }\n );\n})", "language": "typescript", "source_file": "./repos/EricCrosson/numbers-ts/packages/fast-check-bigint/test/property/test-zero-bigint.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "EricCrosson/numbers-ts", "url": "https://github.com/EricCrosson/numbers-ts.git", "license": "ISC", "stars": 3, "forks": 2}, "metrics": null, "summary": "`ZeroBigInt` correctly identifies all generated big integers as zero.", "mode": "fast-check"} {"id": 55138, "name": "unknown", "code": "test(\"should yield positive integers\", () => {\n fc.assert(\n fc.property(PositiveBigIntArbitrary, (num) => {\n assert.ok(PositiveBigInt.is(num));\n }),\n {\n verbose: true,\n numRuns: 100,\n }\n );\n})", "language": "typescript", "source_file": "./repos/EricCrosson/numbers-ts/packages/fast-check-bigint/test/property/test-positive-bigint.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "EricCrosson/numbers-ts", "url": "https://github.com/EricCrosson/numbers-ts.git", "license": "ISC", "stars": 3, "forks": 2}, "metrics": null, "summary": "`PositiveBigIntArbitrary` generates values that satisfy the `PositiveBigInt.is` condition, ensuring they are positive integers.", "mode": "fast-check"} {"id": 59859, "name": "unknown", "code": "it('only calls the property function once', () => {\n fc.assert(\n fc.property(domainGen.checkConfig(), domainGen.gens(), domainGen.fallibleFunc(), (config, gens, f) => {\n const checkResult0 = dev.check(dev.property(...gens, f), { ...config, iterations: 100 });\n\n if (checkResult0.kind !== 'falsified') return failwith('expected falsified');\n\n const spyF = spyOn(f);\n dev.check(dev.property(...gens, spyF), {\n seed: checkResult0.seed,\n size: checkResult0.size,\n path: checkResult0.counterexample.path,\n });\n\n expect(spyF).toBeCalledTimes(1);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Property/Property.Repeat.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property verifies that a function within a falsified property check is called exactly once using a specific seed, size, and path from a previous falsification.", "mode": "fast-check"} {"id": 55139, "name": "unknown", "code": "test(\"should yield non-zero integers\", () => {\n fc.assert(\n fc.property(NonZeroBigIntArbitrary, (num) => {\n assert.ok(NonZeroBigInt.is(num));\n }),\n {\n verbose: true,\n numRuns: 100,\n }\n );\n})", "language": "typescript", "source_file": "./repos/EricCrosson/numbers-ts/packages/fast-check-bigint/test/property/test-non-zero-bigint.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "EricCrosson/numbers-ts", "url": "https://github.com/EricCrosson/numbers-ts.git", "license": "ISC", "stars": 3, "forks": 2}, "metrics": null, "summary": "NonZeroBigIntArbitrary generates only non-zero integers, verified by `NonZeroBigInt.is`.", "mode": "fast-check"} {"id": 55140, "name": "unknown", "code": "test(\"should yield non-positive integers\", () => {\n fc.assert(\n fc.property(NonPositiveBigIntArbitrary, (num) => {\n assert.ok(NonPositiveBigInt.is(num));\n }),\n {\n verbose: true,\n numRuns: 100,\n }\n );\n})", "language": "typescript", "source_file": "./repos/EricCrosson/numbers-ts/packages/fast-check-bigint/test/property/test-non-positive-bigint.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "EricCrosson/numbers-ts", "url": "https://github.com/EricCrosson/numbers-ts.git", "license": "ISC", "stars": 3, "forks": 2}, "metrics": null, "summary": "`NonPositiveBigIntArbitrary` generates values that the `NonPositiveBigInt` type recognizes as valid non-positive integers.", "mode": "fast-check"} {"id": 55141, "name": "unknown", "code": "test(\"should yield non-negative integers\", () => {\n fc.assert(\n fc.property(NonNegativeBigIntArbitrary, (num) => {\n assert.ok(NonNegativeBigInt.is(num));\n }),\n {\n verbose: true,\n numRuns: 100,\n }\n );\n})", "language": "typescript", "source_file": "./repos/EricCrosson/numbers-ts/packages/fast-check-bigint/test/property/test-non-negative-bigint.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "EricCrosson/numbers-ts", "url": "https://github.com/EricCrosson/numbers-ts.git", "license": "ISC", "stars": 3, "forks": 2}, "metrics": null, "summary": "NonNegativeBigIntArbitrary generates values verified by `NonNegativeBigInt.is` to ensure they are non-negative integers.", "mode": "fast-check"} {"id": 59861, "name": "unknown", "code": "it('has resilience to parameter ordering', () => {\n fc.assert(\n fc.property(genShuffledRangeParams(), LocalGen.scaleMode(), ({ ordered, unordered }, scaleMode) => {\n const range1 = Range.createFrom(nativeCalculator, ordered.min, ordered.max, ordered.origin, scaleMode);\n const range2 = Range.createFrom(nativeCalculator, unordered.x, unordered.y, unordered.z, scaleMode);\n\n expect(range1.origin).toEqual(range2.origin);\n expect(range1.bounds).toEqual(range2.bounds);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Number/Range.test.ts", "start_line": null, "end_line": null, "dependencies": ["genShuffledRangeParams"], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Creating a range from parameters should result in equivalent origins and bounds, regardless of parameter order.", "mode": "fast-check"} {"id": 55142, "name": "unknown", "code": "test(\"should yield negative bigints\", () => {\n fc.assert(\n fc.property(NegativeBigIntArbitrary, (num) => {\n assert.ok(NegativeBigInt.is(num));\n }),\n {\n verbose: true,\n numRuns: 100,\n }\n );\n})", "language": "typescript", "source_file": "./repos/EricCrosson/numbers-ts/packages/fast-check-bigint/test/property/test-negative-bigint.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "EricCrosson/numbers-ts", "url": "https://github.com/EricCrosson/numbers-ts.git", "license": "ISC", "stars": 3, "forks": 2}, "metrics": null, "summary": "The property ensures that values generated by `NegativeBigIntArbitrary` are valid negative bigints.", "mode": "fast-check"} {"id": 55143, "name": "unknown", "code": "test(\"should yield zero\", () => {\n fc.assert(\n fc.property(ZeroArbitrary, (num) => {\n assert.ok(Zero.is(num));\n }),\n {\n verbose: true,\n numRuns: 100,\n }\n );\n})", "language": "typescript", "source_file": "./repos/EricCrosson/numbers-ts/packages/fast-check-numbers/test/property/test-zero.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "EricCrosson/numbers-ts", "url": "https://github.com/EricCrosson/numbers-ts.git", "license": "ISC", "stars": 3, "forks": 2}, "metrics": null, "summary": "`Zero.is` should confirm that all numbers generated by `ZeroArbitrary` are zero.", "mode": "fast-check"} {"id": 59863, "name": "unknown", "code": "it('returns 100 when n = min, and n < origin', () => {\n fc.assert(\n fc.property(\n genRangeParams().filter((x) => x.min < x.origin),\n LocalGen.scaleMode(),\n ({ min, max, origin }, scaleMode) => {\n const range = Range.createFrom(nativeCalculator, min, max, origin, scaleMode);\n\n const distance = range.getProportionalDistance(min);\n\n expect(distance).toEqual(100);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Number/Range.test.ts", "start_line": null, "end_line": null, "dependencies": ["genRangeParams"], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "When `n` equals `min` and `n` is less than `origin`, the proportional distance returned is 100.", "mode": "fast-check"} {"id": 55144, "name": "unknown", "code": "test(\"should yield positive numbers\", () => {\n fc.assert(\n fc.property(PositiveArbitrary, (num) => {\n assert.ok(Positive.is(num));\n }),\n {\n verbose: true,\n numRuns: 100,\n }\n );\n})", "language": "typescript", "source_file": "./repos/EricCrosson/numbers-ts/packages/fast-check-numbers/test/property/test-positive.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "EricCrosson/numbers-ts", "url": "https://github.com/EricCrosson/numbers-ts.git", "license": "ISC", "stars": 3, "forks": 2}, "metrics": null, "summary": "Numbers generated by `PositiveArbitrary` are verified to be positive using `Positive.is(num)`.", "mode": "fast-check"} {"id": 55145, "name": "unknown", "code": "test(\"should yield positive integers\", () => {\n fc.assert(\n fc.property(PositiveIntArbitrary, (num) => {\n assert.ok(Positive.is(num));\n assert.ok(Int.is(num));\n assert.ok(PositiveInt.is(num));\n }),\n {\n verbose: true,\n numRuns: 100,\n }\n );\n})", "language": "typescript", "source_file": "./repos/EricCrosson/numbers-ts/packages/fast-check-numbers/test/property/test-positive-int.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "EricCrosson/numbers-ts", "url": "https://github.com/EricCrosson/numbers-ts.git", "license": "ISC", "stars": 3, "forks": 2}, "metrics": null, "summary": "`PositiveIntArbitrary` generates numbers that satisfy the conditions of being positive integers, as confirmed by `Positive.is`, `Int.is`, and `PositiveInt.is`.", "mode": "fast-check"} {"id": 59866, "name": "unknown", "code": "it('returns [min,max] when 0 <= size <= 100 ', () => {\n fc.assert(\n fc.property(genRangeParams(), domainGen.size(), ({ min, max, origin }, size) => {\n const range = Range.createFrom(nativeCalculator, min, max, origin, 'constant');\n\n const bounds = range.getSizedBounds(nativeCalculator.loadIntegerUnchecked(size));\n\n const expectedBounds: Bounds = [min, max];\n expect(bounds).toMatchObject(expectedBounds);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Number/Range.test.ts", "start_line": null, "end_line": null, "dependencies": ["genRangeParams"], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Range.getSizedBounds` returns `[min, max]` when the size is between 0 and 100.", "mode": "fast-check"} {"id": 59871, "name": "unknown", "code": "test('GenTree.unfold(, , , ) => forall nodes, node.complexity = calculateComplexity(node.value)', () => {\n fc.assert(\n fc.property(\n domainGen.anything(),\n domainGen.func(domainGen.anything()),\n domainGen.func(domainGen.anyShrinks()),\n domainGen.func(domainGen.naturalNumber()),\n (acc, accToValue, accExpander, calculateComplexity) => {\n const tree = GenTree.unfold(acc, accToValue, accExpander, calculateComplexity);\n\n for (const node of pipe(GenTree.traverse(tree), take(10))) {\n expect(node.complexity).toEqual(calculateComplexity(node.value));\n }\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/GenTree/GenTree.Unfold.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`GenTree.unfold` generates nodes such that each node's complexity equals `calculateComplexity` applied to its value.", "mode": "fast-check"} {"id": 55146, "name": "unknown", "code": "test(\"should yield non-zero numbers\", () => {\n fc.assert(\n fc.property(NonZeroArbitrary, (num) => {\n assert.ok(NonZero.is(num));\n }),\n {\n verbose: true,\n numRuns: 100,\n }\n );\n})", "language": "typescript", "source_file": "./repos/EricCrosson/numbers-ts/packages/fast-check-numbers/test/property/test-non-zero.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "EricCrosson/numbers-ts", "url": "https://github.com/EricCrosson/numbers-ts.git", "license": "ISC", "stars": 3, "forks": 2}, "metrics": null, "summary": "`NonZeroArbitrary` generates numbers that the `NonZero.is` function validates as non-zero.", "mode": "fast-check"} {"id": 55147, "name": "unknown", "code": "test(\"should yield non-zero integers\", () => {\n fc.assert(\n fc.property(NonZeroIntArbitrary, (num) => {\n assert.ok(NonZero.is(num));\n assert.ok(Int.is(num));\n assert.ok(NonZeroInt.is(num));\n }),\n {\n verbose: true,\n numRuns: 100,\n }\n );\n})", "language": "typescript", "source_file": "./repos/EricCrosson/numbers-ts/packages/fast-check-numbers/test/property/test-non-zero-int.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "EricCrosson/numbers-ts", "url": "https://github.com/EricCrosson/numbers-ts.git", "license": "ISC", "stars": 3, "forks": 2}, "metrics": null, "summary": "Generated integers should be non-zero and classified as valid by `NonZero`, `Int`, and `NonZeroInt`.", "mode": "fast-check"} {"id": 59872, "name": "unknown", "code": "test('It has an isomorphism with Array.prototype.map', () => {\n fc.assert(\n fc.property(domainGen.anyTree(), domainGen.anyFunc({ arity: 1 }), (tree, f) => {\n const mappedTree = GenTree.map(tree, f);\n\n const nodesMappedByTree = Array.from(GenTree.traverse(mappedTree));\n const nodesMappedByArray = Array.from(GenTree.traverse(tree)).map((node) => ({ ...node, value: f(node.value) }));\n\n expect(nodesMappedByTree).toEqual(nodesMappedByArray);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/GenTree/GenTree.Map.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`GenTree.map` produces a tree whose traversal matches the array mapping of the input tree's traversal with the same function.", "mode": "fast-check"} {"id": 59873, "name": "unknown", "code": "test('GenTree.concat([], concatComplexity, ) => the root node contains the concatComplexity', () => {\n fc.assert(\n fc.property(domainGen.naturalNumber(), (concatComplexity) => {\n const genTreeConcat = GenTree.concat([], () => concatComplexity, Shrink.none());\n\n const expectedNode: GenTree.Node = {\n id: NodeId.EMPTY,\n value: [],\n complexity: concatComplexity,\n };\n expect(genTreeConcat.node).toEqual(expectedNode);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/GenTree/GenTree.Concat.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`GenTree.concat` with an empty array assigns the root node a complexity equal to the provided `concatComplexity`.", "mode": "fast-check"} {"id": 59874, "name": "unknown", "code": "test('GenTree.concat([tree], , ) => the root node contains the root node of tree', () => {\n fc.assert(\n fc.property(domainGen.anyTree(), domainGen.naturalNumber(), (tree, concatComplexity) => {\n const treeConcat = GenTree.concat([tree], () => concatComplexity, Shrink.none());\n\n const expectedNode: GenTree.Node = {\n id: tree.node.id,\n value: [tree.node.value],\n complexity: tree.node.complexity + concatComplexity,\n };\n expect(treeConcat.node).toEqual(expectedNode);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/GenTree/GenTree.Concat.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The root node of the concatenated tree should contain the root node of the original tree with updated complexity.", "mode": "fast-check"} {"id": 55151, "name": "unknown", "code": "test(\"should yield non-negative integers\", () => {\n fc.assert(\n fc.property(NonNegativeIntArbitrary, (num) => {\n assert.ok(NonNegative.is(num));\n assert.ok(Int.is(num));\n assert.ok(NonNegativeInt.is(num));\n }),\n {\n verbose: true,\n numRuns: 100,\n }\n );\n})", "language": "typescript", "source_file": "./repos/EricCrosson/numbers-ts/packages/fast-check-numbers/test/property/test-non-negative-int.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "EricCrosson/numbers-ts", "url": "https://github.com/EricCrosson/numbers-ts.git", "license": "ISC", "stars": 3, "forks": 2}, "metrics": null, "summary": "The property should verify that generated numbers are non-negative integers, satisfying `NonNegative.is`, `Int.is`, and `NonNegativeInt.is` conditions.", "mode": "fast-check"} {"id": 55152, "name": "unknown", "code": "test(\"should yield negative numbers\", () => {\n fc.assert(\n fc.property(NegativeArbitrary, (num) => {\n assert.ok(Negative.is(num));\n }),\n {\n verbose: true,\n numRuns: 100,\n }\n );\n})", "language": "typescript", "source_file": "./repos/EricCrosson/numbers-ts/packages/fast-check-numbers/test/property/test-negative.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "EricCrosson/numbers-ts", "url": "https://github.com/EricCrosson/numbers-ts.git", "license": "ISC", "stars": 3, "forks": 2}, "metrics": null, "summary": "The test verifies that values generated by `NegativeArbitrary` are identified as negative by the `Negative.is` method.", "mode": "fast-check"} {"id": 59877, "name": "unknown", "code": "it('is repeatable', () => {\n fc.assert(\n fc.property(domainGen.sampleConfig(), domainGen.gen(), (config, gen) => {\n const config0 = { ...config, seed: config.seed, iterations: 1 };\n const sample0 = dev.sample(gen, config0);\n\n const config1 = { seed: sample0.seed, size: sample0.size, iterations: 1 };\n const sample1 = dev.sample(gen, config1);\n\n expect(sample1).toEqual(sample0);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Gen/Gen.Repeat.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property checks that sampling a generator with a consistent seed and configuration produces repeatable results.", "mode": "fast-check"} {"id": 55156, "name": "unknown", "code": "test(\"that sPoNGEcAsE contains at least one upper case and lower case character\", () => {\n fc.assert(\n fc.property(arb.pathSegment(10, 15), (name) => {\n const newName = recase(name, [\"sPoNGEcAsE\"]);\n\n expect(newName.split(\"\").some((c) => c === c.toUpperCase()));\n expect(newName.split(\"\").some((c) => c === c.toLowerCase()));\n })\n );\n})", "language": "typescript", "source_file": "./repos/mausworks/tidier/packages/tidier-core/src/recase.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mausworks/tidier", "url": "https://github.com/mausworks/tidier.git", "license": "ISC", "stars": 202, "forks": 2}, "metrics": null, "summary": "The `recase` function ensures that converting a string to `sPoNGEcAsE` results in a mix of at least one uppercase and one lowercase character.", "mode": "fast-check"} {"id": 59878, "name": "unknown", "code": "test('sample(gen.map(f)).values = sample(gen).values.map(f)', () => {\n fc.assert(\n fc.property(domainGen.sampleConfig(), domainGen.gen(), fc.func(fc.anything()), (config, gen, f) => {\n const genMapped = gen.map((x) => f(x));\n\n const mappedSample = dev.sampleTrees(genMapped, config);\n const unmappedSample = dev.sampleTrees(gen, config);\n\n const actualTrees = mappedSample.values.map(dev.GenTree.traverseGreedy);\n const expectedTrees = unmappedSample.values\n .map((tree) => dev.GenTree.map(tree, f))\n .map(dev.GenTree.traverseGreedy);\n expect(actualTrees).toEqual(expectedTrees);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Gen/Gen.Map.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Mapping a function over a generated sample should produce equivalent values to generating a sample and then mapping the function over it.", "mode": "fast-check"} {"id": 59879, "name": "unknown", "code": "test('gen.map(f) = Gen.map(gen, f)', () => {\n fc.assert(\n fc.property(domainGen.sampleConfig(), domainGen.gen(), fc.func(fc.anything()), (config, gen, f) => {\n const genMapped = gen.map((x) => f(x));\n const genMappedAlt = dev.Gen.map(gen, (x) => f(x));\n\n expect(dev.sample(genMapped, config)).toEqual(dev.sample(genMappedAlt, config));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Gen/Gen.Map.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Mapping a function over a generator using `gen.map(f)` should yield the same result as using `Gen.map(gen, f)`.", "mode": "fast-check"} {"id": 55157, "name": "unknown", "code": "it(\"includes new projects on include\", async () => {\n fc.assert(\n fc.property(arb.folderPath(true), (rootPath) => {\n const folder = new TestFolder(rootPath);\n\n const projects = new Projects();\n const project = new Project(folder, basicSettings);\n projects.add(project);\n\n expect(projects.count).toBe(1);\n expect(projects.list()[0]).toBe(project);\n expect(projects.find(project.folder.path)).toBe(project);\n expect(projects.bestMatch(project.folder.path)).toBe(project);\n })\n );\n })", "language": "typescript", "source_file": "./repos/mausworks/tidier/packages/tidier-core/src/projects.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mausworks/tidier", "url": "https://github.com/mausworks/tidier.git", "license": "ISC", "stars": 202, "forks": 2}, "metrics": null, "summary": "Adding a new project to `Projects` should result in the project being countable, listable, findable by folder path, and the best match by folder path.", "mode": "fast-check"} {"id": 55158, "name": "unknown", "code": "it(\"removes projects by path\", async () => {\n fc.assert(\n fc.property(arb.folderPath(true), (rootPath) => {\n const folder = new TestFolder(rootPath);\n\n const projects = new Projects();\n const project = new Project(folder, basicSettings);\n projects.add(project);\n projects.remove(project.folder.path);\n\n expect(projects.count).toBe(0);\n expect(projects.list()[0]).toBe(undefined);\n expect(projects.find(project.folder.path)).toBe(null);\n expect(projects.bestMatch(project.folder.path)).toBe(null);\n })\n );\n })", "language": "typescript", "source_file": "./repos/mausworks/tidier/packages/tidier-core/src/projects.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mausworks/tidier", "url": "https://github.com/mausworks/tidier.git", "license": "ISC", "stars": 202, "forks": 2}, "metrics": null, "summary": "Projects should be removable by specifying their path, verified by checking the project's absence in the list, count, and search results.", "mode": "fast-check"} {"id": 59880, "name": "unknown", "code": "test('Gen.integer().between(x, y) *produces* integers in the range [x, y]', () => {\n fc.assert(\n fc.property(\n domainGen.sampleConfig(),\n domainGen.setOfSize(domainGen.integer(), 2),\n fc.boolean(),\n (config, [a, b], shouldBias) => {\n const [x, y] = [a, b].sort((a, b) => a - b);\n const gen = shouldBias ? dev.Gen.integer().between(x, y) : dev.Gen.integer().between(x, y).noBias();\n\n const sample = dev.sample(gen, config);\n\n for (const value of sample.values) {\n expect(value).toEqual(Math.round(value));\n expect(value).toBeGreaterThanOrEqual(x);\n expect(value).toBeLessThanOrEqual(y);\n }\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Gen/Gen.Integer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Gen.integer().between(x, y)` produces integers within the inclusive range `[x, y]`, ensuring each value is an integer and falls within the specified bounds.", "mode": "fast-check"} {"id": 59881, "name": "unknown", "code": "test('Gen.integer().between(x, y), x > 0, y >= x = Gen.integer().between(x, y).origin(x) *because* the origin is clipped', () => {\n fc.assert(\n fc.property(\n domainGen.sampleConfig(),\n domainGen.integer({ min: 1 }),\n domainGen.integer({ min: 1 }),\n (config, a, b) => {\n const [x, y] = [a, b].sort((a, b) => a - b);\n const gen = dev.Gen.integer().between(x, y);\n const genAlt = dev.Gen.integer().between(x, y).origin(x);\n\n expect(dev.sample(gen, config)).toEqual(dev.sample(genAlt, config));\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Gen/Gen.Integer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Gen.integer().between(x, y)` with `x > 0` and `y >= x` should produce the same samples as `Gen.integer().between(x, y).origin(x)` because the origin is clipped.", "mode": "fast-check"} {"id": 59882, "name": "unknown", "code": "test('Gen.integer().between(x, y), x < 0, y <= x = Gen.integer().between(x, y).origin(x) *because* the origin is clipped', () => {\n fc.assert(\n fc.property(\n domainGen.sampleConfig(),\n domainGen.integer({ max: -1 }),\n domainGen.integer({ max: -1 }),\n (config, a, b) => {\n const [x, y] = [a, b].sort((a, b) => b - a);\n const gen = dev.Gen.integer().between(x, y);\n const genAlt = dev.Gen.integer().between(x, y).origin(x);\n\n expect(dev.sample(gen, config)).toEqual(dev.sample(genAlt, config));\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Gen/Gen.Integer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "For `Gen.integer().between(x, y)` where `x < 0` and `y <= x`, the origin is clipped to `x`, resulting in the same sample output as explicitly setting the origin to `x`.", "mode": "fast-check"} {"id": 59887, "name": "unknown", "code": "test('default(origin) = 0', () => {\n fc.assert(\n fc.property(domainGen.sampleConfig(), (config) => {\n const genDefault = dev.Gen.integer();\n const genLinear = dev.Gen.integer().origin(0);\n\n expect(dev.sample(genDefault, config)).toEqual(dev.sample(genLinear, config));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Gen/Gen.Integer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks if the default origin of integers generated by `dev.Gen.integer()` is equivalent to explicitly setting the origin to 0.", "mode": "fast-check"} {"id": 59889, "name": "unknown", "code": "test('Gen.integer().between(x, y) = Gen.integer().between(y, x) *because* it is resilient to parameter order', () => {\n fc.assert(\n fc.property(domainGen.sampleConfig(), domainGen.setOfSize(domainGen.integer(), 3), (config, [a, b, c]) => {\n const [x, z, y] = [a, b, c].sort((a, b) => a - b);\n const gen = dev.Gen.integer().origin(z);\n const genBetween = gen.between(x, y);\n const genBetweenAlt = gen.between(y, x);\n\n expect(dev.sample(genBetween, config)).toEqual(dev.sample(genBetweenAlt, config));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Gen/Gen.Integer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Gen.integer().between(x, y)` is invariant to the order of parameters, producing equivalent samples when `x` and `y` are swapped.", "mode": "fast-check"} {"id": 59895, "name": "unknown", "code": "test('sample(gen.filter(false)) *throws* exhausted', () => {\n fc.assert(\n fc.property(domainGen.sampleConfig(), domainGen.gen(), (config, gen) => {\n const genFiltered = gen.filter(() => false);\n\n expect(() => dev.sample(genFiltered, config)).toThrow('Exhausted after');\n }),\n );\n})", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Gen/Gen.Filter.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Filtering a generator with a condition that is never met raises an \"Exhausted after\" error when sampled.", "mode": "fast-check"} {"id": 59898, "name": "unknown", "code": "test('Gen.array(gen).ofMaxLength(x) *produces* arrays with length equal to *oracle* Gen.integer().between(0, x)', () => {\n fc.assert(\n fc.property(domainGen.sampleConfig(), domainGen.gen(), genArrayLength(), (config, elementGen, x) => {\n const genArray = dev.Gen.array(elementGen)\n .ofMaxLength(x)\n .map((arr) => arr.length);\n const genInteger = dev.Gen.integer().between(0, x);\n\n expect(dev.sample(genArray, { ...config, iterations: 1 })).toEqual(\n dev.sample(genInteger, { ...config, iterations: 1 }),\n );\n }),\n );\n})", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Gen/Gen.Array.test.ts", "start_line": null, "end_line": null, "dependencies": ["genArrayLength"], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Gen.array(gen).ofMaxLength(x)` produces arrays whose lengths match those generated by `Gen.integer().between(0, x)`.", "mode": "fast-check"} {"id": 59899, "name": "unknown", "code": "test('default(min) = 0', () => {\n fc.assert(\n fc.property(domainGen.sampleConfig(), domainGen.gen(), (config, elementGen) => {\n const genDefault = dev.Gen.array(elementGen);\n const genAlt = dev.Gen.array(elementGen).ofMinLength(0);\n\n expect(dev.sample(genDefault, config)).toEqual(dev.sample(genAlt, config));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Gen/Gen.Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The default minimum length of arrays generated by `dev.Gen.array` should be zero, matching arrays generated with an explicit minimum length of zero.", "mode": "fast-check"} {"id": 59901, "name": "unknown", "code": "test('Gen.array(gen) = gen.array()', () => {\n fc.assert(\n fc.property(domainGen.sampleConfig(), domainGen.gen(), (config, elementGen) => {\n const genArray = dev.Gen.array(elementGen);\n const genArrayAlt = elementGen.array();\n\n expect(dev.sample(genArray, config)).toEqual(dev.sample(genArrayAlt, config));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Gen/Gen.Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Gen.array(gen)` should produce the same sample output as `gen.array()` given the same configuration and element generator.", "mode": "fast-check"} {"id": 59902, "name": "unknown", "code": "test('Gen.array(gen).betweenLengths(x, y) = Gen.array(gen).betweenLengths(y, x)', () => {\n fc.assert(\n fc.property(\n domainGen.sampleConfig(),\n domainGen.gen(),\n genArrayLength(),\n genArrayLength(),\n (config, elementGen, x, y) => {\n const genArray = dev.Gen.array(elementGen).betweenLengths(x, y);\n const genArrayAlt = dev.Gen.array(elementGen).betweenLengths(y, x);\n\n expect(dev.sample(genArray, config)).toEqual(dev.sample(genArrayAlt, config));\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Gen/Gen.Array.test.ts", "start_line": null, "end_line": null, "dependencies": ["genArrayLength"], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Generating arrays with `Gen.array(gen).betweenLengths(x, y)` should produce the same output as `Gen.array(gen).betweenLengths(y, x)`.", "mode": "fast-check"} {"id": 60116, "name": "unknown", "code": "test(\"order of elements is maintained\", () => {\n const arb = fc.array(fc.nat({ max: 1024 }), {\n maxLength: 10,\n })\n\n fc.assert(\n fc.property(arb, sizes => {\n const arrs = sizes.map(arrayOfSize)\n const vecs = arrs.map(fromArray)\n const merged = concatMany(vecs)\n\n assertEqualElements(merged, arrs.flat())\n }),\n { numRuns: 100 }\n )\n })", "language": "typescript", "source_file": "./repos/peterhorne/rrb-tree/src/test.ts", "start_line": null, "end_line": null, "dependencies": ["concatMany", "assertEqualElements"], "repo": {"name": "peterhorne/rrb-tree", "url": "https://github.com/peterhorne/rrb-tree.git", "license": "MIT", "stars": 18, "forks": 0}, "metrics": null, "summary": "The order of elements should be maintained when merging multiple arrays into a single vector using `concatMany`.", "mode": "fast-check"} {"id": 60118, "name": "unknown", "code": "test(\"height invariant is maintained\", () => {\n const arb = fc.array(fc.nat({ max: 32_768 }), {\n maxLength: 10,\n })\n\n fc.assert(\n fc.property(arb, sizes => {\n const arrs = sizes.map(arrayOfSize)\n const vecs = arrs.map(fromArray)\n const merged = concatMany(vecs)\n\n const length = arrs.flat().length\n const heightLeastDense =\n length > 0 ? Math.log(length) / Math.log(M - E_MAX) : 0\n const heightMostDense =\n length > 0 ? Math.ceil(Math.log(length) / Math.log(M)) - 1 : 0\n\n expect(merged.root.height).toBeLessThanOrEqual(heightLeastDense)\n expect(merged.root.height).toBeGreaterThanOrEqual(heightMostDense)\n }),\n { numRuns: 1000 }\n )\n })", "language": "typescript", "source_file": "./repos/peterhorne/rrb-tree/src/test.ts", "start_line": null, "end_line": null, "dependencies": ["concatMany"], "repo": {"name": "peterhorne/rrb-tree", "url": "https://github.com/peterhorne/rrb-tree.git", "license": "MIT", "stars": 18, "forks": 0}, "metrics": null, "summary": "The height of the resultant RRB tree after concatenating multiple vectors should be within a calculated range based on density, ensuring the height invariant is maintained.", "mode": "fast-check"} {"id": 60122, "name": "unknown", "code": "it.concurrent('returns true if the objects are equal', () => {\n fc.assert(\n fc.property(cloneValueObjArb, ([valueObj, otherObj]) => {\n expect(valueObj.equals(otherObj)).toBe(true);\n expect(otherObj.equals(valueObj)).toBe(true);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/determined-ai/determined/webui/react/src/utils/asValueObject.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "determined-ai/determined", "url": "https://github.com/determined-ai/determined.git", "license": "Apache-2.0", "stars": 3159, "forks": 365}, "metrics": null, "summary": "The property should hold that `valueObj.equals(otherObj)` and `otherObj.equals(valueObj)` both return true when the objects are equal.", "mode": "fast-check"} {"id": 60124, "name": "unknown", "code": "it.concurrent('immutable.is returns true when setting to a clone', () => {\n fc.assert(\n fc.property(withMapArb(cloneValueObjArb), ([valueMap, otherMap]) => {\n expect(is(valueMap, otherMap)).toBe(true);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/determined-ai/determined/webui/react/src/utils/asValueObject.test.ts", "start_line": null, "end_line": null, "dependencies": ["withMapArb"], "repo": {"name": "determined-ai/determined", "url": "https://github.com/determined-ai/determined.git", "license": "Apache-2.0", "stars": 3159, "forks": 365}, "metrics": null, "summary": "The test verifies that `immutable.is` returns true when comparing a map to its clone.", "mode": "fast-check"} {"id": 55163, "name": "unknown", "code": "it(\"lists all files (except ignored) with '**/*'\", async () => {\n await fc.assert(\n fc.asyncProperty(\n arb.folderPath(true),\n fc.set(arb.filePath({ minLength: 2, maxLength: 2 }), {\n minLength: 2,\n maxLength: 2,\n }),\n async (rootPath, files) => {\n const root = seedFolder(rootPath, files, []);\n const ignore = files.slice(0, files.length / 2);\n\n const project = new Project(root, { ...basicSettings, ignore });\n const entries = await project.list(Glob.ANYTHING, \"file\");\n const paths = entries.map(([path]) => path);\n\n for (const file of paths) {\n expect(paths.includes(file)).toBe(!ignore.includes(file));\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mausworks/tidier/packages/tidier-core/src/project.spec.ts", "start_line": null, "end_line": null, "dependencies": ["seedFolder"], "repo": {"name": "mausworks/tidier", "url": "https://github.com/mausworks/tidier.git", "license": "ISC", "stars": 202, "forks": 2}, "metrics": null, "summary": "`Project` lists all files using the pattern '**/*', excluding those specified in the ignore list.", "mode": "fast-check"} {"id": 60127, "name": "unknown", "code": "it('should return passed cell for any string value', () => {\n fc.assert(\n fc.property(fc.string(), (value) => {\n expect(handleEmptyCell(value, (data) => generateGridCell(data))).toEqual(\n generateGridCell(value),\n );\n }),\n );\n })", "language": "typescript", "source_file": "./repos/determined-ai/determined/webui/react/src/utils/table.test.ts", "start_line": null, "end_line": null, "dependencies": ["generateGridCell"], "repo": {"name": "determined-ai/determined", "url": "https://github.com/determined-ai/determined.git", "license": "Apache-2.0", "stars": 3159, "forks": 365}, "metrics": null, "summary": "`handleEmptyCell` should return the generated grid cell for any string value.", "mode": "fast-check"} {"id": 60128, "name": "unknown", "code": "it('should return passed cell for any non-empty string value when allowFalsy is false', () => {\n fc.assert(\n fc.property(fc.string({ minLength: 1 }), (value) => {\n expect(handleEmptyCell(value, (data) => generateGridCell(data))).toEqual(\n generateGridCell(value),\n );\n }),\n );\n })", "language": "typescript", "source_file": "./repos/determined-ai/determined/webui/react/src/utils/table.test.ts", "start_line": null, "end_line": null, "dependencies": ["generateGridCell"], "repo": {"name": "determined-ai/determined", "url": "https://github.com/determined-ai/determined.git", "license": "Apache-2.0", "stars": 3159, "forks": 365}, "metrics": null, "summary": "When `allowFalsy` is false, `handleEmptyCell` should return the given grid cell for any non-empty string.", "mode": "fast-check"} {"id": 60130, "name": "unknown", "code": "it('merged abort controller aborts with constituent reason', () => {\n fc.assert(\n fc.property(argArbWithSelectionAndReasons(1), ([args, abortControllers]) => {\n const [[abortController, reason]] = abortControllers;\n const result = mergeAbortControllers(...args);\n\n abortController.abort(reason);\n expect(abortController.signal.reason).toBe(reason);\n expect(result.signal.reason).toBe(abortController.signal.reason);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/determined-ai/determined/webui/react/src/utils/mergeAbortControllers.test.ts", "start_line": null, "end_line": null, "dependencies": ["argArbWithSelectionAndReasons"], "repo": {"name": "determined-ai/determined", "url": "https://github.com/determined-ai/determined.git", "license": "Apache-2.0", "stars": 3159, "forks": 365}, "metrics": null, "summary": "A merged abort controller should abort with the reason provided to one of its constituent controllers.", "mode": "fast-check"} {"id": 60131, "name": "unknown", "code": "it('merged abort controller only reflects the first abort', () => {\n fc.assert(\n fc.property(argArbWithSelectionAndReasons(), ([args, abortControllers]) => {\n const [[firstAbortController]] = abortControllers;\n const result = mergeAbortControllers(...args);\n\n abortControllers.forEach(([abortController, reason]) => {\n abortController.abort(reason);\n });\n expect(result.signal.reason).toBe(firstAbortController.signal.reason);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/determined-ai/determined/webui/react/src/utils/mergeAbortControllers.test.ts", "start_line": null, "end_line": null, "dependencies": ["argArbWithSelectionAndReasons"], "repo": {"name": "determined-ai/determined", "url": "https://github.com/determined-ai/determined.git", "license": "Apache-2.0", "stars": 3159, "forks": 365}, "metrics": null, "summary": "`mergeAbortControllers` returns a signal that reflects only the reason from the first `AbortController` that is aborted.", "mode": "fast-check"} {"id": 60133, "name": "unknown", "code": "it(\"does not affect the returned result for a deterministic IO\", () =>\n fc.assert(\n fc.asyncProperty(\n io,\n fc.integer({ min: 0, max: 10 }),\n async (io, retryCount) => {\n expect(await io.retry(retryCount).runSafe()).toEqual(\n await io.runSafe()\n );\n }\n )\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/retry.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The result of a deterministic IO operation should remain unchanged by retrying it a specified number of times.", "mode": "fast-check"} {"id": 60136, "name": "unknown", "code": "it(\"raises a Timeout error if the action takes longer than the timeout\", () =>\n fc.assert(\n fc.asyncProperty(\n io,\n fc.integer({ min: 0, max: 8 }).map((x) => x * 5),\n fc.integer({ min: 0, max: 8 }).map((x) => x * 5),\n async (io, msToComplete, msToTimeout) => {\n fc.pre(msToComplete > msToTimeout);\n await expect(\n io\n .delay(msToComplete, \"milliseconds\")\n .timeout(msToTimeout, \"milliseconds\")\n .run()\n ).rejects.toEqual(new TimeoutError());\n }\n )\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/timeout.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "A `TimeoutError` is raised when an asynchronous action's duration exceeds the specified timeout limit.", "mode": "fast-check"} {"id": 60137, "name": "unknown", "code": "it(\"returns the same result as the base action if it completes within the timeout\", () =>\n fc.assert(\n fc.asyncProperty(\n io,\n fc.integer({ min: 0, max: 8 }).map((x) => x * 5),\n fc.integer({ min: 0, max: 8 }).map((x) => x * 5),\n async (io, msToComplete, msToTimeout) => {\n fc.pre(msToComplete < msToTimeout);\n expect(\n await io\n .delay(msToComplete, \"milliseconds\")\n .timeout(msToTimeout, \"milliseconds\")\n .runSafe()\n ).toEqual(await io.runSafe());\n }\n )\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/timeout.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The action should return the same result if it finishes within the specified timeout duration.", "mode": "fast-check"} {"id": 55165, "name": "unknown", "code": "it(\"does not include other project files\", async () => {\n await fc.assert(\n fc.asyncProperty(\n arb.folderPath(true),\n fc.set(arb.folderPath(), { minLength: 2 }),\n async (rootPath, folders) => {\n const root = seedFolder(rootPath, [], folders);\n const otherRoot = folders[folders.length - 1];\n const configPath = join(rootPath, otherRoot, TIDIER_CONFIG_NAME);\n root.volume[configPath] = \"{}\";\n\n const project = new Project(root, basicSettings);\n const entries = await project.list(Glob.ANYTHING, \"folder\");\n\n expect(entries.map(([path]) => path).includes(otherRoot)).toBe(false);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mausworks/tidier/packages/tidier-core/src/project.spec.ts", "start_line": null, "end_line": null, "dependencies": ["seedFolder"], "repo": {"name": "mausworks/tidier", "url": "https://github.com/mausworks/tidier.git", "license": "ISC", "stars": 202, "forks": 2}, "metrics": null, "summary": "A `Project` instance should exclude other project files not located in its root when listing folder entries.", "mode": "fast-check"} {"id": 60138, "name": "unknown", "code": "it(\"can be created with an initial value\", () =>\n fc.assert(\n fc.asyncProperty(fc.anything(), async (initialValue) => {\n const program = Ref.create(initialValue).andThen(Ref.get);\n const result = await program.run();\n expect(result).toBe(initialValue);\n })\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/ref.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`Ref.create` initializes with a value, and `Ref.get` retrieves that same value.", "mode": "fast-check"} {"id": 60139, "name": "unknown", "code": "it(\"can be updated using the set instance method\", () =>\n fc.assert(\n fc.asyncProperty(\n fc.anything(),\n fc.anything(),\n async (initialValue, newValue) => {\n const program = Ref.create(initialValue)\n .through((ref) => ref.set(newValue))\n .andThen((ref) => ref.get);\n const result = await program.run();\n expect(result).toBe(newValue);\n }\n )\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/ref.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`Ref` updates correctly using the `set` method, ensuring the retrieved value matches the new value set.", "mode": "fast-check"} {"id": 60140, "name": "unknown", "code": "it(\"can be updated using the set static method\", () =>\n fc.assert(\n fc.asyncProperty(\n fc.anything(),\n fc.anything(),\n async (initialValue, newValue) => {\n const program = Ref.create(initialValue)\n .through(Ref.set(newValue))\n .andThen(Ref.get);\n const result = await program.run();\n expect(result).toBe(newValue);\n }\n )\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/ref.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Updating a reference using the `set` method should result in the reference holding the new value.", "mode": "fast-check"} {"id": 55166, "name": "unknown", "code": "it(\"reads the file with the specified path on load and reload\", async () => {\n await fc.assert(\n fc.asyncProperty(\n arb.folderPath(true),\n arb.fileName(),\n arbitraryIgnorePaths(),\n async (root, fileName, contents) => {\n const folder = new TestFolder(root, {\n [`${root}/${fileName}`]: contents.join(\"\\n\"),\n });\n const readFileSpy = jest.spyOn(folder, \"readFile\");\n const ignorefile = await Ignorefile.load(folder, fileName);\n await ignorefile.reload();\n\n expect(readFileSpy).toHaveBeenCalledWith(fileName);\n expect(readFileSpy).toHaveBeenLastCalledWith(fileName);\n expect(readFileSpy).toHaveBeenCalledTimes(2);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mausworks/tidier/packages/tidier-core/src/ignore.spec.ts", "start_line": null, "end_line": null, "dependencies": ["arbitraryIgnorePaths"], "repo": {"name": "mausworks/tidier", "url": "https://github.com/mausworks/tidier.git", "license": "ISC", "stars": 202, "forks": 2}, "metrics": null, "summary": "Upon loading and reloading, `Ignorefile` should read the specified file path twice.", "mode": "fast-check"} {"id": 60142, "name": "unknown", "code": "it(\"can be updated with a pure function using the modify static method\", () =>\n fc.assert(\n fc.asyncProperty(fc.integer(), async (initialValue) => {\n const program = Ref.create(initialValue).andThen((ref) =>\n // return a tuple of the result of \"modify\" and the ref's value\n // afterwards, to check they are equal.\n IO.sequence([Ref.modify((x: number) => x + 1)(ref), ref.get] as const)\n );\n\n const result = await program.run();\n expect(result[0]).toBe(initialValue + 1);\n expect(result[1]).toBe(initialValue + 1);\n })\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/ref.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Verifies that the `Ref.modify` method correctly updates a reference's value with a pure function, ensuring the result of the modification and the subsequent retrieval from the reference are equal to the incremented initial value.", "mode": "fast-check"} {"id": 55168, "name": "unknown", "code": "it(\"does not add duplicate ignorefiles\", () => {\n fc.assert(\n fc.property(arb.filePath(), (path) => {\n const folder = new TestFolder(path);\n const ignorefiles = [\n new Ignorefile({ path, folder, patterns: [], semantics: \"glob\" }),\n new Ignorefile({ path, folder, patterns: [], semantics: \"glob\" }),\n ];\n\n const ignore = new ProjectIgnore();\n\n for (const ignorefile of ignorefiles) {\n ignore.useIgnorefile(ignorefile);\n }\n\n expect(ignore.ignorefiles).toHaveLength(1);\n })\n );\n })", "language": "typescript", "source_file": "./repos/mausworks/tidier/packages/tidier-core/src/ignore.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mausworks/tidier", "url": "https://github.com/mausworks/tidier.git", "license": "ISC", "stars": 202, "forks": 2}, "metrics": null, "summary": "Adding duplicate ignore files should result in only one instance being maintained.", "mode": "fast-check"} {"id": 60143, "name": "unknown", "code": "it(\"adds another IO which will run after the target IO, but retains the original result\", () =>\n fc.assert(\n fc.asyncProperty(\n arbitraries.io,\n arbitraries.successfulIo,\n async (firstIo, secondIo) => {\n const firstIoOutcome = await firstIo.runSafe();\n\n const throughFunc = jest.fn(() => secondIo);\n const resultThroughAdditionalIo = await firstIo\n .through(throughFunc)\n .runSafe();\n\n expect(resultThroughAdditionalIo).toEqual(firstIoOutcome);\n\n if (firstIoOutcome.kind === OutcomeKind.Succeeded) {\n expect(throughFunc).toHaveBeenCalledTimes(1);\n expect(throughFunc).toHaveBeenCalledWith(firstIoOutcome.value);\n } else {\n expect(throughFunc).toHaveBeenCalledTimes(0);\n }\n }\n )\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/through.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "An additional IO operation is executed after the target IO without altering the original result, and the subsequent IO is invoked only if the initial IO succeeds.", "mode": "fast-check"} {"id": 60144, "name": "unknown", "code": "it(\"always produces the same value when mapped with the identity function\", () =>\n fc.assert(\n fc.asyncProperty(arbitraries.successfulIo, async (io) => {\n const identity = (x: X) => x;\n expect(await io.map(identity).run()).toBe(await io.run());\n })\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/functor-laws.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Mapping with the identity function on a functor should produce the same value as the original functor when executed.", "mode": "fast-check"} {"id": 60145, "name": "unknown", "code": "it(\"always produces the same value when mapping two functions separately or as one\", () =>\n fc.assert(\n fc.asyncProperty(\n arbitraries.successfulIo,\n arbitraries.unaryFunction,\n arbitraries.unaryFunction,\n async (io, f, g) => {\n const doubleMapped = io.map(f).map(g);\n const composed = io.map((x) => g(f(x)));\n expect(await doubleMapped.run()).toBe(await composed.run());\n }\n )\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/functor-laws.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Mapping two functions separately produces the same value as mapping their composition.", "mode": "fast-check"} {"id": 55169, "name": "unknown", "code": "it(\"ignores files that are ignored by settings\", () => {\n fc.assert(\n fc.property(arbitraryIgnorePaths(), (paths) => {\n const ignore = new ProjectIgnore();\n ignore.use(paths);\n\n expect(ignore.patterns).toEqual(paths);\n\n for (const path of paths) {\n expect(ignore.ignores(path)).toBe(true);\n }\n })\n );\n })", "language": "typescript", "source_file": "./repos/mausworks/tidier/packages/tidier-core/src/ignore.spec.ts", "start_line": null, "end_line": null, "dependencies": ["arbitraryIgnorePaths"], "repo": {"name": "mausworks/tidier", "url": "https://github.com/mausworks/tidier.git", "license": "ISC", "stars": 202, "forks": 2}, "metrics": null, "summary": "When provided with a set of paths to ignore, `ProjectIgnore` should mark each of those paths as ignored.", "mode": "fast-check"} {"id": 55170, "name": "unknown", "code": "it(\"ignores files that are ignored by ignorefiles\", () => {\n fc.assert(\n fc.property(arbitraryIgnorePaths(), (paths) => {\n const ignore = new ProjectIgnore();\n const ignorefile = new Ignorefile({\n path: \"/.gitignore\",\n folder: new TestFolder(\"/\"),\n patterns: paths,\n semantics: \"gitignore\",\n });\n\n ignore.useIgnorefile(ignorefile);\n\n for (const path of paths) {\n expect(ignore.ignores(path)).toBe(true);\n }\n })\n );\n })", "language": "typescript", "source_file": "./repos/mausworks/tidier/packages/tidier-core/src/ignore.spec.ts", "start_line": null, "end_line": null, "dependencies": ["arbitraryIgnorePaths"], "repo": {"name": "mausworks/tidier", "url": "https://github.com/mausworks/tidier.git", "license": "ISC", "stars": 202, "forks": 2}, "metrics": null, "summary": "Files listed in ignorefiles should be marked as ignored by the `ProjectIgnore` class.", "mode": "fast-check"} {"id": 55173, "name": "unknown", "code": "test(\"different paths do not match each other\", () => {\n fc.assert(\n fc.property(\n fc.set(fc.oneof(arb.filePath(), arb.folderPath()), {\n minLength: 2,\n maxLength: 2,\n }),\n ([one, theNext]) => !new Glob(one).matches(theNext)\n )\n );\n})", "language": "typescript", "source_file": "./repos/mausworks/tidier/packages/tidier-core/src/glob.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mausworks/tidier", "url": "https://github.com/mausworks/tidier.git", "license": "ISC", "stars": 202, "forks": 2}, "metrics": null, "summary": "Different file paths or folder paths should not match each other using the `Glob` class.", "mode": "fast-check"} {"id": 60146, "name": "unknown", "code": "it(\"always produces the same value when mapped with the identity function\", () =>\n fc.assert(\n fc.asyncProperty(arbitraries.unsuccessfulIo, async (unsuccessfulIo) => {\n const identity = (x: X) => x;\n expect(await unsuccessfulIo.mapError(identity).runSafe()).toEqual(\n await unsuccessfulIo.runSafe()\n );\n })\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/functor-laws.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Mapping with the identity function on `unsuccessfulIo` should produce the same value as before mapping.", "mode": "fast-check"} {"id": 60147, "name": "unknown", "code": "it(\"always produces the same value when mapping two functions separately or as one\", () =>\n fc.assert(\n fc.asyncProperty(\n arbitraries.unsuccessfulIo,\n arbitraries.unaryFunction,\n arbitraries.unaryFunction,\n async (unsuccessfulIo, f, g) => {\n const doubleMapped = unsuccessfulIo.mapError(f).mapError(g);\n const composed = unsuccessfulIo.mapError((x) => g(f(x)));\n expect(await doubleMapped.runSafe()).toEqual(\n await composed.runSafe()\n );\n }\n )\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/functor-laws.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Mapping two functions separately or as one should produce the same result when applied to an error within `unsuccessfulIo`.", "mode": "fast-check"} {"id": 60151, "name": "unknown", "code": "it(\"creates an IO which performs the side-effect when run\", () =>\n fc.assert(\n fc.asyncProperty(fc.anything(), (effectResult) => {\n let effectPerformedCount = 0;\n const effect = () => {\n effectPerformedCount += 1;\n return effectResult;\n };\n const io = IO(effect);\n expect(effectPerformedCount).toBe(0);\n const result = io.run();\n expect(effectPerformedCount).toBe(1);\n return expect(result).resolves.toBe(effectResult);\n })\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/core.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "An `IO` executes a side-effect exactly once when its `run` method is called, and returns a promise resolving to the effect's result.", "mode": "fast-check"} {"id": 60153, "name": "unknown", "code": "it(\"creates an IO which waits for a promise returned by the effect\", () =>\n fc.assert(\n fc.asyncProperty(fc.anything(), (eventualValue) => {\n const effect = () => Promise.resolve(eventualValue);\n return expect(IO(effect).run()).resolves.toBe(eventualValue);\n })\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/core.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "An `IO` should properly wait for and resolve a promise returned by the effect, matching the expected value.", "mode": "fast-check"} {"id": 60154, "name": "unknown", "code": "it(\"creates an IO which returns the wrapped values when run\", () =>\n fc.assert(\n fc.asyncProperty(fc.anything(), (initialValue) =>\n expect(IO.wrap(initialValue).run()).resolves.toBe(initialValue)\n )\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/core.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The `IO.wrap` function creates an IO that returns the wrapped value when `run` is called.", "mode": "fast-check"} {"id": 55177, "name": "unknown", "code": "test(\"general casings return themselves\", () => {\n fc.assert(\n fc.property(arb.generalCasing(), (casing) => {\n return resolveCasing(casing) === casing;\n })\n );\n })", "language": "typescript", "source_file": "./repos/mausworks/tidier/packages/tidier-core/src/convention.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mausworks/tidier", "url": "https://github.com/mausworks/tidier.git", "license": "ISC", "stars": 202, "forks": 2}, "metrics": null, "summary": "The property ensures that the `resolveCasing` function returns the original casing for general casing inputs.", "mode": "fast-check"} {"id": 55178, "name": "unknown", "code": "test(\"general aliases return a valid general casing\", () => {\n fc.assert(\n fc.property(arb.generalCasingAlias(), (alias) => {\n return validateCasing(resolveCasing(alias)) !== null;\n })\n );\n })", "language": "typescript", "source_file": "./repos/mausworks/tidier/packages/tidier-core/src/convention.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mausworks/tidier", "url": "https://github.com/mausworks/tidier.git", "license": "ISC", "stars": 202, "forks": 2}, "metrics": null, "summary": "General aliases should resolve to a valid general casing that passes validation.", "mode": "fast-check"} {"id": 60155, "name": "unknown", "code": "it(\"creates an IO which rejects with the raised value when run\", () =>\n fc.assert(\n fc.asyncProperty(fc.anything(), (raisedValue) =>\n expect(IO.raise(raisedValue).run()).rejects.toBe(raisedValue)\n )\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/core.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`IO.raise` creates an IO instance that, when executed, rejects with the specified value.", "mode": "fast-check"} {"id": 60156, "name": "unknown", "code": "it(\"passes the output of the parent IO to the next function\", () =>\n fc.assert(\n fc.asyncProperty(fc.anything(), async (initialValue) => {\n const nextFunction = jest.fn(() => IO.void);\n await IO.wrap(initialValue).andThen(nextFunction).run();\n expect(nextFunction).toHaveBeenCalledTimes(1);\n expect(nextFunction).toHaveBeenCalledWith(initialValue);\n })\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/core.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The output of an `IO` operation should be passed to the next function, which should be called once with that output.", "mode": "fast-check"} {"id": 60157, "name": "unknown", "code": "it(\"makes no difference to IOs which succeed\", () =>\n fc.assert(\n fc.asyncProperty(arbitraries.successfulIo, async (successfulIo) => {\n const withCatch = successfulIo.catch(() => IO.wrap(\"caught an error\"));\n expect(await withCatch.run()).toEqual(await successfulIo.run());\n })\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/core.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Successful IO operations remain unaffected by attaching a catch handler.", "mode": "fast-check"} {"id": 60158, "name": "unknown", "code": "it(\"can always turn an unsuccessful IO into a successful one\", () =>\n fc.assert(\n fc.asyncProperty(arbitraries.unsuccessfulIo, async (unsuccessfulIo) => {\n const withCatch = unsuccessfulIo.catch(() =>\n IO.wrap(\"caught an error\")\n );\n expect(await withCatch.run()).toBe(\"caught an error\");\n })\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/core.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "An unsuccessful IO operation can be transformed into a successful one by catching errors and wrapping the result with a predefined successful value.", "mode": "fast-check"} {"id": 60159, "name": "unknown", "code": "it(\"makes no differences if it re-raises the error unchanged\", () =>\n fc.assert(\n fc.asyncProperty(arbitraries.io, async (io) => {\n const withCatch = io.catch(IO.raise);\n expect(await withCatch.runSafe()).toEqual(await io.runSafe());\n })\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/core.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Re-raising an error unchanged using `IO.raise` should result in no differences when compared to the original `io`.", "mode": "fast-check"} {"id": 55184, "name": "unknown", "code": "it(\"fails to create a when the root is a file\", async () => {\n await fc.assert(\n fc.asyncProperty(\n arb.folderPath(true),\n arb.fileName(),\n async (rootPath, filePath) => {\n seedVolume(rootPath, [filePath], []);\n const path = join(rootPath, filePath);\n\n const expected = expect(FileDirectory.resolve(path)).rejects;\n await expected.toThrow(/The path /);\n await expected.toThrow(filePath);\n await expected.toThrow(/does not resolve to a directory/);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mausworks/tidier/packages/tidier-cli/src/directory.spec.ts", "start_line": null, "end_line": null, "dependencies": ["seedVolume"], "repo": {"name": "mausworks/tidier", "url": "https://github.com/mausworks/tidier.git", "license": "ISC", "stars": 202, "forks": 2}, "metrics": null, "summary": "A `FileDirectory.resolve` operation is expected to throw an error when the given path is a file rather than a directory.", "mode": "fast-check"} {"id": 60161, "name": "unknown", "code": "it(\"combines an array of IOs into a single IO returning an array of the results\", () =>\n fc.assert(\n fc.asyncProperty(fc.array(successfulIo), async (actions) => {\n const allResults = await Promise.all(actions.map((io) => io.run()));\n const parallelized = await IO.parallel(actions).run();\n expect(parallelized).toEqual(allResults);\n })\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/concurrency.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Combining an array of IO actions should return a single IO that produces an array of results equivalent to the results obtained by running each IO individually.", "mode": "fast-check"} {"id": 60165, "name": "unknown", "code": "it(\"replaces the resulting value of a successful IO with a void value\", () =>\n fc.assert(\n fc.asyncProperty(arbitraries.successfulIo, async (io) => {\n await expect(io.void.run()).resolves.toBe(void 0);\n })\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/as.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "A successful IO operation's result is replaced with a `void` value, verifying it resolves to `undefined`.", "mode": "fast-check"} {"id": 60166, "name": "unknown", "code": "it(\"has no effect on an IO which fails\", () =>\n fc.assert(\n fc.asyncProperty(arbitraries.unsuccessfulIo, async (io) => {\n const resultWithVoid = await io.void.runSafe();\n const resultWithoutVoid = await io.runSafe();\n expect(resultWithVoid).toEqual(resultWithoutVoid);\n })\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/as.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "An IO operation that fails retains the same result whether `void` is applied or not.", "mode": "fast-check"} {"id": 60167, "name": "unknown", "code": "it(\"Propagates any errors raised by the open function\", () =>\n fc.assert(\n fc.asyncProperty(arbitraries.unsuccessfulIo, async (willRaise) => {\n const bracketed = IO.bracket(willRaise, () => IO.void)(() => IO.void);\n expect(await bracketed.runSafe()).toEqual(await willRaise.runSafe());\n })\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/bracket.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Errors raised by the `open` function are propagated when using `IO.bracket`.", "mode": "fast-check"} {"id": 60168, "name": "unknown", "code": "it(\"Propagates any errors raised by the use function\", () =>\n fc.assert(\n fc.asyncProperty(arbitraries.unsuccessfulIo, async (willRaise) => {\n const bracketed = IO.bracket(\n IO.wrap(null),\n () => IO.void\n )(() => willRaise);\n expect(await bracketed.runSafe()).toEqual(await willRaise.runSafe());\n })\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/bracket.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The test ensures that `IO.bracket` correctly propagates errors raised by the `use` function when executed.", "mode": "fast-check"} {"id": 60169, "name": "unknown", "code": "it(\"Propagates any errors raised by the close function\", () =>\n fc.assert(\n fc.asyncProperty(\n arbitraries.io,\n arbitraries.unsuccessfulIo,\n async (mightRaise, willRaise) => {\n // If the `use` function raises, it still calls the `close` function.\n // If `close` also raises, the error from `close` takes priority.\n const bracketed = IO.bracket(\n IO.wrap(null),\n () => willRaise\n )(() => mightRaise);\n expect(await bracketed.runSafe()).toEqual(await willRaise.runSafe());\n }\n )\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/bracket.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The test confirms that if both the `use` and `close` functions raise errors, the error from the `close` function is prioritized and propagated.", "mode": "fast-check"} {"id": 55189, "name": "unknown", "code": "test('base64ToArray and arrayToBase64 roundtrip', () => {\n\tfc.assert(\n\t\tfc.property(\n\t\t\tfc.uint8Array({\n\t\t\t\tminLength: idLength,\n\t\t\t\tmaxLength: idLength,\n\t\t\t}),\n\t\t\t(id) => {\n\t\t\t\tconst base64 = arrayToBase64(id)\n\t\t\t\tconst actual = base64ToArray(base64)\n\t\t\t\texpect(actual).toEqual(id)\n\t\t\t},\n\t\t),\n\t)\n})", "language": "typescript", "source_file": "./repos/AlexErrant/Pentive/shared/tests/binary.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "AlexErrant/Pentive", "url": "https://github.com/AlexErrant/Pentive.git", "license": "Apache-2.0", "stars": 42, "forks": 3}, "metrics": null, "summary": "Converting an array to base64 and back should return the original array.", "mode": "fast-check"} {"id": 60172, "name": "unknown", "code": "it(\"creates an IO which performs the side-effect when run\", () =>\n fc.assert(\n fc.asyncProperty(fc.anything(), (effectResult) => {\n let effectPerformedCount = 0;\n const io = IO.cancelable(() => {\n effectPerformedCount += 1;\n return {\n promise: Promise.resolve(effectResult),\n cancel: () => {},\n };\n });\n expect(effectPerformedCount).toBe(0);\n const result = io.run();\n expect(effectPerformedCount).toBe(1);\n return expect(result).resolves.toBe(effectResult);\n })\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/cancellation.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "An `IO` created with `IO.cancelable` performs a side-effect exactly once when run, returning a promise that resolves to the expected result.", "mode": "fast-check"} {"id": 55190, "name": "unknown", "code": "test('base64urlToArray and arrayToBase64url roundtrip', () => {\n\tfc.assert(\n\t\tfc.property(\n\t\t\tfc.uint8Array({\n\t\t\t\tminLength: idLength,\n\t\t\t\tmaxLength: idLength,\n\t\t\t}),\n\t\t\t(id) => {\n\t\t\t\tconst base64url = arrayToBase64url(id)\n\t\t\t\tconst actual = base64urlToArray(base64url)\n\t\t\t\texpect(actual).toEqual(id)\n\t\t\t},\n\t\t),\n\t)\n})", "language": "typescript", "source_file": "./repos/AlexErrant/Pentive/shared/tests/binary.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "AlexErrant/Pentive", "url": "https://github.com/AlexErrant/Pentive.git", "license": "Apache-2.0", "stars": 42, "forks": 3}, "metrics": null, "summary": "`base64urlToArray` and `arrayToBase64url` should correctly convert between base64url strings and uint8 arrays, ensuring reversibility.", "mode": "fast-check"} {"id": 60179, "name": "unknown", "code": "test(\"encoded, decode pairing ApplyChangesOnPrimary\", () => {\n fc.assert(\n fc.property(\n fc.uint8Array({ minLength: 16, maxLength: 16 }),\n fc.array(\n fc.tuple(\n fc.string(),\n fc.uint8Array({ minLength: 1, maxLength: 10 }),\n fc.string(),\n fc.oneof(\n fc.string(),\n fc.boolean(),\n fc.integer(),\n fc.double(),\n fc.constant(null),\n fc.bigInt({\n min: BigInt(Number.MAX_SAFE_INTEGER) + 1n,\n max: 9223372036854775807n,\n }),\n fc.uint8Array()\n ),\n fc.bigIntN(64),\n fc.bigIntN(64),\n fc.oneof(\n fc.uint8Array({ minLength: 16, maxLength: 16 }),\n fc.constant(null)\n ),\n fc.bigIntN(64),\n fc.integer({ min: 0 })\n )\n ),\n fc.string(),\n fc.tuple(fc.bigIntN(64), fc.integer({ min: 0 })),\n (sender, changes, room, newLastSeen) => {\n const msg = {\n _tag: tags.ApplyChangesOnPrimary,\n _reqid: 0,\n sender,\n changes,\n room,\n newLastSeen,\n } as const;\n const encoded = encode(msg);\n const decoded = decode(encoded);\n expect(decoded).toEqual(msg);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/vlcn-io/js/packages/ws-common/src/__tests__/encodeDecode.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "vlcn-io/js", "url": "https://github.com/vlcn-io/js.git", "license": "MIT", "stars": 67, "forks": 8}, "metrics": null, "summary": "Encoding and decoding functions should be inverse operations for messages formatted with the `ApplyChangesOnPrimary` structure, ensuring the decoded message matches the original.", "mode": "fast-check"} {"id": 60180, "name": "unknown", "code": "test(\"encoded, decode pairing CraeteDBOnPrimary\", () => {\n fc.assert(\n fc.property(\n fc.string(),\n fc.bigIntN(64),\n fc.string(),\n (schemaName, schemaVersion, room) => {\n const msg = {\n _tag: tags.CreateDbOnPrimary,\n _reqid: 0,\n schemaName,\n schemaVersion,\n room,\n } as const;\n const encoded = encode(msg);\n const decoded = decode(encoded);\n expect(decoded).toEqual(msg);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/vlcn-io/js/packages/ws-common/src/__tests__/encodeDecode.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "vlcn-io/js", "url": "https://github.com/vlcn-io/js.git", "license": "MIT", "stars": 67, "forks": 8}, "metrics": null, "summary": "Encoding and decoding a `CreateDbOnPrimary` message should preserve the original message properties: `_tag`, `_reqid`, `schemaName`, `schemaVersion`, and `room`.", "mode": "fast-check"} {"id": 60181, "name": "unknown", "code": "test(\"prepend append\", () => {\n fc.assert(\n fc.property(\n fc.array(fc.oneof(fc.constant(1), fc.constant(-1))),\n (operations) => {\n const db = setupDb();\n\n const expected = [];\n let id = 1;\n for (const op of operations) {\n if (op == 1) {\n expected.push(id);\n } else {\n expected.unshift(id);\n }\n\n db.exec(`INSERT INTO todo VALUES (${id}, 1, ${op}, 'test')`);\n ++id;\n }\n\n let actual = db\n .execA(\"SELECT id FROM todo ORDER BY ordering\")\n .map((r) => r[0]);\n expect(actual).toEqual(expected);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/vlcn-io/js/packages/node-tests/src/__tests__/fract-check.test.ts", "start_line": null, "end_line": null, "dependencies": ["setupDb"], "repo": {"name": "vlcn-io/js", "url": "https://github.com/vlcn-io/js.git", "license": "MIT", "stars": 67, "forks": 8}, "metrics": null, "summary": "Verifies that inserting values into the `todo` table with ordering operations (`prepend` or `append`) results in an ordered list of IDs that matches the expected sequence.", "mode": "fast-check"} {"id": 60182, "name": "unknown", "code": "test(\"randomized inserts, updates, deletes then sync\", () => {\n fc.assert(\n fc.property(\n fc\n .oneof(\n fc.constant(\"round-trip\"),\n fc.constant(\"pairwise\"),\n fc.constant(\"centralized\"),\n fc.constant(\"loop\")\n )\n .noShrink(),\n fc\n .shuffledSubarray([\"modify\", \"delete\", \"reinsert\", \"create\"], {\n minLength: 4,\n })\n .noShrink(),\n fc\n .array(fc.tuple(fc.integer(), fc.string(), fc.boolean()), {\n maxLength: 20,\n })\n .noShrink(),\n fc\n .array(fc.tuple(fc.integer(), fc.string(), fc.boolean()), {\n maxLength: 500,\n })\n .noShrink(),\n randomizedTestCase\n )\n );\n})", "language": "typescript", "source_file": "./repos/vlcn-io/js/packages/node-tests/src/__tests__/merge-check.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "vlcn-io/js", "url": "https://github.com/vlcn-io/js.git", "license": "MIT", "stars": 67, "forks": 8}, "metrics": null, "summary": "The system performs a series of random inserts, updates, and deletes, followed by a synchronization check using different scenarios and orderings.", "mode": "fast-check"} {"id": 60183, "name": "unknown", "code": "test(\"encoded, decode pairing ApplyChangesMsg\", () => {\n fc.assert(\n fc.property(\n fc.uint8Array({ minLength: 16, maxLength: 16 }),\n fc.uint8Array({ minLength: 16, maxLength: 16 }),\n fc.bigIntN(64),\n fc.tuple(fc.bigIntN(64), fc.integer({ min: 0 })),\n fc.tuple(fc.bigIntN(64), fc.integer({ min: 0 })),\n fc.array(\n fc.tuple(\n fc.string(),\n fc.uint8Array({ minLength: 1, maxLength: 10 }),\n fc.string(),\n fc.oneof(\n fc.string(),\n fc.boolean(),\n fc.integer(),\n fc.bigInt({\n min: BigInt(Number.MAX_SAFE_INTEGER) + 1n,\n max: 9223372036854775807n,\n }),\n fc.uint8Array()\n ),\n fc.bigIntN(64),\n fc.bigIntN(64),\n fc.bigIntN(64),\n fc.integer({ min: 0 })\n )\n ),\n (toDbid, fromDbid, schemaVersion, seqStart, seqEnd, changes) => {\n const serializer = new JsonSerializer();\n const msg = {\n _tag: tags.applyChanges,\n toDbid,\n fromDbid,\n schemaVersion,\n seqStart,\n seqEnd,\n changes,\n } as const;\n const encoded = JSON.stringify(serializer.encode(msg));\n const decoded = serializer.decode(JSON.parse(encoded));\n expect(decoded).toEqual(msg);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/vlcn-io/js/packages/direct-connect-common/src/msg/__tests__/JsonSerializer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "vlcn-io/js", "url": "https://github.com/vlcn-io/js.git", "license": "MIT", "stars": 67, "forks": 8}, "metrics": null, "summary": "Encoding and decoding of `ApplyChangesMsg` should be consistent when passed through `JsonSerializer`, ensuring the decoded message is equal to the original.", "mode": "fast-check"} {"id": 60184, "name": "unknown", "code": "test(\"encode, decode pairing for GetChangesMsg\", () => {\n fc.assert(\n fc.property(\n fc.uint8Array({ minLength: 16, maxLength: 16 }),\n fc.uint8Array({ minLength: 16, maxLength: 16 }),\n fc.tuple(fc.bigIntN(64), fc.integer({ min: 0 })),\n fc.bigIntN(64),\n (dbid, requestorDbid, since, schemaVersion) => {\n const serializer = new JsonSerializer();\n const msg = {\n _tag: tags.getChanges,\n dbid,\n requestorDbid,\n since,\n schemaVersion,\n } as const;\n const encoded = JSON.stringify(serializer.encode(msg));\n const decoded = serializer.decode(JSON.parse(encoded));\n expect(decoded).toEqual(msg);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/vlcn-io/js/packages/direct-connect-common/src/msg/__tests__/JsonSerializer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "vlcn-io/js", "url": "https://github.com/vlcn-io/js.git", "license": "MIT", "stars": 67, "forks": 8}, "metrics": null, "summary": "Encoding and decoding a `GetChangesMsg` should be consistent, such that decoding the encoded message reproduces the original message.", "mode": "fast-check"} {"id": 60187, "name": "unknown", "code": "test(\"StreamingChangesMsg\", () => {\n fc.assert(\n fc.property(\n fc.tuple(fc.bigIntN(64), fc.integer({ min: 0 })),\n fc.tuple(fc.bigIntN(64), fc.integer({ min: 0 })),\n fc.array(\n fc.tuple(\n fc.string(),\n fc.uint8Array({ minLength: 1, maxLength: 10 }),\n fc.string(),\n fc.oneof(\n fc.string(),\n fc.boolean(),\n fc.integer(),\n fc.bigInt({\n min: BigInt(Number.MAX_SAFE_INTEGER) + 1n,\n max: 9223372036854775807n,\n }),\n fc.uint8Array()\n ),\n fc.bigIntN(64),\n fc.bigIntN(64),\n fc.bigIntN(64),\n fc.integer({ min: 0 })\n )\n ),\n (seqStart, seqEnd, changes) => {\n const serializer = new JsonSerializer();\n const msg = {\n _tag: tags.streamingChanges,\n seqStart,\n seqEnd,\n changes,\n } as const;\n const encoded = JSON.stringify(serializer.encode(msg));\n const decoded = serializer.decode(JSON.parse(encoded));\n expect(decoded).toEqual(msg);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/vlcn-io/js/packages/direct-connect-common/src/msg/__tests__/JsonSerializer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "vlcn-io/js", "url": "https://github.com/vlcn-io/js.git", "license": "MIT", "stars": 67, "forks": 8}, "metrics": null, "summary": "The property ensures that encoding and then decoding a `StreamingChangesMsg` via `JsonSerializer` results in the original message.", "mode": "fast-check"} {"id": 60188, "name": "unknown", "code": "test(\"CreateOrMigrateResponse\", () => {\n fc.assert(\n fc.property(\n fc.tuple(fc.bigIntN(64), fc.integer({ min: 0 })),\n fc.oneof(\n fc.constant(\"noop\"),\n fc.constant(\"apply\"),\n fc.constant(\"migrate\")\n ),\n (seq, status) => {\n const serializer = new JsonSerializer();\n const msg = {\n _tag: tags.createOrMigrateResponse,\n seq,\n status,\n } as const;\n const encoded = JSON.stringify(serializer.encode(msg as any));\n const decoded = serializer.decode(JSON.parse(encoded));\n expect(decoded).toEqual(msg);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/vlcn-io/js/packages/direct-connect-common/src/msg/__tests__/JsonSerializer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "vlcn-io/js", "url": "https://github.com/vlcn-io/js.git", "license": "MIT", "stars": 67, "forks": 8}, "metrics": null, "summary": "The `JsonSerializer` should correctly encode and decode `CreateOrMigrateResponse` messages, preserving their structure and contents including `seq` and `status`.", "mode": "fast-check"} {"id": 60189, "name": "unknown", "code": "test(\"CreateOrMigrateMsg\", () => {\n fc.assert(\n fc.property(\n fc.uint8Array({ minLength: 16, maxLength: 16 }),\n fc.uint8Array({ minLength: 16, maxLength: 16 }),\n fc.string(),\n fc.bigIntN(64),\n (dbid, requestorDbid, schemaName, schemaVersion) => {\n const serializer = new JsonSerializer();\n const msg = {\n _tag: tags.createOrMigrate,\n dbid,\n requestorDbid,\n schemaName,\n schemaVersion,\n } as const;\n const encoded = JSON.stringify(serializer.encode(msg));\n const decoded = serializer.decode(JSON.parse(encoded));\n expect(decoded).toEqual(msg);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/vlcn-io/js/packages/direct-connect-common/src/msg/__tests__/JsonSerializer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "vlcn-io/js", "url": "https://github.com/vlcn-io/js.git", "license": "MIT", "stars": 67, "forks": 8}, "metrics": null, "summary": "Ensures that encoding and then decoding a `CreateOrMigrateMsg` using `JsonSerializer` retains the original message structure and content.", "mode": "fast-check"} {"id": 60190, "name": "unknown", "code": "test(\"GetLastSeenMsg\", () => {\n fc.assert(\n fc.property(\n fc.uint8Array({ minLength: 16, maxLength: 16 }),\n fc.uint8Array({ minLength: 16, maxLength: 16 }),\n (toDbid, fromDbid) => {\n const serializer = new JsonSerializer();\n const msg = {\n _tag: tags.getLastSeen,\n toDbid,\n fromDbid,\n } as const;\n const encoded = JSON.stringify(serializer.encode(msg));\n const decoded = serializer.decode(JSON.parse(encoded));\n expect(decoded).toEqual(msg);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/vlcn-io/js/packages/direct-connect-common/src/msg/__tests__/JsonSerializer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "vlcn-io/js", "url": "https://github.com/vlcn-io/js.git", "license": "MIT", "stars": 67, "forks": 8}, "metrics": null, "summary": "Verifies that a message containing `toDbid` and `fromDbid` fields is correctly encoded and then decoded by the `JsonSerializer`, preserving the original message structure and content.", "mode": "fast-check"} {"id": 60191, "name": "unknown", "code": "test(\"GetLastSeenResponse\", () => {\n fc.assert(\n fc.property(fc.tuple(fc.bigIntN(64), fc.integer({ min: 0 })), (seq) => {\n const serializer = new JsonSerializer();\n const msg = {\n _tag: tags.getLastSeenResponse,\n seq,\n } as const;\n const encoded = JSON.stringify(serializer.encode(msg));\n const decoded = serializer.decode(JSON.parse(encoded));\n expect(decoded).toEqual(msg);\n })\n );\n})", "language": "typescript", "source_file": "./repos/vlcn-io/js/packages/direct-connect-common/src/msg/__tests__/JsonSerializer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "vlcn-io/js", "url": "https://github.com/vlcn-io/js.git", "license": "MIT", "stars": 67, "forks": 8}, "metrics": null, "summary": "The property involves encoding and decoding a `GetLastSeenResponse` message, ensuring that decoding the encoded message yields the original message.", "mode": "fast-check"} {"id": 60193, "name": "unknown", "code": "test(\"ActivateSchemaMsg\", () => {\n fc.assert(\n fc.property(fc.string(), fc.bigIntN(64), (name, version) => {\n const serializer = new JsonSerializer();\n const msg = {\n _tag: tags.activateSchema,\n name,\n version,\n } as const;\n const encoded = JSON.stringify(serializer.encode(msg));\n const decoded = serializer.decode(JSON.parse(encoded));\n expect(decoded).toEqual(msg);\n })\n );\n})", "language": "typescript", "source_file": "./repos/vlcn-io/js/packages/direct-connect-common/src/msg/__tests__/JsonSerializer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "vlcn-io/js", "url": "https://github.com/vlcn-io/js.git", "license": "MIT", "stars": 67, "forks": 8}, "metrics": null, "summary": "`JsonSerializer` encodes and decodes `ActivateSchemaMsg` objects with string names and 64-bit integer versions correctly, maintaining object integrity.", "mode": "fast-check"} {"id": 60194, "name": "unknown", "code": "test(\"encoded, decode pairing ApplyChangesMsg\", () => {\n fc.assert(\n fc.property(\n fc.uint8Array({ minLength: 16, maxLength: 16 }),\n fc.uint8Array({ minLength: 16, maxLength: 16 }),\n fc.bigIntN(64),\n fc.tuple(fc.bigIntN(64), fc.integer({ min: 0 })),\n fc.tuple(fc.bigIntN(64), fc.integer({ min: 0 })),\n fc.array(\n fc.tuple(\n fc.string(),\n fc.uint8Array({ minLength: 1, maxLength: 10 }),\n fc.string(),\n fc.oneof(\n fc.string(),\n fc.boolean(),\n fc.integer(),\n fc.bigInt({\n min: BigInt(Number.MAX_SAFE_INTEGER) + 1n,\n max: 9223372036854775807n,\n }),\n fc.uint8Array()\n ),\n fc.bigIntN(64),\n fc.bigIntN(64),\n fc.bigIntN(64),\n fc.integer({ min: 0 })\n )\n ),\n (toDbid, fromDbid, schemaVersion, seqStart, seqEnd, changes) => {\n const serializer = new BinarySerializer();\n const msg: ApplyChangesMsg = {\n _tag: tags.applyChanges,\n toDbid,\n fromDbid,\n schemaVersion,\n seqStart,\n seqEnd,\n changes,\n } as const;\n const encoded = serializer.encode(msg);\n const decoded = serializer.decode(encoded);\n expect(decoded).toEqual(msg);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/vlcn-io/js/packages/direct-connect-common/src/msg/__tests__/BinarySerializer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "vlcn-io/js", "url": "https://github.com/vlcn-io/js.git", "license": "MIT", "stars": 67, "forks": 8}, "metrics": null, "summary": "Encoding and decoding of `ApplyChangesMsg` should result in the original message remaining unchanged.", "mode": "fast-check"} {"id": 60195, "name": "unknown", "code": "test(\"encode, decode pairing for GetChangesMsg\", () => {\n fc.assert(\n fc.property(\n fc.uint8Array({ minLength: 16, maxLength: 16 }),\n fc.uint8Array({ minLength: 16, maxLength: 16 }),\n fc.tuple(fc.bigIntN(64), fc.integer({ min: 0 })),\n fc.bigIntN(64),\n (dbid, requestorDbid, since, schemaVersion) => {\n const serializer = new BinarySerializer();\n const msg: GetChangesMsg = {\n _tag: tags.getChanges,\n dbid,\n requestorDbid,\n since,\n schemaVersion,\n } as const;\n const encoded = serializer.encode(msg);\n const decoded = serializer.decode(encoded);\n expect(decoded).toEqual(msg);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/vlcn-io/js/packages/direct-connect-common/src/msg/__tests__/BinarySerializer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "vlcn-io/js", "url": "https://github.com/vlcn-io/js.git", "license": "MIT", "stars": 67, "forks": 8}, "metrics": null, "summary": "`BinarySerializer` correctly encodes and decodes `GetChangesMsg` messages, ensuring the decoded message matches the original.", "mode": "fast-check"} {"id": 60196, "name": "unknown", "code": "test(\"encode, decode pairing for EstablishOutboundStreamMsg\", () => {\n fc.assert(\n fc.property(\n fc.uint8Array({ minLength: 16, maxLength: 16 }),\n fc.uint8Array({ minLength: 16, maxLength: 16 }),\n fc.tuple(fc.bigIntN(64), fc.integer({ min: 0 })),\n fc.bigIntN(64),\n (toDbid, fromDbid, seqStart, schemaVersion) => {\n const serializer = new BinarySerializer();\n const msg: EstablishOutboundStreamMsg = {\n _tag: tags.establishOutboundStream,\n toDbid,\n fromDbid,\n seqStart,\n schemaVersion,\n } as const;\n const encoded = serializer.encode(msg);\n const decoded = serializer.decode(encoded);\n expect(decoded).toEqual(msg);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/vlcn-io/js/packages/direct-connect-common/src/msg/__tests__/BinarySerializer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "vlcn-io/js", "url": "https://github.com/vlcn-io/js.git", "license": "MIT", "stars": 67, "forks": 8}, "metrics": null, "summary": "Encoding and decoding an `EstablishOutboundStreamMsg` with `BinarySerializer` should yield equivalent messages.", "mode": "fast-check"} {"id": 60197, "name": "unknown", "code": "test(\"encode, decode pairing for AckChangesMsg\", () => {\n fc.assert(\n fc.property(fc.tuple(fc.bigIntN(64), fc.integer({ min: 0 })), (seqEnd) => {\n const serializer = new BinarySerializer();\n const msg = { _tag: tags.ackChanges, seqEnd } as const;\n const encoded = serializer.encode(msg);\n const decoded = serializer.decode(encoded);\n expect(decoded).toEqual(msg);\n })\n );\n})", "language": "typescript", "source_file": "./repos/vlcn-io/js/packages/direct-connect-common/src/msg/__tests__/BinarySerializer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "vlcn-io/js", "url": "https://github.com/vlcn-io/js.git", "license": "MIT", "stars": 67, "forks": 8}, "metrics": null, "summary": "Encoding and decoding of `AckChangesMsg` should result in the original message.", "mode": "fast-check"} {"id": 60198, "name": "unknown", "code": "test(\"StreamingChangesMsg\", () => {\n fc.assert(\n fc.property(\n fc.tuple(fc.bigIntN(64), fc.integer({ min: 0 })),\n fc.tuple(fc.bigIntN(64), fc.integer({ min: 0 })),\n fc.array(\n fc.tuple(\n fc.string(),\n fc.uint8Array({ minLength: 1, maxLength: 10 }),\n fc.string(),\n fc.oneof(\n fc.string(),\n fc.boolean(),\n fc.integer(),\n fc.bigInt({\n min: BigInt(Number.MAX_SAFE_INTEGER) + 1n,\n max: 9223372036854775807n,\n }),\n fc.uint8Array()\n ),\n fc.bigIntN(64),\n fc.bigIntN(64),\n fc.bigIntN(64),\n fc.integer({ min: 0 })\n )\n ),\n (seqStart, seqEnd, changes) => {\n const serializer = new BinarySerializer();\n const msg = {\n _tag: tags.streamingChanges,\n seqStart,\n seqEnd,\n changes,\n } as const;\n const encoded = serializer.encode(msg);\n const decoded = serializer.decode(encoded);\n expect(decoded).toEqual(msg);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/vlcn-io/js/packages/direct-connect-common/src/msg/__tests__/BinarySerializer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "vlcn-io/js", "url": "https://github.com/vlcn-io/js.git", "license": "MIT", "stars": 67, "forks": 8}, "metrics": null, "summary": "The `BinarySerializer` correctly encodes and decodes `StreamingChangesMsg` objects, preserving their original properties.", "mode": "fast-check"} {"id": 60199, "name": "unknown", "code": "test(\"CreateOrMigrateResponse\", () => {\n fc.assert(\n fc.property(\n fc.tuple(fc.bigIntN(64), fc.integer({ min: 0 })),\n fc.oneof(\n fc.constant(\"noop\"),\n fc.constant(\"apply\"),\n fc.constant(\"migrate\")\n ),\n (seq, status) => {\n const serializer = new BinarySerializer();\n const msg = {\n _tag: tags.createOrMigrateResponse,\n seq,\n status,\n } as const;\n const encoded = serializer.encode(msg as any);\n const decoded = serializer.decode(encoded);\n expect(decoded).toEqual(msg);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/vlcn-io/js/packages/direct-connect-common/src/msg/__tests__/BinarySerializer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "vlcn-io/js", "url": "https://github.com/vlcn-io/js.git", "license": "MIT", "stars": 67, "forks": 8}, "metrics": null, "summary": "Encoding and then decoding a `CreateOrMigrateResponse` message should return the original message object.", "mode": "fast-check"} {"id": 60200, "name": "unknown", "code": "test(\"CreateOrMigrateMsg\", () => {\n fc.assert(\n fc.property(\n fc.uint8Array({ minLength: 16, maxLength: 16 }),\n fc.uint8Array({ minLength: 16, maxLength: 16 }),\n fc.string(),\n fc.bigIntN(64),\n (dbid, requestorDbid, schemaName, schemaVersion) => {\n const serializer = new BinarySerializer();\n const msg = {\n _tag: tags.createOrMigrate,\n dbid,\n requestorDbid,\n schemaName,\n schemaVersion,\n } as const;\n const encoded = serializer.encode(msg);\n const decoded = serializer.decode(encoded);\n expect(decoded).toEqual(msg);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/vlcn-io/js/packages/direct-connect-common/src/msg/__tests__/BinarySerializer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "vlcn-io/js", "url": "https://github.com/vlcn-io/js.git", "license": "MIT", "stars": 67, "forks": 8}, "metrics": null, "summary": "Encoding and decoding a `CreateOrMigrateMsg` should preserve its original content.", "mode": "fast-check"} {"id": 60201, "name": "unknown", "code": "test(\"GetLastSeenMsg\", () => {\n fc.assert(\n fc.property(\n fc.uint8Array({ minLength: 16, maxLength: 16 }),\n fc.uint8Array({ minLength: 16, maxLength: 16 }),\n (toDbid, fromDbid) => {\n const serializer = new BinarySerializer();\n const msg = {\n _tag: tags.getLastSeen,\n toDbid,\n fromDbid,\n } as const;\n const encoded = serializer.encode(msg);\n const decoded = serializer.decode(encoded);\n expect(decoded).toEqual(msg);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/vlcn-io/js/packages/direct-connect-common/src/msg/__tests__/BinarySerializer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "vlcn-io/js", "url": "https://github.com/vlcn-io/js.git", "license": "MIT", "stars": 67, "forks": 8}, "metrics": null, "summary": "Encoding and then decoding a message with `BinarySerializer` should return the original message for `GetLastSeenMsg` objects.", "mode": "fast-check"} {"id": 60202, "name": "unknown", "code": "test(\"GetLastSeenResponse\", () => {\n fc.assert(\n fc.property(fc.tuple(fc.bigIntN(64), fc.integer({ min: 0 })), (seq) => {\n const serializer = new BinarySerializer();\n const msg = {\n _tag: tags.getLastSeenResponse,\n seq,\n } as const;\n const encoded = serializer.encode(msg);\n const decoded = serializer.decode(encoded);\n expect(decoded).toEqual(msg);\n })\n );\n})", "language": "typescript", "source_file": "./repos/vlcn-io/js/packages/direct-connect-common/src/msg/__tests__/BinarySerializer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "vlcn-io/js", "url": "https://github.com/vlcn-io/js.git", "license": "MIT", "stars": 67, "forks": 8}, "metrics": null, "summary": "Encoding and decoding a `GetLastSeenResponse` message with a tuple of a 64-bit integer and a non-negative integer should yield an equivalent message.", "mode": "fast-check"} {"id": 60203, "name": "unknown", "code": "test(\"UploadSchemaMsg\", () => {\n fc.assert(\n fc.property(\n fc.string(),\n fc.bigIntN(64),\n fc.string(),\n fc.boolean(),\n (name, version, content, activate) => {\n const serializer = new BinarySerializer();\n const msg = {\n _tag: tags.uploadSchema,\n name,\n version,\n content,\n activate,\n } as const;\n const encoded = serializer.encode(msg);\n const decoded = serializer.decode(encoded);\n expect(decoded).toEqual(msg);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/vlcn-io/js/packages/direct-connect-common/src/msg/__tests__/BinarySerializer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "vlcn-io/js", "url": "https://github.com/vlcn-io/js.git", "license": "MIT", "stars": 67, "forks": 8}, "metrics": null, "summary": "Encoding and decoding an `UploadSchemaMsg` using `BinarySerializer` should return the original message.", "mode": "fast-check"} {"id": 60204, "name": "unknown", "code": "test(\"ActivateSchemaMsg\", () => {\n fc.assert(\n fc.property(fc.string(), fc.bigIntN(64), (name, version) => {\n const serializer = new BinarySerializer();\n const msg = {\n _tag: tags.activateSchema,\n name,\n version,\n } as const;\n const encoded = serializer.encode(msg);\n const decoded = serializer.decode(encoded);\n expect(decoded).toEqual(msg);\n })\n );\n})", "language": "typescript", "source_file": "./repos/vlcn-io/js/packages/direct-connect-common/src/msg/__tests__/BinarySerializer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "vlcn-io/js", "url": "https://github.com/vlcn-io/js.git", "license": "MIT", "stars": 67, "forks": 8}, "metrics": null, "summary": "Encoding and then decoding a schema activation message should return the original message intact.", "mode": "fast-check"} {"id": 60205, "name": "unknown", "code": "it(\"should return an empty string if no valid fuzzed inputs are provided\", () => {\n fc.assert(\n fc.property(fc.string(), (className) => {\n if (className.trim() === \"\") {\n return expect(cn(className)).toBe(\"\");\n }\n\n expect(cn(className)).toBe(className.trim().replace(/\\s{2,}/g, \" \"));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dsm23/dsm23-bun-next-template/src/utils/fuzz.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dsm23/dsm23-bun-next-template", "url": "https://github.com/dsm23/dsm23-bun-next-template.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "When no valid fuzzed inputs are provided, `cn` should return an empty string; otherwise, it trims the input and replaces consecutive spaces with a single space.", "mode": "fast-check"} {"id": 60208, "name": "unknown", "code": "it('should handle date arithmetic correctly', () => {\n fc.assert(\n fc.property(\n fc.date({ min: new Date('2024-01-01'), max: new Date('2024-12-31') }),\n fc.integer({ min: -365, max: 365 }),\n (baseDate, dayOffset) => {\n // Property: Adding and subtracting days should be reversible\n const futureDate = new Date(baseDate.getTime() + dayOffset * 24 * 60 * 60 * 1000);\n const backToBase = new Date(futureDate.getTime() - dayOffset * 24 * 60 * 60 * 1000);\n\n // Should be equal within millisecond precision\n return Math.abs(baseDate.getTime() - backToBase.getTime()) < 1000;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/date-time-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Adding and then subtracting days from a base date should result in the original date, within millisecond precision.", "mode": "fast-check"} {"id": 60210, "name": "unknown", "code": "it('should identify school days correctly', () => {\n fc.assert(\n fc.property(domainArbitraries.schoolDay, (date) => {\n // Property: School days should be Monday through Friday\n const dayOfWeek = date.getDay();\n return dayOfWeek >= 1 && dayOfWeek <= 5;\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/date-time-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "School days are identified as Monday through Friday, based on the day of the week.", "mode": "fast-check"} {"id": 60211, "name": "unknown", "code": "it('should calculate school weeks correctly', () => {\n fc.assert(\n fc.property(\n fc.tuple(domainArbitraries.schoolDay, domainArbitraries.schoolDay),\n ([startDate, endDate]) => {\n // Property: School week calculations should be consistent\n if (startDate > endDate) {\n [startDate, endDate] = [endDate, startDate];\n }\n\n const msPerDay = 24 * 60 * 60 * 1000;\n const msPerWeek = 7 * msPerDay;\n const timeDiff = endDate.getTime() - startDate.getTime();\n const daysDiff = Math.floor(timeDiff / msPerDay);\n const weeksDiff = Math.floor(timeDiff / msPerWeek);\n\n // Relationship between days and weeks should be consistent\n return weeksDiff >= 0 && weeksDiff <= Math.floor(daysDiff / 7);\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/date-time-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The calculation of school weeks between two dates should be consistent with the difference in days, ensuring weeks are non-negative and not exceeding the total days divided by seven.", "mode": "fast-check"} {"id": 60213, "name": "unknown", "code": "it('should validate term date ranges', () => {\n fc.assert(\n fc.property(\n fc.tuple(\n fc.date({ min: new Date('2024-09-01'), max: new Date('2024-12-20') }), // Fall term\n fc.date({ min: new Date('2025-01-08'), max: new Date('2025-06-30') }), // Spring term\n ),\n ([fallEnd, springStart]) => {\n // Property: Term breaks should provide adequate time off\n const msPerDay = 24 * 60 * 60 * 1000;\n const breakDays = Math.floor((springStart.getTime() - fallEnd.getTime()) / msPerDay);\n\n // Should have at least 10 days break between terms\n return breakDays >= 10;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/date-time-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Validates that the break between the fall and spring term dates is at least 10 days.", "mode": "fast-check"} {"id": 60214, "name": "unknown", "code": "it('should maintain lesson time boundaries', () => {\n fc.assert(\n fc.property(domainArbitraries.validTimeSlot, (timeSlot) => {\n // Property: Lesson end time should equal start time + duration\n const expectedEndTime = new Date(\n timeSlot.start.getTime() + timeSlot.duration * 60 * 1000,\n );\n\n return Math.abs(timeSlot.end.getTime() - expectedEndTime.getTime()) < 1000; // Within 1 second\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/date-time-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Ensures that the lesson end time equals the start time plus the duration, within a 1-second margin.", "mode": "fast-check"} {"id": 60217, "name": "unknown", "code": "it('should respect daily time limits', () => {\n fc.assert(\n fc.property(\n fc.array(domainArbitraries.validTimeSlot, { minLength: 1, maxLength: 8 }),\n (timeSlots) => {\n // Property: All time slots should fit within a school day\n const schoolStartMs = 8 * 60 * 60 * 1000; // 8 AM in milliseconds from midnight\n const schoolEndMs = 16 * 60 * 60 * 1000; // 4 PM in milliseconds from midnight\n\n return timeSlots.every((slot) => {\n const startOfDay = new Date(slot.start);\n startOfDay.setHours(0, 0, 0, 0);\n\n const startMs = slot.start.getTime() - startOfDay.getTime();\n const endMs = slot.end.getTime() - startOfDay.getTime();\n\n return startMs >= schoolStartMs && endMs <= schoolEndMs;\n });\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/date-time-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Time slots should fit within the school day, starting no earlier than 8 AM and ending no later than 4 PM.", "mode": "fast-check"} {"id": 60220, "name": "unknown", "code": "it('should handle duration arithmetic', () => {\n fc.assert(\n fc.property(\n fc.tuple(domainArbitraries.lessonDuration, domainArbitraries.lessonDuration),\n ([duration1, duration2]) => {\n // Property: Duration addition should be commutative\n const sum1 = duration1 + duration2;\n const sum2 = duration2 + duration1;\n\n return sum1 === sum2;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/date-time-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Duration addition should be commutative, ensuring that the sum of two durations is the same regardless of their order.", "mode": "fast-check"} {"id": 55203, "name": "unknown", "code": "it(\"should parse CSV\", async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.gen().map((g) => {\n const header = g(FC.header, {\n // TextEncoderStream can't handle utf-16 string.\n fieldConstraints: {\n kindExcludes: [\"string16bits\"],\n },\n });\n const EOL = g(FC.eol);\n const csvData = g(FC.csvData, {\n // TextEncoderStream can't handle utf-16 string.\n fieldConstraints: {\n kindExcludes: [\"string16bits\"],\n },\n columnsConstraints: {\n minLength: header.length,\n maxLength: header.length,\n },\n });\n const EOF = g(fc.boolean);\n const csv = [\n header.map((v) => escapeField(v, { quote: true })).join(\",\"),\n ...csvData.map((row) =>\n row.map((v) => escapeField(v, { quote: true })).join(\",\"),\n ),\n ...(EOF ? [\"\"] : []),\n ].join(EOL);\n const data =\n csvData.length >= 1\n ? csvData.map((row) =>\n Object.fromEntries(row.map((v, i) => [header[i], v])),\n )\n : [];\n return {\n data,\n // csv:\n response: new Response(\n new SingleValueReadableStream(csv).pipeThrough(\n new TextEncoderStream(),\n ),\n {\n headers: {\n \"content-type\": \"text/csv\",\n },\n },\n ),\n };\n }),\n async ({ data, response }) => {\n let i = 0;\n for await (const row of parseResponse(response)) {\n expect(data[i++]).toStrictEqual(row);\n }\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/kamiazya/web-csv-toolbox/src/parseResponseToStream.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "kamiazya/web-csv-toolbox", "url": "https://github.com/kamiazya/web-csv-toolbox.git", "license": "MIT", "stars": 15, "forks": 4}, "metrics": null, "summary": "Parsing a CSV response to a stream should correctly convert each row into an equivalent JavaScript object representation, ensuring that the parsed data matches the original structured data used to generate the CSV.", "mode": "fast-check"} {"id": 60222, "name": "unknown", "code": "it('should validate lesson distribution over time', () => {\n fc.assert(\n fc.property(domainArbitraries.unitTimeline, (timeline) => {\n // Property: Lesson distribution should be feasible\n const { startDate, endDate, lessonCount } = timeline;\n\n const msPerDay = 24 * 60 * 60 * 1000;\n const totalDays = Math.ceil((endDate.getTime() - startDate.getTime()) / msPerDay);\n const schoolDays = Math.floor((totalDays * 5) / 7); // Approximate school days (5/7 of total)\n\n // Should not exceed 1 lesson per school day on average\n const lessonsPerSchoolDay = lessonCount / Math.max(schoolDays, 1);\n\n return lessonsPerSchoolDay <= 1.5; // Allow some flexibility\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/date-time-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Lesson distribution within a given timeline should average no more than 1.5 lessons per school day.", "mode": "fast-check"} {"id": 60224, "name": "unknown", "code": "it('should detect conflicting events', () => {\n fc.assert(\n fc.property(\n fc.array(domainArbitraries.validTimeSlot, { minLength: 2, maxLength: 5 }),\n (events) => {\n // Property: Conflict detection should be reliable\n const hasConflict = (\n event1: (typeof events)[0],\n event2: (typeof events)[0],\n ): boolean => {\n return (\n (event1.start < event2.end && event1.end > event2.start) ||\n (event2.start < event1.end && event2.end > event1.start)\n );\n };\n\n // Check all pairs for conflicts\n let conflictCount = 0;\n for (let i = 0; i < events.length; i++) {\n for (let j = i + 1; j < events.length; j++) {\n if (hasConflict(events[i], events[j])) {\n conflictCount++;\n }\n }\n }\n\n // Property: Conflict detection should be deterministic\n return conflictCount >= 0; // Should always return a non-negative count\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/date-time-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that the conflict detection between event time slots is reliable and always produces a non-negative count of conflicts when checking all pairs.", "mode": "fast-check"} {"id": 60225, "name": "unknown", "code": "it('should handle daylight saving transitions', () => {\n fc.assert(\n fc.property(\n fc.date({ min: new Date('2024-03-01'), max: new Date('2024-04-01') }), // Around DST transition\n (date) => {\n // Property: Time calculations should account for DST changes\n const oneDayLater = new Date(date.getTime() + 24 * 60 * 60 * 1000);\n const timeDifference = oneDayLater.getTime() - date.getTime();\n\n // Should be either 23, 24, or 25 hours depending on DST transition\n const hoursDifference = timeDifference / (60 * 60 * 1000);\n\n return hoursDifference >= 23 && hoursDifference <= 25;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/date-time-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Time calculations should correctly account for daylight saving time changes, resulting in a 23, 24, or 25-hour difference.", "mode": "fast-check"} {"id": 60226, "name": "unknown", "code": "it('should maintain UTC consistency', () => {\n fc.assert(\n fc.property(fc.date(), (date) => {\n // Property: UTC conversion should be reversible\n const utcTime = date.getTime();\n const reconstructed = new Date(utcTime);\n\n return reconstructed.getTime() === date.getTime();\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/date-time-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "UTC conversion of a date should be reversible, ensuring the reconstructed date has the same timestamp as the original.", "mode": "fast-check"} {"id": 60227, "name": "unknown", "code": "it('should maintain data through ISO string conversion', () => {\n fc.assert(\n fc.property(fc.date(), (date) => {\n // Property: ISO string conversion should preserve date information\n const isoString = date.toISOString();\n const parsed = new Date(isoString);\n\n return parsed.getTime() === date.getTime();\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/date-time-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Converting a date to an ISO string and back should result in an equivalent date object with the same time value.", "mode": "fast-check"} {"id": 60229, "name": "unknown", "code": "it('should count school days correctly', () => {\n fc.assert(\n fc.property(\n fc.tuple(domainArbitraries.schoolDay, domainArbitraries.schoolDay),\n ([startDate, endDate]) => {\n if (startDate > endDate) {\n [startDate, endDate] = [endDate, startDate];\n }\n\n const schoolDays = calculateSchoolDaysInRange(startDate, endDate);\n\n // Property: School days should be non-negative and reasonable\n const totalDays =\n Math.ceil((endDate.getTime() - startDate.getTime()) / (24 * 60 * 60 * 1000)) + 1;\n\n return schoolDays >= 0 && schoolDays <= totalDays;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/date-time-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `calculateSchoolDaysInRange` must return a non-negative count of school days that does not exceed the total chronological days between two adjusted dates.", "mode": "fast-check"} {"id": 55205, "name": "unknown", "code": "it(\"should parse CSV string\", () =>\n fc.assert(\n fc.asyncProperty(\n fc.gen().map((g) => {\n const header = g(FC.header);\n const EOL = g(FC.eol);\n const EOF = g(fc.boolean);\n const csvData = [\n ...g(FC.csvData, {\n rowsConstraints: {\n minLength: 1,\n },\n columnsConstraints: {\n minLength: header.length,\n maxLength: header.length,\n },\n }),\n // Last row is not empty for testing.\n g(FC.row, {\n fieldConstraints: {\n minLength: 1,\n },\n columnsConstraints: {\n minLength: header.length,\n maxLength: header.length,\n },\n }),\n ];\n const csv = [\n header.map((v) => escapeField(v)).join(\",\"),\n EOL,\n ...csvData.flatMap((row, i) => [\n ...row.map((v) => escapeField(v)).join(\",\"),\n ...(EOF || csvData.length - 1 !== i ? [EOL] : []),\n ]),\n ].join(\"\");\n const data = csvData.map((row) =>\n Object.fromEntries(row.map((v, i) => [header[i], v])),\n );\n return { data, csv };\n }),\n async ({ data, csv }) => {\n let i = 0;\n for await (const row of parse(csv)) {\n expect(row).toEqual(data[i++]);\n }\n },\n ),\n {\n examples: [\n [{ csv: \"a,b,c\\n1,2,3\", data: [{ a: \"1\", b: \"2\", c: \"3\" }] }],\n [{ csv: \"a,b,c\\n1,,3\", data: [{ a: \"1\", b: \"\", c: \"3\" }] }],\n [{ csv: \"a,b,c\\n1,2,3\\n\", data: [{ a: \"1\", b: \"2\", c: \"3\" }] }],\n [\n {\n csv: \"a,b,c\\n\\n1,2,3\",\n data: [\n { a: \"\", b: \"\", c: \"\" },\n { a: \"1\", b: \"2\", c: \"3\" },\n ],\n },\n ],\n ],\n },\n ))", "language": "typescript", "source_file": "./repos/kamiazya/web-csv-toolbox/src/parse.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "kamiazya/web-csv-toolbox", "url": "https://github.com/kamiazya/web-csv-toolbox.git", "license": "MIT", "stars": 15, "forks": 4}, "metrics": null, "summary": "The `parse` function should correctly convert a generated CSV string into an array of objects, ensuring that each row corresponds to the header fields and matches the expected data structure.", "mode": "fast-check"} {"id": 60230, "name": "unknown", "code": "it('should find next school day correctly', () => {\n fc.assert(\n fc.property(\n fc.date({ min: new Date('2024-01-01'), max: new Date('2024-12-31') }),\n (date) => {\n const nextSchoolDay = getNextSchoolDay(date);\n\n // Property: Next school day should be after current date and on a weekday\n const isAfter = nextSchoolDay > date;\n const isWeekday = nextSchoolDay.getDay() >= 1 && nextSchoolDay.getDay() <= 5;\n\n return isAfter && isWeekday;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/date-time-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test verifies that `getNextSchoolDay` returns a date that is both after the given date and falls on a weekday.", "mode": "fast-check"} {"id": 55206, "name": "unknown", "code": "it(\"should parse Uint8Arrayed CSV\", () =>\n fc.assert(\n fc.asyncProperty(\n fc.gen().map((g) => {\n const header = g(FC.header, {\n fieldConstraints: {\n kindExcludes: [\"string16bits\"],\n },\n });\n const EOL = g(FC.eol);\n const EOF = g(fc.boolean);\n const csvData = [\n ...g(FC.csvData, {\n rowsConstraints: {\n minLength: 1,\n },\n columnsConstraints: {\n minLength: header.length,\n maxLength: header.length,\n },\n fieldConstraints: {\n kindExcludes: [\"string16bits\"],\n },\n }),\n // Last row is not empty for testing.\n g(FC.row, {\n fieldConstraints: {\n minLength: 1,\n kindExcludes: [\"string16bits\"],\n },\n columnsConstraints: {\n minLength: header.length,\n maxLength: header.length,\n },\n }),\n ];\n const csv = [\n header.map((v) => escapeField(v)).join(\",\"),\n EOL,\n ...csvData.flatMap((row, i) => [\n ...row.map((v) => escapeField(v)).join(\",\"),\n ...(EOF || csvData.length - 1 !== i ? [EOL] : []),\n ]),\n ].join(\"\");\n const data = csvData.map((row) =>\n Object.fromEntries(row.map((v, i) => [header[i], v])),\n );\n return { data, csv: new TextEncoder().encode(csv) };\n }),\n async ({ data, csv }) => {\n let i = 0;\n for await (const row of parse(csv)) {\n expect(row).toEqual(data[i++]);\n }\n },\n ),\n ))", "language": "typescript", "source_file": "./repos/kamiazya/web-csv-toolbox/src/parse.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "kamiazya/web-csv-toolbox", "url": "https://github.com/kamiazya/web-csv-toolbox.git", "license": "MIT", "stars": 15, "forks": 4}, "metrics": null, "summary": "Verifies that parsing a `Uint8Array`-encoded CSV correctly reconstructs the original data structure.", "mode": "fast-check"} {"id": 60231, "name": "unknown", "code": "it('should validate school hours correctly', () => {\n fc.assert(\n fc.property(domainArbitraries.validTimeSlot, (timeSlot) => {\n const startValid = isWithinSchoolHours(timeSlot.start);\n const endValid = isWithinSchoolHours(timeSlot.end);\n\n // Property: Valid time slots should be within school hours\n return startValid && endValid;\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/date-time-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Valid time slots should have start and end times within school hours.", "mode": "fast-check"} {"id": 60232, "name": "unknown", "code": "it('should handle leap year calculations', () => {\n fc.assert(\n fc.property(fc.integer({ min: 2020, max: 2030 }), (year) => {\n // Property: Leap year detection should be accurate\n const isLeapYear = (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n\n const feb29 = new Date(year, 1, 29); // February 29\n const isValidDate = feb29.getMonth() === 1 && feb29.getDate() === 29;\n\n return isLeapYear === isValidDate;\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/date-time-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Accurately detects leap years by verifying that February 29th exists only in those years.", "mode": "fast-check"} {"id": 60234, "name": "unknown", "code": "it('should handle invalid date inputs gracefully', () => {\n fc.assert(\n fc.property(\n fc.oneof(fc.constant(null), fc.constant(undefined), fc.string(), fc.integer()),\n (invalidInput) => {\n // Property: Date validation should handle invalid inputs\n const validateDate = (input: unknown): boolean => {\n try {\n const date = new Date(input);\n return !isNaN(date.getTime());\n } catch {\n return false;\n }\n };\n\n const result = validateDate(invalidInput);\n\n // Should return boolean regardless of input\n return typeof result === 'boolean';\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/date-time-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`validateDate` returns a boolean when handling various invalid date inputs.", "mode": "fast-check"} {"id": 60237, "name": "unknown", "code": "it('should always generate valid curriculum codes', () => {\n fc.assert(\n fc.property(domainArbitraries.curriculumCode, (code) => {\n // Property: All generated codes follow the pattern [A-E][1-5].[1-10]\n const codePattern = /^[A-E][1-5]\\.[1-9]|10$/;\n return codePattern.test(code);\n }),\n { numRuns: 50 },\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/curriculum-expectation-validation.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Generated curriculum codes always match the pattern `[A-E][1-5].[1-10]`.", "mode": "fast-check"} {"id": 60238, "name": "unknown", "code": "it('should generate unique codes within reasonable bounds', () => {\n fc.assert(\n fc.property(\n fc.array(domainArbitraries.curriculumCode, { minLength: 50, maxLength: 100 }),\n (codes) => {\n // Property: Generated codes should have reasonable diversity\n const uniqueCodes = new Set(codes);\n const uniqueRatio = uniqueCodes.size / codes.length;\n return uniqueRatio > 0.7; // At least 70% unique\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/curriculum-expectation-validation.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Generated curriculum codes should be at least 70% unique within arrays of length 50 to 100.", "mode": "fast-check"} {"id": 60239, "name": "unknown", "code": "it('should maintain grade-subject consistency', () => {\n fc.assert(\n fc.property(domainArbitraries.fullCurriculumExpectation, (expectation) => {\n // Property: Grade and subject combinations should be educationally valid\n const validGradeSubjectCombinations = new Map([\n ['Mathematics', [1, 2, 3, 4, 5, 6, 7, 8]],\n ['Language Arts', [1, 2, 3, 4, 5, 6, 7, 8]],\n ['Science', [1, 2, 3, 4, 5, 6, 7, 8]],\n ['Social Studies', [1, 2, 3, 4, 5, 6, 7, 8]],\n ['French', [1, 2, 3, 4, 5, 6, 7, 8]],\n ['Physical Education', [1, 2, 3, 4, 5, 6, 7, 8]],\n ['Arts', [1, 2, 3, 4, 5, 6, 7, 8]],\n ['Music', [1, 2, 3, 4, 5, 6, 7, 8]],\n ['Health', [1, 2, 3, 4, 5, 6, 7, 8]],\n ]);\n\n const validGrades = validGradeSubjectCombinations.get(expectation.subject) || [];\n return validGrades.includes(expectation.grade);\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/curriculum-expectation-validation.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Grade-subject combinations should be educationally valid according to predefined mappings.", "mode": "fast-check"} {"id": 60240, "name": "unknown", "code": "it('should validate strand-subject relationships', () => {\n fc.assert(\n fc.property(domainArbitraries.fullCurriculumExpectation, (expectation) => {\n // Property: Strands should be appropriate for their subjects\n const subjectStrands = new Map([\n [\n 'Mathematics',\n ['Number Sense', 'Algebra', 'Geometry', 'Measurement', 'Data Management'],\n ],\n ['Language Arts', ['Reading', 'Writing', 'Oral Communication', 'Media Literacy']],\n [\n 'Science',\n [\n 'Understanding Life Systems',\n 'Understanding Structures and Mechanisms',\n 'Understanding Matter and Energy',\n 'Understanding Earth and Space Systems',\n ],\n ],\n [\n 'Social Studies',\n ['Heritage and Identity', 'People and Environments', 'Citizenship and Government'],\n ],\n ]);\n\n const validStrands = subjectStrands.get(expectation.subject);\n if (!validStrands) {\n return true; // Unknown subject, skip validation\n }\n\n return validStrands.includes(expectation.strand);\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/curriculum-expectation-validation.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Strands should correspond correctly to their associated subjects in curriculum expectations.", "mode": "fast-check"} {"id": 60241, "name": "unknown", "code": "it('should maintain English-French content consistency', () => {\n fc.assert(\n fc.property(domainArbitraries.fullCurriculumExpectation, (expectation) => {\n // Property: If French content exists, it should be consistent with English\n if (expectation.descriptionFr && expectation.strandFr) {\n // Both descriptions should be non-empty\n const englishValid = expectation.description.trim().length > 0;\n const frenchValid = expectation.descriptionFr.trim().length > 0;\n const englishStrandValid = expectation.strand.trim().length > 0;\n const frenchStrandValid = expectation.strandFr.trim().length > 0;\n\n return englishValid && frenchValid && englishStrandValid && frenchStrandValid;\n }\n\n return true; // Skip if no French content\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/curriculum-expectation-validation.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "If French content is present, both English and French descriptions and strands should be non-empty.", "mode": "fast-check"} {"id": 60242, "name": "unknown", "code": "it('should maintain required field constraints', () => {\n fc.assert(\n fc.property(domainArbitraries.fullCurriculumExpectation, (expectation) => {\n // Property: Required fields should always be present and valid\n const hasValidId = expectation.id && expectation.id.length > 0;\n const hasValidCode = expectation.code && expectation.code.length > 0;\n const hasValidDescription =\n expectation.description && expectation.description.trim().length > 0;\n const hasValidStrand = expectation.strand && expectation.strand.trim().length > 0;\n const hasValidGrade = expectation.grade >= 1 && expectation.grade <= 8;\n const hasValidSubject = expectation.subject && expectation.subject.length > 0;\n\n return (\n hasValidId &&\n hasValidCode &&\n hasValidDescription &&\n hasValidStrand &&\n hasValidGrade &&\n hasValidSubject\n );\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/curriculum-expectation-validation.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that all required fields in `fullCurriculumExpectation` have valid and non-empty values and that the grade is between 1 and 8.", "mode": "fast-check"} {"id": 60243, "name": "unknown", "code": "it('should preserve data through JSON serialization', () => {\n fc.assert(\n fc.property(domainArbitraries.fullCurriculumExpectation, (expectation) => {\n // Property: Serialization should preserve all data\n const serialized = JSON.stringify(expectation);\n const deserialized = JSON.parse(serialized);\n\n // Compare all fields\n return (\n expectation.id === deserialized.id &&\n expectation.code === deserialized.code &&\n expectation.description === deserialized.description &&\n expectation.strand === deserialized.strand &&\n expectation.grade === deserialized.grade &&\n expectation.subject === deserialized.subject\n );\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/curriculum-expectation-validation.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Serialization and deserialization using JSON should preserve all fields of a `fullCurriculumExpectation` object, ensuring data integrity.", "mode": "fast-check"} {"id": 60244, "name": "unknown", "code": "it('should validate grade progression constraints', () => {\n fc.assert(\n fc.property(domainArbitraries.curriculumProgression, (progression) => {\n // Property: Curriculum complexity should align with grade level\n const { grade, complexity } = progression;\n\n if (grade <= 3) {\n return complexity === 'basic';\n } else if (grade <= 6) {\n return complexity === 'intermediate';\n } else {\n return complexity === 'advanced';\n }\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/curriculum-expectation-validation.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Curriculum complexity should match grade level constraints: grades 3 and below must be 'basic', grades 4 to 6 'intermediate', and grades above 6 'advanced'.", "mode": "fast-check"} {"id": 60245, "name": "unknown", "code": "it('should limit expectations per grade appropriately', () => {\n fc.assert(\n fc.property(domainArbitraries.curriculumProgression, (progression) => {\n // Property: Lower grades should have fewer expectations\n const { grade, expectations } = progression;\n\n if (grade <= 3) {\n return expectations.length <= 2;\n } else if (grade <= 6) {\n return expectations.length <= 3;\n } else {\n return expectations.length <= 4;\n }\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/curriculum-expectation-validation.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Expectations for progressions are limited by grade, with lower grades having fewer expectations.", "mode": "fast-check"} {"id": 60247, "name": "unknown", "code": "it('should validate grade-subject alignment correctly', () => {\n fc.assert(\n fc.property(domainArbitraries.grade, domainArbitraries.subject, (grade, subject) => {\n // Property: Valid grade-subject combinations should pass validation\n return validateGradeSubjectAlignment(grade, subject) === true;\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/curriculum-expectation-validation.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Valid grade-subject combinations should result in `validateGradeSubjectAlignment` returning true.", "mode": "fast-check"} {"id": 60248, "name": "unknown", "code": "it('should validate expectation content correctly', () => {\n fc.assert(\n fc.property(domainArbitraries.fullCurriculumExpectation, (expectation) => {\n // Property: Valid content should pass validation\n return validateExpectationContent(expectation.description, expectation.strand) === true;\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/curriculum-expectation-validation.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Valid curriculum expectation content should pass the validation check.", "mode": "fast-check"} {"id": 60249, "name": "unknown", "code": "it('should handle empty and null values gracefully', () => {\n fc.assert(\n fc.property(fc.option(fc.string()), fc.option(fc.string()), (description, strand) => {\n // Property: Validation should handle optional fields appropriately\n const validateOptionalContent = (desc?: string, str?: string): boolean => {\n if (!desc || !str) return false;\n return desc.trim().length > 0 && str.trim().length > 0;\n };\n\n const result = validateOptionalContent(description || undefined, strand || undefined);\n\n // If both are provided and non-empty, should be valid\n if (description && strand && description.trim() && strand.trim()) {\n return result === true;\n }\n // If either is missing or empty, should be invalid\n return result === false;\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/curriculum-expectation-validation.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Validation handles optional string fields correctly, ensuring both are non-empty for validity; otherwise, they are invalid.", "mode": "fast-check"} {"id": 60250, "name": "unknown", "code": "it('should validate expectations efficiently', () => {\n const startTime = Date.now();\n\n fc.assert(\n fc.property(\n fc.array(domainArbitraries.fullCurriculumExpectation, { minLength: 100, maxLength: 100 }),\n (expectations) => {\n // Property: Validation should be efficient for large datasets\n const validationStartTime = Date.now();\n\n expectations.forEach((expectation) => {\n // Simulate validation logic\n const isValid =\n expectation.id.length > 0 &&\n expectation.code.length > 0 &&\n expectation.description.trim().length > 0 &&\n expectation.grade >= 1 &&\n expectation.grade <= 8;\n return isValid;\n });\n\n const validationTime = Date.now() - validationStartTime;\n\n // Should validate 100 expectations in less than 100ms\n return validationTime < 100;\n },\n ),\n { ...getPropertyTestConfig('fast'), numRuns: 5 },\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/curriculum-expectation-validation.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function checks that validating 100 curriculum expectations takes less than 100 milliseconds, ensuring efficiency for large datasets.", "mode": "fast-check"} {"id": 60253, "name": "unknown", "code": "it('should maintain referential integrity in relationships', () => {\n fc.assert(\n fc.property(\n fc.array(domainArbitraries.fullCurriculumExpectation, { minLength: 5, maxLength: 10 }),\n (expectations) => {\n // Property: Related expectations should maintain consistency\n const codeToSubject = new Map();\n\n expectations.forEach((expectation) => {\n const existingSubject = codeToSubject.get(expectation.code);\n if (existingSubject) {\n // If code exists, subject should be consistent\n if (existingSubject !== expectation.subject) {\n return false;\n }\n } else {\n codeToSubject.set(expectation.code, expectation.subject);\n }\n });\n\n return true;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/curriculum-expectation-validation.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Expectations with the same code should consistently map to the same subject within a set.", "mode": "fast-check"} {"id": 60254, "name": "unknown", "code": "it('should handle curriculum import scenarios', () => {\n fc.assert(\n fc.property(\n fc.record({\n importId: fc.uuid(),\n expectations: fc.array(domainArbitraries.fullCurriculumExpectation, {\n minLength: 1,\n maxLength: 20,\n }),\n userId: fc.integer({ min: 1, max: 1000 }),\n }),\n (importData) => {\n // Property: Import data should maintain consistency\n const { importId, expectations, userId } = importData;\n\n // All expectations should be valid\n const allValid = expectations.every(\n (exp) => exp.id && exp.code && exp.description.trim().length > 0,\n );\n\n // Import should have valid metadata\n const validImport = importId.length > 0 && userId > 0;\n\n return allValid && validImport;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/curriculum-expectation-validation.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Import data should maintain consistency by ensuring all curriculum expectations have valid attributes, and the import has valid metadata.", "mode": "fast-check"} {"id": 60255, "name": "unknown", "code": "it('should handle malformed data gracefully', () => {\n fc.assert(\n fc.property(\n fc.record({\n id: fc.option(fc.string()),\n code: fc.option(fc.string()),\n description: fc.option(fc.string()),\n grade: fc.option(fc.integer()),\n subject: fc.option(fc.string()),\n }),\n (malformedData) => {\n // Property: Validation should handle partial/malformed data\n const validatePartialExpectation = (data: unknown): boolean => {\n try {\n // Required fields check\n if (!data.id || !data.code || !data.description || !data.grade || !data.subject) {\n return false;\n }\n\n // Type checks\n if (\n typeof data.id !== 'string' ||\n typeof data.code !== 'string' ||\n typeof data.description !== 'string' ||\n typeof data.grade !== 'number' ||\n typeof data.subject !== 'string'\n ) {\n return false;\n }\n\n // Range checks\n if (data.grade < 1 || data.grade > 8) {\n return false;\n }\n\n return true;\n } catch (_error) {\n return false;\n }\n };\n\n const result = validatePartialExpectation(malformedData);\n\n // Should only return true if all required fields are present and valid\n const hasAllFields =\n malformedData.id &&\n malformedData.code &&\n malformedData.description &&\n malformedData.grade &&\n malformedData.subject;\n\n if (\n hasAllFields &&\n typeof malformedData.grade === 'number' &&\n malformedData.grade >= 1 &&\n malformedData.grade <= 8\n ) {\n return result === true;\n } else {\n return result === false;\n }\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/curriculum-expectation-validation.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Validation should only return true for data that contains all required fields with correct types and field values within specified ranges; otherwise, it should return false.", "mode": "fast-check"} {"id": 60256, "name": "unknown", "code": "it('should maintain valid percentage ranges', () => {\n fc.assert(\n fc.property(domainArbitraries.percentage, (percentage) => {\n // Property: All percentages should be within 0-100 range\n return percentage >= 0 && percentage <= 100;\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/assessment-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Percentages should always be within the 0-100 range.", "mode": "fast-check"} {"id": 60257, "name": "unknown", "code": "it('should maintain valid rating ranges', () => {\n fc.assert(\n fc.property(domainArbitraries.rating, (rating) => {\n // Property: All ratings should be within 1-5 range\n return rating >= 1 && rating <= 5;\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/assessment-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "All ratings should be within the range of 1 to 5.", "mode": "fast-check"} {"id": 60258, "name": "unknown", "code": "it('should preserve score ordering', () => {\n fc.assert(\n fc.property(\n fc.array(domainArbitraries.percentage, { minLength: 3, maxLength: 10 }),\n (scores) => {\n // Property: Score comparison should be transitive\n const sorted = [...scores].sort((a, b) => a - b);\n\n for (let i = 2; i < sorted.length; i++) {\n // If A <= B and B <= C, then A <= C\n if (sorted[i - 2] <= sorted[i - 1] && sorted[i - 1] <= sorted[i]) {\n if (sorted[i - 2] > sorted[i]) {\n return false; // Transitivity violated\n }\n }\n }\n\n return true;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/assessment-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Score ordering should maintain transitivity, ensuring a sorted sequence of percentages doesn't violate transitivity.", "mode": "fast-check"} {"id": 60259, "name": "unknown", "code": "it('should convert percentages to achievement levels consistently', () => {\n fc.assert(\n fc.property(domainArbitraries.percentage, (percentage) => {\n // Property: Percentage to achievement level conversion should be deterministic\n const convertToAchievementLevel = (score: number): string => {\n if (score < 50) return 'Below Expectation';\n if (score < 60) return 'Level 1';\n if (score < 70) return 'Level 2';\n if (score < 80) return 'Level 3';\n return 'Level 4';\n };\n\n const level1 = convertToAchievementLevel(percentage);\n const level2 = convertToAchievementLevel(percentage);\n\n return level1 === level2; // Should be consistent\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/assessment-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Conversion from percentage to achievement level should be consistent and deterministic.", "mode": "fast-check"} {"id": 60260, "name": "unknown", "code": "it('should maintain monotonic achievement level progression', () => {\n fc.assert(\n fc.property(\n fc.tuple(domainArbitraries.percentage, domainArbitraries.percentage),\n ([score1, score2]) => {\n // Property: Higher scores should not result in lower achievement levels\n if (score1 >= score2) {\n const levelToNumber = (level: string): number => {\n switch (level) {\n case 'Below Expectation':\n return 0;\n case 'Level 1':\n return 1;\n case 'Level 2':\n return 2;\n case 'Level 3':\n return 3;\n case 'Level 4':\n return 4;\n default:\n return 0;\n }\n };\n\n const convertToAchievementLevel = (score: number): string => {\n if (score < 50) return 'Below Expectation';\n if (score < 60) return 'Level 1';\n if (score < 70) return 'Level 2';\n if (score < 80) return 'Level 3';\n return 'Level 4';\n };\n\n const level1 = convertToAchievementLevel(score1);\n const level2 = convertToAchievementLevel(score2);\n\n return levelToNumber(level1) >= levelToNumber(level2);\n }\n\n return true;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/assessment-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Higher scores should not result in a lower achievement level.", "mode": "fast-check"} {"id": 60261, "name": "unknown", "code": "it('should calculate weighted averages correctly', () => {\n fc.assert(\n fc.property(\n fc.array(\n fc.record({\n score: domainArbitraries.percentage,\n weight: fc.float({ min: 0.1, max: 1.0 }),\n }),\n { minLength: 2, maxLength: 5 },\n ),\n (assessments) => {\n // Property: Weighted average should be within the range of input scores\n const weightedSum = assessments.reduce((sum, a) => sum + a.score * a.weight, 0);\n const totalWeight = assessments.reduce((sum, a) => sum + a.weight, 0);\n const weightedAverage = weightedSum / totalWeight;\n\n const minScore = Math.min(...assessments.map((a) => a.score));\n const maxScore = Math.max(...assessments.map((a) => a.score));\n\n return weightedAverage >= minScore && weightedAverage <= maxScore;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/assessment-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The weighted average of assessment scores, considering their weights, should lie within the minimum and maximum score range of the inputs.", "mode": "fast-check"} {"id": 55210, "name": "unknown", "code": "it(\"should parse CSV Response\", () =>\n fc.assert(\n fc.asyncProperty(\n fc.gen().map((g) => {\n const header = g(FC.header, {\n fieldConstraints: {\n kindExcludes: [\"string16bits\"],\n },\n });\n const EOL = g(FC.eol);\n const EOF = g(fc.boolean);\n const csvData = [\n ...g(FC.csvData, {\n rowsConstraints: {\n minLength: 1,\n },\n columnsConstraints: {\n minLength: header.length,\n maxLength: header.length,\n },\n fieldConstraints: {\n kindExcludes: [\"string16bits\"],\n },\n }),\n // Last row is not empty for testing.\n g(FC.row, {\n fieldConstraints: {\n minLength: 1,\n kindExcludes: [\"string16bits\"],\n },\n columnsConstraints: {\n minLength: header.length,\n maxLength: header.length,\n },\n }),\n ];\n const csv = [\n header.map((v) => escapeField(v)).join(\",\"),\n EOL,\n ...csvData.flatMap((row, i) => [\n ...row.map((v) => escapeField(v)).join(\",\"),\n ...(EOF || csvData.length - 1 !== i ? [EOL] : []),\n ]),\n ].join(\"\");\n const data = csvData.map((row) =>\n Object.fromEntries(row.map((v, i) => [header[i], v])),\n );\n return {\n data,\n csv: new Response(\n new SingleValueReadableStream(new TextEncoder().encode(csv)),\n { headers: { \"content-type\": \"text/csv\" } },\n ),\n };\n }),\n async ({ data, csv }) => {\n let i = 0;\n for await (const row of parse(csv)) {\n expect(row).toEqual(data[i++]);\n }\n },\n ),\n ))", "language": "typescript", "source_file": "./repos/kamiazya/web-csv-toolbox/src/parse.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "kamiazya/web-csv-toolbox", "url": "https://github.com/kamiazya/web-csv-toolbox.git", "license": "MIT", "stars": 15, "forks": 4}, "metrics": null, "summary": "The `parse` function correctly converts CSV formatted `Response` objects into the expected data structure based on headers and rows.", "mode": "fast-check"} {"id": 60262, "name": "unknown", "code": "it('should handle zero weights appropriately', () => {\n fc.assert(\n fc.property(\n fc.array(\n fc.record({\n score: domainArbitraries.percentage,\n weight: fc.constantFrom(0, 0.5, 1.0),\n }),\n { minLength: 3, maxLength: 5 },\n ),\n (assessments) => {\n // Property: Zero-weighted assessments should not affect the average\n const nonZeroAssessments = assessments.filter((a) => a.weight > 0);\n\n if (nonZeroAssessments.length === 0) {\n return true; // Skip if all weights are zero\n }\n\n const calculateWeightedAverage = (items: typeof assessments): number => {\n const filteredItems = items.filter((a) => a.weight > 0);\n if (filteredItems.length === 0) return 0;\n\n const weightedSum = filteredItems.reduce((sum, a) => sum + a.score * a.weight, 0);\n const totalWeight = filteredItems.reduce((sum, a) => sum + a.weight, 0);\n\n return weightedSum / totalWeight;\n };\n\n const fullAverage = calculateWeightedAverage(assessments);\n const nonZeroAverage = calculateWeightedAverage(nonZeroAssessments);\n\n return Math.abs(fullAverage - nonZeroAverage) < 0.001;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/assessment-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Zero-weighted assessments should not impact the calculated average of scores.", "mode": "fast-check"} {"id": 60263, "name": "unknown", "code": "it('should calculate simple averages as special case of weighted', () => {\n fc.assert(\n fc.property(\n fc.array(domainArbitraries.percentage, { minLength: 2, maxLength: 10 }),\n (scores) => {\n // Property: Equal weights should produce simple average\n const simpleAverage = scores.reduce((sum, score) => sum + score, 0) / scores.length;\n\n const equalWeightAssessments = scores.map((score) => ({ score, weight: 1 }));\n const weightedSum = equalWeightAssessments.reduce(\n (sum, a) => sum + a.score * a.weight,\n 0,\n );\n const totalWeight = equalWeightAssessments.reduce((sum, a) => sum + a.weight, 0);\n const weightedAverage = weightedSum / totalWeight;\n\n return Math.abs(simpleAverage - weightedAverage) < 0.001;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/assessment-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Calculating a simple average should be equivalent to calculating a weighted average when all weights are equal.", "mode": "fast-check"} {"id": 55213, "name": "unknown", "code": "it(\"should parse a CSV with headers by option\", () =>\n fc.assert(\n fc.asyncProperty(\n fc.gen().map((g) => {\n const header = g(FC.header);\n const rows = g(FC.csvData, {\n columnsConstraints: {\n minLength: header.length,\n maxLength: header.length,\n },\n });\n const tokens = [\n ...rows.flatMap((row) =>\n row.flatMap((field, j) => [\n { type: Field, value: field, location: LOCATION_SHAPE },\n {\n type: FieldDelimiter,\n value: \",\",\n location: LOCATION_SHAPE,\n },\n ...((j === row.length - 1\n ? [\n {\n type: RecordDelimiter,\n value: \"\\n\",\n },\n ]\n : []) as Token[]),\n ]),\n ),\n ];\n const expected = rows.map((row) =>\n Object.fromEntries(row.map((field, i) => [header[i], field])),\n );\n return { header, tokens, expected };\n }),\n async ({ header, tokens, expected }) => {\n const parser = new RecordAssemblerTransformer({\n header,\n });\n const actual = await transform(parser, [tokens]);\n expect(actual).toEqual(expected);\n },\n ),\n ))", "language": "typescript", "source_file": "./repos/kamiazya/web-csv-toolbox/src/RecordAssemblerTransformer.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "kamiazya/web-csv-toolbox", "url": "https://github.com/kamiazya/web-csv-toolbox.git", "license": "MIT", "stars": 15, "forks": 4}, "metrics": null, "summary": "A CSV with headers specified by the option should be parsed into an array of objects, where each object maps header fields to their corresponding row values.", "mode": "fast-check"} {"id": 60264, "name": "unknown", "code": "it('should maintain valid assessment distribution ratios', () => {\n fc.assert(\n fc.property(domainArbitraries.assessmentDistribution, (distribution) => {\n // Property: Assessment distribution should sum correctly and maintain ratios\n const { diagnostic, formative, summative, total } = distribution;\n\n const calculatedTotal = diagnostic + formative + summative;\n const validTotal = calculatedTotal === total;\n\n const validRatios = diagnostic >= 0 && formative >= 0 && summative >= 0 && total > 0;\n\n return validTotal && validRatios;\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/assessment-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The assessment distribution should correctly sum to the total and maintain non-negative ratios.", "mode": "fast-check"} {"id": 60265, "name": "unknown", "code": "it('should recommend appropriate assessment balance', () => {\n fc.assert(\n fc.property(\n domainArbitraries.grade,\n domainArbitraries.assessmentDistribution,\n (grade, distribution) => {\n // Property: Assessment balance should be appropriate for grade level\n const { formative, summative, total } = distribution;\n\n const formativeRatio = formative / total;\n const summativeRatio = summative / total;\n\n if (grade <= 3) {\n // Lower grades should emphasize formative assessment\n return formativeRatio >= 0.6 && summativeRatio <= 0.3;\n } else if (grade <= 6) {\n // Middle grades should have balanced assessment\n return formativeRatio >= 0.5 && summativeRatio <= 0.4;\n } else {\n // Upper grades can have more summative assessment\n return formativeRatio >= 0.4 && summativeRatio <= 0.5;\n }\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/assessment-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Assessment balance should be appropriate for the grade level, with varying emphasis on formative and summative assessments depending on whether the grade is lower, middle, or upper.", "mode": "fast-check"} {"id": 60266, "name": "unknown", "code": "it('should calculate standard deviation correctly', () => {\n fc.assert(\n fc.property(\n fc.array(domainArbitraries.percentage, { minLength: 5, maxLength: 20 }),\n (scores) => {\n // Property: Standard deviation should be non-negative and bounded\n const mean = scores.reduce((sum, score) => sum + score, 0) / scores.length;\n const variance =\n scores.reduce((sum, score) => sum + Math.pow(score - mean, 2), 0) / scores.length;\n const stdDev = Math.sqrt(variance);\n\n // Standard deviation should be non-negative\n const nonNegative = stdDev >= 0;\n\n // Standard deviation should not exceed the range of scores\n const minScore = Math.min(...scores);\n const maxScore = Math.max(...scores);\n const maxPossibleStdDev = (maxScore - minScore) / 2; // Theoretical maximum\n\n return nonNegative && stdDev <= maxPossibleStdDev + 1; // +1 for floating point tolerance\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/assessment-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The standard deviation calculated from an array of percentage scores should be non-negative and not exceed a certain bounded maximum value.", "mode": "fast-check"} {"id": 60267, "name": "unknown", "code": "it('should identify outliers consistently', () => {\n fc.assert(\n fc.property(\n fc.array(domainArbitraries.percentage, { minLength: 10, maxLength: 20 }),\n (scores) => {\n // Property: Outlier detection should be consistent\n const identifyOutliers = (data: number[]): number[] => {\n const sorted = [...data].sort((a, b) => a - b);\n const q1Index = Math.floor(sorted.length * 0.25);\n const q3Index = Math.floor(sorted.length * 0.75);\n\n const q1 = sorted[q1Index];\n const q3 = sorted[q3Index];\n const iqr = q3 - q1;\n\n const lowerBound = q1 - 1.5 * iqr;\n const upperBound = q3 + 1.5 * iqr;\n\n return data.filter((score) => score < lowerBound || score > upperBound);\n };\n\n const outliers1 = identifyOutliers(scores);\n const outliers2 = identifyOutliers(scores);\n\n // Should be consistent\n return outliers1.length === outliers2.length;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/assessment-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Identifies outliers consistently by ensuring repeated calls produce identical results.", "mode": "fast-check"} {"id": 60268, "name": "unknown", "code": "it('should calculate percentiles correctly', () => {\n fc.assert(\n fc.property(\n fc.array(domainArbitraries.percentage, { minLength: 10, maxLength: 50 }),\n fc.integer({ min: 1, max: 99 }),\n (scores, percentile) => {\n // Property: Percentiles should be monotonically increasing\n const calculatePercentile = (data: number[], p: number): number => {\n const sorted = [...data].sort((a, b) => a - b);\n const index = (p / 100) * (sorted.length - 1);\n const lower = Math.floor(index);\n const upper = Math.ceil(index);\n\n if (lower === upper) {\n return sorted[lower];\n }\n\n const weight = index - lower;\n return sorted[lower] * (1 - weight) + sorted[upper] * weight;\n };\n\n const lowerPercentile = calculatePercentile(scores, Math.max(1, percentile - 10));\n const currentPercentile = calculatePercentile(scores, percentile);\n const upperPercentile = calculatePercentile(scores, Math.min(99, percentile + 10));\n\n return lowerPercentile <= currentPercentile && currentPercentile <= upperPercentile;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/assessment-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Percentiles calculated from a list of scores should be monotonically increasing as the percentile value increases.", "mode": "fast-check"} {"id": 60269, "name": "unknown", "code": "it('should maintain rubric score consistency', () => {\n fc.assert(\n fc.property(\n fc.array(\n fc.record({\n criterion: fc.string({ minLength: 5, maxLength: 20 }),\n score: domainArbitraries.rating,\n weight: fc.float({ min: 0.1, max: 1.0 }),\n }),\n { minLength: 3, maxLength: 6 },\n ),\n (rubricItems) => {\n // Property: Rubric total should be weighted average of criteria\n const weightedSum = rubricItems.reduce(\n (sum, item) => sum + item.score * item.weight,\n 0,\n );\n const totalWeight = rubricItems.reduce((sum, item) => sum + item.weight, 0);\n const rubricScore = weightedSum / totalWeight;\n\n const minScore = Math.min(...rubricItems.map((item) => item.score));\n const maxScore = Math.max(...rubricItems.map((item) => item.score));\n\n return rubricScore >= minScore && rubricScore <= maxScore;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/assessment-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The weighted average score of rubric items should be between the minimum and maximum individual scores of those items.", "mode": "fast-check"} {"id": 60270, "name": "unknown", "code": "it('should handle missing criterion scores appropriately', () => {\n fc.assert(\n fc.property(\n fc.array(\n fc.record({\n criterion: fc.string({ minLength: 5, maxLength: 20 }),\n score: fc.option(domainArbitraries.rating),\n weight: fc.float({ min: 0.1, max: 1.0 }),\n }),\n { minLength: 3, maxLength: 6 },\n ),\n (rubricItems) => {\n // Property: Missing scores should not break calculation\n const validItems = rubricItems.filter(\n (item) => item.score !== null && item.score !== undefined,\n );\n\n if (validItems.length === 0) {\n return true; // Skip if no valid scores\n }\n\n const calculateRubricScore = (items: typeof validItems): number => {\n const weightedSum = items.reduce((sum, item) => sum + item.score! * item.weight, 0);\n const totalWeight = items.reduce((sum, item) => sum + item.weight, 0);\n return weightedSum / totalWeight;\n };\n\n const score = calculateRubricScore(validItems);\n\n return score >= 1 && score <= 5; // Should be within rating range\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/assessment-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The calculation should correctly handle rubric items with missing scores, ensuring the resulting score is within a specified range when computed only from valid scores.", "mode": "fast-check"} {"id": 60271, "name": "unknown", "code": "it('should track learning progression over time', () => {\n fc.assert(\n fc.property(\n fc.array(\n fc.record({\n date: fc.date({ min: new Date('2024-01-01'), max: new Date('2024-12-31') }),\n score: domainArbitraries.percentage,\n expectationId: fc.uuid(),\n }),\n { minLength: 5, maxLength: 15 },\n ),\n (progressEntries) => {\n // Property: Progress tracking should show consistent trends\n const entriesByExpectation = new Map();\n\n progressEntries.forEach((entry) => {\n if (!entriesByExpectation.has(entry.expectationId)) {\n entriesByExpectation.set(entry.expectationId, []);\n }\n entriesByExpectation.get(entry.expectationId)!.push(entry);\n });\n\n // Check each expectation's progress\n for (const [, entries] of entriesByExpectation) {\n if (entries.length < 2) continue;\n\n // Sort by date\n const sortedEntries = entries.sort((a, b) => a.date.getTime() - b.date.getTime());\n\n // Calculate trend\n const firstScore = sortedEntries[0].score;\n const lastScore = sortedEntries[sortedEntries.length - 1].score;\n\n // Trend should be reasonable (not impossible jumps)\n const scoreDifference = Math.abs(lastScore - firstScore);\n if (scoreDifference > 80) {\n return false; // Unrealistic score change\n }\n }\n\n return true;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/assessment-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Tracking learning progression should show consistent trends over time without unrealistic score jumps for each expectation.", "mode": "fast-check"} {"id": 60272, "name": "unknown", "code": "it('should calculate improvement rates correctly', () => {\n fc.assert(\n fc.property(\n fc.array(\n fc.record({\n week: fc.integer({ min: 1, max: 40 }),\n score: domainArbitraries.percentage,\n }),\n { minLength: 4, maxLength: 10 },\n ),\n (weeklyScores) => {\n // Property: Improvement rate calculation should be consistent\n const sortedScores = weeklyScores.sort((a, b) => a.week - b.week);\n\n if (sortedScores.length < 2) return true;\n\n const calculateImprovementRate = (scores: typeof sortedScores): number => {\n const firstScore = scores[0].score;\n const lastScore = scores[scores.length - 1].score;\n const weeksDifference = scores[scores.length - 1].week - scores[0].week;\n\n if (weeksDifference === 0) return 0;\n\n return (lastScore - firstScore) / weeksDifference;\n };\n\n const improvementRate = calculateImprovementRate(sortedScores);\n\n // Improvement rate should be bounded\n return Math.abs(improvementRate) <= 25; // Max 25 points per week\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/assessment-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Calculates improvement rates from weekly scores, ensuring the rate is consistent and bounded within a maximum of 25 points per week.", "mode": "fast-check"} {"id": 60273, "name": "unknown", "code": "it('should handle grade boundary edge cases', () => {\n fc.assert(\n fc.property(\n fc.float({ min: 49.8, max: 50.2 }), // Around 50% boundary\n (score) => {\n // Property: Scores near boundaries should be handled consistently\n const getGradeBoundary = (percentage: number): string => {\n if (percentage < 50) return 'Below Standard';\n if (percentage < 60) return 'Approaching Standard';\n if (percentage < 70) return 'Meeting Standard';\n if (percentage < 80) return 'Exceeding Standard';\n return 'Outstanding';\n };\n\n const grade1 = getGradeBoundary(score);\n const grade2 = getGradeBoundary(score);\n\n // Should be consistent\n return grade1 === grade2;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/assessment-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Grades should be consistently determined for scores near the 50% boundary edge case.", "mode": "fast-check"} {"id": 60274, "name": "unknown", "code": "it('should apply grade boundaries fairly', () => {\n fc.assert(\n fc.property(\n fc.tuple(domainArbitraries.percentage, domainArbitraries.percentage),\n ([score1, score2]) => {\n // Property: Higher scores should not result in lower grades\n const getGradeLevel = (percentage: number): number => {\n if (percentage < 50) return 1;\n if (percentage < 60) return 2;\n if (percentage < 70) return 3;\n if (percentage < 80) return 4;\n return 5;\n };\n\n const grade1 = getGradeLevel(score1);\n const grade2 = getGradeLevel(score2);\n\n if (score1 >= score2) {\n return grade1 >= grade2;\n }\n\n return true;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/assessment-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Higher scores should not result in lower grades based on specified grade boundaries.", "mode": "fast-check"} {"id": 60275, "name": "unknown", "code": "it('should handle assessment data validation', () => {\n fc.assert(\n fc.property(\n fc.record({\n studentId: fc.option(fc.uuid()),\n assessmentId: fc.uuid(),\n score: fc.option(domainArbitraries.percentage),\n submittedAt: fc.option(fc.date()),\n attempt: fc.integer({ min: 1, max: 5 }),\n }),\n (assessmentData) => {\n // Property: Assessment validation should handle incomplete data\n const validateAssessmentData = (data: typeof assessmentData): boolean => {\n // Required fields check\n if (!data.assessmentId) return false;\n\n // Score validation\n if (data.score !== null && data.score !== undefined) {\n if (data.score < 0 || data.score > 100) return false;\n }\n\n // Attempt validation\n if (data.attempt < 1 || data.attempt > 5) return false;\n\n return true;\n };\n\n const isValid = validateAssessmentData(assessmentData);\n\n // Should return boolean result\n return typeof isValid === 'boolean';\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/assessment-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Assessment data validation must correctly handle incomplete data and meet field-specific requirements, ensuring a boolean result.", "mode": "fast-check"} {"id": 60276, "name": "unknown", "code": "it('should maintain arithmetic properties in calculations', () => {\n fc.assert(\n fc.property(\n fc.array(domainArbitraries.percentage, { minLength: 3, maxLength: 8 }),\n (scores) => {\n // Property: Addition should be commutative\n const sum1 = scores.reduce((sum, score) => sum + score, 0);\n const sum2 = [...scores].reverse().reduce((sum, score) => sum + score, 0);\n\n return Math.abs(sum1 - sum2) < 0.001; // Account for floating point precision\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/assessment-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that the sum of an array of percentage scores remains consistent when the order of addition is reversed, verifying the commutative property of addition.", "mode": "fast-check"} {"id": 60277, "name": "unknown", "code": "it('should handle floating point precision in calculations', () => {\n fc.assert(\n fc.property(\n fc.array(fc.float({ min: 0, max: 100 }), { minLength: 3, maxLength: 10 }),\n (scores) => {\n // Property: Calculations should handle floating point precision\n const average1 = scores.reduce((sum, score) => sum + score, 0) / scores.length;\n\n // Recalculate using a different method\n let sum = 0;\n for (const score of scores) {\n sum += score;\n }\n const average2 = sum / scores.length;\n\n // Should be equal within floating point tolerance\n return Math.abs(average1 - average2) < 0.0001;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/assessment-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Calculations of averages should maintain floating point precision, ensuring results from different summation methods are equal within a small tolerance.", "mode": "fast-check"} {"id": 60278, "name": "unknown", "code": "it('should maintain consistency in rounding operations', () => {\n fc.assert(\n fc.property(\n fc.float({ min: 0, max: 100 }),\n fc.integer({ min: 0, max: 3 }), // decimal places\n (score, decimals) => {\n // Property: Rounding should be consistent\n const roundToDecimals = (num: number, places: number): number => {\n const factor = Math.pow(10, places);\n return Math.round(num * factor) / factor;\n };\n\n const rounded1 = roundToDecimals(score, decimals);\n const rounded2 = roundToDecimals(score, decimals);\n\n return rounded1 === rounded2;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/assessment-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Rounding a floating-point number to a specified number of decimal places should consistently yield the same result.", "mode": "fast-check"} {"id": 55221, "name": "unknown", "code": "it(\"should lex with with user given quotation and delimiter\", () => {\n fc.assert(\n fc.property(\n fc.gen().map((g) => {\n const options = g(FC.commonOptions);\n const row = g(FC.row);\n const csv = row\n .map((field) => escapeField(field, options))\n .join(options.delimiter);\n const expected = [\n ...row.flatMap((field, i) => [\n // if field is empty or field is escaped, it should be escaped.\n ...(field !== \"\" || escapeField(field, options) !== field\n ? [{ type: Field, value: field, location: LOCATION_SHAPE }]\n : []),\n // if field is not last field, it should be followed by a field delimiter\n ...(row.length - 1 !== i\n ? [\n {\n type: FieldDelimiter,\n value: options.delimiter,\n location: LOCATION_SHAPE,\n },\n ]\n : []),\n ]),\n ];\n return { options, row, csv, expected };\n }),\n ({ options, csv, expected }) => {\n const lexer = new Lexer(options);\n const actual = [...lexer.lex(csv)];\n expect(actual).toMatchObject(expected);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/kamiazya/web-csv-toolbox/src/Lexer.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "kamiazya/web-csv-toolbox", "url": "https://github.com/kamiazya/web-csv-toolbox.git", "license": "MIT", "stars": 15, "forks": 4}, "metrics": null, "summary": "Lexing a CSV string with user-defined quotation and delimiter options should produce tokens matching the expected fields and delimiters.", "mode": "fast-check"} {"id": 60279, "name": "unknown", "code": "it('should apply late penalty calculations correctly', () => {\n fc.assert(\n fc.property(\n domainArbitraries.percentage,\n fc.integer({ min: 1, max: 10 }), // days late\n fc.float({ min: 0.05, max: 0.2 }), // penalty rate\n (originalScore, daysLate, penaltyRate) => {\n // Property: Late penalties should reduce scores appropriately\n const applyLatePenalty = (score: number, days: number, rate: number): number => {\n const penalty = score * rate * days;\n return Math.max(0, score - penalty); // Cannot go below 0\n };\n\n const penalizedScore = applyLatePenalty(originalScore, daysLate, penaltyRate);\n\n // Penalized score should be less than or equal to original\n const validPenalty = penalizedScore <= originalScore;\n\n // Should not go below 0\n const validRange = penalizedScore >= 0 && penalizedScore <= 100;\n\n return validPenalty && validRange;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/assessment-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Late penalty calculations should reduce scores appropriately without lowering them below zero, ensuring penalized scores remain between 0 and the original score.", "mode": "fast-check"} {"id": 60280, "name": "unknown", "code": "it('should handle extra credit calculations appropriately', () => {\n fc.assert(\n fc.property(\n domainArbitraries.percentage,\n fc.float({ min: 0, max: 10 }), // extra credit points\n (baseScore, extraCredit) => {\n // Property: Extra credit should not exceed reasonable limits\n const applyExtraCredit = (score: number, extra: number): number => {\n const newScore = score + extra;\n return Math.min(105, newScore); // Cap at 105%\n };\n\n const finalScore = applyExtraCredit(baseScore, extraCredit);\n\n // Should be greater than or equal to base score\n const validIncrease = finalScore >= baseScore;\n\n // Should not exceed 105%\n const validCap = finalScore <= 105;\n\n return validIncrease && validCap;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/assessment-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Extra credit calculations should result in final scores that are no less than the base score and do not exceed a maximum of 105%.", "mode": "fast-check"} {"id": 60283, "name": "unknown", "code": "it('should test array properties', () => {\n fc.assert(\n fc.property(fc.array(fc.integer()), (arr) => {\n // Property: Array concat with empty array returns same array\n const result = arr.concat([]);\n return result.length === arr.length;\n }),\n { numRuns: 50 },\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/simple-test.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Concatenating an integer array with an empty array returns an array of the same length.", "mode": "fast-check"} {"id": 60284, "name": "unknown", "code": "it('should ensure lessons fit within school hours', () => {\n fc.assert(\n fc.property(domainArbitraries.validTimeSlot, (timeSlot) => {\n // Property: All scheduled lessons must fit within school hours (8 AM - 4 PM)\n const schoolStart = 8; // 8 AM\n const schoolEnd = 16; // 4 PM\n\n const startHour = timeSlot.start.getHours();\n const endHour = timeSlot.end.getHours();\n const endMinute = timeSlot.end.getMinutes();\n\n // Lesson should start after school starts and end before school ends\n const startsAfterSchoolStart = startHour >= schoolStart;\n const endsBeforeSchoolEnd =\n endHour < schoolEnd || (endHour === schoolEnd && endMinute === 0);\n\n return startsAfterSchoolStart && endsBeforeSchoolEnd;\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/lesson-plan-scheduling.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Scheduled lessons must start at or after 8 AM and end by or before 4 PM, aligning with school hours.", "mode": "fast-check"} {"id": 60285, "name": "unknown", "code": "it('should maintain positive lesson durations', () => {\n fc.assert(\n fc.property(domainArbitraries.validTimeSlot, (timeSlot) => {\n // Property: Lesson duration should always be positive\n const durationMs = timeSlot.end.getTime() - timeSlot.start.getTime();\n const durationMinutes = durationMs / (1000 * 60);\n\n return durationMinutes > 0 && durationMinutes === timeSlot.duration;\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/lesson-plan-scheduling.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The lesson duration calculated from `timeSlot` should always be positive and match `timeSlot.duration`.", "mode": "fast-check"} {"id": 55226, "name": "unknown", "code": "test('Difference in days', () => {\n fc.assert(\n fc.property(\n fcCalendarDate(),\n fc.integer(-2000 * 365, 2000 * 365),\n (date, days) => {\n const laterDay = addDays(date, days);\n const diff = numberOfDaysBetween({ start: date, end: laterDay });\n expect(diff).toBe(days);\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/tskj/typescript-calendar-date/specs/index.tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tskj/typescript-calendar-date", "url": "https://github.com/tskj/typescript-calendar-date.git", "license": "MIT", "stars": 9, "forks": 0}, "metrics": null, "summary": "The number of days calculated between two dates should equal the number of days added to the initial date.", "mode": "fast-check"} {"id": 55227, "name": "unknown", "code": "test('Add days', () => {\n fc.assert(\n fc.property(fcCalendarDate(), fcCalendarDate(), (a, b) => {\n const diff = numberOfDaysBetween({ start: a, end: b });\n\n const bPrime = addDays(a, diff);\n expect(bPrime).toEqual(b);\n\n const aPrime = addDays(b, -diff);\n expect(aPrime).toEqual(a);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/tskj/typescript-calendar-date/specs/index.tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tskj/typescript-calendar-date", "url": "https://github.com/tskj/typescript-calendar-date.git", "license": "MIT", "stars": 9, "forks": 0}, "metrics": null, "summary": "Adding a calculated number of days between two dates to one date should result in the other date, and vice versa when subtracting.", "mode": "fast-check"} {"id": 55228, "name": "unknown", "code": "test('Adding days sequentially', () => {\n fc.assert(\n fc.property(fcCalendarDate(), fc.integer(-100, 100), (date, n) => {\n const otherDate = addDays(date, n);\n const step = n < 0 ? -1 : 1;\n const otherDatePrime = repeat(Math.abs(n), (d) => addDays(d, step), date);\n expect(otherDate).toEqual(otherDatePrime);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/tskj/typescript-calendar-date/specs/index.tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tskj/typescript-calendar-date", "url": "https://github.com/tskj/typescript-calendar-date.git", "license": "MIT", "stars": 9, "forks": 0}, "metrics": null, "summary": "Adding days sequentially to a date should yield the same result as adding them one at a time repeatedly.", "mode": "fast-check"} {"id": 60286, "name": "unknown", "code": "it('should respect minimum and maximum lesson durations', () => {\n fc.assert(\n fc.property(domainArbitraries.lessonDuration, (duration) => {\n // Property: Lesson durations should be within pedagogically sound ranges\n const minDuration = 15; // 15 minutes minimum\n const maxDuration = 120; // 2 hours maximum\n\n return duration >= minDuration && duration <= maxDuration;\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/lesson-plan-scheduling.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Lesson durations should fall within the range of 15 to 120 minutes.", "mode": "fast-check"} {"id": 60287, "name": "unknown", "code": "it('should detect overlapping lessons', () => {\n fc.assert(\n fc.property(\n fc.array(domainArbitraries.validTimeSlot, { minLength: 2, maxLength: 10 }),\n (timeSlots) => {\n // Property: No two lessons should overlap in time\n const hasOverlap = (\n slot1: (typeof timeSlots)[0],\n slot2: (typeof timeSlots)[0],\n ): boolean => {\n return (\n (slot1.start <= slot2.start && slot1.end > slot2.start) ||\n (slot2.start <= slot1.start && slot2.end > slot1.start)\n );\n };\n\n const detectConflicts = (slots: typeof timeSlots): boolean => {\n for (let i = 0; i < slots.length; i++) {\n for (let j = i + 1; j < slots.length; j++) {\n if (hasOverlap(slots[i], slots[j])) {\n return true; // Conflict found\n }\n }\n }\n return false; // No conflicts\n };\n\n // Property: Conflict detection should work correctly\n return typeof detectConflicts(timeSlots) === 'boolean';\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/lesson-plan-scheduling.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Detects if there are overlapping lessons in a set of time slots, ensuring conflict detection returns a boolean.", "mode": "fast-check"} {"id": 55229, "name": "unknown", "code": "test('Number of days in leapyears', () => {\n fc.assert(\n fc.property(fcCalendarDate(), (date) => {\n const startOfYear: CalendarDate = { ...date, month: 'jan', day: 1 };\n const endOfYear: CalendarDate = { ...date, month: 'dec', day: 31 };\n const allDaysInYear = periodOfDates(startOfYear, endOfYear);\n const numberOfDays =\n numberOfDaysBetween({ start: startOfYear, end: endOfYear }) + 1;\n const numberOfDaysInSuchAYear = isLeapYear(date) ? 366 : 365;\n expect(allDaysInYear.length).toBe(numberOfDaysInSuchAYear);\n expect(numberOfDays).toBe(numberOfDaysInSuchAYear);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/tskj/typescript-calendar-date/specs/index.tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tskj/typescript-calendar-date", "url": "https://github.com/tskj/typescript-calendar-date.git", "license": "MIT", "stars": 9, "forks": 0}, "metrics": null, "summary": "The number of days in a year, generated from a start and end date, should match 366 for leap years or 365 for non-leap years.", "mode": "fast-check"} {"id": 60288, "name": "unknown", "code": "it('should handle adjacent lessons correctly', () => {\n fc.assert(\n fc.property(\n domainArbitraries.validTimeSlot,\n domainArbitraries.lessonDuration,\n (firstSlot, secondDuration) => {\n // Property: Adjacent lessons (end time = start time) should not conflict\n const secondSlot = {\n start: new Date(firstSlot.end.getTime()),\n end: new Date(firstSlot.end.getTime() + secondDuration * 60 * 1000),\n duration: secondDuration,\n };\n\n // Check if second lesson would extend beyond school hours\n const schoolEnd = new Date(firstSlot.start);\n schoolEnd.setHours(16, 0, 0, 0);\n\n if (secondSlot.end > schoolEnd) {\n return true; // Skip if would extend beyond school hours\n }\n\n // Adjacent lessons should not be considered overlapping\n const areAdjacent = firstSlot.end.getTime() === secondSlot.start.getTime();\n const doNotOverlap =\n firstSlot.end <= secondSlot.start || secondSlot.end <= firstSlot.start;\n\n return areAdjacent ? doNotOverlap : true;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/lesson-plan-scheduling.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Adjacent lessons where the end time of the first lesson equals the start time of the second lesson should not be considered overlapping, provided the second lesson does not extend beyond school hours.", "mode": "fast-check"} {"id": 55233, "name": "unknown", "code": "test('Period of dates has correct number of days', () => {\n fc.assert(\n fc.property(fcCalendarDate(), fcCalendarDate(), (a, b) => {\n const daysBetween = numberOfDaysBetween({ start: a, end: b }) + 1;\n if (Math.abs(daysBetween) > 1000) {\n return;\n }\n const allDaysInPeriod = periodOfDates(a, b);\n expect(allDaysInPeriod.length).toBe(Math.max(daysBetween, 0));\n }),\n );\n})", "language": "typescript", "source_file": "./repos/tskj/typescript-calendar-date/specs/index.tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tskj/typescript-calendar-date", "url": "https://github.com/tskj/typescript-calendar-date.git", "license": "MIT", "stars": 9, "forks": 0}, "metrics": null, "summary": "The period of dates calculated should have a length equal to the computed number of days between two dates, accounting for a maximum of 1000 days.", "mode": "fast-check"} {"id": 55235, "name": "unknown", "code": "test('Ordered ints', () => {\n fc.assert(\n fc.property(\n fcCalendarDate(),\n fc.array(fc.integer(-100, 100)),\n (date, ints) => {\n const orderedInts = ints.sort((a, b) => a - b);\n const shiftDays = (n: number) => addDays(date, n);\n const dates = orderedInts.map(shiftDays);\n expect(areInOrder(...dates)).toBe(true);\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/tskj/typescript-calendar-date/specs/index.tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tskj/typescript-calendar-date", "url": "https://github.com/tskj/typescript-calendar-date.git", "license": "MIT", "stars": 9, "forks": 0}, "metrics": null, "summary": "`areInOrder` should return true when dates are generated by adding ordered integers to a given date.", "mode": "fast-check"} {"id": 60289, "name": "unknown", "code": "it('should maintain daily time limits', () => {\n fc.assert(\n fc.property(\n fc.array(domainArbitraries.fullLessonPlan, { minLength: 1, maxLength: 8 }),\n (dailyLessons) => {\n // Property: Total daily lesson time should not exceed school day limits\n const maxDailyMinutes = 7 * 60; // 7 hours max per day\n\n // Group lessons by date\n const lessonsByDate = new Map();\n dailyLessons.forEach((lesson) => {\n const dateKey = lesson.date.toISOString().split('T')[0];\n if (!lessonsByDate.has(dateKey)) {\n lessonsByDate.set(dateKey, []);\n }\n lessonsByDate.get(dateKey)!.push(lesson);\n });\n\n // Check each day's total duration\n for (const [, lessons] of lessonsByDate) {\n const totalDuration = lessons.reduce((sum, lesson) => sum + lesson.duration, 0);\n if (totalDuration > maxDailyMinutes) {\n return false;\n }\n }\n\n return true;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/lesson-plan-scheduling.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Total daily lesson time for grouped lessons by date should not exceed 7 hours.", "mode": "fast-check"} {"id": 55239, "name": "unknown", "code": "test('Serialize', () => {\n fc.assert(\n fc.property(fcCalendarDate(), (date) => {\n const serialized = serializeIso8601String(date);\n\n expect(serialized.length).toBe(10);\n\n const yyyymmdd = /^\\d{4}-\\d{2}-\\d{2}$/;\n expect(yyyymmdd.test(serialized)).toBe(true);\n\n const digitsOrDash = /^[0-9\\-]*$/;\n expect(digitsOrDash.test(serialized)).toBe(true);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/tskj/typescript-calendar-date/specs/index.tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tskj/typescript-calendar-date", "url": "https://github.com/tskj/typescript-calendar-date.git", "license": "MIT", "stars": 9, "forks": 0}, "metrics": null, "summary": "Serialization of a calendar date should result in a 10-character ISO 8601 string in the format YYYY-MM-DD, containing only digits and dashes.", "mode": "fast-check"} {"id": 60290, "name": "unknown", "code": "it('should balance subject distribution across the week', () => {\n fc.assert(\n fc.property(\n fc.array(domainArbitraries.fullLessonPlan, { minLength: 10, maxLength: 25 }),\n (weeklyLessons) => {\n // Property: Core subjects should appear multiple times per week\n const subjectCounts = new Map();\n\n weeklyLessons.forEach((lesson) => {\n subjectCounts.set(lesson.subject, (subjectCounts.get(lesson.subject) || 0) + 1);\n });\n\n const coreSubjects = ['Mathematics', 'Language Arts'];\n const hasBalancedCore = coreSubjects.every((subject) => {\n const count = subjectCounts.get(subject) || 0;\n return count >= 3; // At least 3 lessons per week for core subjects\n });\n\n // If we have enough lessons for a full week, check balance\n if (weeklyLessons.length >= 15) {\n return hasBalancedCore;\n }\n\n return true; // Skip check for smaller lesson sets\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/lesson-plan-scheduling.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Core subjects, specifically 'Mathematics' and 'Language Arts', should appear at least three times per week in lesson plans with a minimum of 15 lessons.", "mode": "fast-check"} {"id": 60291, "name": "unknown", "code": "it('should maintain realistic unit durations', () => {\n fc.assert(\n fc.property(domainArbitraries.unitTimeline, (timeline) => {\n // Property: Unit timelines should be educationally realistic\n const { startDate, endDate, totalHours, lessonCount, averageLessonDuration } = timeline;\n\n // Duration checks\n const durationMs = endDate.getTime() - startDate.getTime();\n const durationDays = durationMs / (1000 * 60 * 60 * 24);\n const durationWeeks = durationDays / 7;\n\n // Unit should be 1-8 weeks long\n const validDuration = durationWeeks >= 1 && durationWeeks <= 8;\n\n // Average lesson duration should be reasonable (30-90 minutes)\n const validAverageDuration = averageLessonDuration >= 30 && averageLessonDuration <= 90;\n\n // Lesson count should align with duration (3-5 lessons per week)\n const expectedLessonsPerWeek = Math.round(lessonCount / durationWeeks);\n const validLessonFrequency = expectedLessonsPerWeek >= 3 && expectedLessonsPerWeek <= 5;\n\n return validDuration && validAverageDuration && validLessonFrequency;\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/lesson-plan-scheduling.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Unit timelines should have a duration of 1-8 weeks, average lesson durations of 30-90 minutes, and 3-5 lessons per week.", "mode": "fast-check"} {"id": 55241, "name": "unknown", "code": "test('Adding more than a year of days', () => {\n fc.assert(\n fc.property(fcCalendarDate(), fc.integer(-2000, 2000), (date, n) => {\n const otherDate = addDays(date, n);\n if (Math.abs(n) >= 366) {\n expect(date.year !== otherDate.year).toBe(true);\n }\n }),\n );\n})", "language": "typescript", "source_file": "./repos/tskj/typescript-calendar-date/specs/index.tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tskj/typescript-calendar-date", "url": "https://github.com/tskj/typescript-calendar-date.git", "license": "MIT", "stars": 9, "forks": 0}, "metrics": null, "summary": "Adding more than 365 days to a date should result in a different year.", "mode": "fast-check"} {"id": 55242, "name": "unknown", "code": "test('Associativity', () => {\n fc.assert(\n fc.property(\n fcCalendarDate(),\n fc.integer(-500 * 365, 500 * 365),\n fc.integer(-500 * 365, 500 * 365),\n (date, x, y) => {\n expect(addDays(date, x + y)).toEqual(addDays(addDays(date, x), y));\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/tskj/typescript-calendar-date/specs/index.tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tskj/typescript-calendar-date", "url": "https://github.com/tskj/typescript-calendar-date.git", "license": "MIT", "stars": 9, "forks": 0}, "metrics": null, "summary": "Adding days to a date should be associative, meaning `addDays(date, x + y)` should equal `addDays(addDays(date, x), y)`.", "mode": "fast-check"} {"id": 60292, "name": "unknown", "code": "it('should ensure lessons fit within unit timeframe', () => {\n fc.assert(\n fc.property(\n domainArbitraries.unitTimeline,\n fc.array(domainArbitraries.fullLessonPlan, { minLength: 1, maxLength: 15 }),\n (timeline, unitLessons) => {\n // Property: All unit lessons should fall within unit start/end dates\n const { startDate, endDate } = timeline;\n\n // Adjust lesson dates to fall within unit timeframe\n const adjustedLessons = unitLessons.map((lesson, index) => {\n const totalDays = (endDate.getTime() - startDate.getTime()) / (1000 * 60 * 60 * 24);\n const dayOffset = Math.floor((index / unitLessons.length) * totalDays);\n const lessonDate = new Date(startDate.getTime() + dayOffset * 24 * 60 * 60 * 1000);\n\n return {\n ...lesson,\n date: lessonDate,\n };\n });\n\n // Verify all lessons fall within unit timeframe\n return adjustedLessons.every(\n (lesson) => lesson.date >= startDate && lesson.date <= endDate,\n );\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/lesson-plan-scheduling.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Lessons are adjusted to fit within the unit's start and end dates, ensuring all lessons fall within this timeframe.", "mode": "fast-check"} {"id": 60293, "name": "unknown", "code": "it('should handle resource conflicts', () => {\n fc.assert(\n fc.property(\n fc.array(domainArbitraries.fullLessonPlan, { minLength: 2, maxLength: 5 }),\n domainArbitraries.technology,\n (lessons, sharedResource) => {\n // Property: Shared resources should not be double-booked\n const lessonsWithResource = lessons.map((lesson) => ({\n ...lesson,\n materials: [...lesson.materials, sharedResource],\n }));\n\n // Check for same-time resource conflicts\n const hasResourceConflict = (): boolean => {\n for (let i = 0; i < lessonsWithResource.length; i++) {\n for (let j = i + 1; j < lessonsWithResource.length; j++) {\n const lesson1 = lessonsWithResource[i];\n const lesson2 = lessonsWithResource[j];\n\n // If same date and both use the shared resource\n if (lesson1.date.toDateString() === lesson2.date.toDateString()) {\n const end1 = new Date(lesson1.date.getTime() + lesson1.duration * 60 * 1000);\n const end2 = new Date(lesson2.date.getTime() + lesson2.duration * 60 * 1000);\n\n // Check for time overlap\n if (\n (lesson1.date <= lesson2.date && end1 > lesson2.date) ||\n (lesson2.date <= lesson1.date && end2 > lesson1.date)\n ) {\n return true;\n }\n }\n }\n }\n return false;\n };\n\n // Property: System should detect resource conflicts\n return typeof hasResourceConflict() === 'boolean';\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/lesson-plan-scheduling.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The system should correctly detect conflicts when shared resources are double-booked in overlapping lesson schedules.", "mode": "fast-check"} {"id": 60294, "name": "unknown", "code": "it('should allow for transitions between lessons', () => {\n fc.assert(\n fc.property(\n fc.tuple(domainArbitraries.validTimeSlot, domainArbitraries.validTimeSlot),\n ([slot1, slot2]) => {\n // Property: Consecutive lessons should have transition time\n const minTransitionMinutes = 5;\n\n // If lessons are on the same day\n if (slot1.start.toDateString() === slot2.start.toDateString()) {\n // Ensure they don't overlap and have transition time\n if (slot1.end <= slot2.start) {\n const transitionMs = slot2.start.getTime() - slot1.end.getTime();\n const transitionMinutes = transitionMs / (1000 * 60);\n return transitionMinutes >= minTransitionMinutes;\n } else if (slot2.end <= slot1.start) {\n const transitionMs = slot1.start.getTime() - slot2.end.getTime();\n const transitionMinutes = transitionMs / (1000 * 60);\n return transitionMinutes >= minTransitionMinutes;\n } else {\n return false; // Overlapping lessons\n }\n }\n\n return true; // Different days, no conflict\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/lesson-plan-scheduling.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Consecutive lessons within the same day must have a transition time of at least five minutes, ensuring non-overlapping schedules.", "mode": "fast-check"} {"id": 60295, "name": "unknown", "code": "it('should include adequate lunch and recess breaks', () => {\n fc.assert(\n fc.property(\n fc.array(domainArbitraries.validTimeSlot, { minLength: 4, maxLength: 8 }),\n (dailySlots) => {\n // Property: Daily schedule should allow for lunch and recess\n\n // Sort slots by start time\n const sortedSlots = [...dailySlots].sort(\n (a, b) => a.start.getTime() - b.start.getTime(),\n );\n\n // Check for gaps that could accommodate breaks\n let hasLunchBreak = false;\n let hasRecessBreak = false;\n\n for (let i = 0; i < sortedSlots.length - 1; i++) {\n const currentEnd = sortedSlots[i].end;\n const nextStart = sortedSlots[i + 1].start;\n const gapMinutes = (nextStart.getTime() - currentEnd.getTime()) / (1000 * 60);\n\n // Lunch break: 30+ minutes around 11:30-1:00\n const currentHour = currentEnd.getHours();\n if (gapMinutes >= 30 && currentHour >= 11 && currentHour <= 13) {\n hasLunchBreak = true;\n }\n\n // Recess break: 15+ minutes around 10:00-10:30 or 2:00-2:30\n if (\n gapMinutes >= 15 &&\n ((currentHour >= 10 && currentHour <= 10) ||\n (currentHour >= 14 && currentHour <= 14))\n ) {\n hasRecessBreak = true;\n }\n }\n\n // For a full day (6+ lessons), should have both breaks\n if (sortedSlots.length >= 6) {\n return hasLunchBreak && hasRecessBreak;\n }\n\n return true; // Partial day, less stringent requirements\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/lesson-plan-scheduling.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Daily schedules must include at least a 30-minute lunch break and a 15-minute recess break if they have 6 or more lessons.", "mode": "fast-check"} {"id": 60296, "name": "unknown", "code": "it('should distribute assessments appropriately', () => {\n fc.assert(\n fc.property(\n fc.array(domainArbitraries.fullLessonPlan, { minLength: 10, maxLength: 20 }),\n (lessons) => {\n // Property: Assessments should be well-distributed throughout the unit\n const assessmentLessons = lessons.filter(\n (lesson) => lesson.assessmentType === 'summative',\n );\n\n if (assessmentLessons.length === 0) {\n return true; // No assessments to check\n }\n\n // Sort by date\n const sortedAssessments = assessmentLessons.sort(\n (a, b) => a.date.getTime() - b.date.getTime(),\n );\n\n // Check spacing between assessments\n for (let i = 0; i < sortedAssessments.length - 1; i++) {\n const daysBetween =\n Math.abs(\n sortedAssessments[i + 1].date.getTime() - sortedAssessments[i].date.getTime(),\n ) /\n (1000 * 60 * 60 * 24);\n\n // Should have at least 3 days between major assessments\n if (daysBetween < 3) {\n return false;\n }\n }\n\n return true;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/lesson-plan-scheduling.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Assessments labeled as 'summative' within a lesson plan should have at least three days between their scheduled dates.", "mode": "fast-check"} {"id": 60297, "name": "unknown", "code": "it('should identify substitute-friendly lessons', () => {\n fc.assert(\n fc.property(domainArbitraries.fullLessonPlan, (lesson) => {\n // Property: Substitute-friendly lessons should have specific characteristics\n const isSubFriendly =\n lesson.assessmentType !== 'summative' &&\n lesson.materials.every(\n (material) => !['computer', 'tablet', 'projector'].includes(material),\n );\n\n // Complex activities are typically not sub-friendly\n const hasComplexActivities =\n (lesson.action && lesson.action.toLowerCase().includes('experiment')) ||\n (lesson.action && lesson.action.toLowerCase().includes('investigation'));\n\n if (hasComplexActivities) {\n return !isSubFriendly; // Should not be marked as sub-friendly\n }\n\n return true; // Other lessons can be either way\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/lesson-plan-scheduling.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Determines whether lessons marked as substitute-friendly lack summative assessments, avoid reliance on certain materials, and do not include complex activities.", "mode": "fast-check"} {"id": 60298, "name": "unknown", "code": "it('should maintain schedule optimization properties', () => {\n fc.assert(\n fc.property(\n fc.array(domainArbitraries.fullLessonPlan, { minLength: 5, maxLength: 15 }),\n (lessons) => {\n // Property: Optimized schedule should minimize context switching\n\n // Sort lessons by date and time\n const sortedLessons = [...lessons].sort((a, b) => a.date.getTime() - b.date.getTime());\n\n // Count subject changes within the same day\n let subjectChanges = 0;\n const lessonsByDay = new Map();\n\n sortedLessons.forEach((lesson) => {\n const dateKey = lesson.date.toDateString();\n if (!lessonsByDay.has(dateKey)) {\n lessonsByDay.set(dateKey, []);\n }\n lessonsByDay.get(dateKey)!.push(lesson);\n });\n\n lessonsByDay.forEach((dailyLessons) => {\n for (let i = 1; i < dailyLessons.length; i++) {\n if (dailyLessons[i].subject !== dailyLessons[i - 1].subject) {\n subjectChanges++;\n }\n }\n });\n\n // Property: Number of subject changes should be reasonable\n const totalLessons = lessons.length;\n const changeRatio = subjectChanges / Math.max(totalLessons - 1, 1);\n\n // Should not switch subjects more than 70% of the time\n return changeRatio <= 0.7;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/lesson-plan-scheduling.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The schedule optimization minimizes context switching by ensuring the ratio of subject changes does not exceed 70% within daily lesson plans.", "mode": "fast-check"} {"id": 60300, "name": "unknown", "code": "it('should maintain valid elementary grade ranges', () => {\n fc.assert(\n fc.property(domainArbitraries.grade, (grade) => {\n // Property: All grades should be within elementary range (1-8)\n return grade >= 1 && grade <= 8;\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/grade-progression-logic.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Grades should always be within the elementary range of 1 to 8.", "mode": "fast-check"} {"id": 55263, "name": "unknown", "code": "test('onChange callback has called on set new value', () => {\n fc.assert(\n fc.property(recordWithNewValueArbitrary, ([record, value]) => {\n const onChangeSpy = jest.fn()\n const { result } = renderHook(() => useRecordRoot(TestContext, record, onChangeSpy))\n const updater = result.current[1].value[1]\n\n Object.keys(record).forEach((key) => {\n updater(key, jest.fn().mockReturnValue(value))\n })\n\n expect(onChangeSpy.mock.calls.length).toBe(Object.keys(record).length)\n })\n )\n})", "language": "typescript", "source_file": "./repos/best-doctor/ke/src/django-spa/cdk/ContextTree/RecordRoot.hook.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "best-doctor/ke", "url": "https://github.com/best-doctor/ke.git", "license": "MIT", "stars": 17, "forks": 7}, "metrics": null, "summary": "The `onChange` callback should be called once for each key when a new value is set in the record.", "mode": "fast-check"} {"id": 60301, "name": "unknown", "code": "it('should ensure grade progression ordering', () => {\n fc.assert(\n fc.property(fc.array(domainArbitraries.grade, { minLength: 3, maxLength: 8 }), (grades) => {\n // Property: Grades should follow natural ordering\n const sortedGrades = [...grades].sort((a, b) => a - b);\n\n for (let i = 1; i < sortedGrades.length; i++) {\n if (sortedGrades[i] < sortedGrades[i - 1]) {\n return false;\n }\n }\n\n return true;\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/grade-progression-logic.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Grades in an array should follow natural ascending order after sorting.", "mode": "fast-check"} {"id": 55264, "name": "unknown", "code": "test('Retrieve correct value from context by key', () => {\n fc.assert(\n fc.property(keyArbitrary, fc.anything(), (key, value) => {\n const getterSpy = jest.fn().mockReturnValue(value)\n const { result } = renderHook(() => useLeaf(TestContext, key), {\n wrapper: ({ children }) => createElement(TestContext.Provider, { value: [getterSpy, jest.fn()] }, children),\n })\n\n expect(result.current[0]).toBe(value)\n expect(getterSpy.mock.calls[0]).toEqual([key])\n })\n )\n})", "language": "typescript", "source_file": "./repos/best-doctor/ke/src/django-spa/cdk/ContextTree/Leaf.hook.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "best-doctor/ke", "url": "https://github.com/best-doctor/ke.git", "license": "MIT", "stars": 17, "forks": 7}, "metrics": null, "summary": "`useLeaf` retrieves the correct value from the context using the given key.", "mode": "fast-check"} {"id": 60302, "name": "unknown", "code": "it('should maintain appropriate complexity for grade levels', () => {\n fc.assert(\n fc.property(domainArbitraries.curriculumProgression, (progression) => {\n // Property: Curriculum complexity should increase with grade level\n const { grade, complexity } = progression;\n\n switch (complexity) {\n case 'basic':\n return grade >= 1 && grade <= 3;\n case 'intermediate':\n return grade >= 4 && grade <= 6;\n case 'advanced':\n return grade >= 7 && grade <= 8;\n default:\n return false;\n }\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/grade-progression-logic.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Curriculum complexity should appropriately align with grade levels, ensuring basic complexity for grades 1-3, intermediate for grades 4-6, and advanced for grades 7-8.", "mode": "fast-check"} {"id": 60304, "name": "unknown", "code": "it('should ensure prerequisite knowledge progression', () => {\n fc.assert(\n fc.property(\n fc.tuple(domainArbitraries.grade, domainArbitraries.grade),\n ([lowerGrade, higherGrade]) => {\n // Property: Higher grades should build on lower grade concepts\n if (lowerGrade >= higherGrade) {\n return true; // Skip if not progressive\n }\n\n // Mock function to get complexity for a grade\n const getComplexityLevel = (grade: number): number => {\n if (grade <= 3) return 1; // Basic\n if (grade <= 6) return 2; // Intermediate\n return 3; // Advanced\n };\n\n const lowerComplexity = getComplexityLevel(lowerGrade);\n const higherComplexity = getComplexityLevel(higherGrade);\n\n return higherComplexity >= lowerComplexity;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/grade-progression-logic.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Higher grade complexity should be equal to or greater than lower grade complexity for proper knowledge progression.", "mode": "fast-check"} {"id": 60305, "name": "unknown", "code": "it('should match lesson duration to grade attention spans', () => {\n fc.assert(\n fc.property(\n domainArbitraries.grade,\n domainArbitraries.lessonDuration,\n (grade, duration) => {\n // Property: Lesson duration should match developmental attention spans\n const getMaxAttentionSpan = (gradeLevel: number): number => {\n // Rule of thumb: Grade level \u00d7 5-10 minutes\n if (gradeLevel <= 2) return 20; // 15-20 minutes max\n if (gradeLevel <= 4) return 40; // 30-40 minutes max\n if (gradeLevel <= 6) return 60; // 45-60 minutes max\n return 90; // Up to 90 minutes for older students\n };\n\n const maxDuration = getMaxAttentionSpan(grade);\n return duration <= maxDuration;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/grade-progression-logic.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Lesson durations should not exceed the maximum attention span associated with a given grade level.", "mode": "fast-check"} {"id": 60306, "name": "unknown", "code": "it('should ensure age-appropriate vocabulary complexity', () => {\n fc.assert(\n fc.property(domainArbitraries.fullCurriculumExpectation, (expectation) => {\n // Property: Vocabulary should be appropriate for grade level\n const { grade, description } = expectation;\n const words = description.toLowerCase().split(/\\s+/);\n\n // Count complex words (more than 7 characters as a simple heuristic)\n const complexWords = words.filter((word) => word.length > 7);\n const complexityRatio = complexWords.length / words.length;\n\n if (grade <= 3) {\n return complexityRatio <= 0.2; // Max 20% complex words\n } else if (grade <= 6) {\n return complexityRatio <= 0.4; // Max 40% complex words\n } else {\n return complexityRatio <= 0.6; // Max 60% complex words\n }\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/grade-progression-logic.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Vocabulary complexity in curriculum descriptions should be appropriate for the specified grade level, limiting the ratio of complex words based on grade.", "mode": "fast-check"} {"id": 55269, "name": "unknown", "code": "test('Updater from context throw error if key not exists in data', () => {\n fc.assert(\n fc.property(arrayWithInvalidKeyArbitrary, ([array, invalidKey]) => {\n const onChangeSpy = jest.fn().mockImplementation((cb: (prev: unknown[]) => void) => cb(array))\n const { result } = renderHook(() => useArrayRoot(TestContext, array, onChangeSpy, getKeyIndex))\n const updater = result.current[1].value[1]\n\n expect(() => updater(invalidKey, () => undefined)).toThrow(RangeError)\n })\n )\n})", "language": "typescript", "source_file": "./repos/best-doctor/ke/src/django-spa/cdk/ContextTree/ArrayRoot.hook.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "best-doctor/ke", "url": "https://github.com/best-doctor/ke.git", "license": "MIT", "stars": 17, "forks": 7}, "metrics": null, "summary": "An error is thrown by an updater function when a non-existent key is provided in the data.", "mode": "fast-check"} {"id": 60307, "name": "unknown", "code": "it('should ensure appropriate cognitive load distribution', () => {\n fc.assert(\n fc.property(\n domainArbitraries.grade,\n fc.array(domainArbitraries.activityType, { minLength: 1, maxLength: 5 }),\n (grade, activities) => {\n // Property: Cognitive load should be appropriate for grade level\n const cognitiveWeights = new Map([\n ['discussion', 2],\n ['hands-on', 1],\n ['investigation', 4],\n ['presentation', 3],\n ['game', 1],\n ['experiment', 4],\n ['reading', 2],\n ['writing', 3],\n ['problem-solving', 4],\n ['collaboration', 2],\n ]);\n\n const totalCognitiveLoad = activities.reduce(\n (sum, activity) => sum + (cognitiveWeights.get(activity) || 2),\n 0,\n );\n\n const averageLoad = totalCognitiveLoad / activities.length;\n\n if (grade <= 3) {\n return averageLoad <= 2.5; // Lower cognitive load\n } else if (grade <= 6) {\n return averageLoad <= 3.5; // Medium cognitive load\n } else {\n return averageLoad <= 4.0; // Higher cognitive load allowed\n }\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/grade-progression-logic.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The average cognitive load of activities should be appropriate for the specified grade level, with lower grades having lower allowable load.", "mode": "fast-check"} {"id": 55278, "name": "unknown", "code": "test(\"SShort fuzzing\", () => {\n fc.assert(\n fc.property(fc.integer({ min: MIN_I16, max: MAX_I16 }), (val) => {\n const serialized = SShort(val).toHex();\n expect(serialized).to.be.equal(Value$.ofShort(val).toHex()); // ensure compatibility with sigmastate-js\n expect(SConstant.from(serialized).data).to.be.equal(val);\n })\n );\n })", "language": "typescript", "source_file": "./repos/fleet-sdk/fleet/packages/serializer/src/sigmaConstant.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fleet-sdk/fleet", "url": "https://github.com/fleet-sdk/fleet.git", "license": "MIT", "stars": 37, "forks": 8}, "metrics": null, "summary": "The test ensures that a 16-bit integer, when processed through `SShort`, produces a serialized hex representation compatible with `Value$.ofShort`, and that `SConstant.from` can accurately deserialize it back to the original integer.", "mode": "fast-check"} {"id": 60308, "name": "unknown", "code": "it('should maintain mathematics concept progression', () => {\n fc.assert(\n fc.property(\n domainArbitraries.grade,\n domainArbitraries.curriculumStrand,\n (grade, strand) => {\n // Property: Mathematics concepts should follow developmental sequence\n const mathProgressionMap = new Map([\n [1, ['Number Sense']],\n [2, ['Number Sense', 'Measurement']],\n [3, ['Number Sense', 'Measurement', 'Geometry']],\n [4, ['Number Sense', 'Measurement', 'Geometry', 'Data Management']],\n [5, ['Number Sense', 'Measurement', 'Geometry', 'Data Management']],\n [6, ['Number Sense', 'Algebra', 'Measurement', 'Geometry', 'Data Management']],\n [7, ['Number Sense', 'Algebra', 'Measurement', 'Geometry', 'Data Management']],\n [8, ['Number Sense', 'Algebra', 'Measurement', 'Geometry', 'Data Management']],\n ]);\n\n const mathStrands = [\n 'Number Sense',\n 'Algebra',\n 'Geometry',\n 'Measurement',\n 'Data Management',\n ];\n\n if (!mathStrands.includes(strand)) {\n return true; // Not a math strand, skip validation\n }\n\n const gradeStrands = mathProgressionMap.get(grade) || [];\n return gradeStrands.includes(strand);\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/grade-progression-logic.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Mathematics concepts should be presented in a developmental sequence appropriate for each grade level, ensuring that each strand is associated with the correct grade.", "mode": "fast-check"} {"id": 60310, "name": "unknown", "code": "it('should distribute assessment types appropriately by grade', () => {\n fc.assert(\n fc.property(\n domainArbitraries.grade,\n domainArbitraries.assessmentDistribution,\n (grade, distribution) => {\n // Property: Assessment distribution should match developmental needs\n const { diagnostic, formative, summative, total } = distribution;\n\n const formativeRatio = formative / total;\n const summativeRatio = summative / total;\n\n if (grade <= 3) {\n // Lower grades: More formative, less summative\n return formativeRatio >= 0.6 && summativeRatio <= 0.3;\n } else if (grade <= 6) {\n // Middle grades: Balanced approach\n return formativeRatio >= 0.5 && summativeRatio <= 0.4;\n } else {\n // Upper grades: More summative assessment preparation\n return formativeRatio >= 0.4 && summativeRatio <= 0.5;\n }\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/grade-progression-logic.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Distribution of assessment types must align with developmental needs by grade level: lower grades emphasize formative, middle grades are balanced, and upper grades focus more on summative assessments.", "mode": "fast-check"} {"id": 55282, "name": "unknown", "code": "test(\"Round-trip fuzzing\", () => {\n fc.assert(\n fc.property(fc.integer({ min: MIN_I32, max: MAX_I32 }), (n) => {\n expect(zigZag32.decode(zigZag32.encode(n))).to.be.equal(n);\n })\n );\n })", "language": "typescript", "source_file": "./repos/fleet-sdk/fleet/packages/serializer/src/coders/zigZag.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fleet-sdk/fleet", "url": "https://github.com/fleet-sdk/fleet.git", "license": "MIT", "stars": 37, "forks": 8}, "metrics": null, "summary": "Encoding and then decoding an integer using `zigZag32` should return the original integer.", "mode": "fast-check"} {"id": 60311, "name": "unknown", "code": "it('should ensure appropriate assessment frequency', () => {\n fc.assert(\n fc.property(\n domainArbitraries.grade,\n fc.integer({ min: 1, max: 20 }), // weeks in a term\n (grade, weeksInTerm) => {\n // Property: Assessment frequency should match grade level needs\n const getMinFormativeAssessments = (gradeLevel: number, weeks: number): number => {\n if (gradeLevel <= 3) return weeks * 2; // 2 per week minimum\n if (gradeLevel <= 6) return Math.floor(weeks * 1.5); // 1.5 per week\n return weeks; // 1 per week minimum\n };\n\n const getMaxSummativeAssessments = (gradeLevel: number, weeks: number): number => {\n if (gradeLevel <= 3) return Math.ceil(weeks / 4); // 1 per 4 weeks max\n if (gradeLevel <= 6) return Math.ceil(weeks / 3); // 1 per 3 weeks max\n return Math.ceil(weeks / 2); // 1 per 2 weeks max\n };\n\n const minFormative = getMinFormativeAssessments(grade, weeksInTerm);\n const maxSummative = getMaxSummativeAssessments(grade, weeksInTerm);\n\n // Properties should be within reasonable bounds\n return minFormative > 0 && maxSummative > 0 && minFormative >= maxSummative;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/grade-progression-logic.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures that the minimum number of formative assessments and the maximum number of summative assessments per term align with the defined needs based on grade level, with the constraint that formative assessments are more frequent than summative assessments.", "mode": "fast-check"} {"id": 60312, "name": "unknown", "code": "it('should introduce learning skills age-appropriately', () => {\n fc.assert(\n fc.property(domainArbitraries.grade, domainArbitraries.learningSkill, (grade, skill) => {\n // Property: Learning skills should be introduced when developmentally appropriate\n const skillIntroductionGrades = new Map([\n ['responsibility', 1],\n ['organization', 2],\n ['independent work', 3],\n ['collaboration', 1],\n ['initiative', 4],\n ['self-regulation', 5],\n ]);\n\n const introductionGrade = skillIntroductionGrades.get(skill) || 1;\n return grade >= introductionGrade;\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/grade-progression-logic.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Learning skills should be introduced at an age-appropriate grade level, according to predefined criteria.", "mode": "fast-check"} {"id": 55291, "name": "unknown", "code": "bench(\"should never throw\", async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.string({ unit: \"grapheme-composite\" }),\n async (input) => {\n expect(await parse(input)).toBeTruthy();\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/jasikpark/astro-svg-loader/src/components/Svg/overrideSvgAttributes.bench.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "jasikpark/astro-svg-loader", "url": "https://github.com/jasikpark/astro-svg-loader.git", "license": "MIT", "stars": 23, "forks": 5}, "metrics": null, "summary": "The `parse` function should never throw an error for any grapheme-composite string input, always returning a truthy value.", "mode": "fast-check"} {"id": 55292, "name": "unknown", "code": "test(\"at-first\", (t) => {\n fc.assert(\n fc.property(\n fc.array(\n fc.nat().map((v) => v * 2 ** -32),\n { minLength: 10 }\n ),\n (values) => {\n const treeList = AvlList.empty()\n const expected: number[] = []\n\n values.sort()\n values.forEach((val) => {\n const index = asU32Between(0, treeList.length + 1, val)\n treeList.insert(index, val)\n expected.splice(index, 0, val)\n })\n\n const built: number[] = []\n for (const v of treeList) {\n built.push(v)\n }\n\n t.deepEqual(built, expected)\n }\n )\n )\n})", "language": "typescript", "source_file": "./repos/Conaclos/cow-list/src/avl/bin-tree-iterator.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Conaclos/cow-list", "url": "https://github.com/Conaclos/cow-list.git", "license": "Apache-2.0", "stars": 4, "forks": 1}, "metrics": null, "summary": "An `AvlList` constructed with sorted, inserted values should yield the same sequence when iterated as the expected order.", "mode": "fast-check"} {"id": 60314, "name": "unknown", "code": "it('should ensure smooth grade-to-grade transitions', () => {\n fc.assert(\n fc.property(\n fc.tuple(domainArbitraries.grade, domainArbitraries.grade),\n fc.array(domainArbitraries.curriculumCode, { minLength: 3, maxLength: 10 }),\n ([fromGrade, toGrade], expectations) => {\n // Property: Grade transitions should have concept overlap\n if (Math.abs(toGrade - fromGrade) !== 1) {\n return true; // Only test adjacent grades\n }\n\n if (fromGrade >= toGrade) {\n return true; // Only test upward progression\n }\n\n // Mock function to get concept difficulty\n const getConceptDifficulty = (code: string, grade: number): number => {\n const baseCode = code.charAt(0);\n const level = parseInt(code.charAt(1));\n return (baseCode.charCodeAt(0) - 65) * 5 + level + grade;\n };\n\n const fromGradeConcepts = expectations.map((code) =>\n getConceptDifficulty(code, fromGrade),\n );\n const toGradeConcepts = expectations.map((code) => getConceptDifficulty(code, toGrade));\n\n // Should have some overlap in concept difficulty ranges\n const fromMax = Math.max(...fromGradeConcepts);\n const toMin = Math.min(...toGradeConcepts);\n\n return fromMax >= toMin; // Some overlap exists\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/grade-progression-logic.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Grade-to-grade transitions should exhibit overlapping concept difficulties for adjacent, upward progression.", "mode": "fast-check"} {"id": 60315, "name": "unknown", "code": "it('should provide appropriate scaffolding reduction', () => {\n fc.assert(\n fc.property(\n domainArbitraries.grade,\n fc.integer({ min: 1, max: 10 }), // scaffolding level\n (grade, scaffoldingLevel) => {\n // Property: Scaffolding should decrease as grade increases\n const maxScaffoldingForGrade = (gradeLevel: number): number => {\n if (gradeLevel <= 2) return 10; // High scaffolding\n if (gradeLevel <= 4) return 7; // Medium scaffolding\n if (gradeLevel <= 6) return 5; // Reduced scaffolding\n return 3; // Minimal scaffolding\n };\n\n const maxScaffolding = maxScaffoldingForGrade(grade);\n return scaffoldingLevel <= maxScaffolding;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/grade-progression-logic.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Scaffolding should decrease as grade level increases, ensuring the scaffolding level is within the expected maximum for each grade.", "mode": "fast-check"} {"id": 55294, "name": "unknown", "code": "it('can open or close', () => {\n const g = new Goma1015()\n //check definition\n expect(g.open).toBeDefined()\n expect(g.close).toBeDefined()\n expect(g.state).toBeDefined()\n\n //default is close\n expect(g.state() === State.OFF_CLOSE).toBe(true)\n\n //property based testing for open/close\n fc.assert(\n fc.property(fc.boolean(), b => {\n if (b) {\n g.open()\n expect(g.state() === State.OFF_OPEN).toBe(true)\n return\n }\n g.close()\n expect(g.state() === State.OFF_CLOSE).toBe(true)\n }),\n )\n })", "language": "typescript", "source_file": "./repos/freddiefujiwara/goma-1015/__tests__/lib/index.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "freddiefujiwara/goma-1015", "url": "https://github.com/freddiefujiwara/goma-1015.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "The `Goma1015` instance should transition between `OFF_OPEN` and `OFF_CLOSE` states based on the `open` and `close` calls.", "mode": "fast-check"} {"id": 60316, "name": "unknown", "code": "it('should handle split-grade curriculum alignment', () => {\n fc.assert(\n fc.property(\n fc.tuple(domainArbitraries.grade, domainArbitraries.grade),\n domainArbitraries.subject,\n ([grade1, grade2], subject) => {\n // Property: Split grades should have feasible curriculum overlap\n if (grade1 === grade2) {\n return true; // Single grade, no split\n }\n\n const [lowerGrade, higherGrade] = grade1 < grade2 ? [grade1, grade2] : [grade2, grade1];\n const gradeGap = higherGrade - lowerGrade;\n\n // Split grades should be adjacent or at most 2 grades apart\n if (gradeGap > 2) {\n return false; // Too wide a gap for effective split-grade teaching\n }\n\n // Core subjects can handle 1-2 grade splits better than others\n const coreSubjects = ['Mathematics', 'Language Arts'];\n if (coreSubjects.includes(subject)) {\n return gradeGap <= 2;\n } else {\n return gradeGap <= 1;\n }\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/grade-progression-logic.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Split-grade curriculum should have a feasible overlap, with core subjects accommodating up to a 2-grade gap and other subjects accommodating up to a 1-grade gap.", "mode": "fast-check"} {"id": 60320, "name": "unknown", "code": "it('should show increasing complexity trends across grades', () => {\n fc.assert(\n fc.property(\n fc.array(domainArbitraries.curriculumProgression, { minLength: 20, maxLength: 50 }),\n (progressions) => {\n // Property: Average complexity should increase with grade level\n const gradeGroups = new Map();\n\n progressions.forEach((prog) => {\n if (!gradeGroups.has(prog.grade)) {\n gradeGroups.set(prog.grade, []);\n }\n gradeGroups.get(prog.grade)!.push(prog.complexity);\n });\n\n const gradeComplexityAverages = new Map();\n\n for (const [grade, complexities] of gradeGroups) {\n const complexityScores = complexities.map((c) => {\n switch (c) {\n case 'basic':\n return 1;\n case 'intermediate':\n return 2;\n case 'advanced':\n return 3;\n default:\n return 1;\n }\n });\n\n const average =\n complexityScores.reduce((sum, score) => sum + score, 0) / complexityScores.length;\n gradeComplexityAverages.set(grade, average);\n }\n\n // Check if complexity generally increases with grade\n const grades = Array.from(gradeComplexityAverages.keys()).sort((a, b) => a - b);\n\n if (grades.length < 3) return true; // Need at least 3 grades to test trend\n\n let increasingTrend = 0;\n for (let i = 1; i < grades.length; i++) {\n const prevAvg = gradeComplexityAverages.get(grades[i - 1])!;\n const currAvg = gradeComplexityAverages.get(grades[i])!;\n\n if (currAvg >= prevAvg) {\n increasingTrend++;\n }\n }\n\n // At least 70% of transitions should show increasing complexity\n const trendRatio = increasingTrend / (grades.length - 1);\n return trendRatio >= 0.7;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/grade-progression-logic.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Average complexity should generally increase with grade level, with at least 70% of grade transitions showing an increase in complexity.", "mode": "fast-check"} {"id": 60323, "name": "unknown", "code": "it('should maintain curriculum expectation integrity', () => {\n fc.assert(\n fc.property(domainArbitraries.fullCurriculumExpectation, (expectation) => {\n // Invariant: Curriculum expectations must satisfy business rules\n const hasValidId = expectation.id && expectation.id.length > 0;\n const hasValidCode = /^[A-E][1-5]\\.[1-9]|10$/.test(expectation.code);\n const hasValidGrade = expectation.grade >= 1 && expectation.grade <= 8;\n const hasValidDescription = expectation.description.trim().length > 0;\n const hasValidStrand = expectation.strand.trim().length > 0;\n const hasValidSubject = expectation.subject.trim().length > 0;\n\n // Bilingual consistency\n const bilingualConsistent =\n !expectation.descriptionFr || expectation.descriptionFr.trim().length > 0;\n\n return (\n hasValidId &&\n hasValidCode &&\n hasValidGrade &&\n hasValidDescription &&\n hasValidStrand &&\n hasValidSubject &&\n bilingualConsistent\n );\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/invariants/data-model-invariants.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Curriculum expectations must satisfy rules regarding valid ID, code, grade, description, strand, subject, and bilingual consistency.", "mode": "fast-check"} {"id": 55297, "name": "unknown", "code": "it('should detect potential issues with the Goma1015', () =>\n fc.assert(\n fc.property(Goma1015Commands, commands => {\n const real = new Goma1015()\n const model = new Goma1015Model()\n fc.modelRun(() => ({ model, real }), commands)\n }),\n ))", "language": "typescript", "source_file": "./repos/freddiefujiwara/goma-1015/__tests__/lib/index.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "freddiefujiwara/goma-1015", "url": "https://github.com/freddiefujiwara/goma-1015.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "The test checks whether executing a sequence of `Goma1015Commands` on both a `Goma1015` instance and a `Goma1015Model` maintains consistent behavior between the real and model instances.", "mode": "fast-check"} {"id": 55298, "name": "unknown", "code": "test(\"Property-based testing (fast-check)\", () => {\n type Boundaries = {\n min: number;\n max: number;\n };\n\n const minmax =\n ({ min, max }: Boundaries) =>\n (n: number): number =>\n Math.min(max, Math.max(min, n));\n\n fc.assert(\n fc.property(fc.integer(), (n): boolean => {\n const result = minmax({ min: 1, max: 10 })(n);\n return 1 <= result && result <= 10;\n })\n );\n})", "language": "typescript", "source_file": "./repos/mathieueveillard/js-kata-starter/src/index.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mathieueveillard/js-kata-starter", "url": "https://github.com/mathieueveillard/js-kata-starter.git", "license": "MIT", "stars": 16, "forks": 138}, "metrics": null, "summary": "The function `minmax` restricts an integer to a specified range, ensuring the output is between 1 and 10.", "mode": "fast-check"} {"id": 60324, "name": "unknown", "code": "it('should maintain curriculum code uniqueness', () => {\n fc.assert(\n fc.property(\n fc.array(domainArbitraries.curriculumCode, { minLength: 10, maxLength: 50 }),\n (codes) => {\n // Invariant: Curriculum codes should be unique within a subject/grade\n const codeFrequency = new Map();\n\n codes.forEach((code) => {\n codeFrequency.set(code, (codeFrequency.get(code) || 0) + 1);\n });\n\n // Check for duplicates\n const hasDuplicates = Array.from(codeFrequency.values()).some((count) => count > 1);\n\n // Property: We can detect uniqueness violations\n return typeof hasDuplicates === 'boolean';\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/invariants/data-model-invariants.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Curriculum codes should be unique within a subject/grade, with the test ensuring the ability to detect violations of uniqueness.", "mode": "fast-check"} {"id": 55305, "name": "unknown", "code": "it('calculates dice maximum correctly', () => {\n fc.assert(\n fc.property(\n // count\n fc.integer({ min: 1, max: 1000000 }),\n // sides\n fc.integer({ min: 1, max: 1000000 }),\n (sides, count) => {\n const dice = new SimpleDiceGroup(sides, count);\n\n expect(dice.statProps.max).toBe(count * sides);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/Curlyfries13/dice-goblin/src/SimpleDiceGroup.fuzz.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Curlyfries13/dice-goblin", "url": "https://github.com/Curlyfries13/dice-goblin.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`SimpleDiceGroup` calculates the maximum possible sum correctly for dice groups given the number of sides and count.", "mode": "fast-check"} {"id": 60326, "name": "unknown", "code": "it('should maintain unit plan temporal consistency', () => {\n fc.assert(\n fc.property(domainArbitraries.unitPlan, (unitPlan) => {\n // Invariant: Unit plans must have valid temporal relationships\n const hasValidDates = unitPlan.startDate < unitPlan.endDate;\n const hasPositiveDuration = unitPlan.estimatedHours > 0;\n\n // Duration should be reasonable for the time period\n const durationMs = unitPlan.endDate.getTime() - unitPlan.startDate.getTime();\n const durationDays = durationMs / (1000 * 60 * 60 * 24);\n const reasonableDuration = durationDays >= 5 && durationDays <= 60; // 5 days to 2 months\n\n return hasValidDates && hasPositiveDuration && reasonableDuration;\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/invariants/data-model-invariants.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Unit plans must have valid temporal relationships, including start and end dates, positive estimated hours, and a reasonable duration between 5 and 60 days.", "mode": "fast-check"} {"id": 60327, "name": "unknown", "code": "it('should maintain unit plan content integrity', () => {\n fc.assert(\n fc.property(domainArbitraries.unitPlan, (unitPlan) => {\n // Invariant: Unit plans must have meaningful content\n const hasValidTitle = unitPlan.title.trim().length > 0;\n const hasValidGrade = unitPlan.grade >= 1 && unitPlan.grade <= 8;\n const hasValidSubject = unitPlan.subject.trim().length > 0;\n\n return hasValidTitle && hasValidGrade && hasValidSubject;\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/invariants/data-model-invariants.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Unit plans should have a non-empty title, a grade within the range of 1 to 8, and a non-empty subject.", "mode": "fast-check"} {"id": 60328, "name": "unknown", "code": "it('should maintain lesson plan structure integrity', () => {\n fc.assert(\n fc.property(domainArbitraries.fullLessonPlan, (lessonPlan) => {\n // Invariant: Lesson plans must have valid structure\n const hasValidId = lessonPlan.id && lessonPlan.id.length > 0;\n const hasValidTitle = lessonPlan.title.trim().length > 0;\n const hasValidDuration = lessonPlan.duration >= 15 && lessonPlan.duration <= 120;\n const hasValidGrade = lessonPlan.grade >= 1 && lessonPlan.grade <= 8;\n const hasValidSubject = lessonPlan.subject.trim().length > 0;\n\n // Three-part lesson structure (ETFO requirement)\n const hasValidStructure =\n lessonPlan.mindsOn.trim().length > 0 &&\n lessonPlan.action.trim().length > 0 &&\n lessonPlan.consolidation.trim().length > 0;\n\n return (\n hasValidId &&\n hasValidTitle &&\n hasValidDuration &&\n hasValidGrade &&\n hasValidSubject &&\n hasValidStructure\n );\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/invariants/data-model-invariants.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Lesson plans must have a valid ID, title, duration, grade, subject, and a three-part structure.", "mode": "fast-check"} {"id": 60330, "name": "unknown", "code": "it('should maintain daybook entry reflection structure', () => {\n fc.assert(\n fc.property(domainArbitraries.daybookEntry, (entry) => {\n // Invariant: Daybook entries must have valid reflection data\n const hasValidId = entry.id && entry.id.length > 0;\n const hasValidDate = entry.date instanceof Date && !isNaN(entry.date.getTime());\n const hasValidRating =\n !entry.overallRating || (entry.overallRating >= 1 && entry.overallRating <= 5);\n const hasValidReusability =\n entry.wouldReuseLesson === undefined || typeof entry.wouldReuseLesson === 'boolean';\n\n return hasValidId && hasValidDate && hasValidRating && hasValidReusability;\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/invariants/data-model-invariants.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Daybook entries must have non-empty IDs, valid dates, optional ratings between 1 and 5, and an optional boolean for lesson reusability.", "mode": "fast-check"} {"id": 55310, "name": "unknown", "code": "it('parses fudge dice', () => {\n fc.assert(\n fc.property(\n // number of dice\n fc.integer({ min: 1, max: 1000000 }),\n (n) => {\n const parseText = `${n}dF`;\n const parseResult = parse(parseText);\n expect(parseResult.lexErrors).toHaveLength(0);\n expect(parseResult.parseErrors).toHaveLength(0);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/Curlyfries13/dice-goblin/src/Parser/Parser.fuzz.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Curlyfries13/dice-goblin", "url": "https://github.com/Curlyfries13/dice-goblin.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Parsing a string representing fudge dice results in no lexical or parse errors.", "mode": "fast-check"} {"id": 60331, "name": "unknown", "code": "it('should maintain calendar event temporal constraints', () => {\n fc.assert(\n fc.property(\n fc.record({\n id: fc.integer({ min: 1, max: 1000000 }),\n title: fc.string({ minLength: 1, maxLength: 100 }),\n start: fc.date(),\n end: fc.date(),\n allDay: fc.boolean(),\n eventType: fc.constantFrom('PD_DAY', 'ASSEMBLY', 'TRIP', 'HOLIDAY', 'CUSTOM'),\n }),\n (event) => {\n // Invariant: Calendar events must have valid temporal relationships\n const hasValidId = event.id > 0;\n const hasValidTitle = event.title.trim().length > 0;\n const hasValidTimeOrder = event.start <= event.end;\n\n // All-day events should span at least one day\n const validAllDay =\n !event.allDay || event.end.getTime() - event.start.getTime() >= 24 * 60 * 60 * 1000;\n\n return hasValidId && hasValidTitle && hasValidTimeOrder && validAllDay;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/invariants/data-model-invariants.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Calendar events must have a valid ID, non-empty title, correctly ordered start and end times, and if marked as all-day, must span at least one day.", "mode": "fast-check"} {"id": 55311, "name": "unknown", "code": "it('parses simple dice expressions', () => {\n fc.assert(\n fc.property(\n // number of dice\n fc.integer({ min: 1, max: 1000000 }),\n // number of sides\n fc.integer({ min: 1, max: 1000000 }),\n // modifier value3\n fc.integer({ min: 1, max: 1000000 }),\n // modifier function\n fc.integer({ min: 0, max: 3 }).map((v) => {\n if (v === 0) {\n return '+';\n }\n if (v === 1) {\n return '-';\n }\n if (v === 2) {\n return '*';\n }\n // default 3... why not switch\n return '/';\n }),\n (n, s, m, f) => {\n const parseText = `${n}d${s}${f}${m}`;\n const parseResult = parse(parseText);\n expect(parseResult.lexErrors).toHaveLength(0);\n expect(parseResult.parseErrors).toHaveLength(0);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/Curlyfries13/dice-goblin/src/Parser/Parser.fuzz.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Curlyfries13/dice-goblin", "url": "https://github.com/Curlyfries13/dice-goblin.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Parses dice expressions consisting of a number of dice, sides, and a modifier without producing lexing or parsing errors.", "mode": "fast-check"} {"id": 60332, "name": "unknown", "code": "it('should maintain parent-child relationships', () => {\n fc.assert(\n fc.property(\n fc.record({\n longRangePlan: domainArbitraries.longRangePlan,\n unitPlans: fc.array(domainArbitraries.unitPlan, { minLength: 1, maxLength: 5 }),\n }),\n (planHierarchy) => {\n // Invariant: Child records must reference valid parent\n const { longRangePlan, unitPlans } = planHierarchy;\n\n // All unit plans should reference the long range plan\n const validReferences = unitPlans.every((unit) => {\n // In real system, unit.longRangePlanId would equal longRangePlan.id\n // Here we check subject/grade consistency as a proxy\n return unit.subject === longRangePlan.subject && unit.grade === longRangePlan.grade;\n });\n\n return validReferences;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/invariants/data-model-invariants.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Unit plans should reference a long range plan with consistent subject and grade.", "mode": "fast-check"} {"id": 60333, "name": "unknown", "code": "it('should maintain curriculum expectation relationships', () => {\n fc.assert(\n fc.property(\n fc.record({\n expectation: domainArbitraries.fullCurriculumExpectation,\n lessonPlans: fc.array(domainArbitraries.fullLessonPlan, { minLength: 1, maxLength: 3 }),\n }),\n (relationship) => {\n // Invariant: Lesson plans should align with curriculum expectations\n const { expectation, lessonPlans } = relationship;\n\n const validAlignment = lessonPlans.every(\n (lesson) =>\n lesson.grade === expectation.grade && lesson.subject === expectation.subject,\n );\n\n return validAlignment;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/invariants/data-model-invariants.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Lesson plans align with curriculum expectations by matching both grade and subject.", "mode": "fast-check"} {"id": 60334, "name": "unknown", "code": "it('should enforce teacher workload limits', () => {\n fc.assert(\n fc.property(\n fc.record({\n teacherId: fc.integer({ min: 1, max: 1000 }),\n dailyLessons: fc.array(domainArbitraries.fullLessonPlan, {\n minLength: 1,\n maxLength: 10,\n }),\n }),\n (teacherDay) => {\n // Invariant: Teachers should not be overloaded\n const { dailyLessons } = teacherDay;\n\n // Same day lessons\n const sameDay = dailyLessons.filter(\n (lesson) => lesson.date.toDateString() === dailyLessons[0].date.toDateString(),\n );\n\n const totalDuration = sameDay.reduce((sum, lesson) => sum + lesson.duration, 0);\n const maxDailyMinutes = 7 * 60; // 7 hours maximum\n\n return totalDuration <= maxDailyMinutes;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/invariants/data-model-invariants.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Teachers should not exceed seven hours of lessons in a single day.", "mode": "fast-check"} {"id": 60335, "name": "unknown", "code": "it('should maintain assessment balance requirements', () => {\n fc.assert(\n fc.property(\n fc.array(domainArbitraries.fullLessonPlan, { minLength: 10, maxLength: 20 }),\n (unitLessons) => {\n // Invariant: Assessment should be balanced across a unit\n const assessmentCounts = new Map();\n\n unitLessons.forEach((lesson) => {\n const type = lesson.assessmentType;\n assessmentCounts.set(type, (assessmentCounts.get(type) || 0) + 1);\n });\n\n const formativeCount = assessmentCounts.get('formative') || 0;\n const summativeCount = assessmentCounts.get('summative') || 0;\n const total = formativeCount + summativeCount;\n\n if (total === 0) return true; // No assessments\n\n const formativeRatio = formativeCount / total;\n\n // Should have more formative than summative assessments\n return formativeRatio >= 0.6;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/invariants/data-model-invariants.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures that within a unit of lessons, the ratio of formative assessments is at least 60% if any assessments are present.", "mode": "fast-check"} {"id": 60336, "name": "unknown", "code": "it('should enforce grade-appropriate content complexity', () => {\n fc.assert(\n fc.property(domainArbitraries.fullLessonPlan, (lessonPlan) => {\n // Invariant: Content complexity should match grade level\n const { grade, action } = lessonPlan;\n\n // Simple complexity heuristic based on text length and vocabulary\n const words = action.split(/\\s+/);\n const averageWordLength =\n words.reduce((sum, word) => sum + word.length, 0) / words.length;\n\n if (grade <= 3) {\n return averageWordLength <= 6; // Simpler vocabulary\n } else if (grade <= 6) {\n return averageWordLength <= 8; // Moderate vocabulary\n } else {\n return averageWordLength <= 10; // More complex vocabulary\n }\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/invariants/data-model-invariants.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Content complexity in lesson plans should correspond to the appropriate grade level based on average word length.", "mode": "fast-check"} {"id": 55316, "name": "unknown", "code": "it('Drops fudge dice', () => {\n fc.assert(\n fc.property(\n // count & drop: these are dependent\n // we shouldn't be testing if we can drop more than the count - that should be an error\n fc\n .integer({ min: 1, max: 1000000 })\n .chain((count) => fc.tuple(fc.constant(count), fc.nat({ max: count }))),\n // drop mode\n fc.boolean(),\n (countDrop, lowHigh) => {\n const dropGen = new Constant(countDrop[1]);\n const baseDice = new FudgeDiceGroup(countDrop[0]);\n const drop = new Drop(baseDice, dropGen, lowHigh ? KeepDropMode.Low : KeepDropMode.High);\n expect(drop.currentCount).toBe(baseDice.currentCount - dropGen.value());\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/Curlyfries13/dice-goblin/src/Modifiers/Drop.fuzz.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Curlyfries13/dice-goblin", "url": "https://github.com/Curlyfries13/dice-goblin.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Dropping a specific number of fudge dice should result in the `currentCount` reflecting the correct number of dice removed from the original group.", "mode": "fast-check"} {"id": 55318, "name": "unknown", "code": "it('generates stat blocks as expected', () => {\n fc.assert(\n fc.property(fc.integer(), fc.integer(), (valA, valB) => {\n const termA = new Constant(valA);\n const termB = new Constant(valB);\n const combination = new Add(termA, termB);\n expect(combination.statProps.min).toBe(valA + valB);\n expect(combination.statProps.max).toBe(valA + valB);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/Curlyfries13/dice-goblin/src/Combinators/Add.fuzz.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Curlyfries13/dice-goblin", "url": "https://github.com/Curlyfries13/dice-goblin.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Adding two constant terms results in a `statProps` object where both `min` and `max` are equal to the sum of the two values.", "mode": "fast-check"} {"id": 60337, "name": "unknown", "code": "it('should maintain timestamp consistency', () => {\n fc.assert(\n fc.property(\n fc.record({\n createdAt: fc.date({ min: new Date('2020-01-01') }),\n updatedAt: fc.date({ min: new Date('2020-01-01') }),\n }),\n (timestamps) => {\n // Invariant: Updated timestamp should not precede created timestamp\n return timestamps.updatedAt >= timestamps.createdAt;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/invariants/data-model-invariants.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures that the `updatedAt` timestamp does not precede the `createdAt` timestamp.", "mode": "fast-check"} {"id": 60338, "name": "unknown", "code": "it('should maintain enumeration value consistency', () => {\n fc.assert(\n fc.property(\n fc.record({\n assessmentType: domainArbitraries.assessmentType,\n achievementLevel: domainArbitraries.achievementLevel,\n userRole: domainArbitraries.userRole,\n }),\n (enums) => {\n // Invariant: Enumeration values should be from valid sets\n const validAssessmentTypes = ['diagnostic', 'formative', 'summative'];\n const validAchievementLevels = ['Level 1', 'Level 2', 'Level 3', 'Level 4'];\n const validUserRoles = ['teacher', 'administrator', 'substitute'];\n\n return (\n validAssessmentTypes.includes(enums.assessmentType) &&\n validAchievementLevels.includes(enums.achievementLevel) &&\n validUserRoles.includes(enums.userRole)\n );\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/invariants/data-model-invariants.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Enumeration values for `assessmentType`, `achievementLevel`, and `userRole` should belong to specified valid sets.", "mode": "fast-check"} {"id": 60339, "name": "unknown", "code": "it('should maintain data integrity through JSON serialization', () => {\n fc.assert(\n fc.property(domainArbitraries.fullCurriculumExpectation, (expectation) => {\n // Invariant: Data should survive JSON roundtrip\n const serialized = JSON.stringify(expectation);\n const deserialized = JSON.parse(serialized);\n\n return (\n expectation.id === deserialized.id &&\n expectation.code === deserialized.code &&\n expectation.grade === deserialized.grade &&\n expectation.subject === deserialized.subject\n );\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/invariants/data-model-invariants.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Ensures data integrity of `expectation` objects is maintained through JSON serialization and deserialization, verifying `id`, `code`, `grade`, and `subject` remain unchanged.", "mode": "fast-check"} {"id": 60340, "name": "unknown", "code": "it('should handle date serialization correctly', () => {\n fc.assert(\n fc.property(domainArbitraries.fullLessonPlan, (lessonPlan) => {\n // Invariant: Dates should serialize/deserialize correctly\n const serialized = JSON.stringify({\n ...lessonPlan,\n date: lessonPlan.date.toISOString(),\n });\n\n const deserialized = JSON.parse(serialized);\n const reconstructedDate = new Date(deserialized.date);\n\n return reconstructedDate.getTime() === lessonPlan.date.getTime();\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/invariants/data-model-invariants.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Dates should serialize and deserialize without altering the original timestamp.", "mode": "fast-check"} {"id": 60341, "name": "unknown", "code": "it('should maintain reasonable data sizes', () => {\n fc.assert(\n fc.property(domainArbitraries.fullLessonPlan, (lessonPlan) => {\n // Invariant: Data structures should not exceed reasonable sizes\n const serialized = JSON.stringify(lessonPlan);\n const sizeInBytes = new Blob([serialized]).size;\n\n // Should not exceed 10KB per lesson plan\n return sizeInBytes <= 10 * 1024;\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/invariants/data-model-invariants.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The data structure for a lesson plan should not exceed 10KB when serialized.", "mode": "fast-check"} {"id": 60343, "name": "unknown", "code": "it('should validate input data constraints', () => {\n fc.assert(\n fc.property(\n fc.record({\n userInput: fc.string({ minLength: 0, maxLength: 10000 }),\n fieldType: fc.constantFrom('title', 'description', 'notes', 'content'),\n }),\n (input) => {\n // Invariant: User input should be validated and sanitized\n const validateInput = (text: string, type: string): boolean => {\n // Basic validation rules\n const maxLengths = {\n title: 200,\n description: 2000,\n notes: 5000,\n content: 10000,\n };\n\n const maxLength = maxLengths[type as keyof typeof maxLengths] || 1000;\n\n // Should not exceed length limits\n if (text.length > maxLength) return false;\n\n // Should not contain obviously malicious patterns (simplified)\n const suspiciousPatterns = ['\n lowerText.includes(pattern),\n );\n\n return !hasSuspiciousContent;\n };\n\n const isValid = validateInput(input.userInput, input.fieldType);\n\n // Should return a boolean validation result\n return typeof isValid === 'boolean';\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/invariants/data-model-invariants.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "User input for specified field types should be validated to ensure it doesn't exceed maximum length or contain suspicious patterns, returning a boolean validation result.", "mode": "fast-check"} {"id": 60344, "name": "unknown", "code": "it('should maintain valid elementary grade ranges', () => {\n fc.assert(\n fc.property(gradeArbitrary, (grade) => {\n // Property: All grades should be within elementary range (1-8)\n return grade >= 1 && grade <= 8;\n }),\n { numRuns: 100 },\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/curriculum-simple.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Grades should be within the elementary range of 1 to 8.", "mode": "fast-check"} {"id": 60346, "name": "unknown", "code": "it('should generate diverse curriculum codes', () => {\n fc.assert(\n fc.property(\n fc.array(curriculumCodeArbitrary, { minLength: 10, maxLength: 20 }),\n (codes) => {\n // Property: Should generate reasonably diverse codes\n const uniqueCodes = new Set(codes);\n const diversityRatio = uniqueCodes.size / codes.length;\n return diversityRatio > 0.5; // At least 50% unique\n },\n ),\n { numRuns: 50 },\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/curriculum-simple.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Generated curriculum codes should have at least 50% uniqueness.", "mode": "fast-check"} {"id": 60347, "name": "unknown", "code": "it('should maintain valid subject-grade combinations', () => {\n fc.assert(\n fc.property(fc.tuple(gradeArbitrary, subjectArbitrary), ([grade, subject]) => {\n // Property: All subject-grade combinations should be valid for elementary\n const validGradeRange = grade >= 1 && grade <= 8;\n const validSubject = [\n 'Mathematics',\n 'Language Arts',\n 'Science',\n 'Social Studies',\n ].includes(subject);\n\n return validGradeRange && validSubject;\n }),\n { numRuns: 100 },\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/curriculum-simple.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Subject-grade combinations must be valid, ensuring grades are between 1 and 8 and subjects are within the specified list for elementary education.", "mode": "fast-check"} {"id": 60348, "name": "unknown", "code": "it('should maintain curriculum expectation structure', () => {\n fc.assert(\n fc.property(\n fc.record({\n id: fc.uuid(),\n code: curriculumCodeArbitrary,\n description: fc.string({ minLength: 10, maxLength: 200 }),\n grade: gradeArbitrary,\n subject: subjectArbitrary,\n }),\n (expectation) => {\n // Property: All required fields should be present and valid\n const hasValidId = expectation.id.length > 0;\n const hasValidCode = /^[A-E][1-5]\\.[1-9]$|^[A-E][1-5]\\.10$/.test(expectation.code);\n const hasValidDescription = expectation.description.trim().length >= 10;\n const hasValidGrade = expectation.grade >= 1 && expectation.grade <= 8;\n const hasValidSubject = expectation.subject.length > 0;\n\n return (\n hasValidId && hasValidCode && hasValidDescription && hasValidGrade && hasValidSubject\n );\n },\n ),\n { numRuns: 50 },\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/curriculum-simple.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Curriculum expectations should have a valid structure with a non-empty UUID, a code matching the pattern, a description between 10 and 200 characters, a grade between 1 and 8, and a non-empty subject.", "mode": "fast-check"} {"id": 60349, "name": "unknown", "code": "it('should maintain grade ordering properties', () => {\n fc.assert(\n fc.property(fc.tuple(gradeArbitrary, gradeArbitrary), ([grade1, grade2]) => {\n // Property: Grade comparison should be transitive\n if (grade1 < grade2) {\n return grade1 !== grade2 && grade2 > grade1;\n } else if (grade1 > grade2) {\n return grade1 !== grade2 && grade1 > grade2;\n } else {\n return grade1 === grade2;\n }\n }),\n { numRuns: 100 },\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/curriculum-simple.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that the comparison of grades is transitive, ensuring consistent ordering between `grade1` and `grade2`.", "mode": "fast-check"} {"id": 60350, "name": "unknown", "code": "it('should handle curriculum code formatting consistently', () => {\n fc.assert(\n fc.property(curriculumCodeArbitrary, (code) => {\n // Property: Code formatting should be consistent\n const upperCased = code.toUpperCase();\n const lowerCased = code.toLowerCase();\n\n // Original should be uppercase (as generated)\n return code === upperCased && code !== lowerCased;\n }),\n { numRuns: 50 },\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/curriculum-simple.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Curriculum codes should be consistently uppercase, ensuring they match their uppercase conversion and differ from their lowercase conversion.", "mode": "fast-check"} {"id": 60351, "name": "unknown", "code": "it('should maintain consistent response structure', () => {\n fc.assert(\n fc.property(\n fc.record({\n success: fc.boolean(),\n data: fc.oneof(fc.object(), fc.array(fc.object()), fc.constant(null)),\n error: fc.option(fc.string()),\n timestamp: fc.date().map((d) => d.toISOString()),\n requestId: fc.uuid(),\n }),\n (response) => {\n // Property: API responses should follow consistent structure\n const hasRequiredFields =\n typeof response.success === 'boolean' && response.timestamp && response.requestId;\n\n // Success responses should have data, error responses should have error message\n const validSuccessResponse = !response.success || response.data !== null;\n const validErrorResponse = response.success || response.error;\n\n return hasRequiredFields && validSuccessResponse && validErrorResponse;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/api/api-contract.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "API responses should consistently contain boolean `success`, `timestamp`, and `requestId`, with `success` responses having non-null `data`, and non-`success` responses having an `error` message.", "mode": "fast-check"} {"id": 60352, "name": "unknown", "code": "it('should validate request payload structure', () => {\n fc.assert(\n fc.property(\n fc.record({\n method: fc.constantFrom('GET', 'POST', 'PUT', 'DELETE', 'PATCH'),\n endpoint: fc.string({ minLength: 1, maxLength: 100 }),\n headers: fc.dictionary(fc.string(), fc.string()),\n body: fc.option(fc.object()),\n query: fc.option(fc.dictionary(fc.string(), fc.string())),\n }),\n (request) => {\n // Property: Requests should have valid structure\n const hasValidMethod = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH'].includes(\n request.method,\n );\n const hasValidEndpoint = request.endpoint.length > 0;\n const hasValidHeaders = typeof request.headers === 'object';\n\n // GET requests should not have body\n const validGetRequest = request.method !== 'GET' || !request.body;\n\n // POST/PUT requests should have body for data operations\n const validDataRequest =\n !['POST', 'PUT', 'PATCH'].includes(request.method) || request.body !== null;\n\n return (\n hasValidMethod &&\n hasValidEndpoint &&\n hasValidHeaders &&\n validGetRequest &&\n validDataRequest\n );\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/api/api-contract.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The request payload structure must include a valid HTTP method, a non-empty endpoint, valid headers, no body for GET requests, and a body for POST, PUT, or PATCH requests when required.", "mode": "fast-check"} {"id": 60353, "name": "unknown", "code": "it('should handle curriculum expectation queries correctly', () => {\n fc.assert(\n fc.property(\n fc.record({\n grade: fc.option(domainArbitraries.grade),\n subject: fc.option(domainArbitraries.subject),\n strand: fc.option(domainArbitraries.curriculumStrand),\n limit: fc.option(fc.integer({ min: 1, max: 100 })),\n offset: fc.option(fc.integer({ min: 0, max: 1000 })),\n }),\n (query) => {\n // Property: Curriculum queries should produce valid filter criteria\n const mockCurriculumAPI = (params: typeof query) => {\n // Simulate API response structure\n const filters: Record = {};\n\n if (params.grade) filters.grade = params.grade;\n if (params.subject) filters.subject = params.subject;\n if (params.strand) filters.strand = params.strand;\n\n const pagination = {\n limit: Math.min(params.limit || 25, 100),\n offset: Math.max(params.offset || 0, 0),\n };\n\n return {\n success: true,\n data: {\n expectations: [], // Would contain actual data\n filters,\n pagination,\n total: 0,\n },\n error: null,\n };\n };\n\n const response = mockCurriculumAPI(query);\n\n // Validate response structure and logic\n const hasValidStructure = response.success && response.data;\n const hasValidPagination =\n response.data.pagination.limit <= 100 && response.data.pagination.offset >= 0;\n\n return hasValidStructure && hasValidPagination;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/api/api-contract.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Curriculum expectation queries should produce API responses with valid filter criteria and pagination limits that do not exceed specified boundaries.", "mode": "fast-check"} {"id": 60354, "name": "unknown", "code": "it('should validate curriculum expectation creation', () => {\n fc.assert(\n fc.property(domainArbitraries.fullCurriculumExpectation, (expectation) => {\n // Property: Curriculum creation should validate required fields\n const validateCurriculumExpectation = (data: typeof expectation) => {\n const errors: string[] = [];\n\n if (!data.code || !/^[A-E][1-5]\\.[1-9]|10$/.test(data.code)) {\n errors.push('Invalid curriculum code format');\n }\n\n if (!data.description || data.description.trim().length === 0) {\n errors.push('Description is required');\n }\n\n if (!data.strand || data.strand.trim().length === 0) {\n errors.push('Strand is required');\n }\n\n if (!data.grade || data.grade < 1 || data.grade > 8) {\n errors.push('Grade must be between 1 and 8');\n }\n\n if (!data.subject || data.subject.trim().length === 0) {\n errors.push('Subject is required');\n }\n\n return {\n isValid: errors.length === 0,\n errors,\n };\n };\n\n const validation = validateCurriculumExpectation(expectation);\n\n // Well-formed expectations should pass validation\n return validation.isValid;\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/api/api-contract.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Curriculum expectation creation should validate that the fields for code, description, strand, grade, and subject meet specified requirements, ensuring well-formed expectations pass validation.", "mode": "fast-check"} {"id": 60355, "name": "unknown", "code": "it('should handle lesson plan CRUD operations correctly', () => {\n fc.assert(\n fc.property(\n domainArbitraries.fullLessonPlan,\n fc.constantFrom('CREATE', 'READ', 'UPDATE', 'DELETE'),\n (lessonPlan, operation) => {\n // Property: CRUD operations should follow REST conventions\n const mockLessonPlanAPI = (data: typeof lessonPlan, op: string) => {\n switch (op) {\n case 'CREATE':\n return {\n success: true,\n data: { ...data, id: fc.sample(fc.uuid(), 1)[0] },\n error: null,\n };\n\n case 'READ':\n return {\n success: true,\n data: data,\n error: null,\n };\n\n case 'UPDATE':\n return {\n success: true,\n data: { ...data, updatedAt: new Date() },\n error: null,\n };\n\n case 'DELETE':\n return {\n success: true,\n data: { deleted: true, id: data.id },\n error: null,\n };\n\n default:\n return {\n success: false,\n data: null,\n error: 'Invalid operation',\n };\n }\n };\n\n const response = mockLessonPlanAPI(lessonPlan, operation);\n\n // Validate operation-specific responses\n if (operation === 'CREATE') {\n return response.success && response.data && response.data.id;\n } else if (operation === 'DELETE') {\n return response.success && response.data && response.data.deleted;\n } else {\n return response.success && response.data;\n }\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/api/api-contract.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Lesson plan CRUD operations return success with expected data formats and handle specific conditions, such as generating an ID on creation and marking as deleted.", "mode": "fast-check"} {"id": 60356, "name": "unknown", "code": "it('should validate lesson plan scheduling constraints', () => {\n fc.assert(\n fc.property(\n fc.array(domainArbitraries.fullLessonPlan, { minLength: 2, maxLength: 5 }),\n (lessons) => {\n // Property: API should detect scheduling conflicts\n const detectSchedulingConflicts = (lessonPlans: typeof lessons) => {\n const conflicts: Array<{ lesson1: string; lesson2: string; reason: string }> = [];\n\n for (let i = 0; i < lessonPlans.length; i++) {\n for (let j = i + 1; j < lessonPlans.length; j++) {\n const lesson1 = lessonPlans[i];\n const lesson2 = lessonPlans[j];\n\n // Check if same day\n if (lesson1.date.toDateString() === lesson2.date.toDateString()) {\n // Calculate end times\n const end1 = new Date(lesson1.date.getTime() + lesson1.duration * 60 * 1000);\n const end2 = new Date(lesson2.date.getTime() + lesson2.duration * 60 * 1000);\n\n // Check for time overlap\n if (lesson1.date < end2 && end1 > lesson2.date) {\n conflicts.push({\n lesson1: lesson1.id,\n lesson2: lesson2.id,\n reason: 'Time overlap',\n });\n }\n }\n }\n }\n\n return {\n hasConflicts: conflicts.length > 0,\n conflicts,\n };\n };\n\n const conflictCheck = detectSchedulingConflicts(lessons);\n\n // Should return valid conflict detection result\n return (\n typeof conflictCheck.hasConflicts === 'boolean' &&\n Array.isArray(conflictCheck.conflicts)\n );\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/api/api-contract.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Validates that the scheduling conflict detection for lesson plans returns a boolean for conflict presence and an array of conflicts.", "mode": "fast-check"} {"id": 60357, "name": "unknown", "code": "it('should handle assessment data correctly', () => {\n fc.assert(\n fc.property(\n fc.record({\n lessonId: fc.uuid(),\n assessmentType: domainArbitraries.assessmentType,\n scores: fc.array(\n fc.record({\n expectationId: fc.uuid(),\n score: domainArbitraries.percentage,\n notes: fc.option(fc.string({ maxLength: 500 })),\n }),\n { minLength: 1, maxLength: 5 },\n ),\n completedAt: fc.date(),\n }),\n (assessmentData) => {\n // Property: Assessment API should validate and process scores correctly\n const processAssessmentData = (data: typeof assessmentData) => {\n const validationErrors: string[] = [];\n\n // Validate lesson reference\n if (!data.lessonId) {\n validationErrors.push('Lesson ID is required');\n }\n\n // Validate assessment type\n if (!['diagnostic', 'formative', 'summative'].includes(data.assessmentType)) {\n validationErrors.push('Invalid assessment type');\n }\n\n // Validate scores\n for (const score of data.scores) {\n if (score.score < 0 || score.score > 100) {\n validationErrors.push(`Invalid score: ${score.score}`);\n }\n\n if (!score.expectationId) {\n validationErrors.push('Expectation ID is required for each score');\n }\n }\n\n // Calculate overall score\n const overallScore =\n data.scores.reduce((sum, s) => sum + s.score, 0) / data.scores.length;\n\n return {\n isValid: validationErrors.length === 0,\n errors: validationErrors,\n data:\n validationErrors.length === 0\n ? {\n ...data,\n overallScore,\n processedAt: new Date(),\n }\n : null,\n };\n };\n\n const result = processAssessmentData(assessmentData);\n\n // Valid assessment data should process successfully\n return (\n result.isValid &&\n result.data &&\n result.data.overallScore >= 0 &&\n result.data.overallScore <= 100\n );\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/api/api-contract.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Assessment data should be validated and processed correctly, ensuring valid lesson IDs, assessment types, scores between 0 and 100, and expectation IDs for each score, resulting in a valid overall score calculation between 0 and 100.", "mode": "fast-check"} {"id": 60359, "name": "unknown", "code": "it('should handle user permissions correctly', () => {\n fc.assert(\n fc.property(\n domainArbitraries.userRole,\n fc.constantFrom('create', 'read', 'update', 'delete'),\n fc.constantFrom('lesson-plans', 'curriculum', 'assessments', 'users'),\n (userRole, action, resource) => {\n // Property: Permission system should enforce role-based access\n const checkPermissions = (role: string, operation: string, resourceType: string) => {\n const permissions = {\n teacher: {\n 'lesson-plans': ['create', 'read', 'update', 'delete'],\n curriculum: ['read'],\n assessments: ['create', 'read', 'update'],\n users: [],\n },\n administrator: {\n 'lesson-plans': ['create', 'read', 'update', 'delete'],\n curriculum: ['create', 'read', 'update', 'delete'],\n assessments: ['create', 'read', 'update', 'delete'],\n users: ['create', 'read', 'update', 'delete'],\n },\n substitute: {\n 'lesson-plans': ['read'],\n curriculum: ['read'],\n assessments: ['read'],\n users: [],\n },\n };\n\n const rolePermissions = permissions[role as keyof typeof permissions];\n const resourcePermissions =\n rolePermissions?.[resourceType as keyof typeof rolePermissions] || [];\n\n return resourcePermissions.includes(operation);\n };\n\n const hasPermission = checkPermissions(userRole, action, resource);\n\n // Should return boolean permission result\n return typeof hasPermission === 'boolean';\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/api/api-contract.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The permission system should correctly enforce role-based access, returning a boolean when checking if a user role can perform an action on a resource.", "mode": "fast-check"} {"id": 60360, "name": "unknown", "code": "it('should handle malformed requests gracefully', () => {\n fc.assert(\n fc.property(\n fc.oneof(\n fc.constant(null),\n fc.constant(undefined),\n fc.string(),\n fc.integer(),\n fc.object(),\n fc.array(fc.anything()),\n ),\n (malformedInput) => {\n // Property: API should handle malformed input gracefully\n const handleRequest = (input: unknown) => {\n try {\n // Simulate request validation\n if (input === null || input === undefined) {\n return {\n success: false,\n data: null,\n error: 'Request body is required',\n };\n }\n\n if (typeof input !== 'object' || Array.isArray(input)) {\n return {\n success: false,\n data: null,\n error: 'Request body must be an object',\n };\n }\n\n return {\n success: true,\n data: input,\n error: null,\n };\n } catch (_error) {\n return {\n success: false,\n data: null,\n error: 'Internal server error',\n };\n }\n };\n\n const response = handleRequest(malformedInput);\n\n // Should always return valid response structure\n return (\n typeof response.success === 'boolean' &&\n (response.success ? response.data !== null : response.error !== null)\n );\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/api/api-contract.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "API should handle malformed inputs by returning a valid response structure, indicating success or providing an appropriate error message.", "mode": "fast-check"} {"id": 55340, "name": "unknown", "code": "it('should never do more than 7 races', () => {\n fc.assert(\n fc.property(tupleN(fc.nat(), 25), (speeds) => {\n // Arrange\n const compareParticipants = (pa: number, pb: number) => {\n if (speeds[pa] !== speeds[pb]) return speeds[pb] - speeds[pa];\n else return pa - pb;\n };\n const runRace = jest.fn((...participants: RaceParticipants): RaceParticipants => {\n return participants.sort(compareParticipants);\n });\n\n // Act\n racePodium(runRace);\n\n // Assert\n expect(runRace.mock.calls.length).toBeLessThanOrEqual(7);\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/higher-level-algorithms/racePodium.spec.ts", "start_line": null, "end_line": null, "dependencies": ["tupleN"], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The test ensures that the `racePodium` function does not perform more than 7 race operations, even when processing an array of 25 natural numbers as speeds.", "mode": "fast-check"} {"id": 60361, "name": "unknown", "code": "it('should provide meaningful error messages', () => {\n fc.assert(\n fc.property(\n fc.record({\n field: fc.constantFrom('email', 'password', 'grade', 'duration'),\n value: fc.oneof(fc.string(), fc.integer(), fc.constant(null)),\n validationRule: fc.constantFrom('required', 'format', 'range', 'length'),\n }),\n (validationCase) => {\n // Property: Error messages should be specific and helpful\n const generateErrorMessage = (field: string, value: unknown, rule: string) => {\n switch (rule) {\n case 'required':\n if (value === null || value === undefined || value === '') {\n return `${field} is required`;\n }\n break;\n\n case 'format':\n if (field === 'email' && typeof value === 'string' && !value.includes('@')) {\n return `${field} must be a valid email address`;\n }\n break;\n\n case 'range':\n if (field === 'grade' && (typeof value !== 'number' || value < 1 || value > 8)) {\n return `${field} must be between 1 and 8`;\n }\n break;\n\n case 'length':\n if (field === 'password' && typeof value === 'string' && value.length < 8) {\n return `${field} must be at least 8 characters long`;\n }\n break;\n }\n\n return null; // No error\n };\n\n const errorMessage = generateErrorMessage(\n validationCase.field,\n validationCase.value,\n validationCase.validationRule,\n );\n\n // Error message should be string or null\n return errorMessage === null || typeof errorMessage === 'string';\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/api/api-contract.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Error messages generated based on validation rules for fields should either be specific strings or null, ensuring meaningful feedback.", "mode": "fast-check"} {"id": 60362, "name": "unknown", "code": "it('should enforce rate limits correctly', () => {\n fc.assert(\n fc.property(\n fc.integer({ min: 1, max: 100 }),\n fc.integer({ min: 1, max: 3600 }),\n fc.array(fc.integer({ min: 0, max: 3600 }), { minLength: 10, maxLength: 50 }),\n (maxRequests, timeWindowSeconds, requestTimes) => {\n // Property: Rate limiting should track requests within time windows\n const checkRateLimit = (max: number, window: number, times: number[]) => {\n const sortedTimes = [...times].sort((a, b) => a - b);\n const violations: number[] = [];\n\n for (let i = 0; i < sortedTimes.length; i++) {\n const currentTime = sortedTimes[i];\n const windowStart = currentTime - window;\n\n // Count requests in the current window\n const requestsInWindow = sortedTimes.filter(\n (time) => time >= windowStart && time <= currentTime,\n ).length;\n\n if (requestsInWindow > max) {\n violations.push(currentTime);\n }\n }\n\n return {\n violations: violations.length,\n wouldBlock: violations.length > 0,\n };\n };\n\n const rateLimitResult = checkRateLimit(maxRequests, timeWindowSeconds, requestTimes);\n\n // Should return valid rate limit analysis\n return (\n typeof rateLimitResult.violations === 'number' &&\n typeof rateLimitResult.wouldBlock === 'boolean'\n );\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/api/api-contract.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The rate limiting function tracks and evaluates request counts within specified time windows, ensuring the result includes a number of violations and a boolean indicating potential blocking.", "mode": "fast-check"} {"id": 60363, "name": "unknown", "code": "it('should handle pagination consistently', () => {\n fc.assert(\n fc.property(\n fc.integer({ min: 0, max: 1000 }),\n fc.integer({ min: 1, max: 100 }),\n fc.integer({ min: 0, max: 10000 }),\n (offset, limit, totalItems) => {\n // Property: Pagination should calculate pages correctly\n const calculatePagination = (off: number, lim: number, total: number) => {\n const validatedOffset = Math.max(0, off);\n const validatedLimit = Math.min(Math.max(1, lim), 100);\n\n const totalPages = Math.ceil(total / validatedLimit);\n const currentPage = Math.floor(validatedOffset / validatedLimit) + 1;\n const hasNextPage = validatedOffset + validatedLimit < total;\n const hasPrevPage = validatedOffset > 0;\n\n return {\n offset: validatedOffset,\n limit: validatedLimit,\n total,\n totalPages,\n currentPage,\n hasNextPage,\n hasPrevPage,\n };\n };\n\n const pagination = calculatePagination(offset, limit, totalItems);\n\n // Validate pagination logic\n const validCurrentPage =\n pagination.currentPage >= 1 &&\n pagination.currentPage <= Math.max(1, pagination.totalPages);\n const validNextPage =\n pagination.hasNextPage === pagination.offset + pagination.limit < pagination.total;\n const validPrevPage = pagination.hasPrevPage === pagination.offset > 0;\n\n return validCurrentPage && validNextPage && validPrevPage;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/api/api-contract.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Pagination should accurately calculate total pages, current page, and the presence of next and previous pages based on given offset, limit, and total items.", "mode": "fast-check"} {"id": 60365, "name": "unknown", "code": "it('should handle reasonable payload sizes', () => {\n fc.assert(\n fc.property(\n fc.array(domainArbitraries.fullLessonPlan, { minLength: 1, maxLength: 100 }),\n (lessonPlans) => {\n // Property: API should handle reasonable batch sizes\n const estimatePayloadSize = (data: typeof lessonPlans) => {\n const serialized = JSON.stringify(data);\n return new Blob([serialized]).size;\n };\n\n const payloadSize = estimatePayloadSize(lessonPlans);\n const maxReasonableSize = 5 * 1024 * 1024; // 5MB\n\n // Large payloads should be rejected or paginated\n const shouldPaginate = payloadSize > maxReasonableSize;\n const isReasonableSize = payloadSize <= maxReasonableSize;\n\n // Either size is reasonable or we know it should be paginated\n return isReasonableSize || shouldPaginate;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/api/api-contract.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The API should either handle payloads up to a reasonable size limit or require pagination for larger payloads.", "mode": "fast-check"} {"id": 60366, "name": "unknown", "code": "it(\"should correctly set and retrieve items\", () => {\n fc.assert(\n fc.property(fc.string(), fc.string(), (key, value) => {\n storage.setItem(key, value);\n const mockData: DataStore = { [v2UnescapedStoreKey(key)]: value };\n storage.receive(mockData);\n if (value === \"\") {\n expect(storage.getItem(key)).toBeNull();\n } else {\n expect(storage.getItem(key)).toEqual(value);\n }\n }),\n { numRuns: 100 },\n );\n })", "language": "typescript", "source_file": "./repos/defenseunicorns/pepr/src/lib/core/storage.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "defenseunicorns/pepr", "url": "https://github.com/defenseunicorns/pepr.git", "license": "Apache-2.0", "stars": 169, "forks": 6}, "metrics": null, "summary": "Setting an item with a key-value pair should allow retrieving the same value unless the value is an empty string, in which case retrieval should return null.", "mode": "fast-check"} {"id": 60367, "name": "unknown", "code": "it(\"should return null for non-existing items\", () => {\n fc.assert(\n fc.property(fc.string(), key => {\n expect(storage.getItem(key)).toBeNull();\n }),\n { numRuns: 100 },\n );\n })", "language": "typescript", "source_file": "./repos/defenseunicorns/pepr/src/lib/core/storage.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "defenseunicorns/pepr", "url": "https://github.com/defenseunicorns/pepr.git", "license": "Apache-2.0", "stars": 169, "forks": 6}, "metrics": null, "summary": "`storage.getItem` returns null for keys that do not exist.", "mode": "fast-check"} {"id": 60368, "name": "unknown", "code": "it(\"should correctly remove items\", () => {\n fc.assert(\n fc.property(fc.string(), fc.string(), (key, value) => {\n storage.setItem(key, value);\n storage.removeItem(key);\n expect(storage.getItem(key)).toBeNull();\n }),\n { numRuns: 100 },\n );\n })", "language": "typescript", "source_file": "./repos/defenseunicorns/pepr/src/lib/core/storage.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "defenseunicorns/pepr", "url": "https://github.com/defenseunicorns/pepr.git", "license": "Apache-2.0", "stars": 169, "forks": 6}, "metrics": null, "summary": "Removing an item from storage results in `getItem` returning null for that key.", "mode": "fast-check"} {"id": 60369, "name": "unknown", "code": "it(\"should ensure all set items are v2-coded internally\", () => {\n fc.assert(\n fc.property(fc.string(), fc.string(), (key, value) => {\n storage.setItem(key, value);\n const mockData: DataStore = { [v2UnescapedStoreKey(key)]: value };\n storage.receive(mockData);\n if (value === \"\") {\n expect(storage.getItem(key)).toBeNull();\n } else {\n expect(storage.getItem(key)).toEqual(value);\n }\n }),\n { numRuns: 100 },\n );\n })", "language": "typescript", "source_file": "./repos/defenseunicorns/pepr/src/lib/core/storage.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "defenseunicorns/pepr", "url": "https://github.com/defenseunicorns/pepr.git", "license": "Apache-2.0", "stars": 169, "forks": 6}, "metrics": null, "summary": "All items set in storage should be represented internally using v2-coded keys and retrieved accurately, with empty values resulting in null.", "mode": "fast-check"} {"id": 60370, "name": "unknown", "code": "it(\"arrayToHex -> hexToArray\", () => {\n fc.assert(\n fc.property(fc.uint8Array({ minLength: 2 }), data => {\n fc.pre(data.length % 2 == 0);\n assert.deepEqual(hexToArray(arrayToHex(data)), data);\n })\n );\n })", "language": "typescript", "source_file": "./repos/larsrh/bunnyctl/src/test/util.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "larsrh/bunnyctl", "url": "https://github.com/larsrh/bunnyctl.git", "license": "Apache-2.0", "stars": 1, "forks": 0}, "metrics": null, "summary": "Converting a `uint8Array` to a hex string and back to an array should return the original array.", "mode": "fast-check"} {"id": 60372, "name": "unknown", "code": "it(\"parse local path\", () => {\n fc.assert(\n fc.property(fc.string(), string => {\n const typed = `local:${string}`;\n assert.deepEqual(parseTypedPath(typed), [\"local\", string]);\n })\n );\n })", "language": "typescript", "source_file": "./repos/larsrh/bunnyctl/src/test/cli/util.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "larsrh/bunnyctl", "url": "https://github.com/larsrh/bunnyctl.git", "license": "Apache-2.0", "stars": 1, "forks": 0}, "metrics": null, "summary": "`parseTypedPath` splits a string with a \"local:\" prefix into an array with \"local\" and the remaining string.", "mode": "fast-check"} {"id": 60374, "name": "unknown", "code": "it(\"parse unqualified path\", () => {\n fc.assert(\n fc.property(fc.string(), string => {\n fc.pre(!string.includes(\":\"));\n assert.deepEqual(parseTypedPath(string), [undefined, string]);\n })\n );\n })", "language": "typescript", "source_file": "./repos/larsrh/bunnyctl/src/test/cli/util.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "larsrh/bunnyctl", "url": "https://github.com/larsrh/bunnyctl.git", "license": "Apache-2.0", "stars": 1, "forks": 0}, "metrics": null, "summary": "`parseTypedPath` returns an array with `undefined` and the original string if the string does not contain a colon.", "mode": "fast-check"} {"id": 60375, "name": "unknown", "code": "it(\"should preserve the state when zoom in and zoom out on the same position\", () => {\n const precision = 1 / 100;\n const maxZooms = 10;\n const zoomSpeed = 1.1;\n const arbitraryState = fc\n .integer(1, 1000)\n .chain((ratio) =>\n fc.tuple(fc.constant(ratio), fc.float(0, 1 - 1 / ratio))\n )\n .chain(([ratio, offset]) =>\n fc.tuple(\n fc.constant(ratio),\n fc.constant(offset),\n fc.float(offset, offset + 1 / ratio),\n fc.nat(maxZooms)\n )\n );\n fc.assert(\n fc.property(\n arbitraryState,\n ([ratio, offset, mousePosition, numberOfZooms]) => {\n const zoomIns = _.range(numberOfZooms).map(() => ({\n mousePosition,\n zoomDirection: ZoomDirection.IN,\n zoomSpeed,\n }));\n\n const zoomOuts = _.range(numberOfZooms).map(() => ({\n mousePosition,\n zoomDirection: ZoomDirection.OUT,\n zoomSpeed,\n }));\n\n const zoomInsState = zoomIns.reduce(zoomReducer, {\n offset,\n ratio,\n });\n\n const finalState = zoomOuts.reduce(zoomReducer, zoomInsState);\n\n const isRatioOk =\n ratio - precision < finalState.ratio &&\n ratio + precision > finalState.ratio;\n const isOffsetOk =\n offset - precision < finalState.offset &&\n offset + precision > finalState.offset;\n\n return isRatioOk && isOffsetOk;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/SocialGouv/archifiltre-docs/tests/integration/renderer/utils/zoom/zoom-util.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SocialGouv/archifiltre-docs", "url": "https://github.com/SocialGouv/archifiltre-docs.git", "license": "Apache-2.0", "stars": 48, "forks": 8}, "metrics": null, "summary": "Zooming in and then out on the same position should preserve the initial ratio and offset state within a defined precision.", "mode": "fast-check"} {"id": 60376, "name": "unknown", "code": "it(\"should create a new object\", () => {\n fc.assert(\n fc.property(fc.object(), (obj) => {\n expect(copy(obj)).not.toBe(obj);\n })\n );\n })", "language": "typescript", "source_file": "./repos/SocialGouv/archifiltre-docs/tests/integration/renderer/utils/object/object-util.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SocialGouv/archifiltre-docs", "url": "https://github.com/SocialGouv/archifiltre-docs.git", "license": "Apache-2.0", "stars": 48, "forks": 8}, "metrics": null, "summary": "The `copy` function should return a new object that is not the same instance as the input object.", "mode": "fast-check"} {"id": 60378, "name": "unknown", "code": "it(\"should correctly format dates\", () => {\n fc.assert(\n fc.property(\n fc.integer(1, 28),\n fc.integer(0, 11),\n fc.integer(1971, 2071),\n (day, month, year) => {\n const date = Date.UTC(year, month, day);\n const paddedDay = `0${day}`.slice(-2);\n const paddedMonth = `0${month + 1}`.slice(-2);\n return (\n epochToFormattedUtcDateString(date) ===\n `${paddedDay}/${paddedMonth}/${year}`\n );\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/SocialGouv/archifiltre-docs/tests/integration/renderer/utils/date/date-util.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SocialGouv/archifiltre-docs", "url": "https://github.com/SocialGouv/archifiltre-docs.git", "license": "Apache-2.0", "stars": 48, "forks": 8}, "metrics": null, "summary": "`epochToFormattedUtcDateString` should convert a date into a formatted string \"DD/MM/YYYY\" using given day, month, and year.", "mode": "fast-check"} {"id": 60379, "name": "unknown", "code": "it(\"(fromRgba . toRgba) a\", () => {\n fc.assert(\n fc.property(arbitraryRgba, (color) =>\n equal(color, fromRgba(toRgba(color)))\n )\n );\n })", "language": "typescript", "source_file": "./repos/SocialGouv/archifiltre-docs/tests/integration/renderer/utils/color/color-util.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SocialGouv/archifiltre-docs", "url": "https://github.com/SocialGouv/archifiltre-docs.git", "license": "Apache-2.0", "stars": 48, "forks": 8}, "metrics": null, "summary": "Converting an RGBA color to a string and back to RGBA should yield the original color.", "mode": "fast-check"} {"id": 60380, "name": "unknown", "code": "it(\"should always succeed\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(fc.anything(), (input) => {\n expect(castUnknown(input)).toStrictEqual({\n status: \"success\",\n value: input,\n values: []\n });\n })\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`castUnknown` should return an object with the status \"success\" and the original input as the value when given any input.", "mode": "fast-check"} {"id": 60381, "name": "unknown", "code": "it(\"should always fail\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(fc.anything(), (input) => {\n expect(castNever(input)).toStrictEqual({\n status: \"failure\",\n expected: \"never\",\n actual: input\n });\n })\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`castNever` should return an object indicating a failure with the expected value \"never\" and the actual input for any given input.", "mode": "fast-check"} {"id": 60382, "name": "unknown", "code": "it(\"should successfully cast strings\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(fc.string(), (input) => {\n expect(castString(input)).toStrictEqual({\n status: \"success\",\n value: input,\n values: []\n });\n })\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`castString` returns an object with the properties `status: \"success\"`, `value` equal to the input string, and an empty `values` array for any string input.", "mode": "fast-check"} {"id": 60383, "name": "unknown", "code": "it(\"should fail to cast non-strings\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(\n fc.anything().filter((input) => typeof input !== \"string\"),\n (input) => {\n expect(castString(input)).toStrictEqual({\n status: \"failure\",\n expected: \"string\",\n actual: input\n });\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`castString` returns a failure status when attempting to cast non-string inputs.", "mode": "fast-check"} {"id": 60384, "name": "unknown", "code": "it(\"should successfully cast numbers\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(fc.double(), (input) => {\n expect(castNumber(input)).toStrictEqual({\n status: \"success\",\n value: input,\n values: []\n });\n })\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `castNumber` should return an object with `status` as \"success\", `value` as the input number, and an empty `values` array for double inputs.", "mode": "fast-check"} {"id": 55354, "name": "unknown", "code": "it('should never request any changes when moving a string to itself', () => {\n fc.assert(\n fc.property(fc.fullUnicodeString(), (value) => {\n // Arrange / Act\n const numChanges = minimalNumberOfChangesToBeOther(value, value);\n\n // Assert\n expect(numChanges).toBe(0);\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/011-minimalNumberOfChangesToBeOther.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The property tests that transforming a string into itself requires zero changes.", "mode": "fast-check"} {"id": 60385, "name": "unknown", "code": "it(\"should fail to cast non-numbers\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(\n fc.anything().filter((input) => typeof input !== \"number\"),\n (input) => {\n expect(castNumber(input)).toStrictEqual({\n status: \"failure\",\n expected: \"number\",\n actual: input\n });\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`castNumber` returns a failure status with expected type \"number\" for non-numeric inputs.", "mode": "fast-check"} {"id": 60386, "name": "unknown", "code": "it(\"should successfully cast bigints\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(fc.bigInt(), (input) => {\n expect(castBigInt(input)).toStrictEqual({\n status: \"success\",\n value: input,\n values: []\n });\n })\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `castBigInt` function casts input bigints successfully, returning an object with a status of \"success\" and the original input value.", "mode": "fast-check"} {"id": 60387, "name": "unknown", "code": "it(\"should fail to cast non-bigints\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(\n fc.anything().filter((input) => typeof input !== \"bigint\"),\n (input) => {\n expect(castBigInt(input)).toStrictEqual({\n status: \"failure\",\n expected: \"bigint\",\n actual: input\n });\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Verifies that casting non-bigint inputs with `castBigInt` results in a failure status with details of the expected and actual types.", "mode": "fast-check"} {"id": 60388, "name": "unknown", "code": "it(\"should successfully cast booleans\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(fc.boolean(), (input) => {\n expect(castBoolean(input)).toStrictEqual({\n status: \"success\",\n value: input,\n values: []\n });\n })\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `castBoolean` should return an object with a status of \"success,\" the original boolean value, and an empty array for any boolean input.", "mode": "fast-check"} {"id": 60391, "name": "unknown", "code": "it(\"should fail to cast non-symbols\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(\n fc.anything().filter((input) => typeof input !== \"symbol\"),\n (input) => {\n expect(castSymbol(input)).toStrictEqual({\n status: \"failure\",\n expected: \"symbol\",\n actual: input\n });\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`castSymbol` returns a failure status when given a non-symbol input, specifying the expected and actual types.", "mode": "fast-check"} {"id": 60394, "name": "unknown", "code": "it(\"should successfully cast number arrays\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(fc.array(fc.double()), (input) => {\n expect(castNums(input)).toStrictEqual({\n status: \"success\",\n value: input,\n values: []\n });\n })\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`castNums` returns an object with a \"success\" status and original number array unchanged.", "mode": "fast-check"} {"id": 60396, "name": "unknown", "code": "it(\"should fail to cast non-arrays\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(\n fc.anything().filter((input) => !Array.isArray(input)),\n (input) => {\n expect(castNums(input)).toStrictEqual({\n status: \"failure\",\n expected: \"array\",\n actual: input\n });\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`castNums` should return a failure status with expected type \"array\" when given non-array inputs.", "mode": "fast-check"} {"id": 60397, "name": "unknown", "code": "it(\"should successfully cast triples\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(\n fc.tuple(fc.string(), fc.double(), fc.boolean()),\n (input) => {\n expect(castTriple(input)).toStrictEqual({\n status: \"success\",\n value: input,\n values: []\n });\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `castTriple` function should return an object with a \"success\" status and the input as the value for tuples of a string, double, and boolean.", "mode": "fast-check"} {"id": 60398, "name": "unknown", "code": "it(\"should fail to cast invalid triples\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(\n fc.tuple(\n fc.anything().filter((input) => typeof input !== \"string\"),\n fc.anything().filter((input) => typeof input !== \"number\"),\n fc.anything().filter((input) => typeof input !== \"boolean\")\n ),\n (input) => {\n const [first, second, third] = input;\n expect(castTriple(input)).toStrictEqual({\n status: \"failure\",\n expected: \"tuple\",\n length: 3,\n items: [\n { status: \"failure\", expected: \"string\", actual: first },\n { status: \"failure\", expected: \"number\", actual: second },\n { status: \"failure\", expected: \"boolean\", actual: third }\n ],\n actual: input\n });\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`castTriple` returns a failure status for non-string, non-number, and non-boolean elements in a tuple.", "mode": "fast-check"} {"id": 60399, "name": "unknown", "code": "it(\"should fail to cast non-triples\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(fc.tuple(fc.string(), fc.double()), (input) => {\n expect(castTriple(input)).toStrictEqual({\n status: \"failure\",\n expected: \"tuple\",\n length: 3,\n actual: input\n });\n })\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`castTriple` returns an error status when attempting to cast tuples that are not of length three.", "mode": "fast-check"} {"id": 60400, "name": "unknown", "code": "it(\"should fail to cast non-arrays\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(\n fc.anything().filter((input) => !Array.isArray(input)),\n (input) => {\n expect(castTriple(input)).toStrictEqual({\n status: \"failure\",\n expected: \"tuple\",\n length: 3,\n actual: input\n });\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`castTriple` returns a failure object when attempting to cast non-array inputs.", "mode": "fast-check"} {"id": 60401, "name": "unknown", "code": "it(\"should successfully cast numeric records\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(fc.dictionary(fc.string(), fc.double()), (input) => {\n expect(castNumericRecord(input)).toStrictEqual({\n status: \"success\",\n value: input,\n values: []\n });\n })\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `castNumericRecord` function should return a success status with the input record and an empty values array for numeric records.", "mode": "fast-check"} {"id": 60402, "name": "unknown", "code": "it(\"should fail to cast non-numeric records\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(\n fc.dictionary(\n fc.string(),\n fc.anything().filter((input) => typeof input !== \"number\"),\n { minKeys: 1 }\n ),\n (input) => {\n expect(castNumericRecord(input)).toStrictEqual({\n status: \"failure\",\n expected: \"record\",\n properties: Object.fromEntries(\n Object.entries(input).map(([key, actual]) => [\n key,\n { status: \"failure\", expected: \"number\", actual }\n ])\n ),\n actual: input\n });\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`castNumericRecord` returns a failure status when attempting to cast records containing non-numeric values.", "mode": "fast-check"} {"id": 60403, "name": "unknown", "code": "it(\"should fail to cast non-records\", () => {\n expect.assertions(101);\n const property = (input: unknown) => {\n expect(castNumericRecord(input)).toStrictEqual({\n status: \"failure\",\n expected: \"record\",\n actual: input\n });\n };\n fc.assert(\n fc.property(\n fc.anything().filter((input) => typeof input !== \"object\"),\n property\n )\n );\n // eslint-disable-next-line unicorn/no-null -- testing null\n property(null);\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`castNumericRecord` returns a status of \"failure\" for non-object inputs, including `null`, with an expectation of \"record\".", "mode": "fast-check"} {"id": 60404, "name": "unknown", "code": "it(\"should successfully cast objects\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(\n fc.record({ foo: fc.string(), bar: fc.double(), baz: fc.boolean() }),\n (input) => {\n expect(castObject(input)).toStrictEqual({\n status: \"success\",\n value: input,\n values: []\n });\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`castObject` returns an object with `\"status\": \"success\"`, echoing the input when given records with specific types for properties.", "mode": "fast-check"} {"id": 55365, "name": "unknown", "code": "it('should print Fizz whenever divisible by 3', () => {\n fc.assert(\n fc.property(\n fc.nat().map((n) => n * 3),\n (n) => {\n expect(fizzbuzz(n)).toContain('Fizz');\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/007-fizzbuzz.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "`fizzbuzz` includes \"Fizz\" in its output for numbers divisible by 3.", "mode": "fast-check"} {"id": 55366, "name": "unknown", "code": "it('should not print Fizz when not divisible by 3', () => {\n fc.assert(\n fc.property(\n fc.oneof(\n fc.nat().map((n) => n * 3 + 1),\n fc.nat().map((n) => n * 3 + 2)\n ),\n (n) => {\n expect(fizzbuzz(n)).not.toContain('Fizz');\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/007-fizzbuzz.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "When a number is not divisible by 3, `fizzbuzz` should not include \"Fizz\" in its output.", "mode": "fast-check"} {"id": 55374, "name": "unknown", "code": "it('should be able to decompose a product of two numbers', () => {\n fc.assert(\n fc.property(fc.integer(2, MAX_INPUT), fc.integer(2, MAX_INPUT), (a, b) => {\n const n = a * b;\n const factors = decomposeIntoPrimes(n);\n return factors.length >= 2;\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/006-decomposeIntoPrimes.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "Decomposing the product of two integers into prime factors should result in at least two factors.", "mode": "fast-check"} {"id": 60405, "name": "unknown", "code": "it(\"should fail to cast invalid objects\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(\n fc.record({\n foo: fc.anything().filter((input) => typeof input !== \"string\"),\n bar: fc.anything().filter((input) => typeof input !== \"number\")\n }),\n (input) => {\n const { foo, bar } = input;\n expect(castObject(input)).toStrictEqual({\n status: \"failure\",\n expected: \"object\",\n properties: {\n foo: { status: \"failure\", expected: \"string\", actual: foo },\n bar: { status: \"failure\", expected: \"number\", actual: bar },\n baz: {\n status: \"failure\",\n expected: \"boolean\",\n actual: undefined\n }\n },\n actual: input\n });\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Casting an object with non-string `foo` or non-number `bar` should result in a failure report detailing the expected and actual types, including a missing `baz` field.", "mode": "fast-check"} {"id": 60407, "name": "unknown", "code": "it(\"should successfully cast numbers\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(fc.double(), (input) => {\n expect(castNullableNumber(input)).toStrictEqual({\n status: \"success\",\n value: input,\n values: []\n });\n })\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`castNullableNumber` successfully casts doubles to an object with a status of \"success\" and includes the input value in the output.", "mode": "fast-check"} {"id": 60408, "name": "unknown", "code": "it(\"should fail to cast non-numbers and non-null\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(\n fc\n .anything()\n .filter((input) => typeof input !== \"number\")\n .filter((input) => input !== null),\n (input) => {\n expect(castNullableNumber(input)).toStrictEqual({\n status: \"failure\",\n expected: \"union\",\n variants: [\n { status: \"failure\", expected: \"number\", actual: input },\n { status: \"failure\", expected: \"null\", actual: input }\n ]\n });\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`castNullableNumber` should return a failure status when attempting to cast inputs that are neither numbers nor null.", "mode": "fast-check"} {"id": 60409, "name": "unknown", "code": "it(\"should successfully cast numbers\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(fc.double(), (input) => {\n expect(castOptionalNumber(input)).toStrictEqual({\n status: \"success\",\n value: input,\n values: []\n });\n })\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`castOptionalNumber` successfully casts doubles to an object with `status: \"success\"`, `value` as the input, and an empty `values` array.", "mode": "fast-check"} {"id": 60410, "name": "unknown", "code": "it(\"should fail to cast non-numbers and non-undefined\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(\n fc\n .anything()\n .filter((input) => typeof input !== \"number\")\n .filter((input) => typeof input !== \"undefined\"),\n (input) => {\n expect(castOptionalNumber(input)).toStrictEqual({\n status: \"failure\",\n expected: \"union\",\n variants: [\n { status: \"failure\", expected: \"number\", actual: input },\n { status: \"failure\", expected: \"undefined\", actual: input }\n ]\n });\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`castOptionalNumber` should return a failure status when attempting to cast any input that is neither a number nor undefined.", "mode": "fast-check"} {"id": 60415, "name": "unknown", "code": "it(\"should successfully cast bar\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(fc.record({ bar: fc.double() }), (input) => {\n expect(castFooBar(input)).toStrictEqual({\n status: \"success\",\n value: input,\n values: []\n });\n })\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`castFooBar` should return an object with a status of \"success\", the input value, and an empty array when given a record with a double value under the key \"bar\".", "mode": "fast-check"} {"id": 60418, "name": "unknown", "code": "it(\"should fail to cast neither foo nor bar\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(fc.record({ baz: fc.boolean() }), (input) => {\n expect(castFooBar(input)).toStrictEqual({\n status: \"failure\",\n expected: \"intersection\",\n results: [\n {\n status: \"failure\",\n expected: \"object\",\n properties: {\n foo: {\n status: \"failure\",\n expected: \"string\",\n actual: undefined\n }\n },\n actual: input\n },\n {\n status: \"failure\",\n expected: \"object\",\n properties: {\n bar: {\n status: \"failure\",\n expected: \"number\",\n actual: undefined\n }\n },\n actual: input\n }\n ]\n });\n })\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `castFooBar` returns a failure status with expected types for both \"foo\" and \"bar\" when given an input record containing only a boolean \"baz\" property.", "mode": "fast-check"} {"id": 55383, "name": "unknown", "code": "it('should be able to find back the original message', () => {\n fc.assert(\n fc.property(\n fc.set(wordArb, { minLength: 1 }).chain((words) =>\n fc.record({\n words: fc.constant(words),\n originalMessage: fc.array(fc.constantFrom(...words)).map((items) => items.join(' ')),\n })\n ),\n ({ words, originalMessage }) => {\n const spacelessMessage = originalMessage.replace(/\\s/g, '');\n const combinations = respace(spacelessMessage, words);\n expect(combinations).toContain(originalMessage);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/003-respace.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "`respace` should reconstruct the original message from a spaceless string using a given set of words.", "mode": "fast-check"} {"id": 55384, "name": "unknown", "code": "it('should only return messages with spaceless version being the passed message', () => {\n fc.assert(\n fc.property(\n fc.set(wordArb, { minLength: 1 }).chain((words) =>\n fc.record({\n words: fc.shuffledSubarray(words), // we potentially remove words from the dictionary to cover no match case\n originalMessage: fc.array(fc.constantFrom(...words)).map((items) => items.join(' ')),\n })\n ),\n ({ words, originalMessage }) => {\n const spacelessMessage = originalMessage.replace(/\\s/g, '');\n const combinations = respace(spacelessMessage, words);\n for (const combination of combinations) {\n expect(combination.replace(/\\s/g, '')).toBe(spacelessMessage);\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/003-respace.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "When respacing a message, all resulting combinations should transform back to the original spaceless message when spaces are removed.", "mode": "fast-check"} {"id": 60419, "name": "unknown", "code": "it(\"should always succeed with a constant answer\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(fc.anything(), (input) => {\n expect(castAnswer(input)).toStrictEqual({\n status: \"success\",\n value: answer,\n values: []\n });\n })\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `castAnswer` always returns an object with a constant structure, `{ status: \"success\", value: answer, values: [] }`, regardless of the input.", "mode": "fast-check"} {"id": 60422, "name": "unknown", "code": "it(\"should successfully cast recursive data structures\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(\n fc.letrec<{ list: List; cons: Cons }>((tie) => ({\n list: fc.option(tie(\"cons\")),\n cons: fc.record({ head: fc.double(), tail: tie(\"list\") })\n })).list,\n (input) => {\n expect(castNums(input)).toStrictEqual({\n status: \"success\",\n value: input,\n values: []\n });\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Casts recursive data structures of lists and cons cells to verify successful casting with expected output structure.", "mode": "fast-check"} {"id": 60423, "name": "unknown", "code": "it('should build an ExecutableQuery always returning the specified value', () => {\n return fc.assert(\n fc.asyncProperty(fc.anything(), async (a) => {\n const query = ExecutableQuery.of(a);\n\n const result = await query.run(fakeClient);\n expect(result).toStrictEqual(a);\n })\n );\n })", "language": "typescript", "source_file": "./repos/blemoine/posigrade/src/query/executable-query.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "blemoine/posigrade", "url": "https://github.com/blemoine/posigrade.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "`ExecutableQuery.of` creates a query that consistently returns the specified value when run, matching the input.", "mode": "fast-check"} {"id": 55386, "name": "unknown", "code": "it('should detect a substring when there is one', () => {\n fc.assert(\n fc.property(fc.string(), fc.string(), fc.string(), (a, b, c) => {\n const searchString = b;\n const text = `${a}${b}${c}`;\n expect(lastIndexOf(searchString, text)).not.toBe(-1);\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/002-lastIndexOf.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "`lastIndexOf` should return a non-negative index when a substring is present in a concatenated string.", "mode": "fast-check"} {"id": 55387, "name": "unknown", "code": "it('should return the start index of the substring when there is one', () => {\n fc.assert(\n fc.property(fc.string(), fc.string(), fc.string(), (a, b, c) => {\n const searchString = b;\n const text = `${a}${b}${c}`;\n const index = lastIndexOf(searchString, text);\n expect(text.substr(index, searchString.length)).toBe(searchString);\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/002-lastIndexOf.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "`lastIndexOf` returns the starting index of a substring within a text, ensuring the extracted portion matches the substring.", "mode": "fast-check"} {"id": 55388, "name": "unknown", "code": "it('should return the last possible index of the substring when there is one', () => {\n fc.assert(\n fc.property(fc.string(), fc.string({ minLength: 1 }), fc.string(), (a, b, c) => {\n const searchString = b;\n const text = `${a}${b}${c}`;\n const textBis = text.substring(lastIndexOf(searchString, text) + 1);\n expect(lastIndexOf(searchString, textBis)).toBe(-1);\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/002-lastIndexOf.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The last occurrence of a substring in a composed string should not be found in the remaining substring that follows it.", "mode": "fast-check"} {"id": 60425, "name": "unknown", "code": "it('should respect composition', () => {\n return fc.assert(\n fc.asyncProperty(\n arbExecutableQuery(fc.anything()),\n fc.func(fc.anything()),\n fc.func(fc.anything()),\n async (query, fn, fn2) => {\n const result = await query.map(fn).map(fn2).run(fakeClient);\n const expected = await query.map((x) => fn2(fn(x))).run(fakeClient);\n expect(result).toStrictEqual(expected);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/blemoine/posigrade/src/query/executable-query.spec.ts", "start_line": null, "end_line": null, "dependencies": ["arbExecutableQuery"], "repo": {"name": "blemoine/posigrade", "url": "https://github.com/blemoine/posigrade.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "The composition of mapped functions on an `ExecutableQuery` should produce the same result as composing the functions before mapping, then running with `fakeClient`.", "mode": "fast-check"} {"id": 60426, "name": "unknown", "code": "it('should respect right identity', () => {\n return fc.assert(\n fc.asyncProperty(arbExecutableQuery(fc.anything()), async (query) => {\n const result = await query.chain((x) => ExecutableQuery.of(x)).run(fakeClient);\n const expected = await query.run(fakeClient);\n expect(result).toStrictEqual(expected);\n })\n );\n })", "language": "typescript", "source_file": "./repos/blemoine/posigrade/src/query/executable-query.spec.ts", "start_line": null, "end_line": null, "dependencies": ["arbExecutableQuery"], "repo": {"name": "blemoine/posigrade", "url": "https://github.com/blemoine/posigrade.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "An `ExecutableQuery` applied with the right identity operation should yield the same result when executed, compared to executing the original query.", "mode": "fast-check"} {"id": 55395, "name": "unknown", "code": "test(\"The random value should be comprised between min and max boundaries\", () => {\n fc.assert(\n fc.property(fc.nat(), fc.nat(), (min, max) => {\n fc.pre(min <= max);\n const result = random(Math.random)({ min, max });\n return min <= result && result <= max;\n }),\n );\n })", "language": "typescript", "source_file": "./repos/twofortyfive/utils/src/maths/random/index.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "twofortyfive/utils", "url": "https://github.com/twofortyfive/utils.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": "The random value generated should be between the specified minimum and maximum boundaries.", "mode": "fast-check"} {"id": 55396, "name": "unknown", "code": "it(\"never throws\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string(), x => {\n\t\t\t\t\tf(x)\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/URLSearchParams.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Function `f` should not throw an error for any string input.", "mode": "fast-check"} {"id": 60427, "name": "unknown", "code": "it('should respect left identity', () => {\n return fc.assert(\n fc.asyncProperty(fc.anything(), fc.func(arbExecutableQuery(fc.anything())), async (a, fn) => {\n const result = await ExecutableQuery.of(a).chain(fn).run(fakeClient);\n const expected = await fn(a).run(fakeClient);\n expect(result).toStrictEqual(expected);\n })\n );\n })", "language": "typescript", "source_file": "./repos/blemoine/posigrade/src/query/executable-query.spec.ts", "start_line": null, "end_line": null, "dependencies": ["arbExecutableQuery"], "repo": {"name": "blemoine/posigrade", "url": "https://github.com/blemoine/posigrade.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "`ExecutableQuery.of(a).chain(fn).run(fakeClient)` should produce the same result as `fn(a).run(fakeClient)` for any input and function.", "mode": "fast-check"} {"id": 55397, "name": "unknown", "code": "it(\"returns a prefixed string for non-empty params\", () => {\n\t\t\texpect(f(new URLSearchParams(\"a=b\"))).toBe(\"?a=b\")\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(arb.filter(not(isEmpty)), xs => expect(f(xs)[0]).toBe(\"?\")),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/URLSearchParams.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` returns a string prefixed with \"?\" when `URLSearchParams` is non-empty.", "mode": "fast-check"} {"id": 55399, "name": "unknown", "code": "it(\"never throws\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.dictionary(fc.string(), fc.array(fc.string())), x => {\n\t\t\t\t\tf(x)\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/URLSearchParams.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` is tested to ensure it does not throw an exception for any dictionary of strings to arrays of strings.", "mode": "fast-check"} {"id": 60428, "name": "unknown", "code": "it('should respect composition', () => {\n return fc.assert(\n fc.asyncProperty(\n arbExecutableQuery(fc.anything()),\n fc.func(arbExecutableQuery(fc.anything())),\n fc.func(arbExecutableQuery(fc.anything())),\n async (query, fn, fn2) => {\n const result = await query.chain(fn).chain(fn2).run(fakeClient);\n const expected = await query.chain((x) => fn(x).chain(fn2)).run(fakeClient);\n expect(result).toStrictEqual(expected);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/blemoine/posigrade/src/query/executable-query.spec.ts", "start_line": null, "end_line": null, "dependencies": ["arbExecutableQuery"], "repo": {"name": "blemoine/posigrade", "url": "https://github.com/blemoine/posigrade.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Composition of `ExecutableQuery` operations should produce consistent results, whether chaining functions sequentially or nesting them.", "mode": "fast-check"} {"id": 60430, "name": "unknown", "code": "it('should get user using id from create user', async () => {\n await fc.assert(\n fc.asyncProperty(accountCreateRequestDtoArbitrary, async (requestDto) => {\n const { id } = await accountController.create(requestDto);\n\n const responseDto = await accountController.findById(id);\n\n expect(responseDto.id).toEqual(id);\n expect(responseDto.name).toEqual(requestDto.name);\n expect(responseDto.balance).toEqual(0);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/DPS0340/nestjs-fast-check-practice/src/presentation/controllers/account.controller.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DPS0340/nestjs-fast-check-practice", "url": "https://github.com/DPS0340/nestjs-fast-check-practice.git", "license": "MIT", "stars": 7, "forks": 0}, "metrics": null, "summary": "Creating a user should return an ID that can be used to retrieve the user with matching name and an initial balance of zero.", "mode": "fast-check"} {"id": 60431, "name": "unknown", "code": "it('should final amount is 0 from +- amount transfers', async () => {\n await fc.assert(\n fc.asyncProperty(\n accountCreateRequestDtoArbitrary,\n fc.array(fc.nat()),\n async (requestDto, amounts) => {\n const { id } = await accountController.create(requestDto);\n\n let userDto = await accountController.findById(id);\n\n expect(userDto.id).toEqual(id);\n expect(userDto.name).toEqual(requestDto.name);\n expect(userDto.balance).toEqual(0);\n expect(userDto.rawBalance).toEqual(0);\n\n await Promise.allSettled(\n amounts\n .flatMap((e) =>\n [e, e].map(\n (amount, idx) =>\n ({\n type: [TransferType.Deposit, TransferType.Withdrawal][\n idx\n ],\n accountId: id,\n amount,\n }) as TransferCreateRequestDto,\n ),\n )\n .map((e) => accountController.transfer(id, e)),\n );\n\n userDto = await accountController.findById(id);\n\n expect(userDto.id).toEqual(id);\n expect(userDto.name).toEqual(requestDto.name);\n expect(userDto.balance).toEqual(0);\n expect(userDto.rawBalance).toEqual(0);\n },\n ),\n );\n }, 500000)", "language": "typescript", "source_file": "./repos/DPS0340/nestjs-fast-check-practice/src/presentation/controllers/account.controller.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DPS0340/nestjs-fast-check-practice", "url": "https://github.com/DPS0340/nestjs-fast-check-practice.git", "license": "MIT", "stars": 7, "forks": 0}, "metrics": null, "summary": "The test ensures that after a series of deposit and withdrawal transactions of equal amounts, the final account balance remains 0.", "mode": "fast-check"} {"id": 60433, "name": "unknown", "code": "it(\"Property test\", async () => {\n await fc.assert(\n fc.asyncProperty(fcUseModelArgs(), fc.boolean(), async (args, early) => {\n const { model, source, dispose, ready } = early\n ? useModel(...args)\n : await useModel(...args);\n if (early) await ready;\n\n const model_ = model.value;\n assertDefined(model_);\n\n const options = args?.[0];\n\n const expectedLanguage = options?.language ?? \"python\";\n expect(model_.getLanguageId()).toBe(expectedLanguage);\n\n if (isRef(options?.source)) {\n expect(source.value).toBe(options?.source.value);\n }\n\n const expectedValue = unref(options?.source ?? \"\");\n expect(model_.getValue()).toBe(expectedValue);\n\n dispose();\n }),\n { verbose: true, numRuns: 10 }, // NOTE: Error with larger numRuns\n );\n })", "language": "typescript", "source_file": "./repos/simonsobs/nextline-web/src/utils/monaco-editor/__tests__/model.spec.ts", "start_line": null, "end_line": null, "dependencies": ["fcUseModelArgs", "assertDefined"], "repo": {"name": "simonsobs/nextline-web", "url": "https://github.com/simonsobs/nextline-web.git", "license": "MIT", "stars": 4, "forks": 1}, "metrics": null, "summary": "The property should hold that the `useModel` function creates a model with a language ID and value matching the given options, or defaults to \"python\" and an empty string if no options are provided.", "mode": "fast-check"} {"id": 55410, "name": "unknown", "code": "it(\"is infallible\", () => {\n\t\t\tfc.assert(fc.property(arb, xs => f(xs) instanceof Map))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/URLSearchParams.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Verification that the function `f`, when applied to inputs generated by `arb`, always returns an instance of `Map`.", "mode": "fast-check"} {"id": 55411, "name": "unknown", "code": "it(\"is infallible\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.webUrl().map(unsafeParseURL),\n\t\t\t\t\tfc.webPath().map(fromString),\n\t\t\t\t\t(origin, path) => {\n\t\t\t\t\t\tf(origin)(path)\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/URLPath.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` should handle any combination of parsed web URLs and paths without errors.", "mode": "fast-check"} {"id": 55412, "name": "unknown", "code": "it(\"is infallible\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.oneof(fc.string(), fc.webPath()), x => {\n\t\t\t\t\tf(x)\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/URLPath.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Function `f` processes any string or web path without failure.", "mode": "fast-check"} {"id": 55417, "name": "unknown", "code": "it(\"duplicates the input\", () => {\n\t\t\tfc.assert(fc.property(fc.anything(), x => expect(f(x)).toEqual([x, x])))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Tuple.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Function `f` duplicates the input into a tuple containing two identical elements.", "mode": "fast-check"} {"id": 55418, "name": "unknown", "code": "it(\"applies the function and returns both input and output\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(nonMaxNumber, n => expect(g(n)).toEqual([increment(n), n])),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Tuple.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `g` applies an increment operation on a non-maximum number and returns a tuple containing the incremented number and the original number.", "mode": "fast-check"} {"id": 55420, "name": "unknown", "code": "it(\"applies the function and returns both input and output\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(nonMaxNumber, n => expect(g(n)).toEqual([n, increment(n)])),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Tuple.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `g` applies an operation to a number and returns a tuple containing the input and the incremented result.", "mode": "fast-check"} {"id": 55421, "name": "unknown", "code": "it(\"is the dual of toFst\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(nonMaxNumber, n =>\n\t\t\t\t\texpect(g(n)).toEqual(pipe(n, toFst(increment), swap)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Tuple.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`g(n)` should equal the result of applying `increment` to `n` with `toFst`, and then `swap`.", "mode": "fast-check"} {"id": 55422, "name": "unknown", "code": "it(\"is equivalent to a functorial toFst\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(nonMaxNumber, n =>\n\t\t\t\t\texpect(pipe(n, f(flow(increment, O.some)))).toEqual(\n\t\t\t\t\t\tpipe(n, toFst(increment), O.some),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Tuple.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The transformation `flow(increment, O.some)` applied to a number should be equivalent to using `toFst(increment)` followed by `O.some`.", "mode": "fast-check"} {"id": 55423, "name": "unknown", "code": "it(\"is equivalent to a functorial toSnd\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(nonMaxNumber, n =>\n\t\t\t\t\texpect(pipe(n, f(flow(increment, O.some)))).toEqual(\n\t\t\t\t\t\tpipe(n, toSnd(increment), O.some),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Tuple.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Checking if applying a transformation with `f` and `flow` results in the same output as using `toSnd` followed by `O.some`.", "mode": "fast-check"} {"id": 55424, "name": "unknown", "code": "it(\"is equivalent to identity at runtime\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.anything(), fc.anything(), (x, y) =>\n\t\t\t\t\texpect(f([x, y])).toEqual([x, y]),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Tuple.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` applied to a tuple `[x, y]` returns the tuple unchanged, ensuring it behaves as an identity function at runtime.", "mode": "fast-check"} {"id": 55425, "name": "unknown", "code": "it(\"returns identity on identity input\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string(), fc.string(), (l, r) =>\n\t\t\t\t\texpect(f(identity)([l, r])).toEqual([l, r]),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Tuple.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Calling function `f` with `identity` and a tuple returns the tuple unchanged.", "mode": "fast-check"} {"id": 55428, "name": "unknown", "code": "it(\"calls both provided functions and returns their outputs in order\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string(), x =>\n\t\t\t\t\texpect(fanout(O.of)(constant(\"foo\"))(x)).toEqual([O.of(x), \"foo\"]),\n\t\t\t\t),\n\t\t\t)\n\t\t\texpect(f)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Tuple.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`fanout` applies two functions to an input and returns their outputs in order.", "mode": "fast-check"} {"id": 60434, "name": "unknown", "code": "it(\"Scroll to the line number\", async () => {\n await fc.assert(\n fc.asyncProperty(\n fc_text,\n fc.nat(),\n fc.array(fc.nat()),\n async (lines, lineNoInit, lineNoUpdates) => {\n let editor!: ShallowRef;\n const element = ref(document.createElement(\"div\"));\n const source = ref(lines.join(\"\\n\"));\n const lineNo = ref(lineNoInit);\n\n await withAsyncSetup(async () => {\n const ready = useMonacoEditor({ element, source });\n ({ editor } = ready);\n useScroll(editor, lineNo);\n await ready;\n });\n\n const lineNoExpected = Math.min(lineNoInit, lines.length) || 1;\n const ranges = editor.value?.getVisibleRanges();\n expect(ranges).toBeDefined();\n expect(ranges?.length).toBe(1);\n expect(ranges?.[0].startLineNumber).toBeLessThanOrEqual(lineNoExpected);\n expect(ranges?.[0].endLineNumber).toBeGreaterThanOrEqual(lineNoExpected);\n\n for (const lineNoUpdate of lineNoUpdates) {\n lineNo.value = lineNoUpdate;\n await nextTick();\n const lineNoExpected = Math.min(lineNoUpdate, lines.length) || 1;\n const ranges = editor.value?.getVisibleRanges();\n expect(ranges).toBeDefined();\n expect(ranges?.length).toBe(1);\n expect(ranges?.[0].startLineNumber).toBeLessThanOrEqual(lineNoExpected);\n expect(ranges?.[0].endLineNumber).toBeGreaterThanOrEqual(lineNoExpected);\n }\n },\n ),\n { verbose: true, numRuns: 5 },\n );\n }, 10000)", "language": "typescript", "source_file": "./repos/simonsobs/nextline-web/src/utils/monaco-editor/__tests__/scroll.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "simonsobs/nextline-web", "url": "https://github.com/simonsobs/nextline-web.git", "license": "MIT", "stars": 4, "forks": 1}, "metrics": null, "summary": "Validates that the editor scrolls to a specified line number, ensuring it is within the visible range after each update.", "mode": "fast-check"} {"id": 60435, "name": "unknown", "code": "it(\"Options of useMonacoEditor() are generated\", () => {\n fc.assert(\n fc.property(fcUseMonacoEditorOptions(), (options) => {\n expect(options).toBeDefined();\n return true;\n }),\n );\n })", "language": "typescript", "source_file": "./repos/simonsobs/nextline-web/src/utils/monaco-editor/__tests__/editor.spec.ts", "start_line": null, "end_line": null, "dependencies": ["fcUseMonacoEditorOptions"], "repo": {"name": "simonsobs/nextline-web", "url": "https://github.com/simonsobs/nextline-web.git", "license": "MIT", "stars": 4, "forks": 1}, "metrics": null, "summary": "`useMonacoEditor` options are correctly generated as defined records with specified required keys.", "mode": "fast-check"} {"id": 55443, "name": "unknown", "code": "it(\"returns identity for non-positive number\", () => {\n\t\t\texpect(f(-1)(\"abc\")).toBe(\"abc\")\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.string(),\n\t\t\t\t\tfc.integer({ max: 0 }),\n\t\t\t\t\t(x, n) => f(n)(x) === x,\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`f` function returns the input string unchanged when the number is non-positive.", "mode": "fast-check"} {"id": 55446, "name": "unknown", "code": "it(\"returns empty on constTrue\", () => {\n\t\t\tfc.assert(fc.property(fc.string(), x => f(constTrue)(x) === \"\"))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Function `f` returns an empty string when applied to `constTrue` with any input string.", "mode": "fast-check"} {"id": 55448, "name": "unknown", "code": "it(\"drops specified number of characters\", () => {\n\t\t\texpect(f(2)(\"abc\")).toBe(\"a\")\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.string(),\n\t\t\t\t\tfc.integer({ min: 0, max: Number.MAX_SAFE_INTEGER }),\n\t\t\t\t\t(x, n) => f(n)(x).length === max(N.Ord)(0, x.length - n),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`f` should return a string reduced by the specified number of characters, or empty if the reduction exceeds the string's length.", "mode": "fast-check"} {"id": 55449, "name": "unknown", "code": "it(\"returns first character of non-empty string\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string({ minLength: 1, maxLength: 100 }), x =>\n\t\t\t\t\texpect(f(x)).toEqual(O.some(x[0])),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function returns the first character of a non-empty string wrapped in `O.some`.", "mode": "fast-check"} {"id": 55450, "name": "unknown", "code": "it(\"returns empty string for string with one character\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string({ minLength: 1, maxLength: 1 }), x =>\n\t\t\t\t\texpect(f(x)).toEqual(O.some(\"\")),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Function `f` returns `Some(\"\")` for strings containing one character.", "mode": "fast-check"} {"id": 55451, "name": "unknown", "code": "it(\"returns string one character smaller\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string({ minLength: 1, maxLength: 100 }), x =>\n\t\t\t\t\tpipe(\n\t\t\t\t\t\tf(x),\n\t\t\t\t\t\tO.exists(y => y.length === x.length - 1),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` should return a string with one fewer character than the input string of length between 1 and 100.", "mode": "fast-check"} {"id": 60436, "name": "unknown", "code": "it(\"Property test\", async () => {\n await fc.assert(\n fc.asyncProperty(\n fcUseMonacoEditorOptions(),\n fc.boolean(),\n async (options, early) => {\n let editor!: ReturnType[\"editor\"];\n let model!: ReturnType[\"model\"];\n let source!: ReturnType[\"source\"];\n let mode!: ReturnType[\"mode\"];\n let ready!: ReturnType[\"ready\"];\n const { wrapper } = await withAsyncSetup(async () => {\n ({ editor, model, source, mode, ready } = early\n ? useMonacoEditor(options)\n : await useMonacoEditor(options));\n });\n if (early) await ready;\n if (isRef(options.element) && options.element.value === undefined) {\n options.element.value = document.createElement(\"div\");\n }\n await nextTick();\n expect(editor.value).toBeDefined();\n\n const expectedSource = unref(options.source) ?? \"\";\n expect(source.value).toBe(expectedSource);\n expect(model.value?.getValue()).toBe(expectedSource);\n\n const expectedMode = unref(options.mode) ?? \"viewer\";\n expect(mode.value).toBe(expectedMode);\n\n wrapper.unmount();\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/simonsobs/nextline-web/src/utils/monaco-editor/__tests__/editor.spec.ts", "start_line": null, "end_line": null, "dependencies": ["fcUseMonacoEditorOptions"], "repo": {"name": "simonsobs/nextline-web", "url": "https://github.com/simonsobs/nextline-web.git", "license": "MIT", "stars": 4, "forks": 1}, "metrics": null, "summary": "`useMonacoEditor` initializes correctly with varying options, ensuring the `editor`, `source`, `model`, and `mode` values match expected defaults or provided settings.", "mode": "fast-check"} {"id": 55455, "name": "unknown", "code": "it(\"returns None if index out of bounds\", () => {\n\t\t\texpect(f(1)(\"a\")).toEqual(O.none)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string(), x => expect(f(x.length)(x)).toEqual(O.none)),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`f` returns `None` if the provided index is out of bounds for the given string.", "mode": "fast-check"} {"id": 55456, "name": "unknown", "code": "it(\"returns character if in bounds\", () => {\n\t\t\texpect(f(1)(\"abc\")).toEqual(O.some(\"b\"))\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string({ minLength: 1, maxLength: 100 }), x =>\n\t\t\t\t\texpect(f(0)(x)).toEqual(O.some(x[0])),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` returns the character at the specified index if it is within the string's bounds.", "mode": "fast-check"} {"id": 55462, "name": "unknown", "code": "it(\"returns empty string on constFalse\", () => {\n\t\t\tfc.assert(fc.property(fc.string(), x => f(constFalse)(x) === \"\"))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Applying `f` with `constFalse` should return an empty string for any input string `x`.", "mode": "fast-check"} {"id": 60437, "name": "unknown", "code": "it(\"handles CE era strings\", () => {\n fc.assert(\n fc.property(\n fc.date({\n min: new Date(\"0001-01-01 00:00:00\"),\n max: new Date(\"9999-12-31 23:59:59\"),\n }),\n fc.constantFrom(...TEST_FORMATS, ...ERA_TEST_FORMATS),\n (d, fmt) => {\n /**\n * This test is a bit of a hack. Basically, \"1994\" should give us\n * a start and end date that, formatted 'yyyy', will also be \"1994\".\n *\n * This ensures that July 1st formatted a certain way doesn't drift\n * into June 30th or something.\n */\n const formattedDate = format(d, fmt);\n const result = epochize(formattedDate)!;\n expect(result).toBeDefined();\n expect(format(result[0], fmt)).toBe(formattedDate);\n expect(format(result[1], fmt)).toBe(formattedDate);\n }\n ),\n { numRuns: 10000 }\n );\n })", "language": "typescript", "source_file": "./repos/kjrocker/epochal/src/lib/properties.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "kjrocker/epochal", "url": "https://github.com/kjrocker/epochal.git", "license": "MIT", "stars": 4, "forks": 0}, "metrics": null, "summary": "Dates formatted in the CE era should, when processed and reformatted, remain consistent without drifting to incorrect dates.", "mode": "fast-check"} {"id": 60438, "name": "unknown", "code": "it(\"handles BC era strings\", () => {\n fc.assert(\n fc.property(\n fc.date({\n min: new Date(\"0000-12-31 23:59:59\"),\n max: new Date(\"-9999-12-31 23:59:59\"),\n }),\n fc.constantFrom(...ERA_TEST_FORMATS),\n (d, fmt) => {\n /**\n * The same as before, but with BC era dates and only formats that include era\n */\n const formattedDate = format(d, fmt);\n const result = epochize(formattedDate)!;\n expect(result).toBeDefined();\n expect(format(result[0], fmt)).toBe(formattedDate);\n expect(format(result[1], fmt)).toBe(formattedDate);\n }\n ),\n { numRuns: 10000 }\n );\n })", "language": "typescript", "source_file": "./repos/kjrocker/epochal/src/lib/properties.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "kjrocker/epochal", "url": "https://github.com/kjrocker/epochal.git", "license": "MIT", "stars": 4, "forks": 0}, "metrics": null, "summary": "The function `epochize` correctly processes BC era date strings, and the formatted dates match the original input when processed and re-formatted.", "mode": "fast-check"} {"id": 55464, "name": "unknown", "code": "it(\"first and last elements are the same as splits at index\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.integer(), fc.string(), (index, str) => {\n\t\t\t\t\tconst tuple = splitAt(index)(str)\n\t\t\t\t\treturn (\n\t\t\t\t\t\ttuple[0] === S.slice(0, index)(str) &&\n\t\t\t\t\t\ttuple[1] === S.slice(index, Number.POSITIVE_INFINITY)(str)\n\t\t\t\t\t)\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Splitting a string at a given index results in a tuple where the first element matches the substring from the start to the index, and the second element matches the substring from the index to the end.", "mode": "fast-check"} {"id": 55465, "name": "unknown", "code": "it(\"removes prefix if present\", () => {\n\t\t\texpect(f(\"foo\")(\"foobar\")).toBe(\"bar\")\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string(), fc.string(), (x, y) => f(y)(y + x) === x),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` removes a specified prefix from a string if it is present.", "mode": "fast-check"} {"id": 55467, "name": "unknown", "code": "it(\"removes suffix if present\", () => {\n\t\t\texpect(f(\"bar\")(\"foobar\")).toBe(\"foo\")\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string(), fc.string(), (x, y) => f(y)(x + y) === x),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "If a string ends with a given suffix, the suffix is removed from the string.", "mode": "fast-check"} {"id": 55473, "name": "unknown", "code": "it(\"cannot find anything in empty object\", () => {\n\t\t\tfc.assert(fc.property(fc.string(), x => O.isNone(f({})(x))))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyRecord.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Finding a value in an empty object should always return `None`.", "mode": "fast-check"} {"id": 55476, "name": "unknown", "code": "it(\"has every unique transformed value as a key\", () => {\n\t\t\tconst g = fromNumber\n\t\t\tconst h: (x: RR.ReadonlyRecord) => ReadonlyArray =\n\t\t\t\tflow(values, RA.uniq(N.Eq), RA.map(g))\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.dictionary(fc.string(), fc.integer()), x =>\n\t\t\t\t\tpipe(x, f(g), RR.keys, ks =>\n\t\t\t\t\t\tpipe(\n\t\t\t\t\t\t\th(x),\n\t\t\t\t\t\t\tRA.every(k => RA.elem(S.Eq)(k)(ks)),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyRecord.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Every unique transformed value from a `ReadonlyRecord` should be present as a key after applying a function to the record's values.", "mode": "fast-check"} {"id": 55477, "name": "unknown", "code": "it(\"joins\", () => {\n\t\t\texpect(f([])).toBe(\"\")\n\t\t\texpect(f([\"x\"])).toBe(\"x\")\n\t\t\texpect(f([\"x\", \"yz\"])).toBe(\"x,yz\")\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.string()), xs => {\n\t\t\t\t\tconst countDelims = flow(\n\t\t\t\t\t\tsplit(\"\"),\n\t\t\t\t\t\tA.filter(c => c === delim),\n\t\t\t\t\t\tA.size,\n\t\t\t\t\t)\n\n\t\t\t\t\tconst countDelimsA = flow(A.map(countDelims), concatAll(N.MonoidSum))\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\tcountDelims(f(xs)) ===\n\t\t\t\t\t\tcountDelimsA(xs) + max(N.Ord)(0, A.size(xs) - 1)\n\t\t\t\t\t)\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The test checks that the function `f`, which joins an array of strings, results in a delimiter count that matches the expected count based on the input strings and their sizes.", "mode": "fast-check"} {"id": 55478, "name": "unknown", "code": "it(\"always returns a non-empty array\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.integer()),\n\t\t\t\t\tfc.integer(),\n\t\t\t\t\t(xs, y) => !!f(N.Eq)(y)(xs).length,\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` returns a non-empty array when applied to an array of integers and a single integer.", "mode": "fast-check"} {"id": 55480, "name": "unknown", "code": "it(\"returns updated array wrapped in Some if index is okay\", () => {\n\t\t\texpect(f(0)([\"x\"])([])).toEqual(O.some([\"x\"]))\n\t\t\texpect(g([\"x\"])).toEqual(O.some([\"x\", \"a\", \"b\"]))\n\t\t\texpect(g([\"x\", \"y\"])).toEqual(O.some([\"x\", \"a\", \"b\", \"y\"]))\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.anything(), {\n\t\t\t\t\t\tminLength: 1,\n\t\t\t\t\t\tmaxLength: 5,\n\t\t\t\t\t}) as fc.Arbitrary>,\n\t\t\t\t\tfc.integer({ min: 0, max: 10 }),\n\t\t\t\t\t(xs, i) => O.isSome(f(i)(xs)(xs)) === i <= A.size(xs),\n\t\t\t\t),\n\t\t\t)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.string(), { minLength: 1, maxLength: 20 }),\n\t\t\t\t\txs =>\n\t\t\t\t\t\texpect(pipe(g(xs), O.map(A.size))).toEqual(O.some(A.size(xs) + 2)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` returns an updated array wrapped in `Some` when the index is within bounds, and the function `g` appends specific elements to a non-empty array, increasing its size by 2, both verified through property-based testing.", "mode": "fast-check"} {"id": 60445, "name": "unknown", "code": "it(\"should respect list({ limit }) with random keys/values (fast-check)\", async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.array(fc.tuple(fc.string({ minLength: 1, maxLength: 32 }), fc.string({ minLength: 1, maxLength: 32 })), { minLength: 3, maxLength: 10 }),\n fc.integer({ min: 1, max: 10 }),\n async (entries, limit) => {\n const kv = mockKVNamespace();\n for (const [key, value] of entries) await kv.put(key, value);\n const { keys } = await kv.list({ limit });\n expect(keys.length).toBeLessThanOrEqual(limit);\n for (const { name } of keys) {\n expect(entries.map(([k]) => k)).toContain(name);\n }\n }\n ),\n { numRuns: 20 }\n );\n })", "language": "typescript", "source_file": "./repos/variablesoftware/mock-kv/tests/mockKVNamespace/listing.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "variablesoftware/mock-kv", "url": "https://github.com/variablesoftware/mock-kv.git", "license": "MIT", "stars": 3, "forks": 0}, "metrics": null, "summary": "Checking that the `list` method respects a specified limit on the number of entries returned and that all returned keys exist in the original set of entries.", "mode": "fast-check"} {"id": 55492, "name": "unknown", "code": "it(\"returns empty array for non-positive input number\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.integer({ max: 0 }),\n\t\t\t\t\tfc.array(fc.anything()),\n\t\t\t\t\t(n, xs) => !f(n)(xs).length,\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` should return an empty array when the input number is non-positive.", "mode": "fast-check"} {"id": 60446, "name": "unknown", "code": "it(\"should respect list({ prefix }) with random keys/values (fast-check)\", async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.array(fc.tuple(fc.string({ minLength: 1, maxLength: 16 }), fc.string({ minLength: 1, maxLength: 16 })), { minLength: 3, maxLength: 10 }),\n fc.string({ minLength: 1, maxLength: 4 }),\n async (entries, prefix) => {\n const kv = mockKVNamespace();\n for (const [key, value] of entries) await kv.put(key, value);\n const { keys } = await kv.list({ prefix });\n // Build allKeys from the final state of the KV store\n const allKeys = (await kv.list({})).keys.map(k => k.name);\n const allWhitespace = allKeys.length > 0 && allKeys.every(k => /^\\s+$/.test(k));\n // If all keys are whitespace and prefix contains any non-whitespace character, result must be empty\n if (allWhitespace && /[^\\s]/.test(prefix)) {\n expect(keys.map(k => k.name)).toEqual([]);\n return;\n }\n const expected = allKeys.filter(k => k.startsWith(prefix));\n expect(keys.map(k => k.name).sort()).toEqual(expected.sort());\n // All returned keys must start with the prefix\n for (const { name } of keys) {\n expect(name.startsWith(prefix)).toBe(true);\n }\n }\n ),\n { numRuns: 20 }\n );\n })", "language": "typescript", "source_file": "./repos/variablesoftware/mock-kv/tests/mockKVNamespace/listing.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "variablesoftware/mock-kv", "url": "https://github.com/variablesoftware/mock-kv.git", "license": "MIT", "stars": 3, "forks": 0}, "metrics": null, "summary": "`mockKVNamespace.list` correctly filters and returns keys starting with a specified prefix from a randomized set of key-value pairs.", "mode": "fast-check"} {"id": 60447, "name": "unknown", "code": "it(\"should store and retrieve metadata with values (fast-check)\", async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.string({ minLength: 1, maxLength: 32 }),\n fc.string({ minLength: 1, maxLength: 32 }),\n fc.anything(),\n async (key, value, meta) => {\n const kv = mockKVNamespace();\n await kv.put(key, value, { metadata: meta });\n let expected;\n try {\n expected = meta === undefined ? null : JSON.parse(JSON.stringify(meta));\n } catch {\n expected = null;\n }\n const { value: v, metadata: m } = await kv.getWithMetadata(key) ?? {};\n expect(v).toBe(value);\n expect(m).toEqual(expected);\n }\n ),\n { numRuns: 20 }\n );\n })", "language": "typescript", "source_file": "./repos/variablesoftware/mock-kv/tests/mockKVNamespace/metadata.property.fastcheck.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "variablesoftware/mock-kv", "url": "https://github.com/variablesoftware/mock-kv.git", "license": "MIT", "stars": 3, "forks": 0}, "metrics": null, "summary": "Storing and retrieving metadata with values in a key-value store should return the exact stored value and correctly handle the associated metadata, even if it's `undefined` or non-JSON serializable.", "mode": "fast-check"} {"id": 55500, "name": "unknown", "code": "it(\"moves source to target\", () => {\n\t\t\texpect(f(0)(1)([\"a\", \"b\", \"c\"])).toEqual(O.some([\"b\", \"a\", \"c\"]))\n\t\t\texpect(f(1)(0)([\"a\", \"b\", \"c\"])).toEqual(O.some([\"b\", \"a\", \"c\"]))\n\n\t\t\tconst n = 10\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.anything(), { minLength: n, maxLength: n }),\n\t\t\t\t\tfc.integer({ min: 0, max: n - 1 }),\n\t\t\t\t\tfc.integer({ min: 0, max: n - 1 }),\n\t\t\t\t\t(xs, i, j) => O.isSome(f(i)(j)(xs)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` should move an element from a source index to a target index in an array, resulting in a non-empty optional type.", "mode": "fast-check"} {"id": 60448, "name": "unknown", "code": "it(\"should update metadata for a key (fast-check)\", async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.string({ minLength: 1, maxLength: 32 }),\n fc.string({ minLength: 1, maxLength: 32 }),\n fc.anything(),\n fc.anything(),\n async (key, value, meta1, meta2) => {\n const kv = mockKVNamespace();\n await kv.put(key, value, { metadata: meta1 });\n let expected;\n try {\n expected = meta2 === undefined ? null : JSON.parse(JSON.stringify(meta2));\n } catch {\n expected = null;\n }\n await kv.put(key, value, { metadata: meta2 });\n const { metadata: m } = await kv.getWithMetadata(key) ?? {};\n expect(m).toEqual(expected);\n }\n ),\n { numRuns: 20 }\n );\n })", "language": "typescript", "source_file": "./repos/variablesoftware/mock-kv/tests/mockKVNamespace/metadata.property.fastcheck.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "variablesoftware/mock-kv", "url": "https://github.com/variablesoftware/mock-kv.git", "license": "MIT", "stars": 3, "forks": 0}, "metrics": null, "summary": "Updating the metadata for a key in a `mockKVNamespace` should reflect the latest provided metadata, with changes being accurately retrieved.", "mode": "fast-check"} {"id": 55502, "name": "unknown", "code": "it(\"sibling indices are interchangeable\", () => {\n\t\t\tconst n = 10\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.anything(), { minLength: n, maxLength: n }),\n\t\t\t\t\tfc.integer({ min: 0, max: n - 2 }),\n\t\t\t\t\t(xs, i) => expect(f(i)(i + 1)(xs)).toEqual(f(i + 1)(i)(xs)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Two adjacent indices in an array should yield the same result when swapped using function `f`.", "mode": "fast-check"} {"id": 60449, "name": "unknown", "code": "it(\"should round-trip deep/nested JSON objects (fast-check)\", async () => {\n await fc.assert(\n fc.asyncProperty(exoticKeyArb, deepJsonArb, async (key, obj) => {\n // Filter out unsafe/prototype keys\n if ([\"toString\",\"hasOwnProperty\",\"valueOf\",\"constructor\",\"__proto__\",\"isPrototypeOf\",\"propertyIsEnumerable\",\"toLocaleString\"].includes(key)) return;\n // Filter out undefined, which cannot be stringified and stored\n if (typeof obj === \"undefined\") return;\n // Filter out values that cannot be round-tripped by JSON\n function isJsonSafe(val: unknown): boolean {\n if (typeof val === \"bigint\" || typeof val === \"function\" || typeof val === \"symbol\") return false;\n if (typeof val === \"number\" && (!Number.isFinite(val) || Number.isNaN(val))) return false;\n if (Array.isArray(val)) return val.every(isJsonSafe);\n if (val && typeof val === \"object\") return Object.values(val).every(isJsonSafe);\n return true;\n }\n if (!isJsonSafe(obj)) return;\n const kv = mockKVNamespace();\n await kv.put(key, JSON.stringify(obj));\n const result = await kv.get(key, { type: \"json\" });\n // Use deepNullishEqual to treat null/undefined as equivalent everywhere\n expect(deepNullishEqual(result, obj)).toBe(true);\n }),\n { numRuns: 30 }\n );\n })", "language": "typescript", "source_file": "./repos/variablesoftware/mock-kv/tests/mockKVNamespace/json.property.fastcheck.test.ts", "start_line": null, "end_line": null, "dependencies": ["deepNullishEqual"], "repo": {"name": "variablesoftware/mock-kv", "url": "https://github.com/variablesoftware/mock-kv.git", "license": "MIT", "stars": 3, "forks": 0}, "metrics": null, "summary": "Round-tripping deep or nested JSON objects through `mockKVNamespace` retains nullish equality, ensuring the retrieved object is equivalent to the original, with special treatment for `null` and `undefined`.", "mode": "fast-check"} {"id": 60450, "name": "unknown", "code": "it(\"should handle invalid JSON parsing gracefully (fast-check)\", async () => {\n await fc.assert(\n fc.asyncProperty(exoticKeyArb, async (key) => {\n if ([\"toString\",\"hasOwnProperty\",\"valueOf\",\"constructor\",\"__proto__\",\"isPrototypeOf\",\"propertyIsEnumerable\",\"toLocaleString\"].includes(key)) return;\n const kv = mockKVNamespace();\n await kv.put(key, \"not-valid-json\");\n const result = await kv.get(key, { type: \"json\" });\n expect(result).toBeNull();\n }),\n { numRuns: 30 }\n );\n })", "language": "typescript", "source_file": "./repos/variablesoftware/mock-kv/tests/mockKVNamespace/json.property.fastcheck.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "variablesoftware/mock-kv", "url": "https://github.com/variablesoftware/mock-kv.git", "license": "MIT", "stars": 3, "forks": 0}, "metrics": null, "summary": "Mock KV store returns `null` when attempting to parse invalid JSON for specified exotic keys.", "mode": "fast-check"} {"id": 60451, "name": "unknown", "code": "it(\"should store and retrieve values via put/get (fast-check, step 5)\", async () => {\n await fc.assert(\n fc.asyncProperty(safeUnicodeKeyArb, safeUnicodeValueArb, async (key, value) => {\n const kv = mockKVNamespace();\n await kv.put(key, value);\n expect(await kv.get(key)).toBe(value);\n }), { numRuns: 20 }\n );\n })", "language": "typescript", "source_file": "./repos/variablesoftware/mock-kv/tests/mockKVNamespace/property.fastcheck.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "variablesoftware/mock-kv", "url": "https://github.com/variablesoftware/mock-kv.git", "license": "MIT", "stars": 3, "forks": 0}, "metrics": null, "summary": "Values stored using `put` should be accurately retrieved using `get` with consistent key-value pairs.", "mode": "fast-check"} {"id": 55510, "name": "unknown", "code": "it(\"all numbers are above zero\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.string()),\n\t\t\t\t\tflow(\n\t\t\t\t\t\tf(identity),\n\t\t\t\t\t\tvalues,\n\t\t\t\t\t\tA.every(n => n > 0),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "All transformed values from a string array must be greater than zero.", "mode": "fast-check"} {"id": 55511, "name": "unknown", "code": "it(\"constTrue returns empty array\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.anything()), xs =>\n\t\t\t\t\texpect(f(constTrue)(xs)).toEqual([]),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`constTrue` applied to any array results in an empty array.", "mode": "fast-check"} {"id": 55512, "name": "unknown", "code": "it(\"constFalse returns original array\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.anything()), xs =>\n\t\t\t\t\texpect(f(constFalse)(xs)).toEqual(xs),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`constFalse` applied to an array returns the original array unchanged.", "mode": "fast-check"} {"id": 60452, "name": "unknown", "code": "it(\"should handle bulk put/get/delete (fast-check, step 5)\", async () => {\n await fc.assert(\n fc.asyncProperty(safeArrayEntriesArb, async (entries) => {\n // Filter to unique keys only (last value wins, to match put semantics)\n const uniqueEntries = Array.from(new Map(entries.map(([k, v]) => [k, v])).entries());\n const kv = mockKVNamespace();\n for (const [key, value] of uniqueEntries) {\n await kv.put(key, value);\n }\n for (const [key, value] of uniqueEntries) {\n expect(await kv.get(key)).toBe(value);\n }\n for (const [key] of uniqueEntries) {\n await kv.delete(key);\n expect(await kv.get(key)).toBeNull();\n }\n }), { numRuns: 20 }\n );\n })", "language": "typescript", "source_file": "./repos/variablesoftware/mock-kv/tests/mockKVNamespace/property.fastcheck.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "variablesoftware/mock-kv", "url": "https://github.com/variablesoftware/mock-kv.git", "license": "MIT", "stars": 3, "forks": 0}, "metrics": null, "summary": "`mockKVNamespace` should correctly handle bulk operations of put, get, and delete for unique keys, ensuring that key-value pairs are accurately stored, retrieved, and removed.", "mode": "fast-check"} {"id": 55514, "name": "unknown", "code": "it(\"calculates the median\", () => {\n\t\t\texpect(f([2, 9, 7])).toBe(7)\n\t\t\texpect(f([7, 2, 10, 9])).toBe(8)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.integer({ min: 1, max: 50 }),\n\t\t\t\t\tfc.integer(),\n\t\t\t\t\t(x, y) => f(A.replicate(x, y) as ReadonlyNonEmptyArray) === y,\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` should return `y` as the median when `x` copies of `y` are provided in a `ReadonlyNonEmptyArray`.", "mode": "fast-check"} {"id": 55515, "name": "unknown", "code": "it(\"maintains same flattened size\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.array(fc.anything())),\n\t\t\t\t\txs => A.size(A.flatten(xs)) === A.size(A.flatten(f(xs))),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Flattening a nested array should result in the same size before and after applying function `f` if the contents are unchanged.", "mode": "fast-check"} {"id": 60453, "name": "unknown", "code": "it(\"should return null when deleting unknown keys (fast-check, step 5)\", async () => {\n await fc.assert(\n fc.asyncProperty(safeUnicodeKeyArb, async (key) => {\n const kv = mockKVNamespace();\n await kv.delete(key); // Should not throw\n expect(await kv.get(key)).toBeNull();\n }), { numRuns: 20 }\n );\n })", "language": "typescript", "source_file": "./repos/variablesoftware/mock-kv/tests/mockKVNamespace/property.fastcheck.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "variablesoftware/mock-kv", "url": "https://github.com/variablesoftware/mock-kv.git", "license": "MIT", "stars": 3, "forks": 0}, "metrics": null, "summary": "Deleting unknown keys should return null.", "mode": "fast-check"} {"id": 60454, "name": "unknown", "code": "it(\"should round-trip JSON objects via put/get with type: 'json' (fast-check, step 5)\", async () => {\n await fc.assert(\n fc.asyncProperty(safeUnicodeKeyArb, safeJsonArb, async (key, obj) => {\n if (unsafeKeys.includes(key)) return;\n const kv = mockKVNamespace();\n const value = JSON.stringify(obj);\n await kv.put(key, value);\n expect(await kv.get(key, { type: 'json' })).toEqual(obj);\n }), { numRuns: 20 }\n );\n })", "language": "typescript", "source_file": "./repos/variablesoftware/mock-kv/tests/mockKVNamespace/property.fastcheck.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "variablesoftware/mock-kv", "url": "https://github.com/variablesoftware/mock-kv.git", "license": "MIT", "stars": 3, "forks": 0}, "metrics": null, "summary": "Putting and then getting a JSON object with `type: 'json'` should preserve the object's integrity.", "mode": "fast-check"} {"id": 60455, "name": "unknown", "code": "it(\"should handle edge-case unicode keys and values (fast-check, step 5)\", async () => {\n await fc.assert(\n fc.asyncProperty(safeUnicodeKeyArb, safeUnicodeValueArb, async (key, value) => {\n if (unsafeKeys.includes(key) || key.startsWith(\"_\") || key.endsWith(\"_\") || key.includes(\"__\")) return;\n const kv = mockKVNamespace();\n await kv.put(key, value);\n expect(await kv.get(key)).toBe(value);\n }), { numRuns: 20 }\n );\n })", "language": "typescript", "source_file": "./repos/variablesoftware/mock-kv/tests/mockKVNamespace/property.fastcheck.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "variablesoftware/mock-kv", "url": "https://github.com/variablesoftware/mock-kv.git", "license": "MIT", "stars": 3, "forks": 0}, "metrics": null, "summary": "`mockKVNamespace` handles putting and getting values for edge-case Unicode keys, provided they do not match disallowed patterns.", "mode": "fast-check"} {"id": 60456, "name": "unknown", "code": "it(\"should respect expirationTtl (fast-check, step 5)\", async () => {\n await fc.assert(\n fc.asyncProperty(safeUnicodeKeyArb, safeUnicodeValueArb, safeTtlArb, async (key, value, ttl) => {\n const kv = mockKVNamespace();\n await kv.put(key, value, { expirationTtl: ttl });\n expect(await kv.get(key)).toBe(value);\n // Simulate expiration using the test-only method\n (kv as any).expireKeyNow(key);\n // If the key is present after expiration, it should be null; if not present, that's also valid\n const result = await kv.get(key);\n if (!(result === null || result === undefined)) {\n // Debug output for whitespace key/value edge case\n throw new Error(`Expected expired key to be null/undefined, but got value for key: '${key}' (length: ${key.length}), value: '${value}' (length: ${value.length}), ttl: ${ttl}, result: ${result}`);\n }\n expect(result === null || result === undefined).toBe(true);\n }), { numRuns: 20 }\n );\n })", "language": "typescript", "source_file": "./repos/variablesoftware/mock-kv/tests/mockKVNamespace/property.fastcheck.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "variablesoftware/mock-kv", "url": "https://github.com/variablesoftware/mock-kv.git", "license": "MIT", "stars": 3, "forks": 0}, "metrics": null, "summary": "The test ensures that after using `expirationTtl` to store a key-value pair in `mockKVNamespace`, the value becomes null or undefined when accessed after expiration is simulated.", "mode": "fast-check"} {"id": 60457, "name": "unknown", "code": "it(\"should respect list limits (fast-check, step 5)\", async () => {\n await fc.assert(\n fc.asyncProperty(\n safeArrayEntriesArb,\n safeLimitArb,\n async (entries, limit) => {\n const kv = mockKVNamespace();\n for (const [key, value] of entries) {\n await kv.put(key, value);\n }\n const listed = await kv.list({ limit });\n expect(listed.keys.length).toBeLessThanOrEqual(limit);\n for (const { name } of listed.keys) {\n expect(entries.map(([k]) => k)).toContain(name);\n }\n }\n ), { numRuns: 20 }\n );\n })", "language": "typescript", "source_file": "./repos/variablesoftware/mock-kv/tests/mockKVNamespace/property.fastcheck.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "variablesoftware/mock-kv", "url": "https://github.com/variablesoftware/mock-kv.git", "license": "MIT", "stars": 3, "forks": 0}, "metrics": null, "summary": "The `list` function should return a number of keys that is less than or equal to the specified limit and all returned keys must exist in the input entries.", "mode": "fast-check"} {"id": 55525, "name": "unknown", "code": "it(\"equal length inputs is equivalent to normal zip mapped to These\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.anything()), xs => {\n\t\t\t\t\tconst ys = A.reverse(xs)\n\t\t\t\t\texpect(f(xs)(ys)).toEqual(\n\t\t\t\t\t\tpipe(\n\t\t\t\t\t\t\tA.zip(xs)(ys),\n\t\t\t\t\t\t\tA.map(([x, y]) => T.both(x, y)),\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Equal length inputs result in the function `f(xs)(ys)` being equivalent to zipping and mapping `xs` and `ys` into `These` pairs when `ys` is the reverse of `xs`.", "mode": "fast-check"} {"id": 55526, "name": "unknown", "code": "it(\"output length is equal to largest input length\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.anything()),\n\t\t\t\t\tfc.array(fc.anything()),\n\t\t\t\t\t(xs, ys) => A.size(f(xs)(ys)) === max(N.Ord)(A.size(xs), A.size(ys)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` applied to two arrays should produce an output whose length equals the length of the larger input array.", "mode": "fast-check"} {"id": 60458, "name": "unknown", "code": "it(\"should parse stored JSON when type is 'json'\", async () => {\n await fc.assert(\n fc.asyncProperty(snakeCaseKeyArb, jsonValueArb, async (key, obj) => {\n const kv = mockKVNamespace();\n await kv.put(key, JSON.stringify(obj));\n const result = await kv.get(key, { type: \"json\" });\n expect(result).toEqual(obj);\n })\n );\n })", "language": "typescript", "source_file": "./repos/variablesoftware/mock-kv/tests/mockKVNamespace/json.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "variablesoftware/mock-kv", "url": "https://github.com/variablesoftware/mock-kv.git", "license": "MIT", "stars": 3, "forks": 0}, "metrics": null, "summary": "Stored JSON should be correctly parsed and retrieved as an object when the type is specified as 'json'.", "mode": "fast-check"} {"id": 55531, "name": "unknown", "code": "it(\"returns These Left for only Either Lefts\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.anything(), { minLength: 1 }), xs => {\n\t\t\t\t\tconst ys = pipe(\n\t\t\t\t\t\txs as ReadonlyArray as ReadonlyNonEmptyArray,\n\t\t\t\t\t\tRNEA.map(E.left),\n\t\t\t\t\t)\n\n\t\t\t\t\texpect(f(ys)).toEqual(T.left(xs))\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "For an array of `Either` left values, the function should return `These` left containing the same array.", "mode": "fast-check"} {"id": 60460, "name": "unknown", "code": "it(\"should allow overwriting a key multiple times (fast-check)\", async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.string({ minLength: 1, maxLength: 32 }),\n fc.array(fc.string({ minLength: 1, maxLength: 32 }), { minLength: 2, maxLength: 6 }),\n async (key, values) => {\n const kv = mockKVNamespace();\n for (const value of values) await kv.put(key, value);\n expect(await kv.get(key)).toBe(values[values.length - 1]);\n }\n ),\n { numRuns: 20 }\n );\n })", "language": "typescript", "source_file": "./repos/variablesoftware/mock-kv/tests/mockKVNamespace/advanced.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "variablesoftware/mock-kv", "url": "https://github.com/variablesoftware/mock-kv.git", "license": "MIT", "stars": 3, "forks": 0}, "metrics": null, "summary": "Overwriting a key multiple times in `mockKVNamespace` should result in the key storing the last assigned value.", "mode": "fast-check"} {"id": 60461, "name": "unknown", "code": "it(\"should support unicode and special characters in keys/values (fast-check)\", async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.string({ minLength: 1, maxLength: 16 }),\n fc.string({ minLength: 1, maxLength: 16 }),\n async (key, value) => {\n const kv = mockKVNamespace();\n await kv.put(key, value);\n expect(await kv.get(key)).toBe(value);\n }\n ),\n { numRuns: 20 }\n );\n })", "language": "typescript", "source_file": "./repos/variablesoftware/mock-kv/tests/mockKVNamespace/advanced.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "variablesoftware/mock-kv", "url": "https://github.com/variablesoftware/mock-kv.git", "license": "MIT", "stars": 3, "forks": 0}, "metrics": null, "summary": "Verifies that the mockKVNamespace can correctly store and retrieve keys and values containing Unicode and special characters.", "mode": "fast-check"} {"id": 55534, "name": "unknown", "code": "it(\"always returns a non-empty output\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.boolean(), { minLength: 1 }), xs => {\n\t\t\t\t\tconst ys: ReadonlyNonEmptyArray> = pipe(\n\t\t\t\t\t\txs as ReadonlyArray as ReadonlyNonEmptyArray,\n\t\t\t\t\t\tRNEA.map(b => (b ? E.right(b) : E.left(b))),\n\t\t\t\t\t)\n\n\t\t\t\t\tconst zs: ReadonlyNonEmptyArray = pipe(\n\t\t\t\t\t\tys,\n\t\t\t\t\t\tf,\n\t\t\t\t\t\tT.match(identity, identity, (ls, rs) => RNEA.concat(ls)(rs)),\n\t\t\t\t\t)\n\n\t\t\t\t\texpect(A.size(zs)).toBeGreaterThan(0)\n\t\t\t\t\texpect(A.size(zs)).toBe(A.size(xs))\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The output array, processed through transformations involving `ReadonlyNonEmptyArray` and `Either`, should always be non-empty and maintain the same size as the input array.", "mode": "fast-check"} {"id": 60462, "name": "unknown", "code": "it(\"should not return expired keys in list (fast-check)\", async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.string({ minLength: 1, maxLength: 16 }),\n fc.string({ minLength: 1, maxLength: 16 }),\n async (keepKey, expireKey) => {\n if (keepKey === expireKey) return;\n const kv = mockKVNamespace();\n await kv.put(keepKey, \"keep\");\n await kv.put(expireKey, \"expire\", { expiration: Math.floor(Date.now() / 1000) - 10 });\n const { keys } = await kv.list();\n expect(keys.map(k => k.name)).toContain(keepKey);\n expect(keys.map(k => k.name)).not.toContain(expireKey);\n }\n ),\n { numRuns: 20 }\n );\n })", "language": "typescript", "source_file": "./repos/variablesoftware/mock-kv/tests/mockKVNamespace/advanced.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "variablesoftware/mock-kv", "url": "https://github.com/variablesoftware/mock-kv.git", "license": "MIT", "stars": 3, "forks": 0}, "metrics": null, "summary": "Expired keys should not be included in the list of keys returned by `mockKVNamespace`.", "mode": "fast-check"} {"id": 60464, "name": "unknown", "code": "test('decode optional string', () => {\n fc.assert(\n fc.property(fc.oneof(fc.string(), fc.constant(undefined)), (s) => {\n expect(optional(string)(s)).toBe(s);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/tskj/typescript-json-decoder/tests/property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tskj/typescript-json-decoder", "url": "https://github.com/tskj/typescript-json-decoder.git", "license": "MIT", "stars": 59, "forks": 7}, "metrics": null, "summary": "The `optional(string)` function should return the input value, whether it is a string or undefined.", "mode": "fast-check"} {"id": 60465, "name": "unknown", "code": "test('decode number', () => {\n fc.assert(\n fc.property(fc.float(), (n) => {\n expect(number(n)).toBe(n);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/tskj/typescript-json-decoder/tests/property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tskj/typescript-json-decoder", "url": "https://github.com/tskj/typescript-json-decoder.git", "license": "MIT", "stars": 59, "forks": 7}, "metrics": null, "summary": "The `number` function should return the input float as is, maintaining equality.", "mode": "fast-check"} {"id": 60466, "name": "unknown", "code": "test('decode string tuple', () => {\n fc.assert(\n fc.property(fc.string(), fc.string(), (s1, s2) => {\n expect(tuple(string, string)([s1, s2])).toEqual([s1, s2]);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/tskj/typescript-json-decoder/tests/property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tskj/typescript-json-decoder", "url": "https://github.com/tskj/typescript-json-decoder.git", "license": "MIT", "stars": 59, "forks": 7}, "metrics": null, "summary": "The `tuple` function correctly decodes an array of strings into a tuple of strings.", "mode": "fast-check"} {"id": 55537, "name": "unknown", "code": "it(\"extracts expected TaskEither left from a ReaderTaskEither\", async () => {\n\t\t\ttype Env = { dependency: string }\n\t\t\tconst env: Env = { dependency: \"dependency\" }\n\t\t\tawait fc.assert(\n\t\t\t\tfc.asyncProperty(fc.integer(), async _ => {\n\t\t\t\t\tconst rte: RTE.ReaderTaskEither = pipe(\n\t\t\t\t\t\tE.left(_),\n\t\t\t\t\t\tRTE.fromEither,\n\t\t\t\t\t)\n\t\t\t\t\tconst extractedLeft = pipe(rte, runReaderTaskEither(env))()\n\t\t\t\t\tawait expect(extractedLeft).resolves.toStrictEqual(E.left(_))\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReaderTaskEither.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Extracting the expected left value from a `ReaderTaskEither` using a given environment results in the correct `TaskEither` left.", "mode": "fast-check"} {"id": 60467, "name": "unknown", "code": "test('decode string,number tuple', () => {\n fc.assert(\n fc.property(fc.string(), fc.float(), (s, n) => {\n expect(tuple(string, number)([s, n])).toEqual([s, n]);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/tskj/typescript-json-decoder/tests/property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tskj/typescript-json-decoder", "url": "https://github.com/tskj/typescript-json-decoder.git", "license": "MIT", "stars": 59, "forks": 7}, "metrics": null, "summary": "The `tuple` function correctly decodes a tuple containing a string and a number, returning the original values.", "mode": "fast-check"} {"id": 60469, "name": "unknown", "code": "it('property: flatten equals original and chunk lengths are valid', () => {\n fc.assert(\n fc.property(\n fc.array(fc.integer()),\n fc.integer({ min: 1, max: 20 }),\n (arr, n) => {\n const out = collections.chunkArray(arr, n);\n\n expect(out.flat()).toEqual(arr);\n out.forEach((chunk) => expect(chunk.length).toBeGreaterThan(0));\n out.slice(0, -1).forEach((chunk) => expect(chunk.length).toBe(n));\n\n if (out.length > 0) {\n expect(out[out.length - 1].length).toBeLessThanOrEqual(n);\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/6529-Collections/6529seize-backend/src/tests/chunk-array.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "6529-Collections/6529seize-backend", "url": "https://github.com/6529-Collections/6529seize-backend.git", "license": "Apache-2.0", "stars": 6, "forks": 5}, "metrics": null, "summary": "Flattening the output of `chunkArray` should equal the original array, each chunk should have a positive length, all chunks except possibly the last should have length `n`, and the last chunk should have a length less than or equal to `n`.", "mode": "fast-check"} {"id": 60471, "name": "unknown", "code": "it('rejects any float string', () => {\n fc.assert(\n fc.property(\n fc\n .double({ noNaN: true, noDefaultInfinity: true })\n .filter((d) => !Number.isInteger(d)),\n (d) => {\n expect(numbers.parseIntOrNull(d.toString())).toBeNull();\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/6529-Collections/6529seize-backend/src/tests/numbers.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "6529-Collections/6529seize-backend", "url": "https://github.com/6529-Collections/6529seize-backend.git", "license": "Apache-2.0", "stars": 6, "forks": 5}, "metrics": null, "summary": "`numbers.parseIntOrNull` should return `null` for any non-integer float strings.", "mode": "fast-check"} {"id": 60474, "name": "unknown", "code": "it('should capitalize a word, even if it\\'s already capitalized', () =>\n fc.assert(\n fc.property(fc.string(), (str) => {\n const capitalized = capitalize(str);\n\n return capitalized[0] === capitalized[0]?.toUpperCase();\n }),\n ))", "language": "typescript", "source_file": "./repos/NDLANO/h5p-editor-topic-map/src/utils/string.utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "NDLANO/h5p-editor-topic-map", "url": "https://github.com/NDLANO/h5p-editor-topic-map.git", "license": "MIT", "stars": 0, "forks": 2}, "metrics": null, "summary": "The `capitalize` function should ensure the first character of a string is uppercase, regardless of its initial state.", "mode": "fast-check"} {"id": 55552, "name": "unknown", "code": "it(\"returns constant empty/zero on false\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.anything(), x =>\n\t\t\t\t\texpect(f(false)(constant(x))).toEqual(O.none),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55548, "name": "unknown", "code": "it(\"returns identity element on true condition\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(arbOption(fc.string()), x =>\n\t\t\t\t\texpect(f(true)(constant(x))).toEqual(O.none),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Option.test.ts", "start_line": null, "end_line": null, "dependencies": ["arbOption"], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` returns `O.none` when called with `true` and any `Option` value wrapped in a constant function.", "mode": "fast-check"} {"id": 55549, "name": "unknown", "code": "it(\"returns identity on argument on false condition\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(arbOption(fc.string()), x =>\n\t\t\t\t\texpect(f(false)(constant(x))).toEqual(x),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Option.test.ts", "start_line": null, "end_line": null, "dependencies": ["arbOption"], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`f(false)(constant(x))` returns the input `x` unchanged when the condition is false.", "mode": "fast-check"} {"id": 55550, "name": "unknown", "code": "it(\"returns identity element on false condition\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(arbOption(fc.string()), x =>\n\t\t\t\t\texpect(f(false)(constant(x))).toEqual(O.none),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Option.test.ts", "start_line": null, "end_line": null, "dependencies": ["arbOption"], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The property asserts that when a false condition is provided to the function `f`, applying it with any `Option` value results in `O.none`.", "mode": "fast-check"} {"id": 55553, "name": "unknown", "code": "it(\"returns lifted input on true\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.anything(), x =>\n\t\t\t\t\texpect(f(true)(constant(x))).toEqual(O.some(x)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55554, "name": "unknown", "code": "it(\"returns constant empty on empty input\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.anything(), x =>\n\t\t\t\t\texpect(f([])(constant(x))).toEqual(O.none),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55555, "name": "unknown", "code": "it(\"returns constant empty on all-empty input\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.anything(), x =>\n\t\t\t\t\texpect(\n\t\t\t\t\t\tf([constant(O.none), constant(O.none), constant(O.none)])(\n\t\t\t\t\t\t\tconstant(x),\n\t\t\t\t\t\t),\n\t\t\t\t\t).toEqual(O.none),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55556, "name": "unknown", "code": "it(\"returns left-most non-empty value\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.anything(), fc.anything(), fc.anything(), (x, y, z) =>\n\t\t\t\t\texpect(\n\t\t\t\t\t\tf([constant(O.none), constant(O.some(x)), constant(O.some(y))])(\n\t\t\t\t\t\t\tconstant(z),\n\t\t\t\t\t\t),\n\t\t\t\t\t).toEqual(O.some(x)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60475, "name": "unknown", "code": "it('should correctly test if the value is between the two tuple elements', () => {\n fc.assert(\n fc.property(fc.tuple(fc.integer(), fc.integer()), fc.integer(), (a, b) => {\n const sorted = [...a].sort();\n return isBetween(a)(b) === (b >= sorted[0] && b <= sorted[1]);\n }),\n {\n verbose: 2,\n // manual cases\n examples: [\n [[50, 198], 100],\n [[100, 89], 50],\n [[50, 60], 50],\n ],\n },\n );\n})", "language": "typescript", "source_file": "./repos/gohypergiant/standard-toolkit/packages/predicates/src/is-between/index.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "gohypergiant/standard-toolkit", "url": "https://github.com/gohypergiant/standard-toolkit.git", "license": "Apache-2.0", "stars": 13, "forks": 2}, "metrics": null, "summary": "Check that the `isBetween` function returns true if a value is between the two elements of a sorted tuple and false otherwise.", "mode": "fast-check"} {"id": 60476, "name": "unknown", "code": "it('should correctly test value is in array', () => {\n fc.assert(\n fc.property(\n fc.array(fc.integer(), { maxLength: 1000 }),\n fc.integer(),\n (a, b) => {\n return isIn(a)(b) === a.includes(b);\n },\n ),\n {\n verbose: 2,\n // manual cases\n examples: [\n [[50, 75, 100], 100],\n [[100, 200, 300], 50],\n ],\n },\n );\n})", "language": "typescript", "source_file": "./repos/gohypergiant/standard-toolkit/packages/predicates/src/is-in/index.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "gohypergiant/standard-toolkit", "url": "https://github.com/gohypergiant/standard-toolkit.git", "license": "Apache-2.0", "stars": 13, "forks": 2}, "metrics": null, "summary": "`isIn` correctly determines if a value is present in an array by matching the result of `Array.prototype.includes`.", "mode": "fast-check"} {"id": 60477, "name": "unknown", "code": "it('should correctly determine if the regex is not like the string', () => {\n fc.assert(\n fc.property(\n fc.stringMatching(STRING_GEN),\n fc.stringMatching(TESTER_GEN),\n (a, b) => {\n return doesNotStartWith(a)(b) === !a.startsWith(b);\n },\n ),\n {\n verbose: 2,\n // manual cases\n examples: [\n ['b7a70c6346b5', 'b7a7'],\n ['471aead1ae80', 'b7a7'],\n ],\n },\n );\n})", "language": "typescript", "source_file": "./repos/gohypergiant/standard-toolkit/packages/predicates/src/does-not-start-with/index.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "gohypergiant/standard-toolkit", "url": "https://github.com/gohypergiant/standard-toolkit.git", "license": "Apache-2.0", "stars": 13, "forks": 2}, "metrics": null, "summary": "The function `doesNotStartWith` should return true if a string `a` does not start with string `b`, matching the negation of `a.startsWith(b)`.", "mode": "fast-check"} {"id": 55564, "name": "unknown", "code": "it(\"passes for any non-Infinity number\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.integer({\n\t\t\t\t\t\tmin: Number.MIN_SAFE_INTEGER,\n\t\t\t\t\t\tmax: Number.MAX_SAFE_INTEGER,\n\t\t\t\t\t}),\n\t\t\t\t\tf,\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Number.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The test asserts that the function `f` passes for any integer within the range of safe JavaScript integers, excluding Infinity.", "mode": "fast-check"} {"id": 55566, "name": "unknown", "code": "it(\"returns true for any number above zero\", () => {\n\t\t\texpect(f(0.000001)).toBe(true)\n\t\t\texpect(f(42)).toBe(true)\n\t\t\texpect(f(Number.POSITIVE_INFINITY)).toBe(true)\n\n\t\t\tfc.assert(fc.property(fc.integer({ min: 1 }), f))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Number.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Function `f` returns true for any number greater than zero.", "mode": "fast-check"} {"id": 55567, "name": "unknown", "code": "it(\"returns false for any number below zero\", () => {\n\t\t\texpect(f(-0.000001)).toBe(false)\n\t\t\texpect(f(-42)).toBe(false)\n\t\t\texpect(f(Number.NEGATIVE_INFINITY)).toBe(false)\n\n\t\t\tfc.assert(fc.property(fc.integer({ max: -1 }), Pred.not(f)))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Number.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` returns false for any negative number, including negative infinity and values below zero.", "mode": "fast-check"} {"id": 60478, "name": "unknown", "code": "it('should correctly determine if the regex is not like the string', () => {\n fc.assert(\n fc.property(\n fc.oneof(fc.stringMatching(TESTER_GEN), fc.stringMatching(ALTERNATE_GEN)),\n fc.stringMatching(STRING_GEN),\n (a, b) => {\n return isNotLike(a)(b) === !new RegExp(a).test(b);\n },\n ),\n { verbose: 2 },\n );\n})", "language": "typescript", "source_file": "./repos/gohypergiant/standard-toolkit/packages/predicates/src/is-not-like/index.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "gohypergiant/standard-toolkit", "url": "https://github.com/gohypergiant/standard-toolkit.git", "license": "Apache-2.0", "stars": 13, "forks": 2}, "metrics": null, "summary": "Determines if `isNotLike` correctly identifies when a regex does not match a given string, consistent with the negation of `RegExp.test`.", "mode": "fast-check"} {"id": 55571, "name": "unknown", "code": "it(\"returns false for any number below zero\", () => {\n\t\t\texpect(f(-0.000001)).toBe(false)\n\t\t\texpect(f(-42)).toBe(false)\n\t\t\texpect(f(Number.NEGATIVE_INFINITY)).toBe(false)\n\n\t\t\tfc.assert(fc.property(fc.integer({ max: -1 }), Pred.not(f)))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Number.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55572, "name": "unknown", "code": "it(\"returns false for any number above zero\", () => {\n\t\t\texpect(f(0.000001)).toBe(false)\n\t\t\texpect(f(42)).toBe(false)\n\t\t\texpect(f(Number.POSITIVE_INFINITY)).toBe(false)\n\n\t\t\tfc.assert(fc.property(fc.integer({ min: 1 }), Pred.not(f)))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Number.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55573, "name": "unknown", "code": "it(\"returns true for any number below zero\", () => {\n\t\t\texpect(f(-0.000001)).toBe(true)\n\t\t\texpect(f(-42)).toBe(true)\n\t\t\texpect(f(Number.NEGATIVE_INFINITY)).toBe(true)\n\n\t\t\tfc.assert(fc.property(fc.integer({ max: -1 }), f))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Number.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60479, "name": "unknown", "code": "it('should correctly test value is not in array', () => {\n fc.assert(\n fc.property(\n fc.array(fc.integer(), { maxLength: 1000 }),\n fc.integer(),\n (a, b) => {\n return isNotIn(a)(b) === !a.includes(b);\n },\n ),\n {\n verbose: 2,\n // manual cases\n examples: [\n [[50, 75, 100], 100],\n [[100, 200, 300], 50],\n ],\n },\n );\n})", "language": "typescript", "source_file": "./repos/gohypergiant/standard-toolkit/packages/predicates/src/is-not-in/index.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "gohypergiant/standard-toolkit", "url": "https://github.com/gohypergiant/standard-toolkit.git", "license": "Apache-2.0", "stars": 13, "forks": 2}, "metrics": null, "summary": "The `isNotIn` function should return true if and only if the integer is not present in the array.", "mode": "fast-check"} {"id": 60483, "name": "unknown", "code": "it('should correctly test for lesser or equal values', () => {\n fc.assert(\n fc.property(fc.integer(), fc.integer(), (a, b) => {\n return isLesserEqual(a)(b) === b <= a;\n }),\n {\n verbose: 2,\n // manual cases\n examples: [\n [50, 100],\n [100, 50],\n [50, 50],\n ],\n },\n );\n})", "language": "typescript", "source_file": "./repos/gohypergiant/standard-toolkit/packages/predicates/src/is-lesser-equal/index.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "gohypergiant/standard-toolkit", "url": "https://github.com/gohypergiant/standard-toolkit.git", "license": "Apache-2.0", "stars": 13, "forks": 2}, "metrics": null, "summary": "`isLesserEqual` should return true if the second integer is less than or equal to the first.", "mode": "fast-check"} {"id": 55568, "name": "unknown", "code": "it(\"returns false for any number above zero\", () => {\n\t\t\texpect(f(0.000001)).toBe(false)\n\t\t\texpect(f(42)).toBe(false)\n\t\t\texpect(f(Number.POSITIVE_INFINITY)).toBe(false)\n\n\t\t\tfc.assert(fc.property(fc.integer({ min: 1 }), Pred.not(f)))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Number.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Function `f` returns false for any number greater than zero, including integers starting from one.", "mode": "fast-check"} {"id": 55569, "name": "unknown", "code": "it(\"returns true for any number below zero\", () => {\n\t\t\texpect(f(-0.000001)).toBe(true)\n\t\t\texpect(f(-42)).toBe(true)\n\t\t\texpect(f(Number.NEGATIVE_INFINITY)).toBe(true)\n\n\t\t\tfc.assert(fc.property(fc.integer({ max: -1 }), f))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Number.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` should return true for any number less than zero.", "mode": "fast-check"} {"id": 60485, "name": "unknown", "code": "it('should correctly test for lesser than values', () => {\n fc.assert(\n fc.property(fc.integer(), fc.integer(), (a, b) => {\n return isLesser(a)(b) === b < a;\n }),\n {\n verbose: 2,\n // manual cases\n examples: [\n [50, 100],\n [100, 50],\n ],\n },\n );\n})", "language": "typescript", "source_file": "./repos/gohypergiant/standard-toolkit/packages/predicates/src/is-lesser/index.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "gohypergiant/standard-toolkit", "url": "https://github.com/gohypergiant/standard-toolkit.git", "license": "Apache-2.0", "stars": 13, "forks": 2}, "metrics": null, "summary": "`isLesser` function checks if a value is less than another, consistent with the behavior of `<` operator.", "mode": "fast-check"} {"id": 60486, "name": "unknown", "code": "it('should correctly test for equality', () => {\n fc.assert(\n fc.property(fc.integer(), fc.integer(), (a, b) => {\n return isEqual(a)(b) === (a === b);\n }),\n {\n verbose: 2,\n // manual cases\n examples: [\n [50, 50],\n [50, 100],\n ],\n },\n );\n})", "language": "typescript", "source_file": "./repos/gohypergiant/standard-toolkit/packages/predicates/src/is-equal/index.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "gohypergiant/standard-toolkit", "url": "https://github.com/gohypergiant/standard-toolkit.git", "license": "Apache-2.0", "stars": 13, "forks": 2}, "metrics": null, "summary": "`isEqual` returns true if two integers are equal and false otherwise, matching the behavior of the `===` operator.", "mode": "fast-check"} {"id": 60487, "name": "unknown", "code": "it('should correctly test for greater or equal values', () => {\n fc.assert(\n fc.property(fc.integer(), fc.integer(), (a, b) => {\n return isGreaterEqual(a)(b) === b >= a;\n }),\n {\n verbose: 2,\n // manual cases\n examples: [\n [50, 100],\n [100, 50],\n [50, 50],\n ],\n },\n );\n})", "language": "typescript", "source_file": "./repos/gohypergiant/standard-toolkit/packages/predicates/src/is-greater-equal/index.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "gohypergiant/standard-toolkit", "url": "https://github.com/gohypergiant/standard-toolkit.git", "license": "Apache-2.0", "stars": 13, "forks": 2}, "metrics": null, "summary": "The `isGreaterEqual` function should return true if the second integer is greater than or equal to the first, matching the result of `b >= a`.", "mode": "fast-check"} {"id": 55576, "name": "unknown", "code": "it(\"works for positive integers\", () => {\n\t\t\texpect(f(1)).toEqual([1])\n\t\t\texpect(f(123)).toEqual([1, 2, 3])\n\t\t\texpect(f(101)).toEqual([1, 0, 1])\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.integer({ min: 1 }), n =>\n\t\t\t\t\texpect(f(n)).toHaveLength(String(n).length),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Number.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Function `f` produces an array with a length corresponding to the number of digits in a positive integer.", "mode": "fast-check"} {"id": 55577, "name": "unknown", "code": "it(\"strips - from negative numbers\", () => {\n\t\t\texpect(f(-0)).toEqual([0])\n\t\t\texpect(f(-123)).toEqual([1, 2, 3])\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.integer({ max: 0 }), n =>\n\t\t\t\t\texpect(f(n).length).toBeGreaterThan(0),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Number.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function should transform negative integers into arrays of their absolute digit values.", "mode": "fast-check"} {"id": 55578, "name": "unknown", "code": "it(\"strips . from floats\", () => {\n\t\t\texpect(f(1.2)).toEqual([1, 2])\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.float({ noDefaultInfinity: true, noNaN: true }), n =>\n\t\t\t\t\texpect(f(n).length).toBeGreaterThan(0),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Number.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Function `f` converts a float into an array of its digits, excluding the decimal point, and ensures the result is non-empty.", "mode": "fast-check"} {"id": 55579, "name": "unknown", "code": "it(\"is equivalent to lifted Str.fromNumber\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.integer(),\n\t\t\t\t\tn => Str.fromNumber(n) === unNonEmptyString(f(n)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/NonEmptyString.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`unNonEmptyString` applied to `f(n)` should produce the same result as `Str.fromNumber(n)`.", "mode": "fast-check"} {"id": 60488, "name": "unknown", "code": "it('should correctly determine if the regex is not like the string', () => {\n fc.assert(\n fc.property(\n fc.stringMatching(STRING_GEN),\n fc.stringMatching(TESTER_GEN),\n (a, b) => {\n return doesStartWith(a)(b) === a.startsWith(b);\n },\n ),\n {\n verbose: 2,\n // manual cases\n examples: [\n ['b7a70c6346b5', 'b7a7'],\n ['471aead1ae80', 'b7a7'],\n ],\n },\n );\n})", "language": "typescript", "source_file": "./repos/gohypergiant/standard-toolkit/packages/predicates/src/does-start-with/index.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "gohypergiant/standard-toolkit", "url": "https://github.com/gohypergiant/standard-toolkit.git", "license": "Apache-2.0", "stars": 13, "forks": 2}, "metrics": null, "summary": "Validates that `doesStartWith` produces the same results as `String.prototype.startsWith` for strings generated by defined patterns.", "mode": "fast-check"} {"id": 60489, "name": "unknown", "code": "it('should be reflexive', () => {\n fc.assert(\n fc.property(fc.clone(fc.anything(anythingSettings), 2), ([a, b]) => {\n // Given: a and b identical values\n expect(a).toStrictEqual(b);\n }),\n assertSettings,\n );\n })", "language": "typescript", "source_file": "./repos/Saghen/expect-fp/src/__tests__/matchers-toStrictEqual.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Saghen/expect-fp", "url": "https://github.com/Saghen/expect-fp.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "`expect(a).toStrictEqual(b)` should hold true for identical values `a` and `b`.", "mode": "fast-check"} {"id": 60490, "name": "unknown", "code": "it('should be symmetric', () => {\n fc.assert(\n fc.property(\n fc.anything(anythingSettings),\n fc.anything(anythingSettings),\n (a, b) => {\n // Given: a and b values\n // Assert: We expect `expect(a).toStrictEqual(b)`\n // to be equivalent to `expect(b).toStrictEqual(a)`\n expect(safeExpectStrictEqual(a, b)).toBe(safeExpectStrictEqual(b, a));\n },\n ),\n assertSettings,\n );\n })", "language": "typescript", "source_file": "./repos/Saghen/expect-fp/src/__tests__/matchers-toStrictEqual.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Saghen/expect-fp", "url": "https://github.com/Saghen/expect-fp.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Symmetry in `toStrictEqual` expectations should ensure that `expect(a).toStrictEqual(b)` is equivalent to `expect(b).toStrictEqual(a)` for any given values `a` and `b`.", "mode": "fast-check"} {"id": 55587, "name": "unknown", "code": "it(\"is equivalent to lifted Str.toUpperCase\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tarb,\n\t\t\t\t\tx => _toUpperCase(unNonEmptyString(x)) === unNonEmptyString(f(x)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/NonEmptyString.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`_toUpperCase` applied to a non-empty string should equal the result of `f` applied to the same string after extracting it with `unNonEmptyString`.", "mode": "fast-check"} {"id": 55592, "name": "unknown", "code": "it(\"maintains newtype contract\", () => {\n\t\t\tfc.assert(fc.property(arb, flow(f, isValid)))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/NonEmptyString.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "A transformed arbitrary input retains the validity of the newtype contract when passed through a function.", "mode": "fast-check"} {"id": 55593, "name": "unknown", "code": "it(\"is equivalent to lifted infallible Str.head\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tarb,\n\t\t\t\t\tx =>\n\t\t\t\t\t\tunsafeUnwrap(Str.head(unNonEmptyString(x))) ===\n\t\t\t\t\t\tunNonEmptyString(f(x)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/NonEmptyString.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`unsafeUnwrap(Str.head(unNonEmptyString(x)))` should be equal to `unNonEmptyString(f(x))`.", "mode": "fast-check"} {"id": 55594, "name": "unknown", "code": "it(\"maintains newtype contract\", () => {\n\t\t\tfc.assert(fc.property(arb, flow(f, isValid)))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/NonEmptyString.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function ensures that applying `flow(f, isValid)` to generated values with `arb` maintains the newtype contract.", "mode": "fast-check"} {"id": 60491, "name": "unknown", "code": "it('should be equivalent to Node deepStrictEqual', () => {\n fc.assert(\n fc.property(\n fc.anything(anythingSettings),\n fc.anything(anythingSettings),\n (a, b) => {\n expect(safeExpectStrictEqual(a, b)).toBe(\n safeAssertDeepStrictEqual(a, b),\n );\n },\n ),\n assertSettings,\n );\n })", "language": "typescript", "source_file": "./repos/Saghen/expect-fp/src/__tests__/matchers-toStrictEqual.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Saghen/expect-fp", "url": "https://github.com/Saghen/expect-fp.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "The property validates that `safeExpectStrictEqual` produces the same result as `safeAssertDeepStrictEqual` for two arbitrary inputs.", "mode": "fast-check"} {"id": 60492, "name": "unknown", "code": "it('should always find the value when inside the array', () => {\n fc.assert(\n fc.property(\n fc.array(fc.anything(anythingSettings)),\n fc.array(fc.anything(anythingSettings)),\n fc.anything(anythingSettings),\n (startValues, endValues, v) => {\n // Given: startValues, endValues arrays and v any value\n expect([...startValues, v, ...endValues]).toContainEqual(v);\n },\n ),\n assertSettings,\n );\n })", "language": "typescript", "source_file": "./repos/Saghen/expect-fp/src/__tests__/matchers-toContainEqual.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Saghen/expect-fp", "url": "https://github.com/Saghen/expect-fp.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "The test verifies that an array containing a specific value will always have that value when checked with `toContainEqual`.", "mode": "fast-check"} {"id": 60494, "name": "unknown", "code": "it('should be reflexive', () => {\n fc.assert(\n fc.property(fc.clone(fc.anything(anythingSettings), 2), ([a, b]) => {\n // Given: a and b identical values\n expect(a).toEqual(b);\n }),\n assertSettings,\n );\n })", "language": "typescript", "source_file": "./repos/Saghen/expect-fp/src/__tests__/matchers-toEqual.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Saghen/expect-fp", "url": "https://github.com/Saghen/expect-fp.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "The `toEqual` matcher verifies that identical values are considered equal.", "mode": "fast-check"} {"id": 60495, "name": "unknown", "code": "it('should be symmetric', () => {\n const safeExpectEqual = (a: unknown, b: unknown) => {\n try {\n expect(a).toEqual(b);\n return true;\n } catch {\n return false;\n }\n };\n fc.assert(\n fc.property(\n fc.anything(anythingSettings),\n fc.anything(anythingSettings),\n (a, b) => {\n // Given: a and b values\n // Assert: We expect `expect(a).toEqual(b)`\n // to be equivalent to `expect(b).toEqual(a)`\n expect(safeExpectEqual(a, b)).toBe(safeExpectEqual(b, a));\n },\n ),\n {\n ...assertSettings,\n examples: [\n [0, 5e-324], // Issue #7941\n // [\n // new Set([false, true]),\n // new Set([new Boolean(true), new Boolean(true)]),\n // ], // Issue #7975\n ],\n },\n );\n })", "language": "typescript", "source_file": "./repos/Saghen/expect-fp/src/__tests__/matchers-toEqual.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Saghen/expect-fp", "url": "https://github.com/Saghen/expect-fp.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "The test ensures that the `toEqual` matcher is symmetric, meaning `expect(a).toEqual(b)` should produce the same result as `expect(b).toEqual(a)`.", "mode": "fast-check"} {"id": 55600, "name": "unknown", "code": "it(\"are reversible\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.integer(),\n\t\t\t\t\tn => unpack(pack(unpack(pack(n)))) === n,\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Newtype.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Packing and then unpacking an integer of type `Num` should return the original integer.", "mode": "fast-check"} {"id": 55605, "name": "unknown", "code": "it(\"returns identity on argument on false condition\", () => {\n\t\t\tfc.assert(fc.property(fc.string(), x => f(false)(constant(x)) === x))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Monoid.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f(false)(constant(x))` should return `x` when the condition is false.", "mode": "fast-check"} {"id": 55606, "name": "unknown", "code": "it(\"returns identity element on false condition\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string(), x => f(false)(constant(x)) === S.Monoid.empty),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Monoid.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` returns the Monoid's identity element when given a false condition.", "mode": "fast-check"} {"id": 55608, "name": "unknown", "code": "it(\"traverses non-empty array\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.anything()), xs =>\n\t\t\t\t\texpect(pipe(xs, A.map(Lazy.of), f, apply)).toEqual(xs),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Lazy.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Traversing a non-empty array with `Lazy.of`, mapped and applied, should return the original array.", "mode": "fast-check"} {"id": 55609, "name": "unknown", "code": "it(\"gets the value\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.anything(), x =>\n\t\t\t\t\texpect(x).toEqual(pipe(x, Lazy.of, Lazy.execute)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Lazy.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`Lazy.execute` retrieves the original value wrapped by `Lazy.of`.", "mode": "fast-check"} {"id": 55610, "name": "unknown", "code": "it(\"constructs ordinary Lazy value\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.anything(), x =>\n\t\t\t\t\texpect(\n\t\t\t\t\t\tpipe(\n\t\t\t\t\t\t\tLazy.lazy(() => x),\n\t\t\t\t\t\t\tLazy.execute,\n\t\t\t\t\t\t),\n\t\t\t\t\t).toEqual(pipe(() => x, Lazy.execute)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Lazy.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Constructing a `Lazy` value should yield the same result as directly executing the function.", "mode": "fast-check"} {"id": 55611, "name": "unknown", "code": "it(\"never throws\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.oneof(fc.string(), fc.integer(), fc.boolean(), fc.constant(null)),\n\t\t\t\t\tx => {\n\t\t\t\t\t\tstringifyPrimitive(x)\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/JSON.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`stringifyPrimitive` does not throw an error when handling strings, integers, booleans, or null values.", "mode": "fast-check"} {"id": 60499, "name": "unknown", "code": "it('test domain name', () => {\n const _url = toArbitrary(() => faker.internet.domainName());\n\n fc.assert(\n fc.property(_url, (url) => {\n expect(validation.Validators.website(url)).toEqual(ValidationErrors.None);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/Zajno/common-utils/packages/common/src/validation/__tests__/validator.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Zajno/common-utils", "url": "https://github.com/Zajno/common-utils.git", "license": "MIT", "stars": 5, "forks": 2}, "metrics": null, "summary": "The `Validators.website` should return `ValidationErrors.None` for any URL generated as a domain name.", "mode": "fast-check"} {"id": 60501, "name": "unknown", "code": "it('test domainWord', () => {\n const _url = toArbitrary(() => faker.internet.domainWord());\n\n fc.assert(\n fc.property(_url, (url) => {\n expect(validation.Validators.website(url)).toEqual(ValidationErrors.Website);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/Zajno/common-utils/packages/common/src/validation/__tests__/validator.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Zajno/common-utils", "url": "https://github.com/Zajno/common-utils.git", "license": "MIT", "stars": 5, "forks": 2}, "metrics": null, "summary": "Validates that `Validators.website` classifies domain words generated by `faker.internet.domainWord` as `ValidationErrors.Website`.", "mode": "fast-check"} {"id": 60503, "name": "unknown", "code": "it('test email', () => {\n const _url = toArbitrary(() => faker.internet.email());\n\n fc.assert(\n fc.property(_url, (url) => {\n expect(validation.Validators.website(url)).toEqual(ValidationErrors.Website);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/Zajno/common-utils/packages/common/src/validation/__tests__/validator.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Zajno/common-utils", "url": "https://github.com/Zajno/common-utils.git", "license": "MIT", "stars": 5, "forks": 2}, "metrics": null, "summary": "Validation of emails should not result in `ValidationErrors.Website` when checked by the `Validators.website` function.", "mode": "fast-check"} {"id": 60507, "name": "unknown", "code": "it('use logger with runtime mode disabling', () => {\n const _textToLog: fc.Arbitrary = toArbitrary(() => faker.lorem.word());\n const consoleMocks = createConsoleMocks();\n\n let iteration = 0;\n fc.assert(\n fc.property(_textToLog, (textToLog) => {\n // set mode before or after creating a new logger\n\n if (iteration % 2 === 0) {\n setMode('console');\n setMode(() => createCustomLogger());\n setMode(false);\n }\n const logger = createLogger(faker.lorem.word());\n if (iteration % 2 === 1) {\n setMode('console');\n setMode(() => createCustomLogger());\n setMode(false);\n }\n\n const methodName = loggerMethods[iteration % 3];\n logger[methodName](textToLog);\n\n expect(getMode()).toBe(false);\n expect(consoleMocks[methodName]).not.toHaveBeenCalled();\n ++iteration;\n }), {\n numRuns: loggerMethods.length * 2,\n });\n\n clearMocks(consoleMocks);\n })", "language": "typescript", "source_file": "./repos/Zajno/common-utils/packages/common/src/logger/__tests__/logger.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Zajno/common-utils", "url": "https://github.com/Zajno/common-utils.git", "license": "MIT", "stars": 5, "forks": 2}, "metrics": null, "summary": "Logger should not call console methods when runtime mode is disabled.", "mode": "fast-check"} {"id": 55623, "name": "unknown", "code": "it(\"homomorphism\", () => {\n\t\t\t\tfc.assert(\n\t\t\t\t\tfc.property(fc.integer(), fc.integer(), fc.anything(), (x, y, z) => {\n\t\t\t\t\t\tconst f = add(y)\n\n\t\t\t\t\t\tconst left = pipe(F.of(f), F.ap(F.of(x)), apply(z))\n\t\t\t\t\t\tconst right = pipe(F.of(f(x)), apply(z))\n\n\t\t\t\t\t\treturn expect(left).toEqual(right)\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Function.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The property verifies that applying a function via `F.ap` and piped computations using `F.of` is consistent with directly applying the function to a value, both yielding the same result when applied with `apply(z)`.", "mode": "fast-check"} {"id": 55624, "name": "unknown", "code": "it(\"interchange\", () => {\n\t\t\t\tfc.assert(\n\t\t\t\t\tfc.property(fc.integer(), fc.integer(), fc.anything(), (x, y, z) => {\n\t\t\t\t\t\tconst f = add(y)\n\n\t\t\t\t\t\tconst left = pipe(F.of(f), F.ap(F.of(x)), apply(z))\n\t\t\t\t\t\tconst right = pipe(F.of(apply(x)), F.ap(F.of(f)), apply(z))\n\n\t\t\t\t\t\treturn expect(left).toEqual(right)\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Function.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The interchange law should hold by ensuring `pipe(F.of(f), F.ap(F.of(x)), apply(z))` equals `pipe(F.of(apply(x)), F.ap(F.of(f)), apply(z))` for any integers and value.", "mode": "fast-check"} {"id": 60508, "name": "unknown", "code": "it('use logger with \\'null\\' mode', () => {\n const _textToLog: fc.Arbitrary = toArbitrary(() => faker.internet.url());\n\n let iteration = 0;\n fc.assert(\n fc.property(_textToLog, (textToLog) => {\n if (iteration % 2 === 0) setMode(undefined);\n const logger = createLogger(faker.lorem.word());\n if (iteration % 2 === 1) setMode(null);\n\n const methodName = loggerMethods[iteration % 3];\n logger[methodName](textToLog);\n\n const spyLogger = vi.spyOn(CONSOLE, methodName);\n\n expect(getMode()).toBeFalsy();\n expect(spyLogger).not.toHaveBeenCalled();\n ++iteration;\n }), {\n numRuns: loggerMethods.length * 2,\n });\n })", "language": "typescript", "source_file": "./repos/Zajno/common-utils/packages/common/src/logger/__tests__/logger.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Zajno/common-utils", "url": "https://github.com/Zajno/common-utils.git", "license": "MIT", "stars": 5, "forks": 2}, "metrics": null, "summary": "Using a logger with 'null' mode or an undefined mode should result in logger methods not calling the console.", "mode": "fast-check"} {"id": 60511, "name": "unknown", "code": "it('use logger with override mode #override', () => {\n\n const loggerName = `[${faker.lorem.word()}]`;\n const _textToLog: fc.Arbitrary = toArbitrary(() => faker.lorem.word());\n const consoleMocks = createConsoleMocks();\n\n const customLogger = createCustomLogger();\n const customLoggerGetter = () => customLogger;\n\n setMode('console');\n\n let iteration = 0;\n fc.assert(\n fc.property(_textToLog, (textToLog) => {\n const loggerDisabled = createLogger(loggerName, false);\n const loggerCustom = createLogger(loggerName, customLoggerGetter);\n\n const methodName = loggerMethods[iteration % 3];\n loggerDisabled[methodName](textToLog);\n expect(consoleMocks[methodName]).not.toHaveBeenCalled();\n\n loggerCustom[methodName](textToLog);\n\n expect(consoleMocks[methodName]).not.toHaveBeenCalled();\n\n const impl = customLogger[methodName];\n expect(impl).toHaveBeenCalledWith(loggerName, textToLog);\n impl.mockClear();\n\n ++iteration;\n }), {\n numRuns: loggerMethods.length,\n });\n\n expect(getMode()).toBe('console');\n clearMocks(consoleMocks);\n\n })", "language": "typescript", "source_file": "./repos/Zajno/common-utils/packages/common/src/logger/__tests__/logger.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Zajno/common-utils", "url": "https://github.com/Zajno/common-utils.git", "license": "MIT", "stars": 5, "forks": 2}, "metrics": null, "summary": "`createLogger` correctly uses a custom logger's implementation methods without calling console methods when in override mode.", "mode": "fast-check"} {"id": 60518, "name": "unknown", "code": "test('should returns false for everything else', () =>\n fc.assert(\n fc.property(\n fc.oneof(unassignedPhone()),\n (phone) => !isPhoneNumber(phone)\n )\n ))", "language": "typescript", "source_file": "./repos/jonathanpalma/sivar-utils/src/lib/__tests__/telephones.test.ts", "start_line": null, "end_line": null, "dependencies": ["unassignedPhone"], "repo": {"name": "jonathanpalma/sivar-utils", "url": "https://github.com/jonathanpalma/sivar-utils.git", "license": "MIT", "stars": 37, "forks": 9}, "metrics": null, "summary": "`isPhoneNumber` returns false for unassigned phone numbers generated within specified integer ranges.", "mode": "fast-check"} {"id": 55625, "name": "unknown", "code": "it(\"composition\", () => {\n\t\t\t\tfc.assert(\n\t\t\t\t\tfc.property(\n\t\t\t\t\t\tfc.integer(),\n\t\t\t\t\t\tfc.integer(),\n\t\t\t\t\t\tfc.integer(),\n\t\t\t\t\t\tfc.anything(),\n\t\t\t\t\t\t(x, y, z, zz) => {\n\t\t\t\t\t\t\tconst f = add(y)\n\t\t\t\t\t\t\tconst g = multiply(z)\n\n\t\t\t\t\t\t\tconst compose: (\n\t\t\t\t\t\t\t\tbc: (x: B) => C,\n\t\t\t\t\t\t\t) => (ab: (x: A) => B) => (x: A) => C = bc => ab =>\n\t\t\t\t\t\t\t\tflow(ab, bc)\n\n\t\t\t\t\t\t\t// The type system struggles to follow polymorphic compose below, so we'll fix the\n\t\t\t\t\t\t\t// types here.\n\t\t\t\t\t\t\tconst composeMono: (\n\t\t\t\t\t\t\t\tbc: Endomorphism,\n\t\t\t\t\t\t\t) => (ab: Endomorphism) => Endomorphism = compose\n\n\t\t\t\t\t\t\tconst left = pipe(\n\t\t\t\t\t\t\t\tF.of(composeMono),\n\t\t\t\t\t\t\t\tF.ap(F.of(f)),\n\t\t\t\t\t\t\t\tF.ap(F.of(g)),\n\t\t\t\t\t\t\t\tF.ap(F.of(x)),\n\t\t\t\t\t\t\t\tapply(zz),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\tconst right = pipe(\n\t\t\t\t\t\t\t\tF.of(f),\n\t\t\t\t\t\t\t\tF.ap(pipe(F.of(g), F.ap(F.of(x)))),\n\t\t\t\t\t\t\t\tapply(zz),\n\t\t\t\t\t\t\t)\n\n\t\t\t\t\t\t\treturn expect(left).toEqual(right)\n\t\t\t\t\t\t},\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Function.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Verifies that function composition using `composeMono` and applying it through different pipeline structures (`left` and `right`) yields the same result.", "mode": "fast-check"} {"id": 55638, "name": "unknown", "code": "it(\"never throws\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(pair, ([x, y]) => {\n\t\t\t\t\tf(x)(x)\n\t\t\t\t\tf(y)(y)\n\t\t\t\t\tf(y)(x)\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Enum.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Function `f` should not throw an error when applied to any pair of values `x` and `y`.", "mode": "fast-check"} {"id": 55646, "name": "unknown", "code": "it(\"maps both sides\", () => {\n\t\t\tconst g = Str.append(\"!\")\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string(), x => {\n\t\t\t\t\texpect(f(g)(E.left(x))).toEqual(E.left(g(x)))\n\t\t\t\t\texpect(f(g)(E.right(x))).toEqual(E.right(g(x)))\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Either.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Verifies that applying a function with `f` to both `E.left` and `E.right` results in both being mapped with the function `g`.", "mode": "fast-check"} {"id": 55647, "name": "unknown", "code": "it(\"is equivalent to doubly applied bimap\", () => {\n\t\t\tconst g = Str.append(\"!\")\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string(), x => {\n\t\t\t\t\texpect(f(g)(E.left(x))).toEqual(E.bimap(g, g)(E.left(x)))\n\t\t\t\t\texpect(f(g)(E.right(x))).toEqual(E.bimap(g, g)(E.right(x)))\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Either.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f(g)` applied to `Either` values behaves identically to `E.bimap(g, g)` applied to the same `Either` values.", "mode": "fast-check"} {"id": 55648, "name": "unknown", "code": "it(\"considers any Left less than any Right\", () => {\n\t\t\t// For reference.\n\t\t\texpect(Num.Ord.compare(1, 2)).toBe(LT)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.anything(), fc.anything(), (x, y) => {\n\t\t\t\t\t// biome-ignore lint/suspicious/noExplicitAny: Testing.\n\t\t\t\t\texpect(f(E.left(x), E.right(y))).toBe(LT)\n\t\t\t\t\t// biome-ignore lint/suspicious/noExplicitAny: Testing.\n\t\t\t\t\texpect(f(E.right(x), E.left(y))).toBe(GT)\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Either.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "In a comparison, any `Left` value is considered less than any `Right` value, and any `Right` value is greater than any `Left` value.", "mode": "fast-check"} {"id": 55649, "name": "unknown", "code": "it(\"logs string message\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string(), x => {\n\t\t\t\t\tconst spy = jest\n\t\t\t\t\t\t.spyOn(global.console, \"log\")\n\t\t\t\t\t\t.mockImplementation(constVoid)\n\t\t\t\t\tf(x)(undefined)\n\t\t\t\t\texpect(console.log).toHaveBeenCalledTimes(1)\n\t\t\t\t\texpect(console.log).toHaveBeenCalledWith(x)\n\t\t\t\t\tspy.mockRestore()\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Debug.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function logs a given string message to the console exactly once.", "mode": "fast-check"} {"id": 55650, "name": "unknown", "code": "it(\"returns provided value by reference\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.anything(), x => {\n\t\t\t\t\tconst spy = jest\n\t\t\t\t\t\t.spyOn(global.console, \"log\")\n\t\t\t\t\t\t.mockImplementation(constVoid)\n\t\t\t\t\texpect(f(\"\")(x)).toBe(x)\n\t\t\t\t\tspy.mockRestore()\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Debug.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`f(\"\")` returns the provided value without modification.", "mode": "fast-check"} {"id": 55651, "name": "unknown", "code": "it(\"logs string message and value\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string(), fc.anything(), (x, y) => {\n\t\t\t\t\tconst spy = jest\n\t\t\t\t\t\t.spyOn(global.console, \"log\")\n\t\t\t\t\t\t.mockImplementation(constVoid)\n\t\t\t\t\tf(x)(y)\n\t\t\t\t\texpect(console.log).toHaveBeenCalledTimes(1)\n\t\t\t\t\texpect(console.log).toHaveBeenCalledWith(x, y)\n\t\t\t\t\tspy.mockRestore()\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Debug.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Logs a string message and a value to the console once.", "mode": "fast-check"} {"id": 55652, "name": "unknown", "code": "it(\"returns provided value by reference\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.anything(), x => {\n\t\t\t\t\tconst spy = jest\n\t\t\t\t\t\t.spyOn(global.console, \"log\")\n\t\t\t\t\t\t.mockImplementation(constVoid)\n\t\t\t\t\texpect(f(\"\")(x)).toBe(x)\n\t\t\t\t\tspy.mockRestore()\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Debug.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`f` returns the provided value by reference without alteration.", "mode": "fast-check"} {"id": 55655, "name": "unknown", "code": "it(\"wraps prototype method\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.date(), d => unMilliseconds(f(d)) === d.getTime()),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Date.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`unMilliseconds` applied on `f(d)` should return the same result as `d.getTime()` for any date `d`.", "mode": "fast-check"} {"id": 60523, "name": "unknown", "code": "test('Scopa is a game for 2, 3, 4 or 6 players', () => {\n fc.assert(\n fc.property(fc.constantFrom<(2 | 3 | 4 | 6)[]>(2, 3, 4, 6), (players) => {\n const game = getGameState(deal(deck(), { players }))\n return game.players.length === players\n }),\n )\n })", "language": "typescript", "source_file": "./repos/goblindegook/scopa/src/engine/scopa.test.ts", "start_line": null, "end_line": null, "dependencies": ["getGameState"], "repo": {"name": "goblindegook/scopa", "url": "https://github.com/goblindegook/scopa.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The number of players in a Scopa game state must match the specified count of 2, 3, 4, or 6 players.", "mode": "fast-check"} {"id": 55665, "name": "unknown", "code": "it(\"always returns a non-empty array\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.integer()),\n\t\t\t\t\tfc.integer(),\n\t\t\t\t\t(xs, y) => !!f(N.Eq)(y)(xs).length,\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55658, "name": "unknown", "code": "it(\"wraps date constructor\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.oneof(fc.string(), fc.integer()),\n\t\t\t\t\t// Invalid dates don't deep equality check in Jest\n\t\t\t\t\tx =>\n\t\t\t\t\t\tisValid(f(x))\n\t\t\t\t\t\t\t? expect(f(x)).toEqual(new Date(x))\n\t\t\t\t\t\t\t: !isValid(f(x)) && !isValid(new Date(x)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Date.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`f(x)` should produce a valid date equivalent to `new Date(x)`, or both should be invalid.", "mode": "fast-check"} {"id": 55662, "name": "unknown", "code": "it(\"maps both sides\", () => {\n\t\t\tconst h = Str.isAlphaNum\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string(), fc.string(), (l, r) => {\n\t\t\t\t\texpect(f(h)([l, r])).toEqual([h(l), h(r)])\n\t\t\t\t\texpect(g(h)(E.left(l))).toEqual(E.left(h(l)))\n\t\t\t\t\texpect(g(h)(E.right(r))).toEqual(E.right(h(r)))\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Bifunctor.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The test checks that functions `f` and `g` correctly apply a mapping function `h` to both components of a pair and to the left and right values of a type `E`.", "mode": "fast-check"} {"id": 55666, "name": "unknown", "code": "it(\"returns updated array wrapped in Some if index is okay\", () => {\n\t\t\texpect(f(0)([\"x\"])([])).toEqual(O.some([\"x\"]))\n\t\t\texpect(g([\"x\"])).toEqual(O.some([\"x\", \"a\", \"b\"]))\n\t\t\texpect(g([\"x\", \"y\"])).toEqual(O.some([\"x\", \"a\", \"b\", \"y\"]))\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.anything(), {\n\t\t\t\t\t\tminLength: 1,\n\t\t\t\t\t\tmaxLength: 5,\n\t\t\t\t\t}) as fc.Arbitrary>,\n\t\t\t\t\tfc.integer({ min: 0, max: 10 }),\n\t\t\t\t\t(xs, i) => O.isSome(f(i)(xs)(xs)) === i <= A.size(xs),\n\t\t\t\t),\n\t\t\t)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.string(), { minLength: 1, maxLength: 20 }),\n\t\t\t\t\txs =>\n\t\t\t\t\t\texpect(pipe(g(xs), O.map(A.size))).toEqual(O.some(A.size(xs) + 2)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55667, "name": "unknown", "code": "it(\"returns updated array wrapped in Some if index is okay\", () => {\n\t\t\texpect(f(0)([\"x\"])([])).toEqual(O.some([\"x\"]))\n\t\t\texpect(g([\"x\"])).toEqual(O.some([\"x\", \"a\", \"b\"]))\n\t\t\texpect(g([\"x\", \"y\"])).toEqual(O.some([\"x\", \"a\", \"b\", \"y\"]))\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.anything(), {\n\t\t\t\t\t\tminLength: 1,\n\t\t\t\t\t\tmaxLength: 5,\n\t\t\t\t\t}) as fc.Arbitrary>,\n\t\t\t\t\tfc.integer({ min: 0, max: 10 }),\n\t\t\t\t\t(xs, i) => O.isSome(f(i)(xs)(xs)) === i <= A.size(xs),\n\t\t\t\t),\n\t\t\t)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.string(), { minLength: 1, maxLength: 20 }),\n\t\t\t\t\txs =>\n\t\t\t\t\t\texpect(pipe(g(xs), O.map(A.size))).toEqual(O.some(A.size(xs) + 2)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55668, "name": "unknown", "code": "it(\"never returns a larger array\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.integer()), xs => f(xs).length <= A.size(xs)),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55669, "name": "unknown", "code": "it(\"never introduces new elements\", () => {\n\t\t\tconst g = A.uniq(N.Eq)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.integer()), xs =>\n\t\t\t\t\tpipe(xs, f, g, A.every(elemV(N.Eq)(g(xs)))),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55670, "name": "unknown", "code": "it(\"returns true for empty subarray\", () => {\n\t\t\tfc.assert(fc.property(fc.array(fc.integer()), xs => f([])(xs)))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55671, "name": "unknown", "code": "it(\"checks start of array for subarray\", () => {\n\t\t\texpect(f([1])([1, 2, 3])).toBe(true)\n\t\t\texpect(f([3])([1, 2, 3])).toBe(false)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.integer()), fc.array(fc.integer()), (xs, ys) =>\n\t\t\t\t\tf(xs)(A.concat(ys)(xs)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55672, "name": "unknown", "code": "it(\"returns true for empty subarray\", () => {\n\t\t\tfc.assert(fc.property(fc.array(fc.integer()), xs => f([])(xs)))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55673, "name": "unknown", "code": "it(\"checks end of array for subarray\", () => {\n\t\t\texpect(f([3])([1, 2, 3])).toBe(true)\n\t\t\texpect(f([1])([1, 2, 3])).toBe(false)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.integer()), fc.array(fc.integer()), (xs, ys) =>\n\t\t\t\t\tf(xs)(A.concat(xs)(ys)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55674, "name": "unknown", "code": "it(\"removes numbers present in first input array\", () => {\n\t\t\tconst g = f([4, 5])\n\n\t\t\texpect(g([3, 4])).toEqual([3])\n\t\t\texpect(g([4, 5])).toEqual([])\n\t\t\texpect(g([4, 5, 6])).toEqual([6])\n\t\t\texpect(g([3, 4, 5, 6])).toEqual([3, 6])\n\t\t\texpect(g([4, 3, 4, 5, 6, 5])).toEqual([3, 6])\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.integer()), xs =>\n\t\t\t\t\texpect(f(xs)(xs)).toEqual(A.empty),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60525, "name": "unknown", "code": "it(\"should allow to retrieve attribute data from an HTML element\", () => {\n fc.assert(\n fc\n .property(globalHTMLAttrArb, (attr) => {\n const divElement = document.createElement(tagName);\n for (const key in attr) {\n if (attr[key as keyof typeof attr] === false) {\n divElement.removeAttribute(key.toLowerCase());\n } else if (attr[key as keyof typeof attr] !== undefined) {\n divElement.setAttribute(\n key.toLowerCase(),\n String(attr[key as keyof typeof attr])\n );\n expect(divElement.getAttribute(key.toLowerCase())).toBe(\n String(attr[key as keyof typeof attr])\n );\n }\n }\n container.appendChild(divElement);\n\n const doc = htmlAdapter(container) as any;\n expect(doc[tagName as keyof typeof doc]().single()).toMatchObject(\n attr\n );\n })\n .afterEach(() => {\n document.body.removeChild(container!);\n container = document.createElement(\"div\");\n document.body.appendChild(container!);\n })\n );\n })", "language": "typescript", "source_file": "./repos/qgolsteyn/ui-census/tests/unit/dom-ui-census/htmlAdapter.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "qgolsteyn/ui-census", "url": "https://github.com/qgolsteyn/ui-census.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "The test ensures attribute data assigned to an HTML element is accurately retrievable through the `htmlAdapter` function.", "mode": "fast-check"} {"id": 55676, "name": "unknown", "code": "it(\"sums non-empty input\", () => {\n\t\t\texpect(f([25, 3, 10])).toBe(38)\n\t\t\texpect(f([-3, 2])).toBe(-1)\n\t\t\texpect(f([2.5, 3.2])).toBe(5.7)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.integer()),\n\t\t\t\t\txs => f(xs) === xs.reduce((acc, val) => acc + val, 0),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55677, "name": "unknown", "code": "it(\"calculates product of non-empty input\", () => {\n\t\t\texpect(f([4, 2, 3])).toBe(24)\n\t\t\texpect(f([5])).toBe(5)\n\t\t\texpect(f([1.5, -5])).toBe(-7.5)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.integer()),\n\t\t\t\t\txs => f(xs) === xs.reduce((acc, val) => acc * val, 1),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55678, "name": "unknown", "code": "it(\"returns empty array for empty array input\", () => {\n\t\t\texpect(f(0)([])).toEqual([])\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.integer({ min: 0, max: 100 }), n => !f(n)([]).length),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55679, "name": "unknown", "code": "it(\"returns empty array for non-positive input number\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.integer({ max: 0 }),\n\t\t\t\t\tfc.array(fc.anything()),\n\t\t\t\t\t(n, xs) => !f(n)(xs).length,\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55682, "name": "unknown", "code": "it(\"behaves identically to Array.prototype.slice\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.anything()),\n\t\t\t\t\tfc.integer(),\n\t\t\t\t\tfc.integer(),\n\t\t\t\t\t(xs, start, end) =>\n\t\t\t\t\t\texpect(f(start)(end)(xs)).toEqual(xs.slice(start, end)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55683, "name": "unknown", "code": "it(\"is the inverse of filter\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.integer()),\n\t\t\t\t\txs => A.filter(p)(xs).length + f(xs).length === A.size(xs),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55684, "name": "unknown", "code": "it(\"returns unmodified array provided same indices (in bounds)\", () => {\n\t\t\tconst n = 10\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.anything(), { minLength: 1, maxLength: n }),\n\t\t\t\t\tfc.integer({ min: 0, max: n - 1 }),\n\t\t\t\t\t(xs, i) => i >= A.size(xs) || expect(f(i)(i)(xs)).toEqual(O.some(xs)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55685, "name": "unknown", "code": "it(\"returns None if source is out of bounds\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.anything()), xs =>\n\t\t\t\t\texpect(f(A.size(xs))(0)(xs)).toEqual(O.none),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55686, "name": "unknown", "code": "it(\"returns None if target is out of bounds\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.anything()), xs =>\n\t\t\t\t\texpect(f(0)(A.size(xs))(xs)).toEqual(O.none),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55687, "name": "unknown", "code": "it(\"moves source to target\", () => {\n\t\t\texpect(f(0)(1)([\"a\", \"b\", \"c\"])).toEqual(O.some([\"b\", \"a\", \"c\"]))\n\t\t\texpect(f(1)(0)([\"a\", \"b\", \"c\"])).toEqual(O.some([\"b\", \"a\", \"c\"]))\n\n\t\t\tconst n = 10\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.anything(), { minLength: n, maxLength: n }),\n\t\t\t\t\tfc.integer({ min: 0, max: n - 1 }),\n\t\t\t\t\tfc.integer({ min: 0, max: n - 1 }),\n\t\t\t\t\t(xs, i, j) => O.isSome(f(i)(j)(xs)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55688, "name": "unknown", "code": "it(\"returns the same array size\", () => {\n\t\t\tconst n = 10\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.anything(), { minLength: n, maxLength: n }),\n\t\t\t\t\tfc.integer({ min: 0, max: n - 1 }),\n\t\t\t\t\tfc.integer({ min: 0, max: n - 1 }),\n\t\t\t\t\t(xs, i, j) =>\n\t\t\t\t\t\tpipe(\n\t\t\t\t\t\t\tf(i)(j)(xs),\n\t\t\t\t\t\t\tO.exists(ys => A.size(ys) === n),\n\t\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55689, "name": "unknown", "code": "it(\"sibling indices are interchangeable\", () => {\n\t\t\tconst n = 10\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.anything(), { minLength: n, maxLength: n }),\n\t\t\t\t\tfc.integer({ min: 0, max: n - 2 }),\n\t\t\t\t\t(xs, i) => expect(f(i)(i + 1)(xs)).toEqual(f(i + 1)(i)(xs)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55690, "name": "unknown", "code": "it(\"returns unmodified array provided same indices (in bounds)\", () => {\n\t\t\tconst n = 10\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.anything(), { minLength: 1, maxLength: n }),\n\t\t\t\t\tfc.integer({ min: 0, max: n - 1 }),\n\t\t\t\t\t(xs, i) => i >= A.size(xs) || expect(f(i)(i)(xs)).toEqual(O.some(xs)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55691, "name": "unknown", "code": "it(\"returns None if source is out of bounds\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.anything()), xs =>\n\t\t\t\t\texpect(f(0)(A.size(xs))(xs)).toEqual(O.none),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55692, "name": "unknown", "code": "it(\"returns None if target is out of bounds\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.anything()), xs =>\n\t\t\t\t\texpect(f(A.size(xs))(0)(xs)).toEqual(O.none),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60526, "name": "unknown", "code": "it(\"should allow to retrieve attribute data from an HTML element\", () => {\n fc.assert(\n fc\n .property(globalHTMLAttrArb, (attr) => {\n const divElement = document.createElement(\"div\");\n for (const key in attr) {\n if (attr[key as keyof typeof attr] === false) {\n divElement.removeAttribute(key.toLowerCase());\n } else if (attr[key as keyof typeof attr] !== undefined) {\n divElement.setAttribute(\n key.toLowerCase(),\n String(attr[key as keyof typeof attr])\n );\n expect(divElement.getAttribute(key.toLowerCase())).toBe(\n String(attr[key as keyof typeof attr])\n );\n }\n }\n container.appendChild(divElement);\n\n const doc = baseAdapter(container);\n expect(doc.queryHTML(\"div\").single()).toMatchObject(attr);\n })\n .afterEach(() => {\n document.body.removeChild(container!);\n container = document.createElement(\"div\");\n document.body.appendChild(container!);\n })\n );\n })", "language": "typescript", "source_file": "./repos/qgolsteyn/ui-census/tests/unit/dom-ui-census/baseAdapter.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "qgolsteyn/ui-census", "url": "https://github.com/qgolsteyn/ui-census.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Retrieval of attribute data from an HTML element should correctly match the assigned attributes through `baseAdapter` query.", "mode": "fast-check"} {"id": 55693, "name": "unknown", "code": "it(\"moves source to target\", () => {\n\t\t\texpect(f(0)(1)([\"a\", \"b\", \"c\"])).toEqual(O.some([\"b\", \"a\", \"c\"]))\n\t\t\texpect(f(1)(0)([\"a\", \"b\", \"c\"])).toEqual(O.some([\"b\", \"a\", \"c\"]))\n\n\t\t\tconst n = 10\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.anything(), { minLength: n, maxLength: n }),\n\t\t\t\t\tfc.integer({ min: 0, max: n - 1 }),\n\t\t\t\t\tfc.integer({ min: 0, max: n - 1 }),\n\t\t\t\t\t(xs, i, j) => O.isSome(f(i)(j)(xs)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55694, "name": "unknown", "code": "it(\"returns the same array size\", () => {\n\t\t\tconst n = 10\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.anything(), { minLength: n, maxLength: n }),\n\t\t\t\t\tfc.integer({ min: 0, max: n - 1 }),\n\t\t\t\t\tfc.integer({ min: 0, max: n - 1 }),\n\t\t\t\t\t(xs, i, j) =>\n\t\t\t\t\t\tpipe(\n\t\t\t\t\t\t\tf(i)(j)(xs),\n\t\t\t\t\t\t\tO.exists(ys => A.size(ys) === n),\n\t\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55695, "name": "unknown", "code": "it(\"sibling indices are interchangeable\", () => {\n\t\t\tconst n = 10\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.anything(), { minLength: n, maxLength: n }),\n\t\t\t\t\tfc.integer({ min: 0, max: n - 2 }),\n\t\t\t\t\t(xs, i) => expect(f(i)(i + 1)(xs)).toEqual(f(i + 1)(i)(xs)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55697, "name": "unknown", "code": "it(\"all numbers are above zero\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.string()),\n\t\t\t\t\tflow(\n\t\t\t\t\t\tf(identity),\n\t\t\t\t\t\tvalues,\n\t\t\t\t\t\tA.every(n => n > 0),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55696, "name": "unknown", "code": "it(\"counts the same summed number as the A.size of the array\", () => {\n\t\t\t// fast-check generates keys that fp-ts internals won't iterate over,\n\t\t\t// meaning without this the keys below won't necessarily add up.\n\t\t\tconst filterSpecialKeys: Endomorphism> = A.chain(\n\t\t\t\tflow(k => R.singleton(k, null), R.keys),\n\t\t\t)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.string()),\n\t\t\t\t\txs =>\n\t\t\t\t\t\tpipe(xs, f(identity), values, sum) === filterSpecialKeys(xs).length,\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The sum of values produced by `f(identity)` on an array should equal the length of the array with special keys filtered out.", "mode": "fast-check"} {"id": 60656, "name": "unknown", "code": "test(`fitToPage shows the same view after zooming all the way in`, async ({ page }) => {\n\t\tawait page.goto('/Jigs-2-Lots-of-jigs');\n\t\tawait fc.assert(zoomThenFitToPage(page, 'in'), {\n\t\t\texamples: [[1993, 805]],\n\t\t\ttimeout: TEST_TIMEOUT_MILLIS,\n\t\t\tinterruptAfterTimeLimit: TEST_TIMEOUT_MILLIS\n\t\t});\n\t})", "language": "typescript", "source_file": "./repos/flyingcatband/tunebook/tests/test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "flyingcatband/tunebook", "url": "https://github.com/flyingcatband/tunebook.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "`fitToPage` maintains the same view after the page is zoomed all the way in.", "mode": "fast-check"} {"id": 55698, "name": "unknown", "code": "it(\"constTrue returns empty array\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.anything()), xs =>\n\t\t\t\t\texpect(f(constTrue)(xs)).toEqual([]),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55699, "name": "unknown", "code": "it(\"constFalse returns original array\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.anything()), xs =>\n\t\t\t\t\texpect(f(constFalse)(xs)).toEqual(xs),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55702, "name": "unknown", "code": "it(\"maintains same flattened size\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.array(fc.anything())),\n\t\t\t\t\txs => A.size(A.flatten(xs)) === A.size(A.flatten(f(xs))),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55703, "name": "unknown", "code": "it(\"does not mistakenly pass along undefined values\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.array(fc.anything().filter(x => x !== undefined))),\n\t\t\t\t\tflow(\n\t\t\t\t\t\tf,\n\t\t\t\t\t\tA.flatten,\n\t\t\t\t\t\tA.every(x => x !== undefined),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55700, "name": "unknown", "code": "it(\"calculates the mean\", () => {\n\t\t\texpect(f([2, 7, 9])).toBe(6)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.integer({ min: 1, max: 50 }),\n\t\t\t\t\tfc.integer(),\n\t\t\t\t\t(x, y) => f(A.replicate(x, y) as NonEmptyArray) === y,\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` calculates the mean of an array, and for a replicated array of identical numbers, the mean should equal the repeated number.", "mode": "fast-check"} {"id": 55704, "name": "unknown", "code": "it(\"constTrue returns original array\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.anything()), xs =>\n\t\t\t\t\texpect(f(constTrue)(xs)).toEqual(xs),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55705, "name": "unknown", "code": "it(\"constFalse returns empty array\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.anything()), xs =>\n\t\t\t\t\texpect(f(constFalse)(xs)).toEqual([]),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55706, "name": "unknown", "code": "it(\"one empty input returns other input whole\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.integer()), xs =>\n\t\t\t\t\texpect(f(xs)([])).toEqual(xs),\n\t\t\t\t),\n\t\t\t)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.integer()), xs =>\n\t\t\t\t\texpect(f([])(xs)).toEqual(xs),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55707, "name": "unknown", "code": "it(\"one empty input returns other input whole\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.integer()), xs =>\n\t\t\t\t\texpect(f(xs)([])).toEqual(xs),\n\t\t\t\t),\n\t\t\t)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.integer()), xs =>\n\t\t\t\t\texpect(f([])(xs)).toEqual(xs),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55708, "name": "unknown", "code": "it(\"returns identity on singleton non-empty array\", () => {\n\t\t\tfc.assert(fc.property(fc.integer(), n => f([n]) === n))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55709, "name": "unknown", "code": "it(\"returns the smallest value\", () => {\n\t\t\texpect(f([3, 1, 2])).toBe(1)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.integer(),\n\t\t\t\t\tn => f([n, n + 1]) === n && f([n + 1, n]) === n,\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55710, "name": "unknown", "code": "it(\"returns identity on singleton non-empty array\", () => {\n\t\t\tfc.assert(fc.property(fc.integer(), n => f([n]) === n))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55711, "name": "unknown", "code": "it(\"returns the largest value\", () => {\n\t\t\texpect(f([1, 3, 2])).toBe(3)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.integer(),\n\t\t\t\t\tn => f([n, n + 1]) === n + 1 && f([n + 1, n]) === n + 1,\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55712, "name": "unknown", "code": "it(\"equal length inputs is equivalent to normal zip mapped to These\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.anything()), xs => {\n\t\t\t\t\tconst ys = A.reverse(xs)\n\t\t\t\t\texpect(f(xs)(ys)).toEqual(\n\t\t\t\t\t\tpipe(\n\t\t\t\t\t\t\tA.zip(xs)(ys),\n\t\t\t\t\t\t\tA.map(([x, y]) => T.both(x, y)),\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55713, "name": "unknown", "code": "it(\"output length is equal to largest input length\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.anything()),\n\t\t\t\t\tfc.array(fc.anything()),\n\t\t\t\t\t(xs, ys) => A.size(f(xs)(ys)) === max(N.Ord)(A.size(xs), A.size(ys)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55714, "name": "unknown", "code": "it(\"is identical to filter in an applicative context\", () => {\n\t\t\tconst g = A.filter\n\t\t\tconst isEven: Predicate = n => n % 2 === 0\n\t\t\tconst isEvenIO = flow(isEven, IO.of)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.integer()), xs =>\n\t\t\t\t\texpect(f(isEvenIO)(xs)()).toEqual(g(isEven)(xs)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55715, "name": "unknown", "code": "it(\"returns array of input size minus one\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.anything(), { minLength: 2 }), xs =>\n\t\t\t\t\texpect(pipe(xs, f, O.map(flow(snd, A.size)))).toEqual(\n\t\t\t\t\t\tpipe(xs, A.size, decrement, O.some),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55716, "name": "unknown", "code": "it(\"returns element at index\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.anything(), { minLength: 2 }), xs =>\n\t\t\t\t\texpect(pipe(xs, f, O.map(fst))).toEqual(A.lookup(1)(xs)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55725, "name": "unknown", "code": "it(\"always returns a non-empty output\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.boolean(), { minLength: 1 }), xs => {\n\t\t\t\t\tconst ys: NonEmptyArray> = pipe(\n\t\t\t\t\t\txs as NonEmptyArray,\n\t\t\t\t\t\tNEA.map(b => (b ? E.right(b) : E.left(b))),\n\t\t\t\t\t)\n\n\t\t\t\t\tconst zs: NonEmptyArray = pipe(\n\t\t\t\t\t\tys,\n\t\t\t\t\t\tf,\n\t\t\t\t\t\tT.match(identity, identity, (ls, rs) => NEA.concat(ls)(rs)),\n\t\t\t\t\t)\n\n\t\t\t\t\texpect(A.size(zs)).toBeGreaterThan(0)\n\t\t\t\t\texpect(A.size(zs)).toBe(A.size(xs))\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The transformation of a non-empty array of booleans into another non-empty array maintains the same size.", "mode": "fast-check"} {"id": 55726, "name": "unknown", "code": "it(\"equivaent to stricter separate\", () => {\n\t\t\tconst g = A.separate\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.boolean(), { minLength: 1 }), xs => {\n\t\t\t\t\tconst ys: NonEmptyArray> = pipe(\n\t\t\t\t\t\txs as NonEmptyArray,\n\t\t\t\t\t\tNEA.map(b => (b ? E.right(b) : E.left(b))),\n\t\t\t\t\t)\n\n\t\t\t\t\tconst nea: NonEmptyArray = pipe(\n\t\t\t\t\t\tys,\n\t\t\t\t\t\tf,\n\t\t\t\t\t\tT.match(identity, identity, (ls, rs) => NEA.concat(ls)(rs)),\n\t\t\t\t\t)\n\n\t\t\t\t\tconst notNea: Array = pipe(ys, g, ({ left, right }) =>\n\t\t\t\t\t\tA.concat(left)(right),\n\t\t\t\t\t)\n\n\t\t\t\t\texpect(nea).toEqual(notNea)\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` outputs a concatenation of left and right values from a non-empty array of `Either` type booleans, which should be equivalent to the result from `A.separate`.", "mode": "fast-check"} {"id": 55727, "name": "unknown", "code": "it(\"returns constant empty/zero on false\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.anything(), x =>\n\t\t\t\t\texpect(f(false)(constant(x))).toEqual(O.none),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Alternative.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Returns `O.none` when applying a constant function with any input if the condition is false.", "mode": "fast-check"} {"id": 60660, "name": "unknown", "code": "test('should parse complete json', () => {\n expect(partialParse('{\"__proto__\": 0}')).toEqual(JSON.parse('{\"__proto__\": 0}'));\n\n fc.assert(\n fc.property(fc.json({ depthSize: 'large', noUnicodeString: false }), (jsonString) => {\n const parsedNormal = JSON.parse(jsonString);\n const parsedPartial = partialParse(jsonString);\n expect(parsedPartial).toEqual(parsedNormal);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/SirBoely/openai-node/tests/_vendor/partial-json-parser/partial-json-parsing.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SirBoely/openai-node", "url": "https://github.com/SirBoely/openai-node.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`partialParse` should correctly parse complete JSON strings, matching the output of `JSON.parse`.", "mode": "fast-check"} {"id": 55733, "name": "unknown", "code": "it(\"never throws\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string(), x => {\n\t\t\t\t\tf(x)\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/URL.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55734, "name": "unknown", "code": "it(\"never throws\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string(), x => {\n\t\t\t\t\tf(x)\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/URL.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55732, "name": "unknown", "code": "it(\"wraps URL constructor\", () => {\n\t\t\texpect(() => f(\"x\")).toThrow()\n\t\t\texpect(f(validUrl)).toEqual(new URL(validUrl))\n\n\t\t\tfc.assert(fc.property(fc.webUrl(), x => expect(f(x)).toEqual(new URL(x))))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/URL.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` should behave like the `URL` constructor, throwing errors for invalid URLs and returning equivalent `URL` objects for valid inputs.", "mode": "fast-check"} {"id": 55735, "name": "unknown", "code": "it(\"works\", () => {\n\t\t\texpect(f(\"invalid\")).toBe(false)\n\t\t\texpect(f(validUrl)).toBe(true)\n\n\t\t\tfc.assert(fc.property(fc.webUrl(), f))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/URL.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` should return false for an invalid URL and true for valid URLs.", "mode": "fast-check"} {"id": 55736, "name": "unknown", "code": "it(\"is lossless (excluding formatting)\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.webUrl({ withFragments: true, withQueryParameters: true }),\n\t\t\t\t\tx =>\n\t\t\t\t\t\t// biome-ignore lint/suspicious/noSelfCompare: Incorrect lint.\n\t\t\t\t\t\tpipe(x, unsafeParse, f, unsafeParse, f) === pipe(x, unsafeParse, f),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/URL.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Parsing and processing a URL string should consistently result in the same output when repeated, apart from formatting differences.", "mode": "fast-check"} {"id": 60662, "name": "unknown", "code": "it(\"all equal scalars are shallowly equal\", () => {\n fc.assert(\n fc.property(\n // Inputs\n fc.clone(scalar(), 2),\n\n // Unit test\n ([scalar1, scalar2]) => {\n expect(shallow(scalar1, scalar2)).toBe(true);\n\n // If two values are shallowly equal, then those values wrapped in an\n // array (one level) should _also_ be considered shallowly equal\n expect(shallow([scalar1], [scalar2])).toBe(true);\n expect(shallow([scalar1, scalar1], [scalar2, scalar2])).toBe(true);\n\n // ...but wrapping twice is _never_ going to be equal\n expect(shallow([[scalar1]], [[scalar2]])).toBe(false);\n\n // Ditto for objects\n expect(shallow({ a: scalar1 }, { a: scalar2 })).toBe(true);\n expect(\n shallow({ a: scalar1, b: scalar1 }, { a: scalar2, b: scalar2 })\n ).toBe(true);\n\n // ...but nesting twice is _never_ going to be equal\n expect(shallow({ a: { b: scalar1 } }, { a: { b: scalar2 } })).toBe(\n false\n );\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/jurgen-paul/liveblocks/packages/liveblocks-core/src/lib/__tests__/shallow.test.ts", "start_line": null, "end_line": null, "dependencies": ["scalar"], "repo": {"name": "jurgen-paul/liveblocks", "url": "https://github.com/jurgen-paul/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60663, "name": "unknown", "code": "it(\"different scalars are not shallowly equal\", () => {\n fc.assert(\n fc.property(\n // Inputs\n fc.tuple(scalar(), scalar()).filter(([x, y]) => x !== y),\n\n // Unit test\n ([scalar1, scalar2]) => {\n expect(shallow(scalar1, scalar2)).toBe(false);\n\n // If two values are shallowly unequal, then wrapping those in an\n // array (one level) should also always be shallowly unequal\n expect(shallow([scalar1], [scalar2])).toBe(false);\n\n // Ditto for objects\n expect(shallow({ k: scalar1 }, { k: scalar2 })).toBe(false);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/jurgen-paul/liveblocks/packages/liveblocks-core/src/lib/__tests__/shallow.test.ts", "start_line": null, "end_line": null, "dependencies": ["scalar"], "repo": {"name": "jurgen-paul/liveblocks", "url": "https://github.com/jurgen-paul/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60664, "name": "unknown", "code": "it(\"equal composite values\", () => {\n fc.assert(\n fc.property(\n // Inputs\n fc.clone(complex(), 2),\n\n // Unit test\n ([complex1, complex2]) => {\n // Property: _if_ two complex values are considered shallowly equal,\n // then wrapping them in an array (one level) will guarantee they're\n // not shallowly equal\n if (shallow(complex1, complex2)) {\n expect(shallow([complex1], [complex2])).toBe(false);\n }\n\n // Ditto for objects\n if (shallow(complex1, complex2)) {\n expect(shallow({ k: complex1 }, { k: complex2 })).toBe(false);\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/jurgen-paul/liveblocks/packages/liveblocks-core/src/lib/__tests__/shallow.test.ts", "start_line": null, "end_line": null, "dependencies": ["complex"], "repo": {"name": "jurgen-paul/liveblocks", "url": "https://github.com/jurgen-paul/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60665, "name": "unknown", "code": "it(\"consistency\", () => {\n fc.assert(\n fc.property(\n // Inputs\n fc.oneof(\n fc.tuple(anything(), anything()),\n\n // Add a few clones in the mix too, to ensure we'll have different and equal values\n fc.clone(anything(), 2)\n ),\n\n // Unit test\n ([value1, value2]) => {\n // _If_ sticking these values in an array makes them shallow-equal,\n // then they should also always be equal without the array wrappers\n if (shallow([value1], [value2])) {\n expect(shallow(value1, value2)).toBe(true);\n }\n\n if (shallow({ k: value1 }, { k: value2 })) {\n expect(shallow(value1, value2)).toBe(true);\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/jurgen-paul/liveblocks/packages/liveblocks-core/src/lib/__tests__/shallow.test.ts", "start_line": null, "end_line": null, "dependencies": ["anything"], "repo": {"name": "jurgen-paul/liveblocks", "url": "https://github.com/jurgen-paul/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60666, "name": "unknown", "code": "it(\"argument ordering does not matter\", () => {\n fc.assert(\n fc.property(\n // Inputs\n fc.oneof(\n fc.tuple(anything(), anything()),\n\n // Add a few clones in the mix too, to ensure we'll have different and equal values\n fc.clone(anything(), 2)\n ),\n\n // Unit test\n ([value1, value2]) => {\n // Order doesn't matter when comparing\n expect(shallow(value1, value2)).toBe(shallow(value2, value1));\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/jurgen-paul/liveblocks/packages/liveblocks-core/src/lib/__tests__/shallow.test.ts", "start_line": null, "end_line": null, "dependencies": ["anything"], "repo": {"name": "jurgen-paul/liveblocks", "url": "https://github.com/jurgen-paul/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55739, "name": "unknown", "code": "test('can splice', () => {\n fc.assert(\n fc.property(\n fc.commands([\n TSeqSpliceCommand.arbitrary()\n ]), cmds => {\n fc.modelRun(() => ({\n model: new SpliceStringModel(),\n real: new TSeq('p1')\n }), cmds);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/m-ld/m-ld-js/test/tseq.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "m-ld/m-ld-js", "url": "https://github.com/m-ld/m-ld-js.git", "license": "MIT", "stars": 41, "forks": 3}, "metrics": null, "summary": "The test verifies that a series of splice commands can be correctly executed on a `TSeq` instance using a corresponding model for validation.", "mode": "fast-check"} {"id": 55743, "name": "unknown", "code": "assertArbitrary = (arbitrary: fc.Arbitrary, checks: FilterFunction[], result: boolean): void => {\n fc.assert(\n fc.property(arbitrary, (value) => {\n checks.forEach((check) => {\n expect(check(value)).toBe(result);\n });\n }),\n );\n}", "language": "typescript", "source_file": "./repos/janjakubnanista/ts-type-checked/test/utils/utils.v3.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "janjakubnanista/ts-type-checked", "url": "https://github.com/janjakubnanista/ts-type-checked.git", "license": "MIT", "stars": 88, "forks": 5}, "metrics": null, "summary": "The property ensures that all `FilterFunction` checks applied to values generated by an arbitrary match the expected boolean result.", "mode": "fast-check"} {"id": 60667, "name": "unknown", "code": "it(\"date (and other non-pojos) are never considered equal\", () => {\n fc.assert(\n fc.property(\n // Inputs\n fc.oneof(\n fc.tuple(nonpojo(), nonpojo()),\n\n // Add a few clones in the mix too, to ensure we'll have different and equal values\n fc.clone(nonpojo(), 2)\n ),\n\n // Unit test\n ([v1, v2]) => {\n expect(shallow(v1, v2)).toBe(false);\n expect(shallow([v1], [v2])).toBe(false);\n expect(shallow({ k: v1 }, { k: v2 })).toBe(false);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/jurgen-paul/liveblocks/packages/liveblocks-core/src/lib/__tests__/shallow.test.ts", "start_line": null, "end_line": null, "dependencies": ["nonpojo"], "repo": {"name": "jurgen-paul/liveblocks", "url": "https://github.com/jurgen-paul/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55747, "name": "unknown", "code": "test('same-type circular structure should throw an error', () => {\n const circularArbitrary = fc.integer(0, 100).map((n) => createLinkedList(n, true)[0]);\n\n // We check the valid arbitrary on a finer-grained level than the invalid one\n fc.assert(\n fc.property(circularArbitrary, (value) => {\n expect(() => typeCheckFor()(value)).toThrow(circularTypeError);\n expect(() => isA(value)).toThrow(circularTypeError);\n }) as any,\n );\n })", "language": "typescript", "source_file": "./repos/janjakubnanista/ts-type-checked/test/setups/typescript--2.7.2/tests/special-cases.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "janjakubnanista/ts-type-checked", "url": "https://github.com/janjakubnanista/ts-type-checked.git", "license": "MIT", "stars": 88, "forks": 5}, "metrics": null, "summary": "A circular structure of the same type should trigger an error in both `typeCheckFor` and `isA`.", "mode": "fast-check"} {"id": 60671, "name": "unknown", "code": "it(\"deregisering usage\", () => {\n fc.assert(\n fc.property(\n anything(),\n\n (payload) => {\n const callback1 = jest.fn();\n const callback2 = jest.fn();\n const hub = makeEventSource();\n\n const dereg1 = hub.observable.subscribe(callback1);\n\n // Registering the same function instance multiple times has no\n // observable effect\n const dereg2a = hub.observable.subscribe(callback2);\n const dereg2b = hub.observable.subscribe(callback2);\n\n hub.notify(payload);\n hub.notify(payload);\n\n expect(callback1.mock.calls.length).toBe(2); // Both get updates\n expect(callback2.mock.calls.length).toBe(2);\n\n // Deregister callback1\n dereg1();\n\n hub.notify(payload);\n hub.notify(payload);\n hub.notify(payload);\n\n expect(callback1.mock.calls.length).toBe(2); // Callback1 stopped getting updates\n expect(callback2.mock.calls.length).toBe(5); // Callback2 still receives updates\n\n // Deregister callback2\n dereg2a();\n\n hub.notify(payload);\n hub.notify(payload);\n hub.notify(payload);\n\n expect(callback1.mock.calls.length).toBe(2); // Callback1 already stopped getting updates before\n expect(callback2.mock.calls.length).toBe(5); // Callback2 now also stopped getting them\n\n // Deregister callback2 again (has no effect)\n dereg2b();\n\n hub.notify(payload);\n hub.notify(payload);\n hub.notify(payload);\n\n expect(callback1.mock.calls.length).toBe(2); // Callback1 already stopped getting updates before\n expect(callback2.mock.calls.length).toBe(5); // Callback2 already stopped getting updates before\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/jurgen-paul/liveblocks/packages/liveblocks-core/src/lib/__tests__/EventSource.test.ts", "start_line": null, "end_line": null, "dependencies": ["anything"], "repo": {"name": "jurgen-paul/liveblocks", "url": "https://github.com/jurgen-paul/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Subscribing, deregistering, and re-deregistering callbacks should correctly affect the number of updates received by each callback.", "mode": "fast-check"} {"id": 60672, "name": "unknown", "code": "it(\"setting works with any value\", () => {\n fc.assert(\n fc.property(\n fc.anything(),\n fc.anything(),\n\n (init, newVal) => {\n const ref = new ValueRef(init);\n expect(ref.current).toStrictEqual(init);\n\n ref.set(newVal);\n expect(ref.current).toStrictEqual(newVal);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/jurgen-paul/liveblocks/packages/liveblocks-core/src/refs/__tests__/ValueRef.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "jurgen-paul/liveblocks", "url": "https://github.com/jurgen-paul/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`ValueRef` correctly updates its current value, reflecting any initial and subsequent values assigned to it.", "mode": "fast-check"} {"id": 60673, "name": "unknown", "code": "it(\"will freeze all given values\", () => {\n fc.assert(\n fc.property(\n fc.anything(),\n fc.anything(),\n\n (init, newVal) => {\n // Freezes in constructor\n const ref = new ValueRef(init);\n expect(ref.current).toStrictEqual(init);\n expect(() => {\n (ref.current as any).abc = 123;\n }).toThrow();\n\n // Freezes in setter\n ref.set(newVal);\n expect(ref.current).toStrictEqual(newVal);\n expect(() => {\n (ref.current as any).xyz = 456;\n }).toThrow();\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/jurgen-paul/liveblocks/packages/liveblocks-core/src/refs/__tests__/ValueRef.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "jurgen-paul/liveblocks", "url": "https://github.com/jurgen-paul/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`ValueRef` freezes the initial and new values, preventing modifications.", "mode": "fast-check"} {"id": 55836, "name": "unknown", "code": "it('should return time from a query method', async () => {\n const actor = await getCanisterActor('canister');\n\n await fc.assert(\n fc.asyncProperty(fc.constant(undefined), async () => {\n const testTimeBefore = new Date().getTime() - 2_000;\n const canisterTime0 = nanoSecondsToMilliseconds(\n await actor.queryTime()\n );\n const canisterTime1 = nanoSecondsToMilliseconds(\n await actor.queryTime()\n );\n const testTimeAfter = new Date().getTime();\n\n expect(canisterTime0).toBeLessThanOrEqual(canisterTime1);\n\n expect(canisterTime0).toBeGreaterThanOrEqual(\n testTimeBefore\n );\n expect(canisterTime1).toBeGreaterThanOrEqual(\n testTimeBefore\n );\n\n expect(canisterTime0).toBeLessThan(testTimeAfter);\n expect(canisterTime1).toBeLessThanOrEqual(testTimeAfter);\n }),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/time/test/tests.ts", "start_line": null, "end_line": null, "dependencies": ["nanoSecondsToMilliseconds"], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "The property ensures that the time returned by a query method in a canister is non-decreasing, falls between a certain start and end time range, and is converted from nanoseconds to milliseconds.", "mode": "fast-check"} {"id": 60702, "name": "unknown", "code": "test('never pick undefined intervals for relative alarms', () => {\n fc.assert(fc.property(\n arbitrary_complete_intervals(),\n (intervals) => {\n const alarms = findAlarmThresholds(intervals);\n\n return (alarms.lowerAlarmIntervalIndex === undefined || intervals[alarms.lowerAlarmIntervalIndex].change !== undefined)\n && (alarms.upperAlarmIntervalIndex === undefined || intervals[alarms.upperAlarmIntervalIndex].change !== undefined);\n },\n ));\n })", "language": "typescript", "source_file": "./repos/alexandersperling/aws-cdk/packages/aws-cdk-lib/aws-autoscaling-common/test/intervals.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "alexandersperling/aws-cdk", "url": "https://github.com/alexandersperling/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`findAlarmThresholds` should not select undefined intervals for relative alarm indices in an array of intervals.", "mode": "fast-check"} {"id": 60703, "name": "unknown", "code": "test('pick intervals on either side of the undefined interval, if present', () => {\n fc.assert(fc.property(\n arbitrary_complete_intervals(),\n (intervals) => {\n // There must be an undefined interval and it must not be at the edges\n const i = intervals.findIndex(x => x.change === undefined);\n fc.pre(i > 0 && i < intervals.length - 1);\n\n const alarms = findAlarmThresholds(intervals);\n return (alarms.lowerAlarmIntervalIndex === i - 1 && alarms.upperAlarmIntervalIndex === i + 1);\n },\n ));\n })", "language": "typescript", "source_file": "./repos/alexandersperling/aws-cdk/packages/aws-cdk-lib/aws-autoscaling-common/test/intervals.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "alexandersperling/aws-cdk", "url": "https://github.com/alexandersperling/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that if there is an undefined interval in a sequence, `findAlarmThresholds` selects the intervals immediately before and after this undefined interval.", "mode": "fast-check"} {"id": 60708, "name": "unknown", "code": "it('should handle batch operations correctly', () => {\n fc.assert(\n fc.property(\n fc.array(varNameArb, { minLength: 1, maxLength: 50 }),\n (exports) => {\n const tracker = create_file_type_tracker();\n \n // Sequential marking\n let sequential = tracker;\n for (const exp of exports) {\n sequential = mark_as_exported(sequential, exp);\n }\n \n // Batch marking\n const batch = mark_as_exported_batch(tracker, exports);\n \n // Results should be equivalent\n expect(batch.exportedDefinitions.size).toBe(sequential.exportedDefinitions.size);\n for (const exp of exports) {\n expect(batch.exportedDefinitions.has(exp)).toBe(true);\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/CRJFisher/ariadne/packages/core/tests/property_based.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "CRJFisher/ariadne", "url": "https://github.com/CRJFisher/ariadne.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The test ensures that marking exports sequentially in a file type tracker produces the same results as marking them in batch.", "mode": "fast-check"} {"id": 55842, "name": "unknown", "code": "it('should throw error for seed length not equal to 32', async () => {\n const actor = await getCanisterActor('canister');\n\n await fc.assert(\n fc.asyncProperty(\n fc.oneof(\n fc.uint8Array({ minLength: 0, maxLength: 31 }),\n fc.uint8Array({ minLength: 33, maxLength: 1_024 })\n ),\n async (seed) => {\n await expect(actor.seed(seed)).rejects.toThrow(\n 'seed must be exactly 32 bytes in length'\n );\n }\n ),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/rand_seed/test/tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "Ensures an error is thrown when the seed provided to `actor.seed` is not exactly 32 bytes in length.", "mode": "fast-check"} {"id": 55843, "name": "unknown", "code": "it.each(testCases)(\n 'should calculate performanceCounter($counterType) instructions accurately from a $type method',\n async ({ method }) => {\n const actor = await getCanisterActor('canister');\n\n await fc.assert(\n fc.asyncProperty(\n fc.nat({\n max: 1_000_000\n }),\n async (loops) => {\n const instructionsLoops0 = await actor[method](0);\n\n const instructions0 = await actor[method](loops);\n const instructions1 = await actor[method](loops);\n\n const instructionsAfter0 = await actor[method](\n loops + 1_000\n );\n const instructionsAfter1 = await actor[method](\n loops + 1_000\n );\n\n expect(instructionsLoops0).toBeGreaterThan(0n);\n expect(instructions0).toBeGreaterThan(0n);\n expect(instructions1).toBeGreaterThan(0n);\n expect(instructionsAfter0).toBeGreaterThan(0n);\n expect(instructionsAfter1).toBeGreaterThan(0n);\n\n expect(\n percentageDifferenceBigInt(\n instructions0,\n instructions1\n )\n ).toBeLessThanOrEqual(5n);\n\n expect(\n percentageDifferenceBigInt(\n instructionsAfter0,\n instructionsAfter1\n )\n ).toBeLessThanOrEqual(5n);\n\n expect(instructions0).toBeLessThan(\n instructionsAfter0\n );\n expect(instructions1).toBeLessThan(\n instructionsAfter1\n );\n }\n ),\n defaultPropTestParams()\n );\n }\n )", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/performance_counter/test/tests.ts", "start_line": null, "end_line": null, "dependencies": ["percentageDifferenceBigInt"], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "The calculation of performance counter instructions should be accurate across repeated method calls, with a small percentage difference (\u2264 5%) between repeated measurements and increased instruction counts for increased loop iterations.", "mode": "fast-check"} {"id": 55844, "name": "unknown", "code": "it('should echo the reject message in echoThroughReject', async () => {\n const callerCanister = await getCanisterActor('caller');\n await fc.assert(\n fc.asyncProperty(fc.string(), async (message) => {\n const result =\n await callerCanister.echoThroughReject(message);\n expect(result).toBe(\n `reject_message proptest message: ${message}`\n );\n }),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/msg_reject_msg/test/tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "`echoThroughReject` echoes back the provided message prefixed with \"reject_message proptest message:\".", "mode": "fast-check"} {"id": 55847, "name": "unknown", "code": "it('should reply with even numbers and reject odd numbers in evenOrRejectQuery', async () => {\n const canister = await getCanisterActor('canister');\n await fc.assert(\n fc.asyncProperty(fc.bigInt(), async (number) => {\n if (number % 2n === 0n) {\n const result = await canister.evenOrRejectQuery(number);\n expect(result).toBe(number);\n } else {\n await expect(\n canister.evenOrRejectQuery(number)\n ).rejects.toThrow('Odd numbers are rejected');\n }\n }),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/msg_reject/test/tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "The `evenOrRejectQuery` should reply with the number if even and reject with an error message if the number is odd.", "mode": "fast-check"} {"id": 55848, "name": "unknown", "code": "it('should always reject with the provided message in alwaysRejectUpdate', async () => {\n const canister = await getCanisterActor('canister');\n await fc.assert(\n fc.asyncProperty(fc.string(), async (message) => {\n await expect(\n canister.alwaysRejectUpdate(message)\n ).rejects.toThrow(\n message.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"')\n );\n }),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/msg_reject/test/tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "`alwaysRejectUpdate` function should consistently reject with the exact message provided, after escaping backslashes and quotes.", "mode": "fast-check"} {"id": 60722, "name": "unknown", "code": "it(\"generated random strings with given length\", () => {\n fc.assert(\n fc.property(fc.integer({ min: 0, max: 256 }), (n) => {\n expect(nanoid(n).length).toBe(n);\n })\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/nanoid.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60723, "name": "unknown", "code": "test(\"matches entire alphabet\", () => {\n fc.assert(\n fc.property(\n fc.integer({ min: -95, max: 94 }),\n\n (n) => {\n if (n >= 0) {\n expect(nthDigit(n)).toBe(ALPHABET.charAt(n));\n } else {\n expect(nthDigit(n)).toBe(\n ALPHABET.split(\"\")\n .reverse()\n .join(\"\")\n .charAt(-(n + 1))\n );\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/position.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `nthDigit` should return the corresponding character from `ALPHABET` for integers within the specified range, handling negative indices by reversing the order of `ALPHABET`.", "mode": "fast-check"} {"id": 60724, "name": "unknown", "code": "it(\"zero is an illegal Pos value\", () => {\n fc.assert(\n fc.property(\n genZeroes(),\n\n (strOfZeroes) => {\n expect(asPos(strOfZeroes)).toBe(ONE);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/position.test.ts", "start_line": null, "end_line": null, "dependencies": ["genZeroes"], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "A string composed entirely of zeroes is converted to the value `ONE` by `asPos`.", "mode": "fast-check"} {"id": 60725, "name": "unknown", "code": "it(\"for valid strings, asPos is a noop\", () => {\n fc.assert(\n fc.property(\n genPos(),\n\n (s) => {\n expect(asPos(s)).toBe(s);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/position.test.ts", "start_line": null, "end_line": null, "dependencies": ["genPos"], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "For valid strings, the function `asPos` should return the input unchanged.", "mode": "fast-check"} {"id": 55855, "name": "unknown", "code": "it('should return true for whoami principal from an update method', async () => {\n const actor = await getCanisterActor('canister');\n\n await fc.assert(\n fc.asyncProperty(fc.constant(undefined), async () => {\n const principal = Principal.fromText(whoamiPrincipal());\n\n const isController =\n await actor.updateIsController(principal);\n\n expect(isController).toStrictEqual(true);\n }),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/is_controller/test/tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "The `updateIsController` method should return true when called with the principal obtained from `whoamiPrincipal()`.", "mode": "fast-check"} {"id": 60729, "name": "unknown", "code": "it(\"always outputs valid Pos values\", () => {\n fc.assert(\n fc.property(\n genPos(),\n\n (pos) => {\n expect(isPos(after(pos))).toBe(true);\n expect(isPos(before(pos))).toBe(true);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/position.test.ts", "start_line": null, "end_line": null, "dependencies": ["genPos"], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function verifies that both `after(pos)` and `before(pos)` produce valid `Pos` values from generated positions.", "mode": "fast-check"} {"id": 55857, "name": "unknown", "code": "it('should return false for non-controller principal from an update method', async () => {\n const actor = await getCanisterActor('canister');\n\n await fc.assert(\n fc.asyncProperty(\n fc.uint8Array({ minLength: 29, maxLength: 29 }),\n async (bytes) => {\n const principal = Principal.fromUint8Array(bytes);\n\n const isController =\n await actor.updateIsController(principal);\n\n expect(isController).toStrictEqual(false);\n }\n ),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/is_controller/test/tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "The update method returns false when given a non-controller principal converted from a 29-byte Uint8Array.", "mode": "fast-check"} {"id": 60730, "name": "unknown", "code": "it('after generates alphabetically \"higher\" values', () => {\n fc.assert(\n fc.property(\n genUnverifiedPos(),\n\n (pos) => {\n expect(after(pos) > pos).toBe(true);\n expect(pos < after(pos)).toBe(true);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/position.test.ts", "start_line": null, "end_line": null, "dependencies": ["genUnverifiedPos"], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `after` function should generate a value that is alphabetically greater than the input position.", "mode": "fast-check"} {"id": 60738, "name": "unknown", "code": "it(\"all equal scalars are shallowly equal\", () => {\n fc.assert(\n fc.property(\n // Inputs\n fc.clone(scalar(), 2),\n\n // Unit test\n ([scalar1, scalar2]) => {\n expect(shallow(scalar1, scalar2)).toBe(true);\n\n // If two values are shallowly equal, then those values wrapped in an\n // array (one level) should _also_ be considered shallowly equal\n expect(shallow([scalar1], [scalar2])).toBe(true);\n expect(shallow([scalar1, scalar1], [scalar2, scalar2])).toBe(true);\n\n // ...but wrapping twice is _never_ going to be equal\n expect(shallow([[scalar1]], [[scalar2]])).toBe(false);\n\n // Ditto for objects\n expect(shallow({ a: scalar1 }, { a: scalar2 })).toBe(true);\n expect(\n shallow({ a: scalar1, b: scalar1 }, { a: scalar2, b: scalar2 })\n ).toBe(true);\n\n // ...but nesting twice is _never_ going to be equal\n expect(shallow({ a: { b: scalar1 } }, { a: { b: scalar2 } })).toBe(\n false\n );\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/shallow.test.ts", "start_line": null, "end_line": null, "dependencies": ["scalar"], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60739, "name": "unknown", "code": "it(\"different scalars are not shallowly equal\", () => {\n fc.assert(\n fc.property(\n // Inputs\n fc.tuple(scalar(), scalar()).filter(([x, y]) => x !== y),\n\n // Unit test\n ([scalar1, scalar2]) => {\n expect(shallow(scalar1, scalar2)).toBe(false);\n\n // If two values are shallowly unequal, then wrapping those in an\n // array (one level) should also always be shallowly unequal\n expect(shallow([scalar1], [scalar2])).toBe(false);\n\n // Ditto for objects\n expect(shallow({ k: scalar1 }, { k: scalar2 })).toBe(false);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/shallow.test.ts", "start_line": null, "end_line": null, "dependencies": ["scalar"], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60740, "name": "unknown", "code": "it(\"equal composite values\", () => {\n fc.assert(\n fc.property(\n // Inputs\n fc.clone(complex(), 2),\n\n // Unit test\n ([complex1, complex2]) => {\n // Property: _if_ two complex values are considered shallowly equal,\n // then wrapping them in an array (one level) will guarantee they're\n // not shallowly equal\n if (shallow(complex1, complex2)) {\n expect(shallow([complex1], [complex2])).toBe(false);\n }\n\n // Ditto for objects\n if (shallow(complex1, complex2)) {\n expect(shallow({ k: complex1 }, { k: complex2 })).toBe(false);\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/shallow.test.ts", "start_line": null, "end_line": null, "dependencies": ["complex"], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60741, "name": "unknown", "code": "it(\"consistency\", () => {\n fc.assert(\n fc.property(\n // Inputs\n fc.oneof(\n fc.tuple(anything(), anything()),\n\n // Add a few clones in the mix too, to ensure we'll have different and equal values\n fc.clone(anything(), 2)\n ),\n\n // Unit test\n ([value1, value2]) => {\n // _If_ sticking these values in an array makes them shallow-equal,\n // then they should also always be equal without the array wrappers\n if (shallow([value1], [value2])) {\n expect(shallow(value1, value2)).toBe(true);\n }\n\n if (shallow({ k: value1 }, { k: value2 })) {\n expect(shallow(value1, value2)).toBe(true);\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/shallow.test.ts", "start_line": null, "end_line": null, "dependencies": ["anything"], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60742, "name": "unknown", "code": "it(\"argument ordering does not matter\", () => {\n fc.assert(\n fc.property(\n // Inputs\n fc.oneof(\n fc.tuple(anything(), anything()),\n\n // Add a few clones in the mix too, to ensure we'll have different and equal values\n fc.clone(anything(), 2)\n ),\n\n // Unit test\n ([value1, value2]) => {\n // Order doesn't matter when comparing\n expect(shallow(value1, value2)).toBe(shallow(value2, value1));\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/shallow.test.ts", "start_line": null, "end_line": null, "dependencies": ["anything"], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60743, "name": "unknown", "code": "it(\"date (and other non-pojos) are never considered equal\", () => {\n fc.assert(\n fc.property(\n // Inputs\n fc.oneof(\n fc.tuple(nonpojo(), nonpojo()),\n\n // Add a few clones in the mix too, to ensure we'll have different and equal values\n fc.clone(nonpojo(), 2)\n ),\n\n // Unit test\n ([v1, v2]) => {\n expect(shallow(v1, v2)).toBe(false);\n expect(shallow([v1], [v2])).toBe(false);\n expect(shallow({ k: v1 }, { k: v2 })).toBe(false);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/shallow.test.ts", "start_line": null, "end_line": null, "dependencies": ["nonpojo"], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60744, "name": "unknown", "code": "test(\"normal usage\", () => {\n fc.assert(\n fc.property(\n anything(),\n\n (payload) => {\n const callback = jest.fn();\n const hub = makeEventSource();\n\n hub.observable.subscribe(callback);\n hub.notify(payload);\n hub.notify(payload);\n hub.notify(payload);\n\n expect(callback).toHaveBeenCalledTimes(3);\n for (const [arg] of callback.mock.calls) {\n expect(arg).toBe(payload);\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/EventSource.test.ts", "start_line": null, "end_line": null, "dependencies": ["anything"], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60745, "name": "unknown", "code": "test(\"registering multiple callbacks\", () => {\n fc.assert(\n fc.property(\n anything(),\n\n (payload) => {\n const callback1 = jest.fn();\n const callback2 = jest.fn();\n const hub = makeEventSource();\n\n hub.observable.subscribe(callback1);\n hub.notify(payload);\n\n hub.observable.subscribe(callback2);\n hub.notify(payload);\n hub.notify(payload);\n\n expect(callback1).toHaveBeenCalledTimes(3);\n for (const [arg] of callback1.mock.calls) {\n expect(arg).toBe(payload);\n }\n\n expect(callback2).toHaveBeenCalledTimes(2);\n for (const [arg] of callback2.mock.calls) {\n expect(arg).toBe(payload);\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/EventSource.test.ts", "start_line": null, "end_line": null, "dependencies": ["anything"], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60746, "name": "unknown", "code": "test(\"subscribing once\", () => {\n fc.assert(\n fc.property(\n anything(),\n\n (payload) => {\n const callback = jest.fn();\n const hub = makeEventSource();\n\n const dereg1 = hub.observable.subscribeOnce(callback);\n hub.notify(payload);\n hub.notify(payload);\n hub.notify(payload);\n\n expect(callback).toHaveBeenCalledTimes(1); // Called only once, not three times\n for (const [arg] of callback.mock.calls) {\n expect(arg).toBe(payload);\n }\n\n // Deregistering has no effect\n dereg1();\n hub.notify(payload);\n expect(callback).toHaveBeenCalledTimes(1); // Called only once, not three times\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/EventSource.test.ts", "start_line": null, "end_line": null, "dependencies": ["anything"], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60747, "name": "unknown", "code": "test(\"deregisering usage\", () => {\n fc.assert(\n fc.property(\n anything(),\n\n (payload) => {\n const callback1 = jest.fn();\n const callback2 = jest.fn();\n const hub = makeEventSource();\n\n const dereg1 = hub.observable.subscribe(callback1);\n\n // Registering the same function instance multiple times has no\n // observable effect\n const dereg2a = hub.observable.subscribe(callback2);\n const dereg2b = hub.observable.subscribe(callback2);\n\n hub.notify(payload);\n hub.notify(payload);\n\n expect(callback1).toHaveBeenCalledTimes(2); // Both get updates\n expect(callback2).toHaveBeenCalledTimes(2);\n\n // Deregister callback1\n dereg1();\n\n hub.notify(payload);\n hub.notify(payload);\n hub.notify(payload);\n\n expect(callback1).toHaveBeenCalledTimes(2); // Callback1 stopped getting updates\n expect(callback2).toHaveBeenCalledTimes(5); // Callback2 still receives updates\n\n // Deregister callback2\n dereg2a();\n\n hub.notify(payload);\n hub.notify(payload);\n hub.notify(payload);\n\n expect(callback1).toHaveBeenCalledTimes(2); // Callback1 already stopped getting updates before\n expect(callback2).toHaveBeenCalledTimes(5); // Callback2 now also stopped getting them\n\n // Deregister callback2 again (has no effect)\n dereg2b();\n\n hub.notify(payload);\n hub.notify(payload);\n hub.notify(payload);\n\n expect(callback1).toHaveBeenCalledTimes(2); // Callback1 already stopped getting updates before\n expect(callback2).toHaveBeenCalledTimes(5); // Callback2 already stopped getting updates before\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/EventSource.test.ts", "start_line": null, "end_line": null, "dependencies": ["anything"], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60748, "name": "unknown", "code": "test(\"pausing/continuing event delivery\", () => {\n fc.assert(\n fc.property(\n anything(),\n\n (payload) => {\n const callback = jest.fn();\n const hub = makeBufferableEventSource();\n\n const unsub = hub.observable.subscribe(callback);\n\n hub.pause();\n hub.notify(payload);\n hub.notify(payload);\n hub.notify(payload);\n\n expect(callback).not.toHaveBeenCalled(); // No events get delivered until unpaused\n\n hub.unpause();\n expect(callback).toHaveBeenCalledTimes(3); // Buffered events get delivered\n\n // Deregister callback\n unsub();\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/EventSource.test.ts", "start_line": null, "end_line": null, "dependencies": ["anything"], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60749, "name": "unknown", "code": "test(\"[prop] whatever value you initialize it with is what comes out\", () => {\n fc.assert(\n fc.property(\n fc.anything(),\n\n (value) => {\n const signal = new Signal(value);\n expect(signal.get()).toBe(value);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/signals/Signal.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60750, "name": "unknown", "code": "test(\"[prop] setting works with any value\", () => {\n fc.assert(\n fc.property(\n fc.anything(),\n fc.anything(),\n\n (init, newVal) => {\n const signal = new Signal(init);\n expect(signal.get()).toBe(init);\n\n signal.set(newVal);\n expect(signal.get()).toBe(newVal);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/signals/Signal.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60751, "name": "unknown", "code": "test(\"[prop] will freeze all given values\", () => {\n fc.assert(\n fc.property(\n fc.anything().filter((x) => x !== null && x !== undefined),\n fc.anything().filter((x) => x !== null && x !== undefined),\n\n (init, newVal) => {\n // Freezes in constructor\n const signal = new Signal(init);\n expect(signal.get()).toBe(init);\n\n /* eslint-disable @typescript-eslint/no-unsafe-return */\n expect(() => {\n // @ts-expect-error - deliberately set invalid prop\n signal.get().abc = 123;\n }).toThrow(TypeError);\n\n // @ts-expect-error - get prop\n expect(signal.get().abc).toBe(undefined);\n\n // Freezes in setter\n signal.set(newVal);\n\n expect(() => {\n // @ts-expect-error - deliberately set invalid prop\n signal.get().xyz = 456;\n }).toThrow(TypeError);\n\n // @ts-expect-error - get prop\n expect(signal.get().xyz).toBe(undefined);\n /* eslint-enable @typescript-eslint/no-unsafe-return */\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/signals/Signal.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60752, "name": "unknown", "code": "test(\"[prop] whatever value you initialize it with is what comes out\", () => {\n fc.assert(\n fc.property(\n anyObject,\n\n (value) => {\n const signal = new MutableSignal(value);\n expect(signal.get()).toBe(value);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/signals/MutableSignal.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60753, "name": "unknown", "code": "test(\"[prop] mutating works with any value\", () => {\n fc.assert(\n fc.property(\n anyObject,\n fc.anything(),\n\n (init, newVal) => {\n const signal = new MutableSignal(init);\n expect(signal.get()).toBe(init);\n\n signal.mutate((x) => {\n // @ts-expect-error deliberately mutate\n x.whatever = newVal;\n });\n expect(signal.get()).toBe(init);\n\n // But the mutation happened\n expect(\n // @ts-expect-error deliberately access\n signal.get().whatever\n ).toBe(newVal);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/signals/MutableSignal.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55866, "name": "unknown", "code": "it('should not hit the instruction limit with chunking', async () => {\n const actor = await getCanisterActor('canister');\n\n await fc.assert(\n fc.asyncProperty(fc.nat({ max }), async (constant) => {\n const instructions = await actor.measureSum(\n 20_000_000 + 1_000_000 * constant,\n true\n );\n\n expect(instructions).toBeGreaterThanOrEqual(\n updateCallInstructionLimit\n );\n }),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/chunk/test/tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "Chunking ensures the measured instructions for a sum operation exceed or meet the update call instruction limit.", "mode": "fast-check"} {"id": 55869, "name": "unknown", "code": "it('has no certified data if none is set', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.uint8Array({ minLength: 0, maxLength: 32 }),\n async (data) => {\n const agent = await createAuthenticatedAgent(whoami());\n const actor = await getCanisterActor(\n CANISTER_NAME,\n {\n agent\n }\n );\n uninstallCanister(); // to clear any existing certified data\n deployCanister();\n\n // Check that getCertificate returns an empty array initially\n await testCertifiedData(\n new Uint8Array(),\n actor,\n agent,\n CANISTER_NAME\n );\n\n // Set the certified data\n await actor.setData(data);\n\n // Check that getCertificate now returns the set data\n await testCertifiedData(\n data,\n actor,\n agent,\n CANISTER_NAME\n );\n }\n ),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/certified_data/test/tests.ts", "start_line": null, "end_line": null, "dependencies": ["uninstallCanister", "deployCanister", "testCertifiedData"], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "The function verifies that initially, a canister has no certified data, and after setting certified data, it returns the correct data.", "mode": "fast-check"} {"id": 55878, "name": "unknown", "code": "it('should return the caller principal for query and update', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.uint8Array({ minLength: 32, maxLength: 32 }),\n async (bytes) => {\n const identity = Ed25519KeyIdentity.generate(bytes);\n const identityPrincipalText = identity\n .getPrincipal()\n .toText();\n\n const actor = await getCanisterActor(\n 'canister',\n {\n identity\n }\n );\n\n const queryCaller = await actor.getQueryCaller();\n const updateCaller = await actor.getUpdateCaller();\n\n expect(queryCaller.toText()).toBe(\n identityPrincipalText\n );\n expect(updateCaller.toText()).toBe(\n identityPrincipalText\n );\n }\n ),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/caller/test/tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "The function should return the caller's principal for both query and update calls, verifying that it matches the identity created from a generated byte array.", "mode": "fast-check"} {"id": 55887, "name": "unknown", "code": "UnitTest.test('ShadowDom - SelectorFind.descendant', () => {\n if (SugarShadowDom.isSupported()) {\n fc.assert(fc.property(htmlBlockTagName(), htmlInlineTagName(), fc.hexaString(), (block, inline, text) => {\n withShadowElement((ss) => {\n const id = 'theid';\n const inner = SugarElement.fromHtml(`<${block}>

hello<${inline} id=\"${id}\">${text}

`);\n Insert.append(ss, inner);\n\n const frog: SugarElement = SelectorFind.descendant(ss, `#${id}`).getOrDie('Element not found');\n Assert.eq('textcontent', text, frog.dom.textContent);\n });\n }));\n }\n})", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/sugar/src/test/ts/browser/ShadowDomTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55888, "name": "unknown", "code": "UnitTest.test('All valid floats are valid', () => {\n fc.assert(fc.property(fc.oneof(\n // small to medium floats\n fc.float(),\n // big floats\n fc.tuple(fc.float(), fc.integer(-20, 20)).map(([ mantissa, exponent ]) => mantissa * Math.pow(10, exponent))\n ), (num) => {\n const parsed = Dimension.parse(num.toString(), [ 'empty' ]).getOrDie();\n Assert.eq('Number is unchanged by stringifying and parsing', num, parsed.value);\n Assert.eq('Unit is empty', '', parsed.unit);\n return true;\n }));\n})", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/sugar/src/test/ts/atomic/DimensionParseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55889, "name": "unknown", "code": "UnitTest.test('All valid integers are valid', () => {\n fc.assert(fc.property(fc.integer(), (num) => {\n const parsed = Dimension.parse(num.toString(), [ 'empty' ]).getOrDie();\n Assert.eq('Number is unchanged by stringifying and parsing', num, parsed.value);\n Assert.eq('Unit is empty', '', parsed.unit);\n return true;\n }));\n})", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/sugar/src/test/ts/atomic/DimensionParseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55890, "name": "unknown", "code": "it('cell(x).get() === x', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n const cell = Cell(i);\n assert.equal(cell.get(), i);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/struct/CellTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55885, "name": "unknown", "code": "roundtrip = (s: S) =>\n fc.assert(fc.property(decoded(s), x => roundtripWith(s, x)))", "language": "typescript", "source_file": "./repos/briancavalier/braindump/packages/codec/src/roundtrip.test.ts", "start_line": null, "end_line": null, "dependencies": ["roundtripWith"], "repo": {"name": "briancavalier/braindump", "url": "https://github.com/briancavalier/braindump.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "The property ensures that encoding and then decoding a value, twice in succession, yields consistent and identical intermediate encoded and decoded results for a given schema.", "mode": "fast-check"} {"id": 55891, "name": "unknown", "code": "it('cell.get() === last set call', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), fc.integer(), (a, b, c) => {\n const cell = Cell(a);\n assert.equal(cell.get(), a);\n cell.set(b);\n assert.equal(cell.get(), b);\n cell.set(c);\n assert.equal(cell.get(), c);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/struct/CellTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55892, "name": "unknown", "code": "it('Error is thrown if not all arguments are supplied', () => {\n fc.assert(fc.property(arbAdt, fc.array(arbKeys, 1, 40), (subject, exclusions) => {\n const original = Arr.filter(allKeys, (k) => !Arr.contains(exclusions, k));\n\n try {\n const branches = Arr.mapToObject(original, () => Fun.identity);\n subject.match(branches);\n return false;\n } catch (err: any) {\n return err.message.indexOf('nothing') > -1;\n }\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55893, "name": "unknown", "code": "it('adt.nothing.match should pass [ ]', () => {\n fc.assert(fc.property(arbNothing, (subject) => {\n const contents = subject.match({\n nothing: record,\n unknown: Fun.die('should not be unknown'),\n exact: Fun.die('should not be exact')\n });\n assert.deepEqual(contents, []);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55894, "name": "unknown", "code": "it('adt.nothing.match should be same as fold', () => {\n fc.assert(fc.property(arbNothing, (subject) => {\n const matched = subject.match({\n nothing: record,\n unknown: Fun.die('should not be unknown'),\n exact: Fun.die('should not be exact')\n });\n\n const folded = subject.fold(record, Fun.die('should not be unknown'), Fun.die('should not be exact'));\n assert.deepEqual(folded, matched);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55895, "name": "unknown", "code": "it('adt.unknown.match should pass 1 parameter: [ guesses ]', () => {\n fc.assert(fc.property(arbUnknown, (subject) => {\n const contents = subject.match({\n nothing: Fun.die('should not be nothing'),\n unknown: record,\n exact: Fun.die('should not be exact')\n });\n assert.deepEqual(contents.length, 1);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55896, "name": "unknown", "code": "it('adt.unknown.match should be same as fold', () => {\n fc.assert(fc.property(arbUnknown, (subject) => {\n const matched = subject.match({\n nothing: Fun.die('should not be nothing'),\n unknown: record,\n exact: Fun.die('should not be exact')\n });\n\n const folded = subject.fold(Fun.die('should not be nothing'), record, Fun.die('should not be exact'));\n assert.deepEqual(folded, matched);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55897, "name": "unknown", "code": "it('adt.exact.match should pass 2 parameters [ value, precision ]', () => {\n fc.assert(fc.property(arbExact, (subject) => {\n const contents = subject.match({\n nothing: Fun.die('should not be nothing'),\n unknown: Fun.die('should not be unknown'),\n exact: record\n });\n assert.deepEqual(contents.length, 2);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55898, "name": "unknown", "code": "it('adt.exact.match should be same as fold', () => {\n fc.assert(fc.property(arbExact, (subject) => {\n const matched = subject.match({\n nothing: Fun.die('should not be nothing'),\n unknown: Fun.die('should not be unknown'),\n exact: record\n });\n\n const folded = subject.fold(Fun.die('should not be nothing'), Fun.die('should not be unknown'), record);\n assert.deepEqual(folded, matched);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55899, "name": "unknown", "code": "it('adt.match must have the right arguments, not just the right number', () => {\n fc.assert(fc.property(arbAdt, (subject) => {\n try {\n subject.match({\n not: Fun.identity,\n the: Fun.identity,\n right: Fun.identity\n });\n return false;\n } catch (err: any) {\n return err.message.indexOf('nothing') > -1;\n }\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55900, "name": "unknown", "code": "it('leftTrim(whitespace + s) === leftTrim(s)', () => {\n fc.assert(fc.property(\n fc.string(),\n (s) => {\n assert.equal(Strings.lTrim(s), Strings.lTrim(' ' + s));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/str/TrimTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55901, "name": "unknown", "code": "it('rightTrim(s + whitespace) === rightTrim(s)', () => {\n fc.assert(fc.property(\n fc.string(),\n (s) => {\n assert.equal(Strings.rTrim(s), Strings.rTrim(s + ' '));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/str/TrimTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55902, "name": "unknown", "code": "it('trim(whitespace + s) === trim(s)', () => {\n fc.assert(fc.property(\n fc.string(),\n (s) => {\n assert.equal(Strings.trim(s), Strings.trim(' ' + s));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/str/TrimTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55903, "name": "unknown", "code": "it('trim(s + whitespace) === trim(s)', () => {\n fc.assert(fc.property(\n fc.string(),\n (s) => {\n assert.equal(Strings.trim(s), Strings.trim(s + ' '));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/str/TrimTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55904, "name": "unknown", "code": "it('trim(whitespace + s + whitespace) === trim(s)', () => {\n fc.assert(fc.property(\n fc.string(),\n (s) => {\n assert.equal(Strings.trim(s), Strings.trim(' ' + s + ' '));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/str/TrimTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55905, "name": "unknown", "code": "it('Optionals.cat of only nones should be an empty array', () => {\n fc.assert(fc.property(\n fc.array(ArbDataTypes.arbOptionalNone()),\n (options) => {\n const output = Optionals.cat(options);\n assert.deepEqual(output, []);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55906, "name": "unknown", "code": "it('Optionals.cat of only somes should have the same length', () => {\n fc.assert(fc.property(\n fc.array(ArbDataTypes.arbOptionalSome(fc.integer())),\n (options) => {\n const output = Optionals.cat(options);\n assert.lengthOf(output, options.length);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55907, "name": "unknown", "code": "it('Optionals.cat of Arr.map(xs, Optional.some) should be xs', () => {\n fc.assert(fc.property(\n fc.array(fc.json()),\n (arr) => {\n const options = Arr.map(arr, Optional.some);\n const output = Optionals.cat(options);\n assert.deepEqual(output, arr);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55908, "name": "unknown", "code": "it('Optionals.cat of somes and nones should have length <= original', () => {\n fc.assert(fc.property(\n fc.array(ArbDataTypes.arbOptional(fc.integer())),\n (arr) => {\n const output = Optionals.cat(arr);\n assert.isAtMost(output.length, arr.length);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55909, "name": "unknown", "code": "it('Optionals.cat of nones.concat(somes).concat(nones) should be somes', () => {\n fc.assert(fc.property(\n fc.array(fc.json()),\n fc.array(fc.json()),\n fc.array(fc.json()),\n (before, on, after) => {\n const beforeNones: Optional[] = Arr.map(before, Optional.none);\n const afterNones = Arr.map(after, Optional.none);\n const onSomes = Arr.map(on, Optional.some);\n const output = Optionals.cat(beforeNones.concat(onSomes).concat(afterNones));\n assert.deepEqual(output, on);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55910, "name": "unknown", "code": "it('value(x) = value(x)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n assertResult(Result.value(i), Result.value(i));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/ResultInstancesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55911, "name": "unknown", "code": "it('error(x) = error(x)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n assertResult(Result.error(i), Result.error(i));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/ResultInstancesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55912, "name": "unknown", "code": "it('value(a) != error(e)', () => {\n fc.assert(fc.property(fc.integer(), fc.string(), (a, e) => {\n assert.isFalse(tResult(tNumber, tString).eq(\n Result.value(a),\n Result.error(e)\n ));\n\n assert.isFalse(tResult(tNumber, tString).eq(\n Result.error(e),\n Result.value(a)\n ));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/ResultInstancesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55913, "name": "unknown", "code": "it('(a = b) = (value(a) = value(b))', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), (a, b) => {\n assert.equal(tResult(tNumber, tString).eq(\n Result.value(a),\n Result.value(b)\n ), a === b);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/ResultInstancesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55914, "name": "unknown", "code": "it('(a = b) = (error(a) = error(b))', () => {\n fc.assert(fc.property(fc.string(), fc.string(), (a, b) => {\n assert.equal(tResult(tNumber, tString).eq(\n Result.error(a),\n Result.error(b)\n ), a === b);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/ResultInstancesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55915, "name": "unknown", "code": "it('ResultInstances.pprint', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n assert.equal(Pprint.render(Result.value(i), tResult(tNumber, tString)), `Result.value(\n ${i}\n)`);\n\n assert.equal(Pprint.render(Result.error(i), tResult(tString, tNumber)), `Result.error(\n ${i}\n)`);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/ResultInstancesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55916, "name": "unknown", "code": "it('Single some value', () => {\n fc.assert(fc.property(fc.integer(), (n) => {\n assertOptional(Optionals.sequence([ Optional.some(n) ]), Optional.some([ n ]));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalsSequenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55917, "name": "unknown", "code": "it('Two some values', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), (n, m) => {\n assertOptional(Optionals.sequence([ Optional.some(n), Optional.some(m) ]), Optional.some([ n, m ]));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalsSequenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55918, "name": "unknown", "code": "it('Array of numbers', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (n) => {\n const someNumbers = Arr.map(n, (x) => Optional.some(x));\n assertOptional(Optionals.sequence(someNumbers), Optional.some(n));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalsSequenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55919, "name": "unknown", "code": "it('Some then none', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (n) => {\n const someNumbers = Arr.map(n, (x) => Optional.some(x));\n assertNone(Optionals.sequence([ ...someNumbers, Optional.none() ]));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalsSequenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55920, "name": "unknown", "code": "it('None then some', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (n) => {\n const someNumbers = Arr.map(n, (x) => Optional.some(x));\n assertNone(Optionals.sequence([ Optional.none(), ...someNumbers ]));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalsSequenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Optionals.sequence` returns none when the sequence starts with an optional none element.", "mode": "fast-check"} {"id": 55922, "name": "unknown", "code": "it('flattens some(some(x)) to some(x)', () => {\n fc.assert(fc.property(fc.integer(), (n) => {\n assertOptional(Optionals.flatten(Optional.some(Optional.some(n))), Optional.some(n));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalsFlattenTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Flattening a nested `some(some(x))` should result in `some(x)`.", "mode": "fast-check"} {"id": 55924, "name": "unknown", "code": "it('Optional.some(x) !== Optional.none()', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n assert.isFalse((Optionals.equals(Optional.some(i), Optional.none())));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Optionals.equals` returns false when comparing `Optional.some(x)` with `Optional.none()`.", "mode": "fast-check"} {"id": 55925, "name": "unknown", "code": "it('Optional.some(x) === Optional.some(x)', () => {\n fc.assert(fc.property(fc.integer(), (i) => assert.isTrue(Optionals.equals(Optional.some(i), Optional.some(i)))));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Optional.some(x)` is equal to `Optional.some(x)` using `Optionals.equals` for any integer `x`.", "mode": "fast-check"} {"id": 55927, "name": "unknown", "code": "it('Optional.some(x) !== Optional.some(x + y) where y is not identity', () => {\n fc.assert(fc.property(fc.string(), fc.string(1, 40), (a, b) => {\n assert.isFalse(Optionals.equals(Optional.some(a), Optional.some(a + b)));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Optional.some(x)` is not equal to `Optional.some(x + y)` where `y` is a non-identity value.", "mode": "fast-check"} {"id": 55931, "name": "unknown", "code": "it('Checking Optionals.equals(some(x), some(y), _, _ -> true) === true', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), (a, b) => {\n const opt1 = Optional.some(a);\n const opt2 = Optional.some(b);\n assert.isTrue(Optionals.equals(opt1, opt2, Fun.always));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Optionals.equals` should return true when both are `Optional.some` regardless of differing integer values, using a function that always returns true.", "mode": "fast-check"} {"id": 55934, "name": "unknown", "code": "it('Checking some(x).is(x) === true', () => {\n fc.assert(fc.property(fc.integer(), (json) => {\n const opt = Optional.some(json);\n assert.isTrue(Optionals.is(opt, json));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Optional.some(x)` should return true when checked with `Optionals.is(opt, x)`.", "mode": "fast-check"} {"id": 55938, "name": "unknown", "code": "it('Checking some(x).getOrThunk(_ -> v) === x', () => {\n fc.assert(fc.property(fc.integer(), fc.func(fc.integer()), (a, thunk) => {\n assert.equal(Optional.some(a).getOrThunk(thunk), a);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Optional.some(a).getOrThunk(thunk)` should return `a`.", "mode": "fast-check"} {"id": 55939, "name": "unknown", "code": "it('Checking some.getOrDie() never throws', () => {\n fc.assert(fc.property(fc.integer(), fc.string(1, 40), (i, s) => {\n const opt = Optional.some(i);\n opt.getOrDie(s);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Optional.some().getOrDie()` does not throw an exception regardless of the integer value or string message provided.", "mode": "fast-check"} {"id": 55945, "name": "unknown", "code": "it('Given f :: s -> none, checking some(x).bind(f) === none', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), fc.func(arbOptionNone()), (opt, f) => {\n const actual = opt.bind(f);\n assertNone(actual);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Ensures that binding a function returning `none` to `some(x)` results in `none`.", "mode": "fast-check"} {"id": 55946, "name": "unknown", "code": "it('Checking some(x).exists(_ -> false) === false', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => !opt.exists(Fun.never)));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The `exists` method on a `Some` instance with a function that always returns false should itself return false.", "mode": "fast-check"} {"id": 55947, "name": "unknown", "code": "it('Checking some(x).exists(_ -> true) === true', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => opt.exists(Fun.always)));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The `exists` function should return true when applied with a function that always returns true on a `some(x)` optional.", "mode": "fast-check"} {"id": 55954, "name": "unknown", "code": "it('Checking none.fold(_ -> x, die) === x', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n const actual = Optional.none().fold(Fun.constant(i), Fun.die('Should not be called'));\n assert.equal(actual, i);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Optional.none` with `fold` using a constant function for the first argument returns the constant value.", "mode": "fast-check"} {"id": 55955, "name": "unknown", "code": "it('Checking none.is === false', () => {\n fc.assert(fc.property(fc.integer(), (v) => {\n assert.isFalse(Optionals.is(Optional.none(), v));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Optionals.is` returns false when comparing `Optional.none()` with any integer.", "mode": "fast-check"} {"id": 55956, "name": "unknown", "code": "it('Checking none.getOr(v) === v', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n assert.equal(Optional.none().getOr(i), i);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Optional.none().getOr(i)` should return the integer `i`.", "mode": "fast-check"} {"id": 55961, "name": "unknown", "code": "it('none is not some', () => {\n assert.isFalse(Optional.none().isSome());\n fc.assert(fc.property(fc.anything(), (x) => {\n assert.isTrue(Optional.some(x).isSome());\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalIsSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Optional.none()` returns false for `isSome()`, while `Optional.some(x)` returns true for `isSome()` for any `x`.", "mode": "fast-check"} {"id": 55962, "name": "unknown", "code": "it('Optional.isNone', () => {\n assert.isTrue(Optional.none().isNone());\n fc.assert(fc.property(fc.anything(), (x) => {\n assert.isFalse(Optional.some(x).isNone());\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalIsNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Optional.isNone` returns true for `Optional.none()` and false for `Optional.some(x)`.", "mode": "fast-check"} {"id": 55963, "name": "unknown", "code": "it('Optional.getOr', () => {\n fc.assert(fc.property(fc.integer(), (x) => {\n assert.equal(Optional.none().getOr(x), x);\n assert.equal(Optional.none().getOrThunk(() => x), x);\n }));\n fc.assert(fc.property(fc.integer(), fc.integer(), (x, y) => {\n assert.equal(Optional.some(x).getOr(y), x);\n assert.equal(Optional.some(x).getOrThunk(Fun.die('boom')), x);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalGetOrTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Optional.getOr` returns the provided fallback value for `Optional.none()`; `Optional.some(x).getOr` returns the contained value `x`, bypassing the fallback.", "mode": "fast-check"} {"id": 55965, "name": "unknown", "code": "it('Checking some(x).filter(_ -> false) === none', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => {\n assertNone(opt.filter(Fun.never));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalFilterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Filtering an `Option` with a function that always returns false results in `none`.", "mode": "fast-check"} {"id": 55966, "name": "unknown", "code": "it('Checking some(x).filter(_ -> true) === some(x)', () => {\n fc.assert(fc.property(fc.integer(), (x) => {\n assertSome(some(x).filter(Fun.always), x);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalFilterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`some(x).filter(Fun.always)` should yield `some(x)`.", "mode": "fast-check"} {"id": 55967, "name": "unknown", "code": "it('Checking some(x).filter(f) === some(x) iff. f(x)', () => {\n fc.assert(fc.property(fc.integer(), fc.func(fc.boolean()), (i, f) => {\n if (f(i)) {\n assertSome(some(i).filter(f), i);\n } else {\n assertNone(some(i).filter(f));\n }\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalFilterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The property checks that `some(x).filter(f)` returns `some(x)` if `f(x)` is true, and `none` otherwise.", "mode": "fast-check"} {"id": 55969, "name": "unknown", "code": "it('fails for some vs none', () => {\n fc.assert(fc.property(fc.nat(), (n) => {\n assert.throw(() => {\n assertOptional(Optional.some(n), Optional.none());\n });\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/AssertOptionalTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The test checks that `assertOptional` throws an error when comparing `Optional.some(n)` with `Optional.none()`.", "mode": "fast-check"} {"id": 55971, "name": "unknown", "code": "it('passes for identical somes', () => {\n fc.assert(fc.property(fc.nat(), (n) => {\n assertOptional(Optional.some(n), Optional.some(n));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/AssertOptionalTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`assertOptional` should pass when comparing identical `Optional.some` instances containing the same value.", "mode": "fast-check"} {"id": 55979, "name": "unknown", "code": "it('StringMatch.matches(StringMatch.exact(s), s1 + s) === false', () => {\n fc.assert(fc.property(\n fc.string(1, 40),\n fc.string(1, 40),\n (s, s1) => {\n assert.isFalse(StringMatch.matches(\n StringMatch.exact(s, StringMatch.caseInsensitive),\n s1 + s\n ));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`StringMatch.matches` should return false when checking if a concatenated string (`s1 + s`) exactly matches a given string `s`, even with case insensitivity.", "mode": "fast-check"} {"id": 55981, "name": "unknown", "code": "it('StringMatch.matches(StringMatch.exact(s), s) === false when different case and case-insensitive', () => {\n fc.assert(fc.property(\n fc.asciiString(1, 40),\n (s) => s.toUpperCase() === s.toLowerCase() || StringMatch.matches(\n StringMatch.exact(s.toLowerCase(), StringMatch.caseInsensitive),\n s.toUpperCase()\n )\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`StringMatch.matches` should return true for exact matches when case-insensitive and the strings differ only in case.", "mode": "fast-check"} {"id": 55982, "name": "unknown", "code": "it('StringMatch.matches(StringMatch.exact(s), s) === false when different case and case-sensitive', () => {\n fc.assert(fc.property(\n fc.asciiString(1, 40),\n (s) => s.toUpperCase() === s.toLowerCase() || !StringMatch.matches(\n StringMatch.exact(s.toLowerCase(), StringMatch.caseSensitive),\n s.toUpperCase()\n )\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`StringMatch.matches` should return false when comparing a string to its differently cased version using `exact` and case sensitivity.", "mode": "fast-check"} {"id": 55983, "name": "unknown", "code": "it('StringMatch.matches(StringMatch.all(s1), *) === true', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(),\n (s) => {\n assert.isTrue(StringMatch.matches(\n StringMatch.all(),\n s\n ));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`StringMatch.matches` always returns true when using `StringMatch.all` as the matcher, regardless of the input string.", "mode": "fast-check"} {"id": 55984, "name": "unknown", "code": "it('positive range', () => {\n fc.assert(fc.property(fc.char(), fc.integer(1, 100), (c, count) => {\n const actual = Strings.repeat(c, count);\n assert.equal(actual.length, count);\n assert.equal(actual.charAt(0), c);\n assert.equal(actual.charAt(actual.length - 1), c);\n }));\n\n fc.assert(fc.property(fc.asciiString(5), fc.integer(1, 100), (s, count) => {\n const actual = Strings.repeat(s, count);\n assert.equal(actual.length, count * s.length);\n assert.equal(actual.indexOf(s), 0);\n assert.equal(actual.lastIndexOf(s), actual.length - s.length);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/str/RepeatTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 55996, "name": "unknown", "code": "it('An empty string should contain nothing', () => {\n fc.assert(fc.property(\n fc.string(1, 40),\n (value) => !Strings.contains('', value)\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/str/ContainsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "An empty string should not contain any other string.", "mode": "fast-check"} {"id": 55997, "name": "unknown", "code": "it('tail of the string is unchanged', () => {\n fc.assert(fc.property(fc.ascii(), fc.asciiString(30), (h, t) => {\n assert.equal(Strings.capitalize(h + t).substring(1), t);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/str/CapitalizeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The test ensures that capitalizing a string changes only the first character, leaving the rest of the string unchanged.", "mode": "fast-check"} {"id": 56001, "name": "unknown", "code": "it('should have an adjustment of delta, or be the min or max', () => {\n fc.assert(fc.property(\n fc.nat(),\n fc.integer(),\n fc.nat(),\n fc.nat(),\n (value, delta, min, range) => {\n const max = min + range;\n const actual = Num.cycleBy(value, delta, min, max);\n return (actual - value) === delta || actual === min || actual === max;\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/num/NumCycleByTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The `Num.cycleBy` function should return a value adjusted by delta or equal to the specified minimum or maximum.", "mode": "fast-check"} {"id": 56002, "name": "unknown", "code": "it('0 has no effect', () => {\n fc.assert(fc.property(fc.nat(), fc.nat(), (value, delta) => {\n const actual = Num.cycleBy(value, 0, value, value + delta);\n assert.equal(actual, value);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/num/NumCycleByTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Calling `Num.cycleBy` with a cycle argument of `0` returns the original value unchanged.", "mode": "fast-check"} {"id": 56005, "name": "unknown", "code": "it('mirrors bind', () => {\n const arbInner = fc.tuple(fc.boolean(), fc.string()).map(([ isJust, value ]) => {\n if (isJust) {\n return Maybes.just(value);\n } else {\n return Maybes.nothing();\n }\n });\n const arbNested = fc.tuple(fc.boolean(), arbInner).map(([ isJust, value ]) => {\n if (isJust) {\n return Maybes.just(value);\n } else {\n return Maybes.nothing>();\n }\n });\n fc.assert(fc.property(arbNested, (maybe) => {\n const flattened = Maybes.flatten(maybe);\n const bound = Maybes.bind, string>(Fun.identity)(maybe);\n assert.deepEqual(flattened, bound);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/maybe/MonadTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Flattening a nested `Maybe` structure should yield the same result as binding with the identity function.", "mode": "fast-check"} {"id": 56010, "name": "unknown", "code": "it('is always false for \"Nothing\"', () => {\n fc.assert(fc.property(fc.anything(), (thing) => {\n const matches = Fun.pipe(\n Maybes.nothing(),\n Maybes.is(thing)\n );\n\n assert.isFalse(matches);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/maybe/ComparatorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Maybes.is` returns false when comparing \"Nothing\" to any value.", "mode": "fast-check"} {"id": 56011, "name": "unknown", "code": "it('is always false for \"Nothing\" with explicit comparator', () => {\n fc.assert(fc.property(fc.anything(), (thing) => {\n const matches = Fun.pipe(\n Maybes.nothing(),\n Maybes.is(thing, Fun.die('should not be called'))\n );\n\n assert.isFalse(matches);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/maybe/ComparatorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Maybes.is` returns false when comparing \"Nothing\" with any value using an explicit comparator.", "mode": "fast-check"} {"id": 56012, "name": "unknown", "code": "it('is correct for \"Just\"', () => {\n fc.assert(fc.property(fc.string(), (thing) => {\n const matches = Fun.pipe(\n Maybes.just(thing),\n Maybes.is(thing)\n );\n\n assert.isTrue(matches);\n }));\n\n fc.assert(fc.property(fc.string(), (thing) => {\n const matches = Fun.pipe(\n Maybes.just(thing),\n Maybes.is(thing + 'foo')\n );\n\n assert.isFalse(matches);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/maybe/ComparatorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The property checks that `Maybes.is` returns true for a \"Just\" value containing the same string and false for a \"Just\" value with a different string.", "mode": "fast-check"} {"id": 56014, "name": "unknown", "code": "it('is correct for \"Just\" with an explicit comparator', () => {\n\n // Just an example data type that doesn't have a simple equality\n const thunkEq = (a: () => string, b: () => string): boolean => a() === b();\n\n fc.assert(fc.property(fc.string(), (thing) => {\n const matches = Fun.pipe(\n Maybes.just(Fun.constant(thing)),\n Maybes.is(Fun.constant(thing), thunkEq)\n );\n\n assert.isTrue(matches);\n }));\n\n fc.assert(fc.property(fc.string(), (thing) => {\n const matches = Fun.pipe(\n Maybes.just(Fun.constant(thing)),\n Maybes.is(() => thing + 'foo', thunkEq)\n );\n\n assert.isFalse(matches);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/maybe/ComparatorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The comparison of \"Just\" values using an explicit comparator should return true if the provided comparator confirms equality and false if it does not.", "mode": "fast-check"} {"id": 56015, "name": "unknown", "code": "it('is correct for \"Just\" with an explicit comparator', () => {\n\n // Just an example data type that doesn't have a simple equality\n const thunkEq = (a: () => string, b: () => string): boolean => a() === b();\n\n fc.assert(fc.property(fc.string(), (thing) => {\n const matches = Fun.pipe(\n Maybes.just(Fun.constant(thing)),\n Maybes.is(Fun.constant(thing), thunkEq)\n );\n\n assert.isTrue(matches);\n }));\n\n fc.assert(fc.property(fc.string(), (thing) => {\n const matches = Fun.pipe(\n Maybes.just(Fun.constant(thing)),\n Maybes.is(() => thing + 'foo', thunkEq)\n );\n\n assert.isFalse(matches);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/maybe/ComparatorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Verification that a \"Just\" value with an explicit comparator matches the expected value when the thunk evaluates to the same result, and does not match when it evaluates to a different result.", "mode": "fast-check"} {"id": 56016, "name": "unknown", "code": "it('is false for one \"Nothing\"', () => {\n fc.assert(fc.property(fc.anything(), (thing) => {\n assert.isFalse(Maybes.equals(Maybes.nothing(), Maybes.just(thing)));\n assert.isFalse(Maybes.equals(Maybes.just(thing), Maybes.nothing()));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/maybe/ComparatorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Maybes.equals` returns false when comparing `Maybes.nothing()` with `Maybes.just(thing)`.", "mode": "fast-check"} {"id": 56023, "name": "unknown", "code": "it('Check constant :: constant(a)() === a', () => {\n fc.assert(fc.property(fc.json(), (json) => {\n assert.deepEqual(Fun.constant(json)(), json);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Fun.constant(json)()` should always return the original `json` value.", "mode": "fast-check"} {"id": 56024, "name": "unknown", "code": "it('Check identity :: identity(a) === a', () => {\n fc.assert(fc.property(fc.json(), (json) => {\n assert.deepEqual(Fun.identity(json), json);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The function `Fun.identity` should return the input `json` exactly as it is.", "mode": "fast-check"} {"id": 56027, "name": "unknown", "code": "it('Check curry', () => {\n fc.assert(fc.property(fc.json(), fc.json(), fc.json(), fc.json(), (a, b, c, d) => {\n const f = (a: string, b: string, c: string, d: string) => [ a, b, c, d ];\n\n assert.deepEqual([ a, b, c, d ], Fun.curry(f, a)(b, c, d));\n assert.deepEqual([ a, b, c, d ], Fun.curry(f, a, b)(c, d));\n assert.deepEqual([ a, b, c, d ], Fun.curry(f, a, b, c)(d));\n assert.deepEqual([ a, b, c, d ], Fun.curry(f, a, b, c, d)());\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The test verifies that the `Fun.curry` function correctly applies partial application to a four-argument function, preserving the order and values of arguments.", "mode": "fast-check"} {"id": 56030, "name": "unknown", "code": "it('Check apply :: apply(constant(a)) === a', () => {\n fc.assert(fc.property(fc.json(), (x) => {\n assert.deepEqual(Fun.apply(Fun.constant(x)), x);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Applying `Fun.constant(x)` should return `x`.", "mode": "fast-check"} {"id": 56032, "name": "unknown", "code": "it('Check that values should be empty and errors should be all if we only generate errors', () => {\n fc.assert(fc.property(\n fc.array(arbResultError(fc.integer())),\n (resErrors) => {\n const actual = Results.partition(resErrors);\n if (actual.values.length !== 0) {\n assert.fail('Values length should be 0');\n } else if (resErrors.length !== actual.errors.length) {\n assert.fail('Errors length should be ' + resErrors.length);\n }\n return true;\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The result of partitioning an array of error results should have no values and all the errors.", "mode": "fast-check"} {"id": 56048, "name": "unknown", "code": "it('Checking value.fold(die, id) === value.getOrDie()', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), (res) => {\n const actual = res.getOrDie();\n assert.equal(res.fold(Fun.die('should not get here'), Fun.identity), actual);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`value.fold(die, id)` should be equal to `value.getOrDie()`.", "mode": "fast-check"} {"id": 56049, "name": "unknown", "code": "it('Checking value.map(f) === f(value.getOrDie())', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), fc.func(fc.json()), (res, f) => {\n assert.equal(f(res.getOrDie()), res.map(f).getOrDie());\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The property ensures that mapping a function over a `ResultValue` yields the same result as directly applying the function to the value obtained from `getOrDie()`.", "mode": "fast-check"} {"id": 56050, "name": "unknown", "code": "it('Checking value.each(f) === undefined', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), fc.func(fc.json()), (res, f) => {\n const actual = res.each(f);\n assert.isUndefined(actual);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`ResultValue.each(f)` should always return `undefined` when applied to any function `f`.", "mode": "fast-check"} {"id": 60705, "name": "unknown", "code": "test('no picking lower bound 0 for upper alarm', () => {\n fc.assert(fc.property(\n arbitrary_complete_intervals(),\n (intervals) => {\n const alarms = findAlarmThresholds(intervals);\n fc.pre(alarms.upperAlarmIntervalIndex !== undefined);\n\n return intervals[alarms.upperAlarmIntervalIndex!].lower !== 0;\n },\n ));\n })", "language": "typescript", "source_file": "./repos/alexandersperling/aws-cdk/packages/aws-cdk-lib/aws-autoscaling-common/test/intervals.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "alexandersperling/aws-cdk", "url": "https://github.com/alexandersperling/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that when determining alarm thresholds, the lower bound of the interval for an upper alarm is never 0.", "mode": "fast-check"} {"id": 56052, "name": "unknown", "code": "it('Given f :: s -> RE, checking value.bind(f).fold(id, die) === f(value.getOrDie()).fold(id, die)', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), fc.func(arbResultError(fc.integer())), (res, f) => {\n const toErrString = (r: Result) => r.fold(Fun.identity, Fun.die('Not a Result.error'));\n assert.equal(toErrString(f(res.getOrDie())), toErrString(res.bind(f)));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "For a function `f`, applying `bind(f)` to a `Result` value and folding it should equal applying `f` directly to the resolved value and folding that result.", "mode": "fast-check"} {"id": 56066, "name": "unknown", "code": "it('error.each returns undefined', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), (res) => {\n const actual = res.each(Fun.die('should not be called'));\n assert.isUndefined(actual);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`res.each` returns undefined when executed with `Fun.die('should not be called')` on `arbResultError`.", "mode": "fast-check"} {"id": 56067, "name": "unknown", "code": "it('Given f :: s -> RV, error.bind(f) === error', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), fc.func(arbResultValue(fc.integer())), (res, f) => {\n const actual = res.bind(f);\n assert.deepEqual(getErrorOrDie(actual), getErrorOrDie(res));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Binding a function to a `ResultError` should yield the same `ResultError`.", "mode": "fast-check"} {"id": 56073, "name": "unknown", "code": "it('pure', () =>\n fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n LazyValue.pure(i).get((v) => {\n eqAsync('LazyValue.pure', i, v, reject);\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/async/LazyValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`LazyValue.pure` should produce a value retrieved asynchronously that matches the original integer input.", "mode": "fast-check"} {"id": 56078, "name": "unknown", "code": "it('map constant obj means that values(obj) are all the constant', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.integer()), fc.integer(), (obj, x) => {\n const output = Obj.map(obj, Fun.constant(x));\n const values = Obj.values(output);\n return Arr.forall(values, (v) => v === x);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/obj/ObjMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Mapping a dictionary with a constant function results in all values being the constant.", "mode": "fast-check"} {"id": 56079, "name": "unknown", "code": "it('tupleMap obj (x, i) -> { k: i, v: x }', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.integer()), (obj) => {\n const output = Obj.tupleMap(obj, (x, i) => ({ k: i, v: x }));\n assert.deepEqual(output, obj);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/obj/ObjMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Obj.tupleMap` transforms an object by mapping each entry to an object with keys `k` and `v`, maintaining equivalent structure to the original.", "mode": "fast-check"} {"id": 56085, "name": "unknown", "code": "it('If predicate is always true, then value is always the some(first), or none if dict is empty', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(), fc.json()),\n (obj) => {\n const value = Obj.find(obj, Fun.always);\n // No order is specified, so we cannot know what \"first\" is\n return Obj.keys(obj).length === 0 ? value.isNone() : true;\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/obj/ObjFindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Obj.find` returns some(first element) if any exists when the predicate is always true; otherwise, it returns none for an empty dictionary.", "mode": "fast-check"} {"id": 56096, "name": "unknown", "code": "it('Deep-merge(a, b) contains all the keys of b', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), fc.dictionary(fc.asciiString(), fc.json()), (a, b) => {\n const output = Merger.deepMerge(a, b);\n const keys = Obj.keys(b);\n const oKeys = Obj.keys(output);\n return Arr.forall(keys, (k) => {\n return Arr.contains(oKeys, k);\n });\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Deep-merge of two dictionaries `a` and `b` results in an output containing all the keys of `b`.", "mode": "fast-check"} {"id": 56099, "name": "unknown", "code": "it('Check that if the filter always returns true, then everything is in \"t\"', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(), fc.string(1, 40)),\n (obj) => {\n const output = Obj.bifilter(obj, Fun.always);\n assert.lengthOf(Obj.keys(output.f), 0);\n assert.lengthOf(Obj.keys(output.t), Obj.keys(obj).length);\n return true;\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/obj/BiFilterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "If the filter always returns true, all elements should be in \"t\" and none in \"f\".", "mode": "fast-check"} {"id": 56100, "name": "unknown", "code": "it('Check that everything in f fails predicate and everything in t passes predicate', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(1, 30), fc.integer()),\n (obj) => {\n const predicate = (x: number) => x % 2 === 0;\n const output = Obj.bifilter(obj, predicate);\n\n const matches = (k: string) => predicate(obj[k]);\n\n const falseKeys = Obj.keys(output.f);\n const trueKeys = Obj.keys(output.t);\n\n assert.isFalse(Arr.exists(falseKeys, matches));\n assert.isTrue(Arr.forall(trueKeys, matches));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/obj/BiFilterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Everything in the `output.f` object fails the predicate, and everything in the `output.t` object passes the predicate.", "mode": "fast-check"} {"id": 56116, "name": "unknown", "code": "it('matches corresponding tuples', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.array(fc.integer()),\n (keys, values) => {\n if (keys.length !== values.length) {\n assert.throws(() => Zip.zipToTuples(keys, values));\n } else {\n const output = Zip.zipToTuples(keys, values);\n assert.equal(output.length, keys.length);\n assert.isTrue(Arr.forall(output, (x, i) => x.k === keys[i] && x.v === values[i]));\n }\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/ZipTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Zip.zipToTuples` creates tuples where each key corresponds correctly to its value when both arrays have the same length; otherwise, it throws an error.", "mode": "fast-check"} {"id": 56117, "name": "unknown", "code": "it('Reversing twice is identity', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n assert.deepEqual(Arr.reverse(Arr.reverse(arr)), arr);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/ReverseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Reversing an array twice should return the original array.", "mode": "fast-check"} {"id": 56119, "name": "unknown", "code": "it('reverses 2 elements', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), (a, b) => {\n assert.deepEqual(Arr.reverse([ a, b ]), [ b, a ]);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/ReverseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Arr.reverse` reverses arrays containing exactly two elements.", "mode": "fast-check"} {"id": 56120, "name": "unknown", "code": "it('reverses 3 elements', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), fc.integer(), (a, b, c) => {\n assert.deepEqual(Arr.reverse([ a, b, c ]), [ c, b, a ]);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/ReverseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56121, "name": "unknown", "code": "it('every element in the input is in the output, and vice-versa', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (xs) => {\n const rxs = Arr.reverse(xs);\n assert.isTrue(Arr.forall(rxs, (x) => Arr.contains(xs, x)));\n assert.isTrue(Arr.forall(xs, (x) => Arr.contains(rxs, x)));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/ReverseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56122, "name": "unknown", "code": "it('Check that if the filter always returns false, then everything is in \"fail\"', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n (arr) => {\n const output = Arr.partition(arr, Fun.never);\n assert.deepEqual(output.pass.length, 0);\n assert.deepEqual(output.fail, arr);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/PartitionTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56123, "name": "unknown", "code": "it('Check that if the filter always returns true, then everything is in \"pass\"', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n (arr) => {\n const output = Arr.partition(arr, Fun.always);\n assert.deepEqual(output.fail.length, 0);\n assert.deepEqual(output.pass, arr);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/PartitionTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56124, "name": "unknown", "code": "it('Check that everything in fail fails predicate and everything in pass passes predicate', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n (arr) => {\n const predicate = (x: number) => x % 3 === 0;\n const output = Arr.partition(arr, predicate);\n return Arr.forall(output.fail, (x) => !predicate(x)) && Arr.forall(output.pass, predicate);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/PartitionTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56125, "name": "unknown", "code": "it('inductive case', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(1, 30), fc.integer()),\n fc.asciiString(1, 30),\n fc.integer(),\n (obj, k, v) => {\n const objWithoutK = Obj.filter(obj, (x, i) => i !== k);\n assert.deepEqual(Obj.size({ [k]: v, ...objWithoutK }), Obj.size(objWithoutK) + 1);\n }), {\n numRuns: 5000\n });\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/ObjSizeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56126, "name": "unknown", "code": "it('only returns elements that are in the input', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.integer()), (obj) => {\n const keys = Obj.keys(obj);\n return Arr.forall(keys, (k) => obj.hasOwnProperty(k));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/ObjKeysTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56127, "name": "unknown", "code": "it('filter const true is identity', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.integer()), (obj) => {\n assert.deepEqual(Obj.filter(obj, Fun.always), obj);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/ObjFilterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56128, "name": "unknown", "code": "it('Length of interspersed = len(arr) + len(arr)-1', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.integer(),\n (arr, delimiter) => {\n const actual = Jam.intersperse(arr, delimiter);\n const expected = arr.length === 0 ? 0 : arr.length * 2 - 1;\n assert.deepEqual(actual.length, expected);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/IntersperseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56129, "name": "unknown", "code": "it('Every odd element matches delimiter', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.integer(),\n (arr, delimiter) => {\n const actual = Jam.intersperse(arr, delimiter);\n return Arr.forall(actual, (x, i) => i % 2 === 1 ? x === delimiter : true);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/IntersperseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56130, "name": "unknown", "code": "it('Filtering out delimiters (assuming different type to array to avoid removing original array) should equal original', () => {\n fc.assert(fc.property(\n fc.array(fc.nat()),\n arbNegativeInteger(),\n (arr, delimiter) => {\n const actual = Jam.intersperse(arr, delimiter);\n const filtered = Arr.filter(actual, (a) => a !== delimiter);\n assert.deepEqual(filtered, arr);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/IntersperseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56131, "name": "unknown", "code": "it('finds element in middle of array', () => {\n fc.assert(fc.property(fc.array(fc.nat()), arbNegativeInteger(), fc.array(fc.nat()), (prefix, element, suffix) => {\n const arr = prefix.concat([ element ]).concat(suffix);\n assertSome(Arr.indexOf(arr, element), prefix.length);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/IndexOfTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56132, "name": "unknown", "code": "it('Adjacent groups have different hashes, and everything in a group has the same hash', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.func(fc.asciiString()),\n (xs, f) => {\n const groups = Arr.groupBy(xs, (x) => f(x));\n\n /* Properties about groups\n * 1. No two adjacent groups can have the same g(..) value\n * 2. Each group must have the same g(..) value\n */\n\n const hasEmptyGroups = Arr.exists(groups, (g) => g.length === 0);\n\n if (hasEmptyGroups) {\n assert.fail('Should not have empty groups');\n }\n // No consecutive groups should have the same result of g.\n const values = Arr.map(groups, (group) => {\n const first = f(group[0]);\n const mapped = Arr.map(group, (g) => f(g));\n\n const isSame = Arr.forall(mapped, (m) => m === first);\n if (!isSame) {\n assert.fail('Not everything in a group has the same g(..) value');\n }\n return first;\n });\n\n const hasSameGroup = Arr.exists(values, (v, i) => i > 0 ? values[i - 1] === values[i] : false);\n\n if (hasSameGroup) {\n assert.fail('A group is next to another group with the same g(..) value');\n }\n return true;\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/GroupByTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56133, "name": "unknown", "code": "it('Flattening groups equals the original array', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.func(fc.string()),\n (xs, f) => {\n const groups = Arr.groupBy(xs, (x) => f(x));\n\n const output = Arr.flatten(groups);\n assert.deepEqual(output, xs);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/GroupByTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56134, "name": "unknown", "code": "it('forall of a non-empty array with a predicate that always returns false is false', () => {\n fc.assert(fc.property(\n fc.array(fc.integer(), 1, 30),\n (xs) => {\n assert.isFalse(Arr.forall(xs, Fun.never));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/ForallTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56135, "name": "unknown", "code": "it('forall of a non-empty array with a predicate that always returns true is true', () => {\n fc.assert(fc.property(\n fc.array(fc.integer(), 1, 30),\n (xs) => {\n assert.isTrue(Arr.forall(xs, Fun.always));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/ForallTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56136, "name": "unknown", "code": "it('foldl concat [ ] xs === reverse(xs)', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n (arr) => {\n const output = Arr.foldl(arr, (b: number[], a: number) => [ a ].concat(b), []);\n assert.deepEqual(output, Arr.reverse(arr));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/FoldTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56137, "name": "unknown", "code": "it('foldr concat [ ] xs === xs', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n (arr) => {\n const output = Arr.foldr(arr, (b: number[], a: number) => [ a ].concat(b), []);\n assert.deepEqual(output, arr);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/FoldTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56138, "name": "unknown", "code": "it('foldr concat ys xs === xs ++ ys', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.array(fc.integer()),\n (xs, ys) => {\n const output = Arr.foldr(xs, (b, a) => [ a ].concat(b), ys);\n assert.deepEqual(output, xs.concat(ys));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/FoldTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56139, "name": "unknown", "code": "it('foldl concat ys xs === reverse(xs) ++ ys', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.array(fc.integer()),\n (xs, ys) => {\n const output = Arr.foldl(xs, (b, a) => [ a ].concat(b), ys);\n assert.deepEqual(output, Arr.reverse(xs).concat(ys));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/FoldTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56140, "name": "unknown", "code": "it('is consistent with chunking', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.integer(1, 5),\n (arr, chunkSize) => {\n const chunks = Arr.chunk(arr, chunkSize);\n const bound = Arr.flatten(chunks);\n assert.deepEqual(bound, arr);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/FlattenTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56141, "name": "unknown", "code": "it('wrap then flatten array is identity', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n assert.deepEqual(arr, Arr.flatten(Arr.pure(arr)));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/FlattenTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56142, "name": "unknown", "code": "it('mapping pure then flattening array is identity', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n assert.deepEqual(arr, Arr.flatten(Arr.map(arr, Arr.pure)));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/FlattenTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56143, "name": "unknown", "code": "it('flattening two lists === concat', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.array(fc.integer()), (xs, ys) => {\n assert.deepEqual(xs.concat(ys), Arr.flatten([ xs, ys ]));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/FlattenTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56144, "name": "unknown", "code": "describe('finds element in middle of array', () => {\n fc.assert(fc.property(fc.array(fc.nat()), arbNegativeInteger(), fc.array(fc.nat()), (prefix, element, suffix) => {\n const arr = [ ...prefix, element, ...suffix ];\n assertSome(\n Arr.findIndex(arr, (x) => x === element),\n prefix.length\n );\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/FindIndexTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56145, "name": "unknown", "code": "it('finds elements that pass the predicate', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n const pred = (x: number) => x % 3 === 0;\n assert.isTrue(Arr.findIndex(arr, pred).forall((x) => pred(arr[x])));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/FindIndexTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56146, "name": "unknown", "code": "it('returns none if predicate always returns false', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n assertNone(Arr.findIndex(arr, Fun.never));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/FindIndexTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56147, "name": "unknown", "code": "it('is consistent with find', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n const pred = (x: number) => x % 5 === 0;\n assertOptional(Arr.findIndex(arr, pred).map((x) => arr[x]), Arr.find(arr, pred));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/FindIndexTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56148, "name": "unknown", "code": "it('is consistent with exists', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n const pred = (x: number) => x % 6 === 0;\n assert.equal(Arr.findIndex(arr, pred).isSome(), Arr.exists(arr, pred));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/FindIndexTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56149, "name": "unknown", "code": "it('Element exists in middle of array', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), fc.array(fc.integer()), (prefix, element, suffix) => {\n const arr2 = Arr.flatten([ prefix, [ element ], suffix ]);\n assert.isTrue(Arr.exists(arr2, eqc(element)));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/ExistsTest.ts", "start_line": null, "end_line": null, "dependencies": ["eqc"], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56150, "name": "unknown", "code": "it('Element exists in singleton array of itself', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (i) => {\n assert.isTrue(Arr.exists([ i ], eqc(i)));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/ExistsTest.ts", "start_line": null, "end_line": null, "dependencies": ["eqc"], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56151, "name": "unknown", "code": "it('Element does not exist in empty array', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (i) => {\n assert.isFalse(Arr.exists([], eqc(i)));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/ExistsTest.ts", "start_line": null, "end_line": null, "dependencies": ["eqc"], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56152, "name": "unknown", "code": "it('Element not found when predicate always returns false', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => !Arr.exists(arr, never)));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/ExistsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56153, "name": "unknown", "code": "it('Element exists in non-empty array when predicate always returns true', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), (xs, x) => {\n const arr = Arr.flatten([ xs, [ x ]]);\n assert.isTrue(Arr.exists(arr, always));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/ExistsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56154, "name": "unknown", "code": "it('ys-xs contains no elements from xs', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.array(fc.integer()), (xs, ys) => {\n const diff = Arr.difference(ys, xs);\n return Arr.forall(xs, (x) => !Arr.contains(diff, x));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/DifferenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56155, "name": "unknown", "code": "it('every member of ys-xs is in ys', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.array(fc.integer()), (xs, ys) => {\n const diff = Arr.difference(ys, xs);\n return Arr.forall(diff, (d) => Arr.contains(ys, d));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/DifferenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56156, "name": "unknown", "code": "it('returns true when element is in array', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), fc.array(fc.integer()), (prefix, element, suffix) => {\n const arr2 = [ ...prefix, element, ...suffix ];\n assert.isTrue(Arr.contains(arr2, element));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/ContainsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56157, "name": "unknown", "code": "it('creates an array of the appropriate length except for the last one', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.nat(),\n (arr, rawChunkSize) => {\n // ensure chunkSize is at least one\n const chunkSize = rawChunkSize + 1;\n const chunks = Arr.chunk(arr, chunkSize);\n\n const numChunks = chunks.length;\n const firstParts = chunks.slice(0, numChunks - 1);\n\n for (const firstPart of firstParts) {\n assert.lengthOf(firstPart, chunkSize);\n }\n\n if (arr.length === 0) {\n assert.deepEqual(chunks, []);\n } else {\n assert.isAtMost(chunks[chunks.length - 1].length, chunkSize);\n }\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/ChunkTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56158, "name": "unknown", "code": "it('is idempotent', () => {\n fc.assert(fc.property(\n fc.array(fc.nat()), (arr) => {\n assert.deepEqual(Arr.sort(Arr.sort(arr)), Arr.sort(arr));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/ArrSortTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56159, "name": "unknown", "code": "it('returns last element when non-empty', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), (init, last) => {\n const arr = init.concat([ last ]);\n assertSome(Arr.last(arr), last);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/ArrLastTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56160, "name": "unknown", "code": "it('returns first element when nonEmpty', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), (t, h) => {\n const arr = [ h, ...t ];\n assertSome(Arr.head(arr), h);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/ArrHeadTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56161, "name": "unknown", "code": "it('returns none for element of empty list', () => {\n fc.assert(fc.property(fc.integer(), (n) => {\n assertNone(Arr.get([], n));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/ArrGetTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56162, "name": "unknown", "code": "it('returns some for valid index (property test)', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), fc.integer(), (array, h, t) => {\n const arr = [ h ].concat(array);\n const length = arr.push(t);\n const midIndex = Math.round(arr.length / 2);\n\n assertSome(Arr.get(arr, 0), h);\n assertSome(Arr.get(arr, midIndex), arr[midIndex]);\n assertSome(Arr.get(arr, length - 1), t);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/ArrGetTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56163, "name": "unknown", "code": "it('finds a value in the array', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), fc.array(fc.integer()), (prefix, i, suffix) => {\n const arr = prefix.concat([ i ]).concat(suffix);\n const pred = (x: number) => x === i;\n const result = Arr.find(arr, pred);\n assertSome(result, i);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/ArrFindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56164, "name": "unknown", "code": "it('cannot find a nonexistent value', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n const result = Arr.find(arr, Fun.never);\n assertNone(result);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/ArrFindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56165, "name": "unknown", "code": "it('Arr.findMap of non-empty is first if f is Optional.some', () => {\n fc.assert(fc.property(\n fc.integer(),\n fc.array(fc.integer()),\n (head, tail) => {\n const arr = [ head, ...tail ];\n assertSome(Arr.findMap(arr, Optional.some), head);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/ArrFindMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56166, "name": "unknown", "code": "it('Arr.findMap of non-empty is none if f is Optional.none', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n (arr) => {\n assertNone(Arr.findMap(arr, Optional.none));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/ArrFindMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56167, "name": "unknown", "code": "it('Arr.findMap finds an element', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.integer(),\n fc.integer(),\n fc.array(fc.integer()),\n (prefix, element, ret, suffix) => {\n const arr = [ ...prefix, element, ...suffix ];\n assertSome(Arr.findMap(arr, (x) => Optionals.someIf(x === element, ret)), ret);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/ArrFindMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56168, "name": "unknown", "code": "it('Arr.findMap does not find an element', () => {\n fc.assert(fc.property(\n fc.array(fc.nat()),\n fc.nat(),\n (arr, ret) => {\n assertNone(Arr.findMap(arr, (x) => Optionals.someIf(x === -1, ret)));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/ArrFindMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56169, "name": "unknown", "code": "it('binding an array of empty arrays with identity equals an empty array', () => {\n fc.assert(fc.property(fc.array(fc.constant([])), (arr) => {\n assert.deepEqual(Arr.bind(arr, Fun.identity), []);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/ArrBindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56170, "name": "unknown", "code": "it('bind (pure .) is map', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), (arr, j) => {\n const f = (x: number) => x + j;\n assert.deepEqual(Arr.bind(arr, Fun.compose(Arr.pure, f)), Arr.map(arr, f));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/ArrBindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56171, "name": "unknown", "code": "it('obeys left identity law', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), (i, j) => {\n const f = (x: number) => [ x, j, x + j ];\n assert.deepEqual(Arr.bind(Arr.pure(i), f), f(i));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/ArrBindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56172, "name": "unknown", "code": "it('obeys right identity law', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n assert.deepEqual(Arr.bind(arr, Arr.pure), arr);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/ArrBindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56173, "name": "unknown", "code": "it('is associative', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), (arr, j) => {\n const f = (x: number) => [ x, j, x + j ];\n const g = (x: number) => [ j, x, x + j ];\n assert.deepEqual(Arr.bind(Arr.bind(arr, f), g), Arr.bind(arr, (x) => Arr.bind(f(x), g)));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/arr/ArrBindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56174, "name": "unknown", "code": "UnitTest.test('KAssert.eqError: success (reflexivity)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n KAssert.eqError('eq', i, Result.error(i));\n KAssert.eqError('eq', i, Result.error(i), tBoom());\n KAssert.eqError('eq', i, Result.error(i), tBoom(), tNumber);\n }));\n})", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56175, "name": "unknown", "code": "UnitTest.test('KAssert.eqError: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('should throw if numbers differ #1', () => {\n KAssert.eqError('eq', a, Result.error(b));\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqError('eq', a, Result.error(b), tBoom());\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqError('eq', a, Result.error(b), tBoom(), tNumber);\n });\n }));\n\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.throws('should throw if value #1', () => {\n KAssert.eqError('eq', i, Result.value(s));\n });\n Assert.throws('should throw if value #2', () => {\n KAssert.eqError('eq', i, Result.value(s), tBoom());\n });\n Assert.throws('should throw if value #3', () => {\n KAssert.eqError('eq', i, Result.value(s), tBoom(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60721, "name": "unknown", "code": "test(\"popping and pushing from the left or from the right returns the same data, but reversed\", () => {\n fc.assert(\n fc.property(\n sequenceOfOps(),\n\n (seq) => {\n const deque1 = new Deque();\n const deque2 = new Deque();\n\n for (const [op, values] of seq) {\n if (op === \"add\") {\n deque1.push(values);\n deque2.pushLeft(values.reverse());\n } else {\n expect(deque1.pop()).toEqual(deque2.popLeft());\n }\n }\n\n expect(Array.from(deque1)).toEqual(Array.from(deque2).reverse());\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/Deque.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Popping and pushing items from the left or right of two deques results in identical data but with one deque reversed.", "mode": "fast-check"} {"id": 56176, "name": "unknown", "code": "UnitTest.test('KAssert.eqError: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('should throw if numbers differ #1', () => {\n KAssert.eqError('eq', a, Result.error(b));\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqError('eq', a, Result.error(b), tBoom());\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqError('eq', a, Result.error(b), tBoom(), tNumber);\n });\n }));\n\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.throws('should throw if value #1', () => {\n KAssert.eqError('eq', i, Result.value(s));\n });\n Assert.throws('should throw if value #2', () => {\n KAssert.eqError('eq', i, Result.value(s), tBoom());\n });\n Assert.throws('should throw if value #3', () => {\n KAssert.eqError('eq', i, Result.value(s), tBoom(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56177, "name": "unknown", "code": "UnitTest.test('KAssert.eqValue: success', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n KAssert.eqValue('eq', i, Result.value(i));\n KAssert.eqValue('eq', i, Result.value(i), tNumber);\n KAssert.eqValue('eq', i, Result.value(i), tNumber, tBoom());\n }));\n})", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56178, "name": "unknown", "code": "UnitTest.test('KAssert.eqValue: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('should throw if numbers differ #1', () => {\n KAssert.eqValue('eq', a, Result.value(b));\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqValue('eq', a, Result.value(b), tNumber);\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqValue('eq', a, Result.value(b), tNumber, tBoom());\n });\n }));\n\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.throws('should throw if error #1', () => {\n KAssert.eqValue('eq', i, Result.error(s));\n });\n Assert.throws('should throw if error #2', () => {\n KAssert.eqValue('eq', i, Result.error(s), tBoom());\n });\n Assert.throws('should throw if error #3', () => {\n KAssert.eqValue('eq', i, Result.error(s), tBoom(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56179, "name": "unknown", "code": "UnitTest.test('KAssert.eqValue: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('should throw if numbers differ #1', () => {\n KAssert.eqValue('eq', a, Result.value(b));\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqValue('eq', a, Result.value(b), tNumber);\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqValue('eq', a, Result.value(b), tNumber, tBoom());\n });\n }));\n\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.throws('should throw if error #1', () => {\n KAssert.eqValue('eq', i, Result.error(s));\n });\n Assert.throws('should throw if error #2', () => {\n KAssert.eqValue('eq', i, Result.error(s), tBoom());\n });\n Assert.throws('should throw if error #3', () => {\n KAssert.eqValue('eq', i, Result.error(s), tBoom(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56180, "name": "unknown", "code": "UnitTest.test('KAssert.eqResult: success', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n KAssert.eqResult('eq', Result.value(i), Result.value(i));\n KAssert.eqResult('eq', Result.value(i), Result.value(i), tNumber);\n KAssert.eqResult('eq', Result.value(i), Result.value(i), tNumber, tBoom());\n KAssert.eqResult('eq', Result.error(i), Result.error(i));\n KAssert.eqResult('eq', Result.error(i), Result.error(i), tBoom());\n KAssert.eqResult('eq', Result.error(i), Result.error(i), tBoom(), tNumber);\n }));\n})", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56181, "name": "unknown", "code": "UnitTest.test('KAssert.eqResult: fail', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('value(a) != (value(!a)) #1', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b));\n });\n Assert.throws('value(a) != (value(!a)) #2', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b), tNumber);\n });\n Assert.throws('value(a) != (value(!a)) #2', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b), tNumber, tBoom());\n });\n }));\n\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('error(a) != (error(!a)) #1', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b));\n });\n Assert.throws('error(a) != (error(!a)) #2', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b), tBoom());\n });\n Assert.throws('result(a) != (result(!a)) #2', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b), tBoom(), tNumber);\n });\n }));\n\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.throws('value != error #1', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s));\n });\n Assert.throws('value != error #2', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s), tBoom());\n });\n Assert.throws('value != error #3', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s), tBoom());\n });\n\n Assert.throws('error != value #1', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s));\n });\n Assert.throws('error != value #2', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s), tBoom());\n });\n Assert.throws('error != value #3', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s), tBoom(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56182, "name": "unknown", "code": "UnitTest.test('KAssert.eqResult: fail', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('value(a) != (value(!a)) #1', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b));\n });\n Assert.throws('value(a) != (value(!a)) #2', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b), tNumber);\n });\n Assert.throws('value(a) != (value(!a)) #2', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b), tNumber, tBoom());\n });\n }));\n\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('error(a) != (error(!a)) #1', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b));\n });\n Assert.throws('error(a) != (error(!a)) #2', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b), tBoom());\n });\n Assert.throws('result(a) != (result(!a)) #2', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b), tBoom(), tNumber);\n });\n }));\n\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.throws('value != error #1', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s));\n });\n Assert.throws('value != error #2', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s), tBoom());\n });\n Assert.throws('value != error #3', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s), tBoom());\n });\n\n Assert.throws('error != value #1', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s));\n });\n Assert.throws('error != value #2', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s), tBoom());\n });\n Assert.throws('error != value #3', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s), tBoom(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56183, "name": "unknown", "code": "UnitTest.test('KAssert.eqResult: fail', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('value(a) != (value(!a)) #1', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b));\n });\n Assert.throws('value(a) != (value(!a)) #2', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b), tNumber);\n });\n Assert.throws('value(a) != (value(!a)) #2', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b), tNumber, tBoom());\n });\n }));\n\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('error(a) != (error(!a)) #1', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b));\n });\n Assert.throws('error(a) != (error(!a)) #2', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b), tBoom());\n });\n Assert.throws('result(a) != (result(!a)) #2', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b), tBoom(), tNumber);\n });\n }));\n\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.throws('value != error #1', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s));\n });\n Assert.throws('value != error #2', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s), tBoom());\n });\n Assert.throws('value != error #3', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s), tBoom());\n });\n\n Assert.throws('error != value #1', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s));\n });\n Assert.throws('error != value #2', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s), tBoom());\n });\n Assert.throws('error != value #3', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s), tBoom(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56184, "name": "unknown", "code": "UnitTest.test('KAssert.eqSome: success (reflexivity)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n KAssert.eqSome('eq', i, Optional.some(i));\n KAssert.eqSome('eq', i, Optional.some(i), tNumber);\n }));\n})", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56185, "name": "unknown", "code": "UnitTest.test('KAssert.eqSome: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #1', () => {\n KAssert.eqSome('eq', a, Optional.some(b));\n });\n }));\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #2', () => {\n KAssert.eqSome('eq', a, Optional.some(b), tNumber);\n });\n }));\n})", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`KAssert.eqSome` throws an error when comparing a value with `Optional.some()` of a different number.", "mode": "fast-check"} {"id": 56186, "name": "unknown", "code": "UnitTest.test('KAssert.eqSome: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #1', () => {\n KAssert.eqSome('eq', a, Optional.some(b));\n });\n }));\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #2', () => {\n KAssert.eqSome('eq', a, Optional.some(b), tNumber);\n });\n }));\n})", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`KAssert.eqSome` throws an error when comparing a value with an `Optional.some` wrapper containing a different value.", "mode": "fast-check"} {"id": 56187, "name": "unknown", "code": "UnitTest.test('KAssert.eqNone: failure', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('some(i) != none', () => {\n KAssert.eqNone('eq', Optional.some(i));\n });\n }));\n})", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`KAssert.eqNone` throws an error when comparing a non-empty `Optional.some` value against `none`.", "mode": "fast-check"} {"id": 60735, "name": "unknown", "code": "it(\"generates values that are alphabetically between inputs\", () => {\n fc.assert(\n fc.property(\n genPosRange(),\n\n ([lo, hi]) => {\n expect(between(lo, hi) > lo).toBe(true);\n expect(between(lo, hi) < hi).toBe(true);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/position.test.ts", "start_line": null, "end_line": null, "dependencies": ["genPosRange"], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `between` generates a value that is alphabetically greater than `lo` and less than `hi` for given input positions.", "mode": "fast-check"} {"id": 60733, "name": "unknown", "code": "it(\"always output valid positions\", () => {\n fc.assert(\n fc.property(\n genPosRange(),\n\n ([lo, hi]) => {\n expect(isPos(between(lo, hi))).toBe(true);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/position.test.ts", "start_line": null, "end_line": null, "dependencies": ["genPosRange"], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `between` produces a valid position when given a range of two distinct positions.", "mode": "fast-check"} {"id": 60755, "name": "unknown", "code": "test(\"constructor behaves just like a normal Map\", () => {\n fc.assert(\n fc.property(\n fc.array(fc.tuple(fc.string(), fc.anything())),\n\n (tuples) => {\n const expected = new Map(tuples);\n const actual = new DefaultMap(() => 0, tuples);\n expect(new Map(actual)).toEqual(expected);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/DefaultMap.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`DefaultMap` initialized with tuples should behave identically to a standard `Map` when converted to a `Map` object.", "mode": "fast-check"} {"id": 60756, "name": "unknown", "code": "test(\"setter behaves just like a normal Map setter\", () => {\n fc.assert(\n fc.property(\n fc.array(fc.tuple(fc.string(), fc.anything())),\n\n (tuples) => {\n const expected = new Map();\n const actual = new DefaultMap(() => 0 as unknown);\n\n for (const [key, value] of tuples) {\n expected.set(key, value);\n actual.set(key, value);\n expect(actual.getOrCreate(key)).toEqual(expected.get(key));\n }\n\n expect(new Map(actual)).toEqual(expected);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/DefaultMap.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Setting elements in `DefaultMap` should behave identically to setting elements in a regular `Map`, including consistent key-value retrieval.", "mode": "fast-check"} {"id": 60759, "name": "unknown", "code": "test(\"SortedList.from() will sort the input and keep it sorted automatically (desc)\", () => {\n expect(Array.from(SortedList.from([3, 1, 2], desc))).toEqual([3, 2, 1]);\n expect(Array.from(SortedList.from([\"world\", \"hello\"], desc))).toEqual([\n \"world\",\n \"hello\",\n ]);\n expect(\n Array.from(\n SortedList.from(\n [{ id: 1 }, { id: 2 }, { id: -99 }],\n (a, b) => b.id < a.id\n )\n )\n ).toEqual([{ id: 2 }, { id: 1 }, { id: -99 }]);\n\n fc.assert(\n fc.property(\n fc.array(fc.nat()),\n\n (arr) => {\n const descSortedArr = [...arr].sort((a, b) => b - a);\n expect(Array.from(SortedList.from(arr, desc))).toEqual(descSortedArr);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/SortedList.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`SortedList.from()` creates a sorted list in descending order from various types of inputs, maintaining the order automatically.", "mode": "fast-check"} {"id": 60766, "name": "unknown", "code": "it(\"using keys in mapper\", () => {\n expect(\n mapValues({ a: 5, b: 0, c: 3 }, (n, k) => k.repeat(n))\n ).toStrictEqual({ a: \"aaaaa\", b: \"\", c: \"ccc\" });\n\n fc.assert(\n fc.property(\n objectWithoutProto(),\n\n (input) => {\n const output1 = mapValues(input, (x) => x);\n expect(output1).toStrictEqual(input);\n\n const output2 = mapValues(input, (_, k) => k);\n expect(Object.keys(output2)).toStrictEqual(Object.keys(input));\n expect(Object.values(output2)).toStrictEqual(Object.keys(input));\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/utils.test.ts", "start_line": null, "end_line": null, "dependencies": ["objectWithoutProto"], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `mapValues` function should maintain the structure of an object, allowing transformations based on keys and values, and return expected results when mapping keys to values or using identity transformations.", "mode": "fast-check"} {"id": 56204, "name": "unknown", "code": "it('TINY-4773: ending in @ character', () => {\n const editor = hook.editor();\n fc.assert(fc.property(fc.hexaString(0, 100), (s1) => {\n assertNoLink(editor, `${s1}@`, `${s1}@`);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/hugerte/src/plugins/autolink/test/ts/browser/AutoLinkPluginTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Ending a string with an '@' character does not produce a link.", "mode": "fast-check"} {"id": 56206, "name": "unknown", "code": "it('TINY-9226: no constrants', () => {\n fc.assert(\n fc.property(arbBounds, (original) => {\n const actual = Boxes.constrainByMany(original, [ ]);\n assert.deepEqual(actual, original);\n })\n );\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/alloy/src/test/ts/atomic/alien/BoxesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Boxes.constrainByMany` retains the original bounds when no constraints are provided.", "mode": "fast-check"} {"id": 60770, "name": "unknown", "code": "test('training convergence properties', () => {\n fc.assert(\n fc.property(networkConfig(), (config) => {\n // Generate appropriate training data\n const batchSize = 10;\n const inputs = Array(batchSize)\n .fill(0)\n .map(() =>\n Array(config?.inputSize)\n .fill(0)\n .map(() => Math.random() * 2 - 1)\n );\n const outputs = Array(batchSize)\n .fill(0)\n .map(() =>\n Array(config?.outputSize)\n .fill(0)\n .map(() => Math.random() * 2 - 1)\n );\n\n const network = new MockNeuralNetwork(\n config\n ) as any as any as any as any;\n const result = network.train({ inputs, outputs });\n\n // Training should converge\n expect(typeof result?.converged).toBe('boolean');\n expect(result?.finalError).toBeGreaterThanOrEqual(0);\n expect(result?.epochs).toBeGreaterThan(0);\n expect(Number.isFinite(result?.finalError)).toBe(true);\n })\n );\n })", "language": "typescript", "source_file": "./repos/mikkihugo/claude-code-zen/src/__tests__/unit/neural/property-based-tests.test.ts", "start_line": null, "end_line": null, "dependencies": ["networkConfig"], "repo": {"name": "mikkihugo/claude-code-zen", "url": "https://github.com/mikkihugo/claude-code-zen.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Training a neural network with various randomly generated configurations should result in a valid convergence status, non-negative final error, and a finite number of epochs.", "mode": "fast-check"} {"id": 56823, "name": "unknown", "code": "it(\"should fulfill fibo(p)*fibo(q+1)+fibo(p-1)*fibo(q) = fibo(p+q)\", () => {\n fc.assert(\n fc.property(\n fc.integer({ min: 1, max: MaxN }),\n fc.integer({ min: 0, max: MaxN }),\n (p, q) => {\n expect(fibonacci(p + q)).toBe(\n fibonacci(p) * fibonacci(q + 1) + fibonacci(p - 1) * fibonacci(q)\n );\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-07.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The test verifies that for integers \\( p \\) and \\( q \\), the Fibonacci identity \\( \\text{fibo}(p) \\times \\text{fibo}(q+1) + \\text{fibo}(p-1) \\times \\text{fibo}(q) = \\text{fibo}(p+q) \\) holds.", "mode": "fast-check"} {"id": 56824, "name": "unknown", "code": "it(\"should fulfill fibo(2p-1) = fibo\u00b2(p-1)+fibo\u00b2(p)\", () => {\n // Special case of the property above\n fc.assert(\n fc.property(fc.integer({ min: 1, max: MaxN }), (p) => {\n expect(fibonacci(2 * p - 1)).toBe(\n fibonacci(p - 1) * fibonacci(p - 1) + fibonacci(p) * fibonacci(p)\n );\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-07.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Fibonacci numbers satisfy the relationship \\( \\text{fibonacci}(2p-1) = \\text{fibonacci}(p-1)^2 + \\text{fibonacci}(p)^2 \\).", "mode": "fast-check"} {"id": 56825, "name": "unknown", "code": "it(\"should fulfill Catalan identity\", () => {\n fc.assert(\n fc.property(\n fc.integer({ min: 0, max: MaxN }),\n fc.integer({ min: 0, max: MaxN }),\n (a, b) => {\n const [p, q] = a < b ? [b, a] : [a, b];\n const sign = (p - q) % 2 === 0 ? 1n : -1n; // (-1)^(p-q)\n expect(\n fibonacci(p) * fibonacci(p) - fibonacci(p - q) * fibonacci(p + q)\n ).toBe(sign * fibonacci(q) * fibonacci(q));\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-07.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Verifies the fulfillment of a Catalan identity involving Fibonacci numbers, comparing a calculated expression to Fibonacci terms with a sign factor based on evenness of the difference.", "mode": "fast-check"} {"id": 56827, "name": "unknown", "code": "it(\"should fibo(nk) divisible by fibo(n)\", () => {\n fc.assert(\n fc.property(\n fc.integer({ min: 1, max: MaxN }),\n fc.integer({ min: 0, max: 100 }),\n (n, k) => {\n expect(fibonacci(n * k) % fibonacci(n)).toBe(0n);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-07.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Fibonacci number at `nk` should be divisible by the Fibonacci number at `n`.", "mode": "fast-check"} {"id": 56829, "name": "unknown", "code": "it(\"should simplify any fraction to a fraction having the same result\", () => {\n fc.assert(\n fc.property(\n fc.integer(),\n fc.integer().filter((n) => n !== 0),\n (numerator, denominator) => {\n const fSource = { numerator, denominator };\n const fOut = simplifyFraction(fSource);\n expect(fOut.numerator / fOut.denominator).toEqual(\n fSource.numerator / fSource.denominator\n );\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-06.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Simplifying a fraction should result in a fraction with the same numerical value as the original.", "mode": "fast-check"} {"id": 56830, "name": "unknown", "code": "it(\"should always return a simplified fraction having a positive denominator\", () => {\n fc.assert(\n fc.property(\n fc.integer(),\n fc.integer().filter((n) => n !== 0),\n (numerator, denominator) => {\n const fSource = { numerator, denominator };\n const fOut = simplifyFraction(fSource);\n expect(fOut.denominator).toBeGreaterThan(0);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-06.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Simplifying a fraction always results in a fraction with a positive denominator.", "mode": "fast-check"} {"id": 56832, "name": "unknown", "code": "it(\"should simplify fractions to simpler form whenever possible\", () => {\n fc.assert(\n fc.property(\n fc.integer(),\n fc.integer().filter((n) => n !== 0),\n fc.integer({ min: 1 }),\n (smallNumerator, smallDenominator, factor) => {\n fc.pre(Math.abs(smallNumerator * factor) <= Number.MAX_SAFE_INTEGER);\n fc.pre(Math.abs(smallDenominator * factor) <= Number.MAX_SAFE_INTEGER);\n\n const fSource = {\n numerator: smallNumerator * factor,\n denominator: smallDenominator * factor,\n };\n const fOut = simplifyFraction(fSource);\n\n const simplifiedByFactor = Math.abs(\n fSource.denominator / fOut.denominator\n );\n expect(simplifiedByFactor).toBeGreaterThanOrEqual(factor);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-06.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The test ensures that fractions are simplified to their simplest form by verifying the reduction factor used in the simplification process is at least as large as the factor by which the original fraction was scaled.", "mode": "fast-check"} {"id": 56833, "name": "unknown", "code": "it(\"should be able to find back the original message\", () => {\n fc.assert(\n fc.property(\n fc.set(wordArb, { minLength: 1 }).chain((words) =>\n fc.record({\n words: fc.constant(words),\n originalMessage: fc\n .array(fc.constantFrom(...words))\n .map((items) => items.join(\" \")),\n })\n ),\n ({ words, originalMessage }) => {\n const spacelessMessage = originalMessage.replace(/ /g, \"\");\n const combinations = respace(spacelessMessage, words);\n expect(combinations).toContain(originalMessage);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-05.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The function `respace` should reconstruct the original message from a spaceless version using a set of given words, and identify the original message among possible combinations.", "mode": "fast-check"} {"id": 56834, "name": "unknown", "code": "it(\"should only return messages with spaceless version being the passed message\", () => {\n fc.assert(\n fc.property(\n fc.set(wordArb, { minLength: 1 }).chain((words) =>\n fc.record({\n words: fc.shuffledSubarray(words), // we potentially remove words from the dictionary to cover no match case\n originalMessage: fc\n .array(fc.constantFrom(...words))\n .map((items) => items.join(\" \")),\n })\n ),\n ({ words, originalMessage }) => {\n const spacelessMessage = originalMessage.replace(/ /g, \"\");\n const combinations = respace(spacelessMessage, words);\n for (const combination of combinations) {\n expect(combination.replace(/ /g, \"\")).toBe(spacelessMessage);\n }\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-05.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The function `respace` should return only those message combinations whose spaceless version matches the original spaceless message.", "mode": "fast-check"} {"id": 56279, "name": "unknown", "code": "it(\"should agree with flatMap\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), fc.anything()),\n fc.func(result(fc.anything(), fc.anything())),\n flatMapOkayDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function under test behaves consistently with the behavior of `flatMap` using arbitrary values and functions.", "mode": "fast-check"} {"id": 60655, "name": "unknown", "code": "test('fitToPage always shows all tunes', async ({ page }) => {\n\t\tawait page.goto('/Jigs-2-Lots-of-jigs');\n\t\tawait fc.assert(\n\t\t\tfc.asyncProperty(propPageWidth, propPageHeight, async (width, height) => {\n\t\t\t\tawait page.setViewportSize({ width, height });\n\t\t\t\tawait expect(page.getByText('The Cliffs Of Moher', { exact: true })).toBeInViewport();\n\t\t\t\tawait expect(page.getByText('Spirit of the Dance', { exact: true })).toBeInViewport();\n\t\t\t\tawait expect(page.getByText('The Roman Wall', { exact: true })).toBeInViewport();\n\t\t\t\tawait expect(page.getByText('The Kesh', { exact: true })).toBeInViewport();\n\t\t\t}),\n\t\t\t{\n\t\t\t\texamples: [\n\t\t\t\t\t[1992, 809],\n\t\t\t\t\t[2000, 809]\n\t\t\t\t],\n\t\t\t\ttimeout: TEST_TIMEOUT_MILLIS,\n\t\t\t\tinterruptAfterTimeLimit: TEST_TIMEOUT_MILLIS\n\t\t\t}\n\t\t);\n\t})", "language": "typescript", "source_file": "./repos/flyingcatband/tunebook/tests/test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "flyingcatband/tunebook", "url": "https://github.com/flyingcatband/tunebook.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "All specified tunes must remain visible in the viewport across various page dimensions.", "mode": "fast-check"} {"id": 60657, "name": "unknown", "code": "test(`fitToPage shows the same view after zooming all the way out`, async ({ page }) => {\n\t\tawait page.goto('/Jigs-2-Lots-of-jigs');\n\t\tawait fc.assert(zoomThenFitToPage(page, 'out'), {\n\t\t\texamples: [[1993, 802]],\n\t\t\ttimeout: TEST_TIMEOUT_MILLIS,\n\t\t\tinterruptAfterTimeLimit: TEST_TIMEOUT_MILLIS\n\t\t});\n\t})", "language": "typescript", "source_file": "./repos/flyingcatband/tunebook/tests/test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "flyingcatband/tunebook", "url": "https://github.com/flyingcatband/tunebook.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "`fitToPage` maintains consistent view after zooming out completely.", "mode": "fast-check"} {"id": 60658, "name": "unknown", "code": "test(`zooming in from fit to page always makes a tune invisible`, async ({ page }) => {\n\t\tawait page.goto('/Jigs-2-Lots-of-jigs');\n\t\tawait expect(page.getByText('The Cliffs Of Moher', { exact: true })).toBeInViewport();\n\t\tawait fc.assert(\n\t\t\tfc.asyncProperty(propPageWidth, propPageHeight, async (width, height) => {\n\t\t\t\tawait page.setViewportSize({ width, height });\n\t\t\t\t// Wait for the tunes to rerender at the new viewport size\n\t\t\t\tawait page.waitForTimeout(1000);\n\t\t\t\tawait expect(page.getByText('The Cliffs Of Moher', { exact: true })).toBeInViewport();\n\n\t\t\t\tconst tuneWidth = 'document.querySelector(\".tune\").getBoundingClientRect().width';\n\t\t\t\tconst originalWidth: number = await page.evaluate(tuneWidth);\n\t\t\t\tawait page.getByRole('button', { name: 'Show controls' }).click();\n\t\t\t\tconst zoomIn = page.getByRole('button', { name: `Zoom in` });\n\n\t\t\t\tif (await zoomIn.isEnabled()) {\n\t\t\t\t\tawait zoomIn.click();\n\n\t\t\t\t\tawait page.getByRole('button', { name: 'Hide controls' }).click();\n\t\t\t\t\tawait expect(page.getByText('The Kesh', { exact: true })).not.toBeInViewport();\n\t\t\t\t\tawait expect(await page.evaluate(tuneWidth)).toBeGreaterThan(originalWidth);\n\t\t\t\t} else {\n\t\t\t\t\tawait page.getByRole('button', { name: 'Hide controls' }).click();\n\t\t\t\t}\n\t\t\t}),\n\t\t\t{\n\t\t\t\ttimeout: TEST_TIMEOUT_MILLIS,\n\t\t\t\tinterruptAfterTimeLimit: TEST_TIMEOUT_MILLIS,\n\t\t\t\texamples: [\n\t\t\t\t\t[363, 971],\n\t\t\t\t\t[387, 1377]\n\t\t\t\t]\n\t\t\t}\n\t\t);\n\t})", "language": "typescript", "source_file": "./repos/flyingcatband/tunebook/tests/test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "flyingcatband/tunebook", "url": "https://github.com/flyingcatband/tunebook.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Zooming in from \"fit to page\" causes the tune to become invisible and increases its width beyond the original size.", "mode": "fast-check"} {"id": 60659, "name": "unknown", "code": "test(`zooming in with notes hidden makes a tune invisible`, async ({ page }) => {\n\t\tawait page.goto('/Jigs-2-Lots-of-jigs');\n\t\tawait expect(page.getByText('The Cliffs Of Moher', { exact: true })).toBeInViewport();\n\t\tawait fc.assert(\n\t\t\tfc.asyncProperty(propPageWidth, propPageHeight, async (width, height) => {\n\t\t\t\tawait page.setViewportSize({ width, height });\n\t\t\t\t// Wait for the tunes to rerender at the new viewport size\n\t\t\t\tawait page.waitForTimeout(1000);\n\t\t\t\tawait expect(page.getByText('The Cliffs Of Moher', { exact: true })).toBeInViewport();\n\n\t\t\t\tconst tuneWidth = 'document.querySelector(\".tune\").getBoundingClientRect().width';\n\t\t\t\tconst originalWidth: number = await page.evaluate(tuneWidth);\n\t\t\t\tawait page.getByRole('button', { name: 'Show controls' }).click();\n\t\t\t\tif (await page.getByRole('button', { name: 'Hide notes' }).isVisible()) {\n\t\t\t\t\tawait page.getByRole('button', { name: 'Hide notes' }).click();\n\t\t\t\t}\n\t\t\t\tawait expect(page.getByText('Extra notes', { exact: true })).not.toBeVisible();\n\t\t\t\tawait page.getByRole('button', { name: 'Hide controls' }).click();\n\t\t\t\tawait page.waitForTimeout(1000); // Wait for the tunes to rerender after hiding notes\n\t\t\t\tawait page.getByRole('button', { name: 'Show controls' }).click();\n\t\t\t\tconst zoomIn = page.getByRole('button', { name: `Zoom in` });\n\n\t\t\t\tif (await zoomIn.isEnabled()) {\n\t\t\t\t\tawait zoomIn.click();\n\n\t\t\t\t\tawait page.getByRole('button', { name: 'Hide controls' }).click();\n\t\t\t\t\tawait expect(page.getByText('The Kesh', { exact: true })).not.toBeInViewport();\n\t\t\t\t\tawait expect(await page.evaluate(tuneWidth)).toBeGreaterThan(originalWidth);\n\t\t\t\t} else {\n\t\t\t\t\tawait page.getByRole('button', { name: 'Hide controls' }).click();\n\t\t\t\t}\n\t\t\t}),\n\t\t\t{\n\t\t\t\ttimeout: TEST_TIMEOUT_MILLIS,\n\t\t\t\tinterruptAfterTimeLimit: TEST_TIMEOUT_MILLIS,\n\t\t\t\texamples: [[363, 971]]\n\t\t\t}\n\t\t);\n\t})", "language": "typescript", "source_file": "./repos/flyingcatband/tunebook/tests/test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "flyingcatband/tunebook", "url": "https://github.com/flyingcatband/tunebook.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Zooming in on a page with notes hidden should make the tune 'The Kesh' invisible by expanding its width beyond the viewport.", "mode": "fast-check"} {"id": 60661, "name": "unknown", "code": "test('should only throw errors parsing numbers', () =>\n fc.assert(\n fc.property(fc.json({ depthSize: 'large', noUnicodeString: false }), (jsonString) => {\n for (let i = 1; i < jsonString.length; i++) {\n // speedup\n i += Math.floor(Math.random() * 3);\n const substring = jsonString.substring(0, i);\n\n // since we don't allow partial parsing for numbers\n if (\n typeof JSON.parse(jsonString) === 'number' &&\n 'e-+.'.includes(substring[substring.length - 1]!)\n ) {\n expect(() => partialParse(substring)).toThrow(MalformedJSON);\n } else {\n partialParse(substring);\n }\n }\n }),\n ))", "language": "typescript", "source_file": "./repos/SirBoely/openai-node/tests/_vendor/partial-json-parser/partial-json-parsing.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SirBoely/openai-node", "url": "https://github.com/SirBoely/openai-node.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Errors should be thrown when partially parsing numbers if the substring ends with characters like 'e', '-', '+', or '.', since partial parsing is not allowed for numbers.", "mode": "fast-check"} {"id": 60668, "name": "unknown", "code": "it(\"normal usage\", () => {\n fc.assert(\n fc.property(\n anything(),\n\n (payload) => {\n const callback = jest.fn();\n const hub = makeEventSource();\n\n hub.observable.subscribe(callback);\n hub.notify(payload);\n hub.notify(payload);\n hub.notify(payload);\n\n expect(callback.mock.calls.length).toBe(3);\n for (const [arg] of callback.mock.calls) {\n expect(arg).toBe(payload);\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/jurgen-paul/liveblocks/packages/liveblocks-core/src/lib/__tests__/EventSource.test.ts", "start_line": null, "end_line": null, "dependencies": ["anything"], "repo": {"name": "jurgen-paul/liveblocks", "url": "https://github.com/jurgen-paul/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`EventSource` should deliver payloads to subscribers, with each notification matching the sent payload, ensuring the subscriber is called the correct number of times.", "mode": "fast-check"} {"id": 60669, "name": "unknown", "code": "it(\"registering multiple callbacks\", () => {\n fc.assert(\n fc.property(\n anything(),\n\n (payload) => {\n const callback1 = jest.fn();\n const callback2 = jest.fn();\n const hub = makeEventSource();\n\n hub.observable.subscribe(callback1);\n hub.notify(payload);\n\n hub.observable.subscribe(callback2);\n hub.notify(payload);\n hub.notify(payload);\n\n expect(callback1.mock.calls.length).toBe(3);\n for (const [arg] of callback1.mock.calls) {\n expect(arg).toBe(payload);\n }\n\n expect(callback2.mock.calls.length).toBe(2);\n for (const [arg] of callback2.mock.calls) {\n expect(arg).toBe(payload);\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/jurgen-paul/liveblocks/packages/liveblocks-core/src/lib/__tests__/EventSource.test.ts", "start_line": null, "end_line": null, "dependencies": ["anything"], "repo": {"name": "jurgen-paul/liveblocks", "url": "https://github.com/jurgen-paul/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Registering multiple callbacks should result in each being called the correct number of times with the exact payload provided.", "mode": "fast-check"} {"id": 60670, "name": "unknown", "code": "it(\"subscribing once\", () => {\n fc.assert(\n fc.property(\n anything(),\n\n (payload) => {\n const callback = jest.fn();\n const hub = makeEventSource();\n\n const dereg1 = hub.observable.subscribeOnce(callback);\n hub.notify(payload);\n hub.notify(payload);\n hub.notify(payload);\n\n expect(callback.mock.calls.length).toBe(1); // Called only once, not three times\n for (const [arg] of callback.mock.calls) {\n expect(arg).toBe(payload);\n }\n\n // Deregistering has no effect\n dereg1();\n hub.notify(payload);\n expect(callback.mock.calls.length).toBe(1); // Called only once, not three times\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/jurgen-paul/liveblocks/packages/liveblocks-core/src/lib/__tests__/EventSource.test.ts", "start_line": null, "end_line": null, "dependencies": ["anything"], "repo": {"name": "jurgen-paul/liveblocks", "url": "https://github.com/jurgen-paul/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`subscribeOnce` ensures the callback is called exactly once with the expected payload, regardless of multiple notifications and deregistration attempts.", "mode": "fast-check"} {"id": 56314, "name": "unknown", "code": "it(\"should be its own inverse\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), result(fc.anything(), fc.anything())),\n exchangeOkayInverse,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`exchangeOkayInverse` should ensure that applying it twice returns the original result on the provided input values.", "mode": "fast-check"} {"id": 56315, "name": "unknown", "code": "it(\"should agree with collectMapFail\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(result(fc.anything(), fc.anything()), fc.anything()),\n associateRightDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `associateRightDefinition` function's output on nested `result` structures should agree with `collectMapFail`.", "mode": "fast-check"} {"id": 60675, "name": "unknown", "code": "it('`findLastMap(arr, fun)` is equivalent to `last(mapOption(arr, fun))`', () => {\n fc.assert(\n fc.property(fc.array(fc.integer()), (arr) =>\n optionStringEq.equals(findLastMap(multipleOf3AsString)(arr), last(array.filterMap(arr, multipleOf3AsString)))\n )\n )\n })", "language": "typescript", "source_file": "./repos/Nymphium/fp-ts/test/Array.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Nymphium/fp-ts", "url": "https://github.com/Nymphium/fp-ts.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`findLastMap` is equivalent to finding the last element of `mapOption` applied to the array with `multipleOf3AsString`.", "mode": "fast-check"} {"id": 60678, "name": "unknown", "code": "it('`findLastMap(arr, fun)` is equivalent to `last(mapOption(arr, fun))`', () => {\n fc.assert(\n fc.property(fc.array(fc.integer()), (arr) =>\n optionStringEq.equals(\n _.findLastMap(multipleOf3AsString)(arr),\n _.last(_.readonlyArray.filterMap(arr, multipleOf3AsString))\n )\n )\n )\n })", "language": "typescript", "source_file": "./repos/Nymphium/fp-ts/test/ReadonlyArray.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Nymphium/fp-ts", "url": "https://github.com/Nymphium/fp-ts.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`findLastMap` applied to an array with a function should yield the same result as applying `last` on `mapOption` with the same array and function.", "mode": "fast-check"} {"id": 56318, "name": "unknown", "code": "it(\"should be its own inverse\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(\n result(fc.anything(), fc.anything()),\n result(fc.anything(), fc.anything()),\n ),\n distributeInverse,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Applying the `distributeInverse` function to a nested `result` should return the original nested `result`.", "mode": "fast-check"} {"id": 60680, "name": "unknown", "code": "test('should parse complete json', () => {\n expect(partialParse('{\"__proto__\": 0}')).toEqual(JSON.parse('{\"__proto__\": 0}'));\n\n fc.assert(\n fc.property(fc.json({ depthSize: 'large', noUnicodeString: false }), (jsonString) => {\n const parsedNormal = JSON.parse(jsonString);\n const parsedPartial = partialParse(jsonString);\n expect(parsedPartial).toEqual(parsedNormal);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/tannerpresscorp/openai-node/tests/_vendor/partial-json-parser/partial-json-parsing.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tannerpresscorp/openai-node", "url": "https://github.com/tannerpresscorp/openai-node.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`partialParse` returns results equivalent to `JSON.parse` when parsing complete JSON strings.", "mode": "fast-check"} {"id": 60681, "name": "unknown", "code": "test('should only throw errors parsing numbers', () =>\n fc.assert(\n fc.property(fc.json({ depthSize: 'large', noUnicodeString: false }), (jsonString) => {\n for (let i = 1; i < jsonString.length; i++) {\n // speedup\n i += Math.floor(Math.random() * 3);\n const substring = jsonString.substring(0, i);\n\n // since we don't allow partial parsing for numbers\n if (\n typeof JSON.parse(jsonString) === 'number' &&\n 'e-+.'.includes(substring[substring.length - 1]!)\n ) {\n expect(() => partialParse(substring)).toThrow(MalformedJSON);\n } else {\n partialParse(substring);\n }\n }\n }),\n ))", "language": "typescript", "source_file": "./repos/tannerpresscorp/openai-node/tests/_vendor/partial-json-parser/partial-json-parsing.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tannerpresscorp/openai-node", "url": "https://github.com/tannerpresscorp/openai-node.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Parsing partial JSON strings should only throw errors for incomplete numeric values.", "mode": "fast-check"} {"id": 60682, "name": "unknown", "code": "test('alarm thresholds are valid numbers', () => {\n fc.assert(fc.property(\n arbitrary_input_intervals(),\n (intervals) => {\n const template = setupStepScaling(intervals);\n\n const lowerThreshold = template.lowerThreshold;\n const upperThreshold = template.upperThreshold;\n\n return reportFalse(\n (lowerThreshold === undefined || (lowerThreshold > 0 && lowerThreshold !== Infinity))\n && (upperThreshold === undefined || (upperThreshold > 0 && upperThreshold !== Infinity)),\n lowerThreshold,\n upperThreshold);\n },\n ));\n })", "language": "typescript", "source_file": "./repos/alexandersperling/aws-cdk/packages/aws-cdk-lib/aws-applicationautoscaling/test/step-scaling-policy.test.ts", "start_line": null, "end_line": null, "dependencies": ["setupStepScaling", "reportFalse"], "repo": {"name": "alexandersperling/aws-cdk", "url": "https://github.com/alexandersperling/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`setupStepScaling` ensures that alarm thresholds are either undefined or valid numbers greater than zero and not infinite.", "mode": "fast-check"} {"id": 56345, "name": "unknown", "code": "it(\"should convert the Pair to a string\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(pair(fc.anything(), fc.anything()), toStringDefinition),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures that `Pair` instances are correctly converted to strings using `toStringDefinition`.", "mode": "fast-check"} {"id": 60683, "name": "unknown", "code": "test('generated step intervals are valid intervals', () => {\n fc.assert(fc.property(\n arbitrary_input_intervals(),\n (intervals) => {\n const template = setupStepScaling(intervals);\n const steps = template.allStepsAbsolute();\n\n return reportFalse(steps.every(step => {\n return step.MetricIntervalLowerBound! < step.MetricIntervalUpperBound!;\n }), steps, 'template', JSON.stringify(template, undefined, 2));\n },\n ));\n })", "language": "typescript", "source_file": "./repos/alexandersperling/aws-cdk/packages/aws-cdk-lib/aws-applicationautoscaling/test/step-scaling-policy.test.ts", "start_line": null, "end_line": null, "dependencies": ["setupStepScaling", "reportFalse"], "repo": {"name": "alexandersperling/aws-cdk", "url": "https://github.com/alexandersperling/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Generated step intervals should have a lower bound that is less than the upper bound.", "mode": "fast-check"} {"id": 60684, "name": "unknown", "code": "test('generated step intervals are nonoverlapping', () => {\n fc.assert(fc.property(\n arbitrary_input_intervals(),\n (intervals) => {\n const template = setupStepScaling(intervals);\n const steps = template.allStepsAbsolute();\n\n for (let i = 0; i < steps.length; i++) {\n const compareTo = steps.slice(i + 1);\n if (compareTo.some(x => overlaps(steps[i], x))) {\n return reportFalse(false, steps);\n }\n }\n\n return true;\n },\n ), { verbose: true });\n })", "language": "typescript", "source_file": "./repos/alexandersperling/aws-cdk/packages/aws-cdk-lib/aws-applicationautoscaling/test/step-scaling-policy.test.ts", "start_line": null, "end_line": null, "dependencies": ["setupStepScaling", "overlaps", "reportFalse"], "repo": {"name": "alexandersperling/aws-cdk", "url": "https://github.com/alexandersperling/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Generated step intervals should be non-overlapping when set up for scaling in the template.", "mode": "fast-check"} {"id": 56363, "name": "unknown", "code": "it(\"should agree with andSnd\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(text, fc.anything()),\n pair(text, fc.anything()),\n andThenSndDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures that the behavior agrees between certain pairs of text and arbitrary values and the `andSnd` operation.", "mode": "fast-check"} {"id": 56439, "name": "unknown", "code": "it(\"should be irreflexive\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(value, isLessIrreflexivity));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/order.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`isLessIrreflexivity` ensures that no value is considered less than itself.", "mode": "fast-check"} {"id": 60685, "name": "unknown", "code": "test('all template intervals occur in input array', () => {\n fc.assert(fc.property(\n arbitrary_input_intervals(),\n (intervals) => {\n const template = setupStepScaling(intervals);\n const steps = template.allStepsAbsolute();\n\n return steps.every(step => {\n return reportFalse(intervals.find(interval => {\n const acceptableLowerBounds = step.MetricIntervalLowerBound === -Infinity ? [undefined, 0] : [undefined, step.MetricIntervalLowerBound];\n // eslint-disable-next-line max-len\n const acceptableUpperBounds = step.MetricIntervalUpperBound === Infinity ? [undefined, Infinity] : [undefined, step.MetricIntervalUpperBound];\n\n return (acceptableLowerBounds.includes(interval.lower) && acceptableUpperBounds.includes(interval.upper));\n }) !== undefined, step, intervals);\n });\n },\n ));\n })", "language": "typescript", "source_file": "./repos/alexandersperling/aws-cdk/packages/aws-cdk-lib/aws-applicationautoscaling/test/step-scaling-policy.test.ts", "start_line": null, "end_line": null, "dependencies": ["setupStepScaling", "reportFalse"], "repo": {"name": "alexandersperling/aws-cdk", "url": "https://github.com/alexandersperling/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The template should include all intervals present in the input array, ensuring that every step in the template corresponds to an interval with matching bounds in the input.", "mode": "fast-check"} {"id": 60686, "name": "unknown", "code": "test('lower alarm uses lower policy', () => {\n fc.assert(fc.property(\n arbitrary_input_intervals(),\n (intervals) => {\n const template = setupStepScaling(intervals);\n const alarm = template.resource(template.lowerAlarm);\n fc.pre(alarm !== undefined);\n\n return reportFalse(alarm.Properties.AlarmActions[0].Ref === template.lowerPolicy, alarm);\n },\n ));\n })", "language": "typescript", "source_file": "./repos/alexandersperling/aws-cdk/packages/aws-cdk-lib/aws-applicationautoscaling/test/step-scaling-policy.test.ts", "start_line": null, "end_line": null, "dependencies": ["setupStepScaling", "reportFalse"], "repo": {"name": "alexandersperling/aws-cdk", "url": "https://github.com/alexandersperling/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Lower alarms should reference the lower scaling policy in the template setup.", "mode": "fast-check"} {"id": 60687, "name": "unknown", "code": "test('upper alarm uses upper policy', () => {\n fc.assert(fc.property(\n arbitrary_input_intervals(),\n (intervals) => {\n const template = setupStepScaling(intervals);\n const alarm = template.resource(template.upperAlarm);\n fc.pre(alarm !== undefined);\n\n return reportFalse(alarm.Properties.AlarmActions[0].Ref === template.upperPolicy, alarm);\n },\n ));\n })", "language": "typescript", "source_file": "./repos/alexandersperling/aws-cdk/packages/aws-cdk-lib/aws-applicationautoscaling/test/step-scaling-policy.test.ts", "start_line": null, "end_line": null, "dependencies": ["setupStepScaling", "reportFalse"], "repo": {"name": "alexandersperling/aws-cdk", "url": "https://github.com/alexandersperling/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test verifies that an upper alarm in a step scaling policy correctly references the upper scaling policy for given intervals.", "mode": "fast-check"} {"id": 60688, "name": "unknown", "code": "test('every aspect gets executed at most once on every construct', () =>\n fc.assert(\n fc.property(appWithAspects(), fc.boolean(), (app, stabilizeAspects) => {\n afterSynth((testApp) => {\n forEveryVisitPair(testApp.actionLog, (a, b) => {\n if (sameConstruct(a, b) && sameAspect(a, b)) {\n throw new Error(`Duplicate visit: t=${a.index} and t=${b.index}`);\n }\n });\n }, stabilizeAspects)(app);\n }),\n ),\n )", "language": "typescript", "source_file": "./repos/alexandersperling/aws-cdk/packages/aws-cdk-lib/core/test/aspect.prop.test.ts", "start_line": null, "end_line": null, "dependencies": ["appWithAspects", "afterSynth", "forEveryVisitPair", "sameConstruct", "sameAspect"], "repo": {"name": "alexandersperling/aws-cdk", "url": "https://github.com/alexandersperling/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Each aspect is executed at most once on every construct within the application.", "mode": "fast-check"} {"id": 56519, "name": "unknown", "code": "it('returns the correct number of digits', () => {\r\n fc.assert(\r\n fc.property(fc.integer(), (n) => {\r\n const expected = n.toString().replace(\"-\", \"\").length;\r\n assert.strictEqual(numDigits(n), expected);\r\n }),\r\n );\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`numDigits` returns the correct count of digits in an integer.", "mode": "fast-check"} {"id": 60689, "name": "unknown", "code": "test('all aspects that exist at the start of synthesis get invoked on all nodes in its scope at the start of synthesis', () =>\n fc.assert(\n fc.property(appWithAspects(), fc.boolean(), (app, stabilizeAspects) => {\n const originalConstructsOnApp = app.cdkApp.node.findAll();\n const originalAspectApplications = getAllAspectApplications(originalConstructsOnApp);\n afterSynth((testApp) => {\n const visitsMap = getVisitsMap(testApp.actionLog);\n\n for (const aspectApplication of originalAspectApplications) {\n // Check that each original AspectApplication also visited all child nodes of its original scope:\n for (const construct of originalConstructsOnApp) {\n if (isAncestorOf(aspectApplication.construct, construct)) {\n if (!visitsMap.get(construct)!.includes(aspectApplication.aspect)) {\n throw new Error(`Aspect ${aspectApplication.aspect} applied on ${aspectApplication.construct.node.path} did not visit construct ${construct.node.path} in its original scope.`);\n }\n }\n }\n }\n }, stabilizeAspects)(app);\n }),\n ),\n )", "language": "typescript", "source_file": "./repos/alexandersperling/aws-cdk/packages/aws-cdk-lib/core/test/aspect.prop.test.ts", "start_line": null, "end_line": null, "dependencies": ["appWithAspects", "getAllAspectApplications", "afterSynth", "getVisitsMap", "isAncestorOf"], "repo": {"name": "alexandersperling/aws-cdk", "url": "https://github.com/alexandersperling/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "All aspects present at the start of synthesis must be invoked on all constructs within their scope during synthesis.", "mode": "fast-check"} {"id": 60690, "name": "unknown", "code": "test('with stabilization, every aspect applied on the tree eventually executes on all of its nodes in scope', () =>\n fc.assert(\n fc.property(appWithAspects(), (app) => {\n afterSynth((testApp) => {\n const allConstructsOnApp = testApp.cdkApp.node.findAll();\n const allAspectApplications = getAllAspectApplications(allConstructsOnApp);\n const visitsMap = getVisitsMap(testApp.actionLog);\n\n for (const aspectApplication of allAspectApplications) {\n // Check that each AspectApplication also visited all child nodes of its scope:\n for (const construct of allConstructsOnApp) {\n if (isAncestorOf(aspectApplication.construct, construct)) {\n if (!visitsMap.get(construct)!.includes(aspectApplication.aspect)) {\n throw new Error(`Aspect ${aspectApplication.aspect.constructor.name} applied on ${aspectApplication.construct.node.path} did not visit construct ${construct.node.path} in its scope.`);\n }\n }\n }\n }\n }, true)(app);\n }),\n ),\n )", "language": "typescript", "source_file": "./repos/alexandersperling/aws-cdk/packages/aws-cdk-lib/core/test/aspect.prop.test.ts", "start_line": null, "end_line": null, "dependencies": ["appWithAspects", "afterSynth", "getAllAspectApplications", "getVisitsMap", "isAncestorOf"], "repo": {"name": "alexandersperling/aws-cdk", "url": "https://github.com/alexandersperling/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Every aspect applied to a tree should execute on all of its nodes within scope when stabilization is enabled.", "mode": "fast-check"} {"id": 60691, "name": "unknown", "code": "test('inherited aspects get invoked before locally defined aspects, if both have the same priority', () =>\n fc.assert(\n fc.property(appWithAspects(), fc.boolean(), (app, stabilizeAspects) => {\n afterSynth((testApp) => {\n forEveryVisitPair(testApp.actionLog, (a, b) => {\n if (!sameConstruct(a, b)) return;\n if (aspectAppliedT(testApp, a.aspect, a.construct) !== -1 ||\n aspectAppliedT(testApp, b.aspect, b.construct) !== -1) return;\n\n const aPrio = lowestAspectPrioFor(a.aspect, a.construct);\n const bPrio = lowestAspectPrioFor(b.aspect, b.construct);\n\n if (!(aPrio == bPrio)) return;\n\n const aInherited = allAncestorAspects(a.construct).includes(a.aspect);\n const bInherited = allAncestorAspects(b.construct).includes(b.aspect);\n\n if (!(aInherited == true && bInherited == false)) return;\n\n if (!(a.index < b.index)) {\n throw new Error(\n `Aspect ${a.aspect}@${aPrio} at ${a.index} should have been before ${b.aspect}@${bPrio} at ${b.index}, but was after`,\n );\n }\n });\n }, stabilizeAspects)(app);\n }),\n ),\n )", "language": "typescript", "source_file": "./repos/alexandersperling/aws-cdk/packages/aws-cdk-lib/core/test/aspect.prop.test.ts", "start_line": null, "end_line": null, "dependencies": ["appWithAspects", "afterSynth", "forEveryVisitPair", "sameConstruct", "aspectAppliedT", "lowestAspectPrioFor", "allAncestorAspects"], "repo": {"name": "alexandersperling/aws-cdk", "url": "https://github.com/alexandersperling/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Inherited aspects should invoke before locally defined aspects if both have the same priority.", "mode": "fast-check"} {"id": 60692, "name": "unknown", "code": "test('for every construct, lower priorities go before higher priorities', () =>\n fc.assert(\n fc.property(appWithAspects(), fc.boolean(), (app, stabilizeAspects) => {\n afterSynth((testApp) => {\n forEveryVisitPair(testApp.actionLog, (a, b) => {\n if (!sameConstruct(a, b)) return;\n if (aspectAppliedT(testApp, a.aspect, a.construct) !== -1 ||\n aspectAppliedT(testApp, b.aspect, b.construct) !== -1) return;\n\n const aPrio = lowestAspectPrioFor(a.aspect, a.construct);\n const bPrio = lowestAspectPrioFor(b.aspect, b.construct);\n\n // But only if the application of aspect A exists at least as long as the application of aspect B\n const aAppliedT = aspectAppliedT(testApp, a.aspect, a.construct);\n const bAppliedT = aspectAppliedT(testApp, b.aspect, b.construct);\n\n if (!implies(aPrio < bPrio && aAppliedT <= bAppliedT, a.index < b.index)) {\n throw new Error(\n `Aspect ${a.aspect}@${aPrio} at ${a.index} should have been before ${b.aspect}@${bPrio} at ${b.index}, but was after`,\n );\n }\n });\n }, stabilizeAspects)(app);\n }),\n ),\n )", "language": "typescript", "source_file": "./repos/alexandersperling/aws-cdk/packages/aws-cdk-lib/core/test/aspect.prop.test.ts", "start_line": null, "end_line": null, "dependencies": ["appWithAspects", "afterSynth", "forEveryVisitPair", "sameConstruct", "aspectAppliedT", "lowestAspectPrioFor", "implies"], "repo": {"name": "alexandersperling/aws-cdk", "url": "https://github.com/alexandersperling/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "For every construct, aspects with lower priorities are applied before those with higher priorities, ensuring the order respects the application's lifetime.", "mode": "fast-check"} {"id": 60693, "name": "unknown", "code": "test('for every construct, if a invokes before b that must mean it is of equal or lower priority', () =>\n fc.assert(\n fc.property(appWithAspects(), fc.boolean(), (app, stabilizeAspects) => {\n afterSynth((testApp) => {\n forEveryVisitPair(testApp.actionLog, (a, b) => {\n if (!sameConstruct(a, b)) return;\n if (aspectAppliedT(testApp, a.aspect, a.construct) !== -1 ||\n aspectAppliedT(testApp, b.aspect, b.construct) !== -1) return;\n\n const aPrio = lowestAspectPrioFor(a.aspect, a.construct);\n const bPrio = lowestAspectPrioFor(b.aspect, b.construct);\n\n if (!implies(a.index < b.index, aPrio <= bPrio)) {\n throw new Error(\n `Aspect ${a.aspect}@${aPrio} at ${a.index} should have been before ${b.aspect}@${bPrio} at ${b.index}, but was after`,\n );\n }\n });\n }, stabilizeAspects)(app);\n }),\n ),\n )", "language": "typescript", "source_file": "./repos/alexandersperling/aws-cdk/packages/aws-cdk-lib/core/test/aspect.prop.test.ts", "start_line": null, "end_line": null, "dependencies": ["appWithAspects", "afterSynth", "forEveryVisitPair", "sameConstruct", "aspectAppliedT", "lowestAspectPrioFor", "implies"], "repo": {"name": "alexandersperling/aws-cdk", "url": "https://github.com/alexandersperling/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "For each construct, if one aspect invokes before another, the first aspect must have equal or lower priority.", "mode": "fast-check"} {"id": 60694, "name": "unknown", "code": "test('visitLog is nonempty', () =>\n fc.assert(\n fc.property(appWithAspects(), fc.boolean(), (app, stabilizeAspects) => {\n afterSynth((testApp) => {\n expect(testApp.actionLog).not.toEqual([]);\n }, stabilizeAspects)(app);\n }),\n ),\n)", "language": "typescript", "source_file": "./repos/alexandersperling/aws-cdk/packages/aws-cdk-lib/core/test/aspect.prop.test.ts", "start_line": null, "end_line": null, "dependencies": ["appWithAspects", "afterSynth"], "repo": {"name": "alexandersperling/aws-cdk", "url": "https://github.com/alexandersperling/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Ensures that after synthesis, the `visitLog` in a `PrettyApp` is not empty, regardless of aspect stabilization.", "mode": "fast-check"} {"id": 60695, "name": "unknown", "code": "test('LinkedQueue behaves the same as array', () => {\n // define the possible commands and their inputs\n const allCommands = [\n fc.string().map((v) => new PushCommand(v)),\n fc.constant(new ShiftCommand()),\n ];\n\n // run everything\n fc.assert(\n fc.property(fc.commands(allCommands, { size: '+1' }), (cmds) => {\n const s = () => ({\n model: { array: [] } satisfies Model,\n real: new LinkedQueue(),\n });\n fc.modelRun(s, cmds);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/alexandersperling/aws-cdk/packages/aws-cdk-lib/core/test/private/linked-queue.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "alexandersperling/aws-cdk", "url": "https://github.com/alexandersperling/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`LinkedQueue` should perform operations consistently with standard array behaviors, verified by executing sequences of push and shift commands.", "mode": "fast-check"} {"id": 60696, "name": "unknown", "code": "asyncTest(async () => {\n const stack = new Stack();\n fc.assert(\n fc.property(\n fc.string(), anyValue,\n (delimiter, value) => _.isEqual(stack.resolve(Fn.join(delimiter, [value as string])), value),\n ),\n { verbose: true },\n );\n })", "language": "typescript", "source_file": "./repos/alexandersperling/aws-cdk/packages/aws-cdk-lib/core/test/fn.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "alexandersperling/aws-cdk", "url": "https://github.com/alexandersperling/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Fn.join` with a delimiter and a single value results in the resolved output being equal to the original value.", "mode": "fast-check"} {"id": 60697, "name": "unknown", "code": "asyncTest(async () => {\n const stack = new Stack();\n fc.assert(\n fc.property(\n fc.string(), fc.array(nonEmptyString, { minLength: 1, maxLength: 15 }),\n (delimiter, values) => stack.resolve(Fn.join(delimiter, values)) === values.join(delimiter),\n ),\n { verbose: true },\n );\n })", "language": "typescript", "source_file": "./repos/alexandersperling/aws-cdk/packages/aws-cdk-lib/core/test/fn.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "alexandersperling/aws-cdk", "url": "https://github.com/alexandersperling/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Fn.join` should produce the same result as JavaScript's `join` method when joining an array of non-empty strings using a specified delimiter.", "mode": "fast-check"} {"id": 60698, "name": "unknown", "code": "asyncTest(async () => {\n const stack = new Stack();\n fc.assert(\n fc.property(\n fc.string(), fc.array(nonEmptyString, { minLength: 1, maxLength: 3 }), tokenish, fc.array(nonEmptyString, { minLength: 1, maxLength: 3 }),\n (delimiter, prefix, obj, suffix) =>\n _.isEqual(stack.resolve(Fn.join(delimiter, [...prefix, stringToken(obj), ...suffix])),\n { 'Fn::Join': [delimiter, [prefix.join(delimiter), obj, suffix.join(delimiter)]] }),\n ),\n { verbose: true },\n );\n })", "language": "typescript", "source_file": "./repos/alexandersperling/aws-cdk/packages/aws-cdk-lib/core/test/fn.test.ts", "start_line": null, "end_line": null, "dependencies": ["stringToken"], "repo": {"name": "alexandersperling/aws-cdk", "url": "https://github.com/alexandersperling/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property checks that using `Fn.join` to concatenate a mix of string arrays and a token object with a delimiter results in a resolved structure matching an expected `{ 'Fn::Join': [...] }` format.", "mode": "fast-check"} {"id": 56563, "name": "unknown", "code": "it('should return empty array for invalid astra endpoints', () => {\r\n fc.assert(\r\n fc.property(fc.webUrl(), (webURL) => {\r\n assert.deepStrictEqual(extractDbComponentsFromAstraUrl(webURL), []);\r\n }),\r\n );\r\n\r\n fc.assert(\r\n fc.property(fc.string(), (webURL) => {\r\n assert.deepStrictEqual(extractDbComponentsFromAstraUrl(webURL), []);\r\n }),\r\n );\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60699, "name": "unknown", "code": "asyncTest(async () => {\n const stack = new Stack();\n fc.assert(\n fc.property(\n fc.string(), fc.array(anyValue),\n fc.array(anyValue, { minLength: 1, maxLength: 3 }),\n fc.array(anyValue),\n (delimiter, prefix, nested, suffix) =>\n // Gonna test\n _.isEqual(stack.resolve(Fn.join(delimiter, [...prefix as string[], Fn.join(delimiter, nested as string[]), ...suffix as string[]])),\n stack.resolve(Fn.join(delimiter, [...prefix as string[], ...nested as string[], ...suffix as string[]]))),\n ),\n { verbose: true },\n );\n })", "language": "typescript", "source_file": "./repos/alexandersperling/aws-cdk/packages/aws-cdk-lib/core/test/fn.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "alexandersperling/aws-cdk", "url": "https://github.com/alexandersperling/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `Fn.join` function should produce the same result when nested joins are resolved with the same delimiter as when flattened into a single join.", "mode": "fast-check"} {"id": 60700, "name": "unknown", "code": "asyncTest(async () => {\n const stack = new Stack();\n fc.assert(\n fc.property(\n fc.string(), fc.string(),\n fc.array(anyValue, { minLength: 1, maxLength: 3 }),\n fc.array(tokenish, { minLength: 2, maxLength: 3 }),\n fc.array(anyValue, { minLength: 3 }),\n (delimiter1, delimiter2, prefix, nested, suffix) => {\n fc.pre(delimiter1 !== delimiter2);\n const join = Fn.join(delimiter1, [...prefix as string[], Fn.join(delimiter2, stringListToken(nested)), ...suffix as string[]]);\n const resolved = stack.resolve(join);\n return resolved['Fn::Join'][1].find((e: any) => typeof e === 'object'\n && ('Fn::Join' in e)\n && e['Fn::Join'][0] === delimiter2) != null;\n },\n ),\n { verbose: true },\n );\n })", "language": "typescript", "source_file": "./repos/alexandersperling/aws-cdk/packages/aws-cdk-lib/core/test/fn.test.ts", "start_line": null, "end_line": null, "dependencies": ["stringListToken"], "repo": {"name": "alexandersperling/aws-cdk", "url": "https://github.com/alexandersperling/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Fn.join` with different delimiters correctly nests string list tokens, ensuring nested joins are present with the expected delimiter in the resolution.", "mode": "fast-check"} {"id": 60701, "name": "unknown", "code": "test('lower alarm index is lower than higher alarm index', () => {\n fc.assert(fc.property(\n arbitrary_complete_intervals(),\n (intervals) => {\n const alarms = findAlarmThresholds(intervals);\n\n return (alarms.lowerAlarmIntervalIndex === undefined\n || alarms.upperAlarmIntervalIndex === undefined\n || alarms.lowerAlarmIntervalIndex < alarms.upperAlarmIntervalIndex);\n },\n ));\n })", "language": "typescript", "source_file": "./repos/alexandersperling/aws-cdk/packages/aws-cdk-lib/aws-autoscaling-common/test/intervals.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "alexandersperling/aws-cdk", "url": "https://github.com/alexandersperling/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that in the `findAlarmThresholds` function, the `lowerAlarmIntervalIndex` is less than the `upperAlarmIntervalIndex`, if both are defined.", "mode": "fast-check"} {"id": 60704, "name": "unknown", "code": "test('no picking upper bound infinity for lower alarm', () => {\n fc.assert(fc.property(\n arbitrary_complete_intervals(),\n (intervals) => {\n const alarms = findAlarmThresholds(intervals);\n fc.pre(alarms.lowerAlarmIntervalIndex !== undefined);\n\n return intervals[alarms.lowerAlarmIntervalIndex!].upper !== Infinity;\n },\n ));\n })", "language": "typescript", "source_file": "./repos/alexandersperling/aws-cdk/packages/aws-cdk-lib/aws-autoscaling-common/test/intervals.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "alexandersperling/aws-cdk", "url": "https://github.com/alexandersperling/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `findAlarmThresholds` function should not select an interval with an upper bound of infinity for the lower alarm.", "mode": "fast-check"} {"id": 60706, "name": "unknown", "code": "it('should maintain immutability for any sequence of operations', () => {\n fc.assert(\n fc.property(\n fc.array(\n fc.oneof(\n fc.tuple(fc.constant('setVar'), varNameArb, typeInfoArb),\n fc.tuple(fc.constant('setImport'), varNameArb, importedClassInfoArb),\n fc.tuple(fc.constant('markExport'), varNameArb)\n ),\n { minLength: 1, maxLength: 100 }\n ),\n (operations) => {\n const original = create_file_type_tracker();\n let current = original;\n \n for (const [op, name, data] of operations) {\n const previous = current;\n \n switch (op) {\n case 'setVar':\n current = set_variable_type(current, name, data as TypeInfo);\n break;\n case 'setImport':\n current = set_imported_class(current, name, data as ImportedClassInfo);\n break;\n case 'markExport':\n current = mark_as_exported(current, name);\n break;\n }\n \n // Previous state unchanged\n expect(current).not.toBe(previous);\n expect(previous.variableTypes).toBe(previous.variableTypes);\n }\n \n // Original completely unchanged\n expect(original.variableTypes.size).toBe(0);\n expect(original.importedClasses.size).toBe(0);\n expect(original.exportedDefinitions.size).toBe(0);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/CRJFisher/ariadne/packages/core/tests/property_based.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "CRJFisher/ariadne", "url": "https://github.com/CRJFisher/ariadne.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The sequence of `setVar`, `setImport`, and `markExport` operations on a file type tracker should not mutate the previous state, ensuring immutability is maintained and the original tracker's state remains unchanged.", "mode": "fast-check"} {"id": 60707, "name": "unknown", "code": "it('should be commutative for independent operations', () => {\n fc.assert(\n fc.property(\n varNameArb,\n varNameArb,\n typeInfoArb,\n typeInfoArb,\n (var1, var2, type1, type2) => {\n fc.pre(var1 !== var2); // Ensure different variables\n \n const tracker = create_file_type_tracker();\n \n // Apply in order 1->2\n const result1 = set_variable_type(\n set_variable_type(tracker, var1, type1),\n var2, type2\n );\n \n // Apply in order 2->1\n const result2 = set_variable_type(\n set_variable_type(tracker, var2, type2),\n var1, type1\n );\n \n // Results should be equivalent\n expect(result1.variableTypes.size).toBe(result2.variableTypes.size);\n expect(result1.variableTypes.get(var1)).toEqual(result2.variableTypes.get(var1));\n expect(result1.variableTypes.get(var2)).toEqual(result2.variableTypes.get(var2));\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/CRJFisher/ariadne/packages/core/tests/property_based.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "CRJFisher/ariadne", "url": "https://github.com/CRJFisher/ariadne.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "Setting variable types in different orders for independent variables should yield results with equivalent sizes and values for each variable.", "mode": "fast-check"} {"id": 60709, "name": "unknown", "code": "it('should maintain structural sharing for any update sequence', () => {\n fc.assert(\n fc.property(\n fc.array(\n fc.record({\n filePath: fc.string({ minLength: 1, maxLength: 20 }),\n hasGraph: fc.boolean(),\n hasCache: fc.boolean()\n }),\n { minLength: 1, maxLength: 20 }\n ),\n (updates) => {\n let project = create_project_call_graph();\n const unchangedMaps = new Set();\n \n for (const update of updates) {\n const prev = project;\n \n // Track which maps were present before\n if (prev.fileGraphs.size > 0) unchangedMaps.add(prev.fileGraphs);\n if (prev.fileCache.size > 0) unchangedMaps.add(prev.fileCache);\n if (prev.fileTypeTrackers.size > 0) unchangedMaps.add(prev.fileTypeTrackers);\n \n // Apply update\n if (update.hasGraph) {\n project = add_file_graph(project, update.filePath, {} as any);\n }\n if (update.hasCache) {\n project = add_file_cache(project, update.filePath, {} as any);\n }\n \n // Verify structural sharing\n if (!update.hasGraph && prev.fileGraphs.size > 0) {\n expect(project.fileGraphs).toBe(prev.fileGraphs);\n }\n if (!update.hasCache && prev.fileCache.size > 0) {\n expect(project.fileCache).toBe(prev.fileCache);\n }\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/CRJFisher/ariadne/packages/core/tests/property_based.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "CRJFisher/ariadne", "url": "https://github.com/CRJFisher/ariadne.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "Structural sharing is maintained for file graphs and caches during any sequence of updates to a project.", "mode": "fast-check"} {"id": 60710, "name": "unknown", "code": "it('should correctly merge any two projects', () => {\n fc.assert(\n fc.property(\n fc.array(fc.string({ minLength: 1, maxLength: 10 }), { maxLength: 10 }),\n fc.array(fc.string({ minLength: 1, maxLength: 10 }), { maxLength: 10 }),\n (files1, files2) => {\n let project1 = create_project_call_graph();\n let project2 = create_project_call_graph();\n \n // Build project1\n for (const file of files1) {\n project1 = add_file_graph(project1, file, {} as any);\n }\n \n // Build project2\n for (const file of files2) {\n project2 = add_file_graph(project2, file, {} as any);\n }\n \n // Merge\n const merged = merge_project_graphs(project1, project2);\n \n // Verify merge properties\n expect(merged).not.toBe(project1);\n expect(merged).not.toBe(project2);\n \n // All files from both projects should be in merged\n const allFiles = new Set([...files1, ...files2]);\n expect(merged.fileGraphs.size).toBe(allFiles.size);\n \n // Project2 takes precedence for overlapping files\n for (const file of files2) {\n expect(merged.fileGraphs.has(file)).toBe(true);\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/CRJFisher/ariadne/packages/core/tests/property_based.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "CRJFisher/ariadne", "url": "https://github.com/CRJFisher/ariadne.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "Merging two project call graphs results in a new graph containing all files from both projects, with precedence given to files from the second project if there are overlaps.", "mode": "fast-check"} {"id": 60711, "name": "unknown", "code": "it('should handle batch updates efficiently', () => {\n fc.assert(\n fc.property(\n fc.array(\n fc.record({\n filePath: fc.string({ minLength: 1, maxLength: 20 }),\n graph: fc.constant({} as any),\n cache: fc.constant({} as any)\n }),\n { minLength: 1, maxLength: 50 }\n ),\n (updates) => {\n const project = create_project_call_graph();\n \n // Apply batch\n const batchResult = batch_update_files(project, updates);\n \n // Apply sequentially\n let seqResult = project;\n for (const update of updates) {\n if (update.graph) {\n seqResult = add_file_graph(seqResult, update.filePath, update.graph);\n }\n if (update.cache) {\n seqResult = add_file_cache(seqResult, update.filePath, update.cache);\n }\n }\n \n // Results should be equivalent\n expect(batchResult.fileGraphs.size).toBe(seqResult.fileGraphs.size);\n expect(batchResult.fileCache.size).toBe(seqResult.fileCache.size);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/CRJFisher/ariadne/packages/core/tests/property_based.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "CRJFisher/ariadne", "url": "https://github.com/CRJFisher/ariadne.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "Applying batch file updates should yield the same results as applying them sequentially in terms of file graph and file cache sizes.", "mode": "fast-check"} {"id": 60712, "name": "unknown", "code": "it('should never expose mutable internal state', () => {\n fc.assert(\n fc.property(\n fc.array(varNameArb, { minLength: 1, maxLength: 10 }),\n (vars) => {\n let tracker = create_file_type_tracker();\n \n // Add some data\n for (const v of vars) {\n tracker = set_variable_type(tracker, v, {\n className: 'TestClass',\n classDef: undefined,\n position: { row: 0, column: 0 }\n });\n }\n \n // Get internal state\n const varTypes = tracker.variableTypes;\n const exports = tracker.exportedDefinitions;\n \n // Verify they're readonly types (TypeScript enforces at compile time)\n // At runtime, verify immutability through operations\n const originalSize = varTypes.size;\n const originalExportsSize = exports.size;\n \n // Any mutations would only affect a new instance\n const updated = set_variable_type(tracker, 'newVar', {\n className: 'NewClass',\n classDef: undefined,\n position: { row: 0, column: 0 }\n });\n \n // Original tracker unchanged\n expect(tracker.variableTypes.size).toBe(originalSize);\n expect(tracker.exportedDefinitions.size).toBe(originalExportsSize);\n \n // New instance has the changes\n expect(updated.variableTypes.size).toBe(originalSize + 1);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/CRJFisher/ariadne/packages/core/tests/property_based.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "CRJFisher/ariadne", "url": "https://github.com/CRJFisher/ariadne.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "`create_file_type_tracker` ensures its internal state remains immutable, as evidenced by no changes occurring to the original state after operations that modify a new instance.", "mode": "fast-check"} {"id": 60713, "name": "unknown", "code": "it('should support undo/redo through state history', () => {\n fc.assert(\n fc.property(\n fc.array(\n fc.tuple(varNameArb, typeInfoArb),\n { minLength: 1, maxLength: 20 }\n ),\n (operations) => {\n const history: FileTypeTrackerData[] = [];\n let current = create_file_type_tracker();\n \n history.push(current);\n \n // Apply operations and track history\n const uniqueVars = new Set();\n for (const [name, type] of operations) {\n current = set_variable_type(current, name, type);\n uniqueVars.add(name);\n history.push(current);\n }\n \n // Verify we can access any previous state\n // The size is based on unique variable names, not total operations\n for (let i = 0; i < history.length; i++) {\n if (i === 0) {\n expect(history[i].variableTypes.size).toBe(0);\n } else {\n // Size increases only when we see a new variable\n const varsUpToI = new Set(operations.slice(0, i).map(([n]) => n));\n expect(history[i].variableTypes.size).toBe(varsUpToI.size);\n }\n }\n \n // Simulate undo\n const undoSteps = Math.min(5, operations.length);\n const afterUndo = history[history.length - 1 - undoSteps];\n const varsAfterUndo = new Set(operations.slice(0, operations.length - undoSteps).map(([n]) => n));\n expect(afterUndo.variableTypes.size).toBe(varsAfterUndo.size);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/CRJFisher/ariadne/packages/core/tests/property_based.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "CRJFisher/ariadne", "url": "https://github.com/CRJFisher/ariadne.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The state history should correctly track variable type changes to support undo/redo functionality, with the ability to revert to any previous state based on unique variable operations.", "mode": "fast-check"} {"id": 60714, "name": "unknown", "code": "test('should parse complete json', () => {\n expect(partialParse('{\"__proto__\": 0}')).toEqual(JSON.parse('{\"__proto__\": 0}'));\n\n fc.assert(\n fc.property(fc.json({ depthSize: 'large', noUnicodeString: false }), (jsonString) => {\n const parsedNormal = JSON.parse(jsonString);\n const parsedPartial = partialParse(jsonString);\n expect(parsedPartial).toEqual(parsedNormal);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/EvaRoksBot/Nide/tests/_vendor/partial-json-parser/partial-json-parsing.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "EvaRoksBot/Nide", "url": "https://github.com/EvaRoksBot/Nide.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `partialParse` should produce the same result as `JSON.parse` when parsing JSON strings.", "mode": "fast-check"} {"id": 60715, "name": "unknown", "code": "test('should only throw errors parsing numbers', () =>\n fc.assert(\n fc.property(fc.json({ depthSize: 'large', noUnicodeString: false }), (jsonString) => {\n for (let i = 1; i < jsonString.length; i++) {\n // speedup\n i += Math.floor(Math.random() * 3);\n const substring = jsonString.substring(0, i);\n\n // since we don't allow partial parsing for numbers\n if (\n typeof JSON.parse(jsonString) === 'number' &&\n 'e-+.'.includes(substring[substring.length - 1]!)\n ) {\n expect(() => partialParse(substring)).toThrow(MalformedJSON);\n } else {\n partialParse(substring);\n }\n }\n }),\n ))", "language": "typescript", "source_file": "./repos/EvaRoksBot/Nide/tests/_vendor/partial-json-parser/partial-json-parsing.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "EvaRoksBot/Nide", "url": "https://github.com/EvaRoksBot/Nide.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Partial parsing attempts on JSON strings should only throw errors when dealing with numbers where the substring ends with `'e'`, `'-'`, `'+'`, or `'.'`.", "mode": "fast-check"} {"id": 60716, "name": "unknown", "code": "it(\"deep cloning of LiveStructures\", () =>\n fc.assert(\n fc.asyncProperty(\n liveStructure,\n\n async (data) => {\n const { root } = await prepareStorageUpdateTest([\n createSerializedObject(\"0:0\", {}),\n ]);\n\n // Clone \"a\" to \"b\"\n root.set(\"a\", data);\n root.set(\"b\", data.clone());\n\n const imm = root.toImmutable();\n expect(imm.a).toEqual(imm.b);\n }\n )\n ))", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/crdts/__tests__/cloning.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Deep cloning `LiveStructures` ensures that cloned objects are equal to their originals when stored within the same parent structure.", "mode": "fast-check"} {"id": 60717, "name": "unknown", "code": "it(\"deep cloning of LiveStructures (twice)\", () =>\n fc.assert(\n fc.asyncProperty(\n liveStructure,\n\n async (data) => {\n const { root } = await prepareStorageUpdateTest([\n createSerializedObject(\"0:0\", {}),\n ]);\n\n // Clone \"a\" to \"b\"\n root.set(\"a\", data);\n root.set(\"b\", data.clone().clone());\n // ^^^^^^^^ Deliberately cloning twice in this test\n\n const imm = root.toImmutable();\n expect(imm.a).toEqual(imm.b);\n }\n )\n ))", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/crdts/__tests__/cloning.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Deep cloning of `LiveStructures` twice should result in equivalent objects, verified by ensuring property `a` equals property `b` after two clones.", "mode": "fast-check"} {"id": 60718, "name": "unknown", "code": "it(\"deep cloning of LSON data (= LiveStructures or JSON)\", () =>\n fc.assert(\n fc.asyncProperty(\n lson,\n\n async (data) => {\n const { root } = await prepareStorageUpdateTest([\n createSerializedObject(\"0:0\", {}),\n ]);\n\n // Clone \"a\" to \"b\"\n root.set(\"a\", data);\n root.set(\"b\", cloneLson(data));\n // ^^^^^^^^^ Much like data.clone(), but generalized to\n // work on _any_ LSON value, even if data is\n // a JSON value\n\n const imm = root.toImmutable();\n expect(imm.a).toEqual(imm.b);\n }\n )\n ))", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/crdts/__tests__/cloning.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Deep cloning of LSON data ensures that cloned data structures, when converted to immutable form, are equal to their source counterparts.", "mode": "fast-check"} {"id": 60719, "name": "unknown", "code": "test(\"normal popping and pushing behaves like a normal array\", () => {\n fc.assert(\n fc.property(\n sequenceOfOps(),\n\n (seq) => {\n const expected = [];\n const deque = new Deque();\n\n for (const [op, values] of seq) {\n if (op === \"add\") {\n expected.push(...values);\n deque.push(values);\n } else {\n expect(expected.pop()).toEqual(deque.pop());\n }\n }\n\n const actual = Array.from(deque);\n expect(actual).toEqual(expected);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/Deque.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Sequential push and pop operations on `Deque` should produce the same results as a normal array.", "mode": "fast-check"} {"id": 60720, "name": "unknown", "code": "test(\"popping and pushing from the left cannot be distinguished from array shift/unshift ops\", () => {\n fc.assert(\n fc.property(\n sequenceOfOps(),\n\n (seq) => {\n const expected = [];\n const deque = new Deque();\n\n for (const [op, values] of seq) {\n if (op === \"add\") {\n expected.unshift(...values);\n deque.pushLeft(values);\n } else {\n expect(expected.shift()).toEqual(deque.popLeft());\n }\n }\n\n const actual = Array.from(deque);\n expect(actual).toEqual(expected);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/Deque.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Popping and pushing elements from the left of a `Deque` should produce the same result as using array `shift` and `unshift` operations, ensuring both methods lead to equivalent sequences.", "mode": "fast-check"} {"id": 60726, "name": "unknown", "code": "it(\"asPos is idempotent\", () => {\n fc.assert(\n fc.property(\n fc.string(),\n\n (s) => {\n expect(asPos(s)).toBe(asPos(asPos(s)));\n expect(asPos(s)).toBe(asPos(asPos(asPos(asPos(s)))));\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/position.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `asPos` function, when applied to a string, should be idempotent, meaning repeated applications yield the same result as a single application.", "mode": "fast-check"} {"id": 60727, "name": "unknown", "code": "test(\"after hops to next major digit when possible\", () => {\n expect(after(ONE)).toBe(TWO);\n expect(after(TWO)).toBe(THREE);\n expect(after(THREE)).toBe(FOUR);\n expect(after(asPos(ZERO + ZERO + ONE))).toBe(ONE);\n expect(after(ONE)).toBe(TWO);\n expect(after(asPos(ONE + ZERO + ONE))).toBe(TWO);\n expect(after(TWO)).toBe(THREE);\n expect(after(THREE)).toBe(FOUR);\n expect(after(EIGHT)).toBe(NINE);\n expect(after(NINE)).toBe(NINE + ONE);\n expect(after(asPos(NINE + ONE))).toBe(NINE + TWO);\n expect(after(asPos(NINE + ONE + TWO + THREE))).toBe(NINE + TWO);\n expect(after(asPos(NINE + EIGHT))).toBe(NINE + NINE);\n expect(after(asPos(NINE + NINE))).toBe(NINE + NINE + ONE);\n expect(after(asPos(NINE + NINE + NINE + NINE))).toBe(\n NINE + NINE + NINE + NINE + ONE\n );\n\n // Generically stated, if the first digit isn't a 9, the result is always\n // going to be a single digit position\n fc.assert(\n fc.property(\n genPos(),\n\n (pos) => {\n if (pos[0] !== NINE) {\n expect(after(pos).length).toBe(1); // Always generates a single-digit\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/position.test.ts", "start_line": null, "end_line": null, "dependencies": ["genPos"], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `after` function should increment positions by hopping to the next major digit, ensuring single-digit results unless the first digit is a 9.", "mode": "fast-check"} {"id": 60728, "name": "unknown", "code": "test(\"before hops to prior major digit when possible\", () => {\n expect(before(NINE)).toBe(EIGHT);\n expect(before(FOUR)).toBe(THREE);\n expect(before(THREE)).toBe(TWO);\n expect(before(TWO)).toBe(ONE);\n\n // Not possible when reading the \"left edge\" of .1, .01, .001, .0001, etc.\n expect(before(ONE)).toBe(ZERO + NINE); // e.g. before(.1) => .09\n\n expect(before(asPos(ONE + ONE))).toBe(ONE);\n expect(before(asPos(ONE + ONE))).toBe(ONE);\n expect(before(TWO)).toBe(ONE);\n expect(before(asPos(TWO + THREE + ONE + ZERO + ONE))).toBe(TWO);\n expect(before(THREE)).toBe(TWO);\n expect(before(NINE)).toBe(EIGHT);\n expect(before(asPos(NINE + ONE))).toBe(NINE);\n expect(before(asPos(NINE + TWO))).toBe(NINE);\n expect(before(asPos(NINE + THREE))).toBe(NINE);\n expect(before(asPos(NINE + EIGHT))).toBe(NINE);\n expect(before(asPos(NINE + NINE))).toBe(NINE);\n expect(before(asPos(ZERO + ONE))).toBe(ZERO + ZERO + NINE);\n expect(before(asPos(ZERO + ZERO + ONE))).toBe(ZERO + ZERO + ZERO + NINE);\n expect(before(asPos(ONE + ZERO + ZERO + ONE))).toBe(ONE); // e.g. before(.1001) => .1\n\n expect(before(asPos(NINE + THREE))).toBe(NINE); // e.g. before(.93) => .9\n expect(before(asPos(TWO + THREE + ONE + ZERO + ONE))).toBe(TWO); // e.g. before(.23101) => .2\n\n expect(before(asPos(ZERO + ZERO + TWO))).toBe(ZERO + ZERO + ONE);\n expect(before(asPos(ZERO + ZERO + TWO + EIGHT + THREE))).toBe(\n ZERO + ZERO + TWO\n );\n expect(before(asPos(ZERO + ZERO + TWO + ZERO + THREE))).toBe(\n ZERO + ZERO + TWO\n );\n\n // Generically stated, if this isn't the \"left edge\", the result is always\n // going to be a single digit\n fc.assert(\n fc.property(\n genUnverifiedPos(),\n\n (pos) => {\n if (!(pos === ONE || asPos(pos)[0] === ZERO)) {\n expect(before(pos).length).toBe(1); // Always generates a single-digit\n }\n }\n ),\n\n {\n // Counter-examples that where found in the past by fast-check\n examples: [[\"\\u0000x\"]],\n }\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/position.test.ts", "start_line": null, "end_line": null, "dependencies": ["genUnverifiedPos"], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Verifying that the `before` function returns the correct prior major digit for different positions, ensuring it generates a single-digit when not on the \"left edge\" of a sequence.", "mode": "fast-check"} {"id": 60731, "name": "unknown", "code": "it('before generates alphabetically \"lower\" values', () => {\n fc.assert(\n fc.property(\n genPos(),\n\n (pos) => {\n expect(before(pos) < pos).toBe(true);\n expect(pos > before(pos)).toBe(true);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/position.test.ts", "start_line": null, "end_line": null, "dependencies": ["genPos"], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `before` function generates values that are alphabetically lower than the given position.", "mode": "fast-check"} {"id": 56641, "name": "unknown", "code": "it('should handle to-bignumber coercion properly', () => {\n const desAsserter = mkDesAsserter('bignumber', (n) => BigNumber(n));\n\n fc.assert(\n fc.property(fc.oneof(fc.double(), arbs.bigNum()), arbs.pathWithObj(), (num, pathWithObj) => {\n desAsserter.ok(pathWithObj, num);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/collections/ser-des/enable-big-numbers.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`mkDesAsserter` correctly coerces numbers to `BigNumber` across various numeric inputs and paths.", "mode": "fast-check"} {"id": 56646, "name": "unknown", "code": "it('should serialize the date into the proper format', () => {\n fc.assert(\n fc.property(arbs.validDate(), (date) => {\n assert.deepStrictEqual(serdes.serialize(date), [{ $date: date.valueOf() }, false]);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/collections/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`serdes.serialize` converts a valid date into an object with a `$date` property holding the date's timestamp value.", "mode": "fast-check"} {"id": 56647, "name": "unknown", "code": "it('should deserialize the date properly', () => {\n fc.assert(\n fc.property(arbs.validDate(), (date) => {\n assert.deepStrictEqual(serdes.deserialize({ $date: date.valueOf() }, {}), date);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/collections/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Deserialization of a date object from its serialized form should yield the original date.", "mode": "fast-check"} {"id": 60732, "name": "unknown", "code": "it(\"throws for equal values\", () => {\n expect(() => between(asPos(\"x\"), asPos(\"x\"))).toThrow();\n expect(() => between(asPos(\"x\"), asPos(\"x \"))).toThrow();\n\n fc.assert(\n fc.property(\n genUnverifiedPos(),\n\n (pos) => {\n expect(() => between(pos, pos)).toThrow();\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/position.test.ts", "start_line": null, "end_line": null, "dependencies": ["genUnverifiedPos"], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `between` throws an exception when called with two identical position values, including those with trailing spaces or unverified positions.", "mode": "fast-check"} {"id": 60734, "name": "unknown", "code": "it(\"arguments are commutative\", () => {\n fc.assert(\n fc.property(\n genPos(),\n genPos(),\n\n (pos1, pos2) => {\n if (pos1 !== pos2) {\n expect(between(pos1, pos2)).toBe(between(pos2, pos1));\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/position.test.ts", "start_line": null, "end_line": null, "dependencies": ["genPos"], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`between` function produces the same result regardless of the order of distinct `pos1` and `pos2`.", "mode": "fast-check"} {"id": 60736, "name": "unknown", "code": "it(\"correct compares output of before/after\", () => {\n fc.assert(\n fc.property(\n genPos(),\n\n (pos) => {\n expect(pos < after(pos)).toBe(true);\n expect(before(pos) < pos).toBe(true);\n expect(after(pos) > pos).toBe(true);\n expect(pos > before(pos)).toBe(true);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/position.test.ts", "start_line": null, "end_line": null, "dependencies": ["genPos"], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures that for any generated position `pos`, `before(pos)` produces a position less than `pos`, and `after(pos)` produces a position greater than `pos`.", "mode": "fast-check"} {"id": 60737, "name": "unknown", "code": "it(\"correct compares output of between\", () => {\n fc.assert(\n fc.property(\n genPosRange(),\n\n ([lo, hi]) => {\n const mid = between(lo, hi);\n expect(lo < mid).toBe(true);\n expect(mid < hi).toBe(true);\n expect(mid > lo).toBe(true);\n expect(hi > mid).toBe(true);\n }\n ),\n\n {\n examples: [\n // Found these as counter examples once, adding them here to prevent regressions in the future\n [[\"a\", \"a!\"] as Pos[]],\n [[\"a\", \"a !\"] as Pos[]],\n ],\n }\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/position.test.ts", "start_line": null, "end_line": null, "dependencies": ["genPosRange"], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `between` function generates a position between two given positions `lo` and `hi`, ensuring `lo < mid < hi` holds true.", "mode": "fast-check"} {"id": 60754, "name": "unknown", "code": "it(\"will only generate syntactically valid queries\", () =>\n fc.assert(\n fc.property(\n fc.dictionary(\n fc.string(),\n fc.oneof(\n fc.string(),\n fc.dictionary(fc.string(), fc.string(), { minKeys: 1 })\n ),\n { minKeys: 1 }\n ),\n fc.context(),\n\n (objValue, ctx) => {\n let query: string;\n try {\n query = objectToQuery(objValue);\n } catch {\n // If there was a parse error, we cannot assert anything reasonable\n // about the result\n return;\n }\n\n const fields = Object.fromEntries(\n Object.entries(objValue).flatMap(([k, v]) =>\n typeof v === \"string\" ? [[k, \"mixed\"] as const] : []\n )\n );\n const indexableFields = Object.fromEntries(\n Object.entries(objValue).flatMap(([k, v]) =>\n typeof v !== \"string\" ? [[k, \"mixed\"] as const] : []\n )\n );\n\n const parser = new QueryParser({\n fields,\n indexableFields,\n });\n\n ctx.log(`Generated query that did not parse was: \u2192${query}\u2190`);\n expect(() => parser.parse(query)).not.toThrow();\n }\n )\n ))", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/objectToQuery.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`objectToQuery` generates syntactically valid queries from dictionaries, ensuring they can be parsed without errors.", "mode": "fast-check"} {"id": 56648, "name": "unknown", "code": "it('should $binary-ify any DataAPIVectorLike and ignore the rest', () => {\n const arb = fc.oneof(\n fc.anything(),\n arbs.vector().map(v => v.asArray()),\n arbs.vector().map(v => v.asFloat32Array()),\n arbs.vector().map(v => ({ $binary: v.asBase64() })),\n arbs.vector(),\n );\n\n fc.assert(\n fc.property(arb, (anything) => {\n if (DataAPIVector.isVectorLike(anything)) {\n assert.deepStrictEqual(serdes.serialize({ $vector: anything }), [{ $vector: { $binary: vector(anything).asBase64() } }, false]);\n } else {\n assert.deepStrictEqual(serdes.serialize({ $vector: anything }), [{ $vector: anything }, false]);\n }\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/collections/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The serialization process should convert `DataAPIVectorLike` objects into a `$binary` format and leave non-vector-like objects unchanged.", "mode": "fast-check"} {"id": 56649, "name": "unknown", "code": "it('should deserialize number[]s into DataAPIVectors', () => {\n fc.assert(\n fc.property(arbs.vector(), (vector) => {\n assert.deepStrictEqual(serdes.deserialize({ $vector: vector.asArray() }, {}), { $vector: vector });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/collections/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Deserializes arrays of numbers into `DataAPIVectors` and ensures the deserialized result matches the original vector structure.", "mode": "fast-check"} {"id": 56650, "name": "unknown", "code": "it('should deserialize { $binary }s into DataAPIVectors', () => {\n fc.assert(\n fc.property(arbs.vector().map(v => v.asBase64()), (base64) => {\n assert.deepStrictEqual(serdes.deserialize({ $vector: { $binary: base64 } }, {}), { $vector: vector({ $binary: base64 }) });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/collections/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Deserialization of `{ $binary }` inputs should correctly yield `DataAPIVectors`.", "mode": "fast-check"} {"id": 56651, "name": "unknown", "code": "it('should serialize uuids properly', () => {\n fc.assert(\n fc.property(arbs.uuid(), (uuid) => {\n assert.deepStrictEqual(serdes.serialize(uuid), [{ $uuid: uuid.toString() }, false]);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/collections/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Serializing a UUID should result in an object with the UUID string under the key `$uuid` and a boolean value `false`.", "mode": "fast-check"} {"id": 56652, "name": "unknown", "code": "it('should deserialize uuids properly', () => {\n fc.assert(\n fc.property(arbs.uuid(), (uuid) => {\n assert.deepStrictEqual(serdes.deserialize({ $uuid: uuid.toString() }, {}), uuid);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/collections/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Deserializing an object with a `$uuid` key should return the original UUID.", "mode": "fast-check"} {"id": 60757, "name": "unknown", "code": "test(\"delete behaves just like a normal Map delete\", () => {\n fc.assert(\n fc.property(\n fc.array(fc.tuple(fc.string(), fc.anything())),\n fc.array(fc.string()),\n\n (tuples, keysToDelete) => {\n const expected = new Map(tuples);\n const actual = new DefaultMap(() => 0 as unknown, tuples);\n\n for (const key of keysToDelete) {\n expected.delete(key);\n actual.delete(key);\n }\n\n expect(new Map(actual)).toEqual(expected);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/DefaultMap.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Deleting keys from `DefaultMap` should yield the same result as doing so from a normal `Map`.", "mode": "fast-check"} {"id": 60758, "name": "unknown", "code": "test(\"SortedList.from() will sort the input and keep it sorted automatically (asc)\", () => {\n expect(Array.from(SortedList.from([3, 1, 2], asc))).toEqual([1, 2, 3]);\n expect(Array.from(SortedList.from([\"world\", \"hello\"], asc))).toEqual([\n \"hello\",\n \"world\",\n ]);\n expect(\n Array.from(\n SortedList.from(\n [{ id: 1 }, { id: 2 }, { id: -99 }],\n (a, b) => a.id < b.id\n )\n )\n ).toEqual([{ id: -99 }, { id: 1 }, { id: 2 }]);\n\n fc.assert(\n fc.property(\n fc.array(fc.nat()),\n\n (arr) => {\n const sortedArr = [...arr].sort((a, b) => a - b);\n expect(Array.from(SortedList.from(arr, asc))).toEqual(sortedArr);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/SortedList.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`SortedList.from()` sorts the input array automatically in ascending order, preserving the sorted order for numbers, strings, and objects with `id` properties.", "mode": "fast-check"} {"id": 60760, "name": "unknown", "code": "test(\"Static method .fromAlreadySorted won't sort (garbage in, garbage out)\", () => {\n expect(Array.from(SortedList.fromAlreadySorted([3, 1, 2], asc))).toEqual([\n 3, 1, 2,\n ]);\n expect(\n Array.from(SortedList.fromAlreadySorted([\"world\", \"hello\"], asc))\n ).toEqual([\"world\", \"hello\"]);\n\n fc.assert(\n fc.property(\n fc.array(fc.nat()),\n\n (arr) => {\n expect(Array.from(SortedList.fromAlreadySorted(arr, asc))).toEqual(\n arr\n );\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/SortedList.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`SortedList.fromAlreadySorted` returns the input array unchanged, even if it is not sorted.", "mode": "fast-check"} {"id": 60761, "name": "unknown", "code": "test(\"will keep a sorted list sorted, no matter what elements are added (asc)\", () => {\n fc.assert(\n fc.property(\n fc.array(fc.nat()),\n fc.array(fc.nat()),\n\n (input, valuesToAdd) => {\n const sortedList = SortedList.from(input, asc); // Our thing\n const jsSortedArr = [...input].sort((a, b) => a - b); // For comparison\n\n expect(Array.from(sortedList)).toEqual(jsSortedArr);\n for (const value of valuesToAdd) {\n jsSortedArr.push(value);\n jsSortedArr.sort((a, b) => a - b);\n\n sortedList.add(value);\n expect(Array.from(sortedList)).toEqual(jsSortedArr);\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/SortedList.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "A `SortedList` maintains its elements in ascending order, regardless of which elements are added.", "mode": "fast-check"} {"id": 60762, "name": "unknown", "code": "test(\"will keep a sorted list sorted, no matter what elements are added (desc)\", () => {\n fc.assert(\n fc.property(\n fc.array(fc.nat()),\n fc.array(fc.nat()),\n\n (input, valuesToAdd) => {\n const sortedList = SortedList.from(input, desc); // Our thing\n const jsDescSortedArr = [...input].sort((a, b) => b - a); // For comparison\n\n expect(Array.from(sortedList)).toEqual(jsDescSortedArr);\n for (const value of valuesToAdd) {\n jsDescSortedArr.push(value);\n jsDescSortedArr.sort((a, b) => b - a);\n\n sortedList.add(value);\n expect(Array.from(sortedList)).toEqual(jsDescSortedArr);\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/SortedList.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "SortedList maintains a descending order after adding elements, ensuring it matches the order produced by JavaScript's native sort function.", "mode": "fast-check"} {"id": 60763, "name": "unknown", "code": "test(\"test with more complex data structures (asc)\", () => {\n const thread = fc.record({ id: fc.nat(), updatedAt: fc.date() });\n\n fc.assert(\n fc.property(\n fc.array(thread, { maxLength: 10_000 }),\n fc.array(thread, { maxLength: 10_000 }),\n\n (threads, threadsToAdd) => {\n const sortedList = SortedList.from(\n threads,\n (t1, t2) => t1.updatedAt < t2.updatedAt\n ); // Our thing\n const jsSortedArr = [...threads].sort(\n (t1, t2) => t1.updatedAt.getTime() - t2.updatedAt.getTime()\n ); // For comparison\n\n expect(Array.from(sortedList)).toEqual(jsSortedArr);\n for (const newThread of threadsToAdd) {\n jsSortedArr.push(newThread);\n jsSortedArr.sort(\n (t1, t2) => t1.updatedAt.getTime() - t2.updatedAt.getTime()\n ); // For comparison\n\n sortedList.add(newThread);\n expect(Array.from(sortedList)).toEqual(jsSortedArr);\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/SortedList.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `SortedList` maintains ascending order of threads based on `updatedAt` when initially created and after adding new threads, matching JavaScript's array sorting.", "mode": "fast-check"} {"id": 60764, "name": "unknown", "code": "test(\"test with more complex data structures (desc)\", () => {\n const thread = fc.record({ id: fc.nat(), updatedAt: fc.date() });\n\n fc.assert(\n fc.property(\n fc.array(thread, { maxLength: 10_000 }),\n fc.array(thread, { maxLength: 10_000 }),\n\n (threads, threadsToAdd) => {\n const sortedList = SortedList.from(\n threads,\n (t1, t2) => t2.updatedAt < t1.updatedAt\n ); // Our thing\n const jsDescSortedArr = [...threads].sort(\n (t1, t2) => t2.updatedAt.getTime() - t1.updatedAt.getTime()\n ); // For comparison\n\n expect(Array.from(sortedList)).toEqual(jsDescSortedArr);\n for (const newThread of threadsToAdd) {\n jsDescSortedArr.push(newThread);\n jsDescSortedArr.sort(\n (t1, t2) => t2.updatedAt.getTime() - t1.updatedAt.getTime()\n ); // For comparison\n\n sortedList.add(newThread);\n expect(Array.from(sortedList)).toEqual(jsDescSortedArr);\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/SortedList.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`SortedList` maintains proper descending order of elements by comparing `updatedAt` dates, even after adding new elements.", "mode": "fast-check"} {"id": 60765, "name": "unknown", "code": "it(\"keys don't change\", () => {\n fc.assert(\n fc.property(\n objectWithoutProto(),\n\n (obj) => {\n const result = mapValues(obj, () => Math.random());\n expect(Object.keys(result)).toStrictEqual(Object.keys(obj));\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/palashgdev/liveblocks/packages/liveblocks-core/src/lib/__tests__/utils.test.ts", "start_line": null, "end_line": null, "dependencies": ["objectWithoutProto"], "repo": {"name": "palashgdev/liveblocks", "url": "https://github.com/palashgdev/liveblocks.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`mapValues` returns an object with the same keys as the input object, even when the `__proto__` property is removed.", "mode": "fast-check"} {"id": 60767, "name": "unknown", "code": "test('output dimensions match configuration', () => {\n fc.assert(\n fc.property(networkConfig(), (config) => {\n const network = new MockNeuralNetwork(\n config\n ) as any as any as any as any;\n const input = new Array(config?.inputSize).fill(0.5);\n const output = network.predict(input);\n\n expect(output).toHaveLength(config?.outputSize);\n })\n );\n })", "language": "typescript", "source_file": "./repos/mikkihugo/claude-code-zen/src/__tests__/unit/neural/property-based-tests.test.ts", "start_line": null, "end_line": null, "dependencies": ["networkConfig"], "repo": {"name": "mikkihugo/claude-code-zen", "url": "https://github.com/mikkihugo/claude-code-zen.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The output dimensions of a neural network should match the specified output size in the configuration.", "mode": "fast-check"} {"id": 56674, "name": "unknown", "code": "it('should create a new cursor with the initial page state unset if undefined', () => {\n fc.assert(\n fc.property(fc.string(), arbs.record(fc.anything()), (garbagePageState, oldOptions) => {\n const cursor = new CursorImpl(parent, null!, [{}, false], oldOptions);\n cursor['_currentPage'] = { nextPageState: 'some-page-state', result: [] };\n\n CursorDeltaAsserter\n .captureImmutDelta(cursor, () => cursor.initialPageState(garbagePageState).initialPageState(undefined))\n .assertDelta({ _currentPage: undefined });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/cursors/rerank-cursor.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Creating a new cursor with an undefined initial page state results in `_currentPage` being set to undefined.", "mode": "fast-check"} {"id": 56676, "name": "unknown", "code": "it('should return a brand new cursor with the same config', () => {\n const allArbs = [\n arbs.record(fc.anything()),\n arbs.record(fc.anything()),\n fc.func(fc.anything()),\n fc.array(fc.anything().map((x) => new RerankedResult(x, {}))),\n arbs.cursorState(),\n fc.nat(),\n fc.string(),\n ];\n\n fc.assert(\n fc.property(...allArbs, (filter, options, mapping, buffer, state, consumed, qs) => {\n const cursor = new CursorImpl(parent, null!, [filter, false], options, mapping);\n\n cursor['_currentPage'] = { nextPageState: qs, result: buffer };\n cursor['_state'] = state;\n cursor['_consumed'] = consumed;\n\n CursorDeltaAsserter\n .captureImmutDelta(cursor, () => {\n return cursor.clone();\n })\n .assertDelta({\n _currentPage: undefined,\n _state: 'idle',\n _consumed: 0,\n });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/cursors/rerank-cursor.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "A cloned `Cursor` should return as a new instance with the `_currentPage`, `_state`, and `_consumed` properties reset to specified default values.", "mode": "fast-check"} {"id": 60768, "name": "unknown", "code": "test('network info consistency', () => {\n fc.assert(\n fc.property(networkConfig(), (config) => {\n const network = new MockNeuralNetwork(\n config\n ) as any as any as any as any;\n const info = network.getInfo();\n\n // Input/output sizes should match config\n expect(info.numInputs).toBe(config?.inputSize);\n expect(info.numOutputs).toBe(config?.outputSize);\n\n // Layer count should be consistent\n expect(info.numLayers).toBe(config?.hiddenLayers.length + 2);\n\n // Total neurons should be positive\n expect(info.totalNeurons).toBeGreaterThan(0);\n\n // Memory usage should be reasonable\n expect(info.metrics.memoryUsage).toBeGreaterThan(0);\n expect(info.metrics.memoryUsage).toBeLessThan(1e9); // Less than 1GB\n })\n );\n })", "language": "typescript", "source_file": "./repos/mikkihugo/claude-code-zen/src/__tests__/unit/neural/property-based-tests.test.ts", "start_line": null, "end_line": null, "dependencies": ["networkConfig"], "repo": {"name": "mikkihugo/claude-code-zen", "url": "https://github.com/mikkihugo/claude-code-zen.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "A neural network's input/output sizes, layer count, total neurons, and memory usage should be consistent with its configuration settings.", "mode": "fast-check"} {"id": 56684, "name": "unknown", "code": "it('should create a new cursor with sort vector included', () => {\n fc.assert(\n fc.property(fc.constantFrom(undefined, true, false), arbs.record(fc.anything()), (include, oldOptions) => {\n const cursor = new CursorImpl(parent, null!, [{}, false], oldOptions);\n\n CursorInternalDeltaAsserter\n .captureImmutDelta(cursor._internal, () => cursor.includeSortVector(include)._internal)\n .assertDelta({ _options: { ...oldOptions, includeSortVector: include ?? true } });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/cursors/find-cursor.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Creating a new cursor should include the sort vector in its options, reflecting whether it is specified as undefined, true, or false.", "mode": "fast-check"} {"id": 56685, "name": "unknown", "code": "it('should create a new cursor with the initial page state set if a string', () => {\n fc.assert(\n fc.property(fc.string(), arbs.record(fc.anything()), (pageState, oldOptions) => {\n const cursor = new CursorImpl(parent, null!, [{}, false], oldOptions);\n\n CursorDeltaAsserter\n .captureImmutDelta(cursor, () => cursor.initialPageState(pageState))\n .assertDelta({ _currentPage: { nextPageState: pageState, result: [] } });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/cursors/find-cursor.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "A new cursor should be created with the initial page state set when the page state is a string, and this state should reflect in the cursor's current page configuration.", "mode": "fast-check"} {"id": 56686, "name": "unknown", "code": "it('should create a new cursor with the initial page state unset if undefined', () => {\n fc.assert(\n fc.property(fc.string(), arbs.record(fc.anything()), (garbagePageState, oldOptions) => {\n const cursor = new CursorImpl(parent, null!, [{}, false], oldOptions);\n cursor['_currentPage'] = { nextPageState: 'some-page-state', result: [] };\n\n CursorDeltaAsserter\n .captureImmutDelta(cursor, () => cursor.initialPageState(garbagePageState).initialPageState(undefined))\n .assertDelta({ _currentPage: undefined });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/cursors/find-cursor.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Creating a new cursor should result in the initial page state being unset when the page state is defined as undefined.", "mode": "fast-check"} {"id": 60769, "name": "unknown", "code": "test('parameter bounds validation', () => {\n fc.assert(\n fc.property(\n networkConfig(),\n fc.array(finiteFloat(), { minLength: 100, maxLength: 1000 }),\n (_config, weights) => {\n // All weights should be finite\n const allFinite = weights.every((w) => Number.isFinite(w));\n expect(allFinite).toBe(true);\n\n // Weights should be in reasonable range for training stability\n const allReasonable = weights.every((w) => Math.abs(w) < 100);\n expect(allReasonable).toBe(true);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mikkihugo/claude-code-zen/src/__tests__/unit/neural/property-based-tests.test.ts", "start_line": null, "end_line": null, "dependencies": ["networkConfig", "finiteFloat"], "repo": {"name": "mikkihugo/claude-code-zen", "url": "https://github.com/mikkihugo/claude-code-zen.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "All weights generated for a network configuration must be finite and within a reasonable range for training stability.", "mode": "fast-check"} {"id": 60771, "name": "unknown", "code": "test('normalization reversibility', () => {\n fc.assert(\n fc.property(\n fc.array(finiteFloat(), { minLength: 10, maxLength: 100 }),\n (data) => {\n // Skip if all values are the same (stdDev = 0)\n const unique = [...new Set(data)];\n fc.pre(unique.length > 1);\n\n const mean = data?.reduce((sum, x) => sum + x, 0) / data.length;\n const variance =\n data?.reduce((sum, x) => sum + (x - mean) ** 2, 0) / data.length;\n const stdDev = Math.sqrt(variance);\n\n const normalized = normalizeData(data);\n const denormalized = denormalizeData(normalized, mean, stdDev);\n\n // Original data should be approximately restored\n for (let i = 0; i < data.length; i++) {\n expect(denormalized[i]).toBeCloseTo(data?.[i], 5);\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mikkihugo/claude-code-zen/src/__tests__/unit/neural/property-based-tests.test.ts", "start_line": null, "end_line": null, "dependencies": ["finiteFloat", "normalizeData", "denormalizeData"], "repo": {"name": "mikkihugo/claude-code-zen", "url": "https://github.com/mikkihugo/claude-code-zen.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Normalizing and then denormalizing a set of floating-point numbers should approximately restore the original data, assuming the standard deviation is not zero.", "mode": "fast-check"} {"id": 60772, "name": "unknown", "code": "test('normalized data properties', () => {\n fc.assert(\n fc.property(\n fc.array(finiteFloat(), { minLength: 10, maxLength: 100 }),\n (data) => {\n const unique = [...new Set(data)];\n fc.pre(unique.length > 1); // Skip constant arrays\n\n const normalized = normalizeData(data);\n\n // Mean should be approximately 0\n const mean =\n normalized.reduce((sum, x) => sum + x, 0) / normalized.length;\n expect(Math.abs(mean)).toBeLessThan(1e-10);\n\n // Standard deviation should be approximately 1\n const variance =\n normalized.reduce((sum, x) => sum + (x - mean) ** 2, 0) /\n normalized.length;\n const stdDev = Math.sqrt(variance);\n expect(Math.abs(stdDev - 1.0)).toBeLessThan(1e-10);\n\n // All values should be finite\n expect(normalized.every((x) => Number.isFinite(x))).toBe(true);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mikkihugo/claude-code-zen/src/__tests__/unit/neural/property-based-tests.test.ts", "start_line": null, "end_line": null, "dependencies": ["finiteFloat", "normalizeData"], "repo": {"name": "mikkihugo/claude-code-zen", "url": "https://github.com/mikkihugo/claude-code-zen.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Normalized data should have a mean close to 0, a standard deviation close to 1, and all values should be finite.", "mode": "fast-check"} {"id": 60773, "name": "unknown", "code": "test('time series window generation correctness', () => {\n fc.assert(\n fc.property(\n fc.array(finiteFloat(), { minLength: 20, maxLength: 100 }),\n fc.integer({ min: 2, max: 10 }),\n fc.integer({ min: 1, max: 5 }),\n (data, windowSize, step) => {\n fc.pre(windowSize <= data.length);\n\n const windows = createTimeSeriesWindows(data, windowSize, step);\n\n // Each window should have correct size\n windows.forEach((window) => {\n expect(window).toHaveLength(windowSize);\n });\n\n // Window count should be correct\n const expectedCount =\n Math.floor((data.length - windowSize) / step) + 1;\n expect(windows.length).toBe(expectedCount);\n\n // Windows should contain correct subsequences\n for (let i = 0; i < windows.length; i++) {\n const startIndex = i * step;\n for (let j = 0; j < windowSize; j++) {\n expect(windows[i]?.[j]).toBe(data?.[startIndex + j]);\n }\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mikkihugo/claude-code-zen/src/__tests__/unit/neural/property-based-tests.test.ts", "start_line": null, "end_line": null, "dependencies": ["finiteFloat", "createTimeSeriesWindows"], "repo": {"name": "mikkihugo/claude-code-zen", "url": "https://github.com/mikkihugo/claude-code-zen.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`createTimeSeriesWindows` correctly generates windows of a specified size and step from input arrays, ensuring that each window contains the appropriate subsequences and matches the expected count.", "mode": "fast-check"} {"id": 60774, "name": "unknown", "code": "test('missing value handling consistency', () => {\n fc.assert(\n fc.property(\n fc.array(fc.oneof(finiteFloat(), fc.constant(Number.NaN)), {\n minLength: 5,\n maxLength: 50,\n }),\n fc.constantFrom('mean', 'zero', 'forward_fill'),\n (dataWithNaN, strategy) => {\n const result = handleMissingValues(dataWithNaN, strategy);\n\n // Result should have same length\n expect(result).toHaveLength(dataWithNaN.length);\n\n // No NaN values should remain\n expect(result?.every((x) => !Number.isNaN(x))).toBe(true);\n\n // All values should be finite\n expect(result?.every((x) => Number.isFinite(x))).toBe(true);\n\n // Non-NaN values should be preserved\n for (let i = 0; i < dataWithNaN.length; i++) {\n if (!Number.isNaN(dataWithNaN?.[i])) {\n expect(result?.[i]).toBe(dataWithNaN?.[i]);\n }\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mikkihugo/claude-code-zen/src/__tests__/unit/neural/property-based-tests.test.ts", "start_line": null, "end_line": null, "dependencies": ["finiteFloat", "handleMissingValues"], "repo": {"name": "mikkihugo/claude-code-zen", "url": "https://github.com/mikkihugo/claude-code-zen.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Handles missing values consistently by replacing NaNs using specified strategies, ensuring the result maintains the same length, contains no NaNs, consists of finite numbers, and preserves original non-NaN values.", "mode": "fast-check"} {"id": 60778, "name": "unknown", "code": "test('loss function properties', () => {\n fc.assert(\n fc.property(\n fc.array(smallFloat(), { minLength: 5, maxLength: 20 }),\n fc.array(smallFloat(), { minLength: 5, maxLength: 20 }),\n (predictions, targets) => {\n fc.pre(predictions.length === targets.length);\n\n // Mean Squared Error\n const mse =\n predictions.reduce(\n (sum, p, i) => sum + (p - targets?.[i]) ** 2,\n 0\n ) / predictions.length;\n\n expect(mse).toBeGreaterThanOrEqual(0);\n expect(Number.isFinite(mse)).toBe(true);\n\n // MSE should be 0 when predictions equal targets\n const identicalMse =\n predictions.reduce((sum, p) => sum + (p - p) ** 2, 0) /\n predictions.length;\n expect(identicalMse).toBeCloseTo(0, 10);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mikkihugo/claude-code-zen/src/__tests__/unit/neural/property-based-tests.test.ts", "start_line": null, "end_line": null, "dependencies": ["smallFloat"], "repo": {"name": "mikkihugo/claude-code-zen", "url": "https://github.com/mikkihugo/claude-code-zen.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The loss function ensures that the Mean Squared Error (MSE) is non-negative and finite, and it is zero when predictions are identical to targets.", "mode": "fast-check"} {"id": 56694, "name": "unknown", "code": "it('should return the raw records before any mapping', () => {\n fc.assert(\n fc.property(fc.array(fc.anything()), (buffer) => {\n const cursor = new CursorImpl(parent, null!, [{}, false]).map(() => untouchable());\n cursor['_currentPage'] = { nextPageState: null, result: [...buffer] as SomeDoc[] };\n const consumed = cursor.consumeBuffer();\n assert.deepStrictEqual(consumed, buffer);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/cursors/abstract-cursor.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The `CursorImpl` should return raw records from the buffer before any mapping is applied.", "mode": "fast-check"} {"id": 56696, "name": "unknown", "code": "it('should set the state to closed', () => {\n fc.assert(\n fc.property(arbs.cursorState(), (state) => {\n const cursor = new CursorImpl(parent, null!, [{}, false]);\n cursor['_state'] = state;\n\n DeltaAsserter\n .captureMutDelta(cursor, () => {\n cursor.close();\n })\n .assertDelta({\n _state: 'closed',\n });\n\n assert.strictEqual(cursor.state, 'closed');\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/cursors/abstract-cursor.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The test ensures that calling `close` on a `CursorImpl` sets its state to 'closed'.", "mode": "fast-check"} {"id": 60775, "name": "unknown", "code": "test('activation function bounds', () => {\n fc.assert(\n fc.property(finiteFloat(), (x) => {\n // Sigmoid bounds\n const sigmoid = 1 / (1 + Math.exp(-x));\n expect(sigmoid).toBeGreaterThanOrEqual(0);\n expect(sigmoid).toBeLessThanOrEqual(1);\n expect(Number.isFinite(sigmoid)).toBe(true);\n\n // Tanh bounds\n const tanh = Math.tanh(x);\n expect(tanh).toBeGreaterThanOrEqual(-1);\n expect(tanh).toBeLessThanOrEqual(1);\n expect(Number.isFinite(tanh)).toBe(true);\n\n // ReLU properties\n const relu = Math.max(0, x);\n expect(relu).toBeGreaterThanOrEqual(0);\n expect(Number.isFinite(relu)).toBe(true);\n })\n );\n })", "language": "typescript", "source_file": "./repos/mikkihugo/claude-code-zen/src/__tests__/unit/neural/property-based-tests.test.ts", "start_line": null, "end_line": null, "dependencies": ["finiteFloat"], "repo": {"name": "mikkihugo/claude-code-zen", "url": "https://github.com/mikkihugo/claude-code-zen.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that for finite float inputs, the sigmoid function output is in [0, 1], the tanh function output is in [-1, 1], and the ReLU function output is non-negative, with all outputs being finite.", "mode": "fast-check"} {"id": 60776, "name": "unknown", "code": "test('matrix operations stability', () => {\n fc.assert(\n fc.property(\n fc.array(smallFloat(), { minLength: 4, maxLength: 16 }),\n fc.array(smallFloat(), { minLength: 4, maxLength: 16 }),\n (a, b) => {\n // Simple element-wise operations\n fc.pre(a.length === b.length);\n\n const sum = a.map((x, i) => x + b[i]);\n const product = a.map((x, i) => x * b[i]);\n\n // Results should be finite\n expect(sum.every((x) => Number.isFinite(x))).toBe(true);\n expect(product.every((x) => Number.isFinite(x))).toBe(true);\n\n // Operation properties\n expect(sum).toHaveLength(a.length);\n expect(product).toHaveLength(a.length);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mikkihugo/claude-code-zen/src/__tests__/unit/neural/property-based-tests.test.ts", "start_line": null, "end_line": null, "dependencies": ["smallFloat"], "repo": {"name": "mikkihugo/claude-code-zen", "url": "https://github.com/mikkihugo/claude-code-zen.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Element-wise sums and products of two arrays of small floats should be finite and maintain the same length as the input arrays.", "mode": "fast-check"} {"id": 60777, "name": "unknown", "code": "test('gradient magnitude bounds', () => {\n fc.assert(\n fc.property(\n fc.array(smallFloat(), { minLength: 10, maxLength: 100 }),\n fc.float({ min: 0.001, max: 0.1 }),\n (weights, learningRate) => {\n // Simulate gradient computation\n const gradients = weights.map((w) => w * 0.1 * (Math.random() - 0.5));\n\n // Gradients should be finite\n expect(gradients.every((g) => Number.isFinite(g))).toBe(true);\n\n // Gradient magnitude should be reasonable\n const magnitude = Math.sqrt(\n gradients.reduce((sum, g) => sum + g * g, 0)\n );\n expect(magnitude).toBeLessThan(1000);\n\n // Weight updates should be stable\n const updatedWeights = weights.map(\n (w, i) => w - learningRate * gradients[i]\n );\n expect(updatedWeights.every((w) => Number.isFinite(w))).toBe(true);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mikkihugo/claude-code-zen/src/__tests__/unit/neural/property-based-tests.test.ts", "start_line": null, "end_line": null, "dependencies": ["smallFloat"], "repo": {"name": "mikkihugo/claude-code-zen", "url": "https://github.com/mikkihugo/claude-code-zen.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Tests the generation of finite gradient values, reasonable gradient magnitude, and finite weight updates given arrays of small floats representing weights and a learning rate.", "mode": "fast-check"} {"id": 56700, "name": "unknown", "code": "it('should match the root obj when the key is an empty string', () => {\n fc.assert(\n fc.property(arbs.jsonObj(), (obj) => {\n const codec = CodecsClass.forName('', {\n serialize: (v: any, ctx: BaseSerDesCtx) => ctx.done(JSON.stringify(v)),\n deserialize: (v: any, ctx: BaseSerDesCtx) => ctx.done(JSON.stringify(v)),\n });\n\n const serdes = mkSerDesWithCodecs([codec]);\n const expected = JSON.stringify(obj);\n\n assert.deepStrictEqual(serdes.serialize(obj), [expected, false]);\n assert.deepStrictEqual(serdes.deserialize(obj, { status: { projectionSchema: {} } }), expected);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/ser-des/for-name.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "When using an empty string as the key, the serialized and deserialized output of an object should match its JSON string representation.", "mode": "fast-check"} {"id": 60779, "name": "unknown", "code": "test('extreme input values', () => {\n fc.assert(\n fc.property(\n fc.array(\n fc.float({\n min: -1e6,\n max: 1e6,\n noNaN: true,\n noDefaultInfinity: true,\n }),\n {\n minLength: 1,\n maxLength: 10,\n }\n ),\n (extremeInputs) => {\n // Network should handle extreme values gracefully\n const config: NetworkConfig = {\n inputSize: extremeInputs.length,\n hiddenLayers: [{ size: 5, activation: 'sigmoid' }],\n outputSize: 3,\n outputActivation: 'sigmoid',\n };\n\n const network = new MockNeuralNetwork(config);\n const output = network.predict(extremeInputs);\n\n // Output should be finite and within bounds for sigmoid\n expect(output.every((x) => Number.isFinite(x))).toBe(true);\n expect(output.every((x) => x >= 0 && x <= 1)).toBe(true);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mikkihugo/claude-code-zen/src/__tests__/unit/neural/property-based-tests.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mikkihugo/claude-code-zen", "url": "https://github.com/mikkihugo/claude-code-zen.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The neural network should produce finite outputs within the range [0, 1] for extreme input values without NaN or infinity.", "mode": "fast-check"} {"id": 60780, "name": "unknown", "code": "test('malformed data resilience', () => {\n fc.assert(\n fc.property(\n fc.array(\n fc.oneof(\n finiteFloat(),\n fc.constant(Number.NaN),\n fc.constant(Number.POSITIVE_INFINITY),\n fc.constant(Number.NEGATIVE_INFINITY)\n ),\n { minLength: 5, maxLength: 20 }\n ),\n (malformedData) => {\n // Data cleaning should handle malformed inputs\n const cleanedData = malformedData?.map((x) =>\n Number.isFinite(x) ? x : 0\n );\n\n expect(cleanedData?.every((x) => Number.isFinite(x))).toBe(true);\n expect(cleanedData).toHaveLength(malformedData.length);\n\n // Missing value handling should work\n const withNaN = malformedData?.map((x) =>\n Number.isFinite(x) ? x : Number.NaN\n );\n const handled = handleMissingValues(withNaN, 'zero');\n\n expect(handled.every((x) => Number.isFinite(x))).toBe(true);\n expect(handled.every((x) => !Number.isNaN(x))).toBe(true);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mikkihugo/claude-code-zen/src/__tests__/unit/neural/property-based-tests.test.ts", "start_line": null, "end_line": null, "dependencies": ["finiteFloat", "handleMissingValues"], "repo": {"name": "mikkihugo/claude-code-zen", "url": "https://github.com/mikkihugo/claude-code-zen.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Ensures data cleaning replaces non-finite values with zero and `handleMissingValues` correctly fills missing numeric values, resulting in finite values throughout.", "mode": "fast-check"} {"id": 60781, "name": "unknown", "code": "test('distribution preservation in preprocessing', () => {\n fc.assert(\n fc.property(\n fc.array(fc.float({ min: -100, max: 100, noNaN: true }), {\n minLength: 50,\n maxLength: 200,\n }),\n (data) => {\n const unique = [...new Set(data)];\n fc.pre(unique.length > 10); // Ensure sufficient variance\n\n const normalized = normalizeData(data);\n\n // Check that relative ordering is preserved\n for (let i = 0; i < data.length - 1; i++) {\n for (let j = i + 1; j < data.length; j++) {\n const originalOrder = data?.[i] <= data?.[j];\n const normalizedOrder = normalized[i] <= normalized[j];\n expect(originalOrder).toBe(normalizedOrder);\n }\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mikkihugo/claude-code-zen/src/__tests__/unit/neural/property-based-tests.test.ts", "start_line": null, "end_line": null, "dependencies": ["normalizeData"], "repo": {"name": "mikkihugo/claude-code-zen", "url": "https://github.com/mikkihugo/claude-code-zen.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Normalized data maintains the relative ordering of the original data array.", "mode": "fast-check"} {"id": 60782, "name": "unknown", "code": "test('correlation preservation', () => {\n fc.assert(\n fc.property(\n fc.array(finiteFloat(), { minLength: 20, maxLength: 50 }),\n fc.float({ min: -2, max: 2 }),\n fc.float({ min: -10, max: 10 }),\n (baseData, correlation, offset) => {\n // Create correlated data\n const correlatedData = baseData?.map(\n (x) => correlation * x + offset + (Math.random() - 0.5) * 0.1\n );\n\n // Normalize both datasets\n const normalizedBase = normalizeData(baseData);\n const normalizedCorrelated = normalizeData(correlatedData);\n\n // Calculate correlation coefficients\n const originalCorr = calculateCorrelation(baseData, correlatedData);\n const normalizedCorr = calculateCorrelation(\n normalizedBase,\n normalizedCorrelated\n );\n\n // Normalization should preserve correlation (within tolerance)\n if (Math.abs(originalCorr) > 0.1) {\n // Only test when correlation is significant\n expect(Math.abs(originalCorr - normalizedCorr)).toBeLessThan(0.1);\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mikkihugo/claude-code-zen/src/__tests__/unit/neural/property-based-tests.test.ts", "start_line": null, "end_line": null, "dependencies": ["finiteFloat", "normalizeData", "calculateCorrelation"], "repo": {"name": "mikkihugo/claude-code-zen", "url": "https://github.com/mikkihugo/claude-code-zen.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Normalization of datasets should approximately preserve correlation, provided the original correlation is significant.", "mode": "fast-check"} {"id": 56718, "name": "unknown", "code": "test('generated', () => {\n fc.assert(\n fc.property(\n fcTsconfig({\n compilerRuleSet: rulesForGenerated,\n }),\n (config) => {\n const validator = new TypeScriptConfigValidator(TypeScriptConfigValidationRuleSet.GENERATED);\n validator.validate(config);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aws/jsii-compiler/test/tsconfig/tsconfig-validator.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aws/jsii-compiler", "url": "https://github.com/aws/jsii-compiler.git", "license": "Apache-2.0", "stars": 38, "forks": 18}, "metrics": null, "summary": "The `TypeScriptConfigValidator` validates configurations against the `GENERATED` rule set.", "mode": "fast-check"} {"id": 60783, "name": "unknown", "code": "test('alarm thresholds are valid numbers', () => {\n fc.assert(fc.property(\n arbitrary_input_intervals(),\n (intervals) => {\n const template = setupStepScaling(intervals);\n\n const lowerThreshold = template.lowerThreshold;\n const upperThreshold = template.upperThreshold;\n\n return reportFalse(\n (lowerThreshold === undefined || (lowerThreshold > 0 && lowerThreshold !== Infinity))\n && (upperThreshold === undefined || (upperThreshold > 0 && upperThreshold !== Infinity)),\n lowerThreshold,\n upperThreshold);\n },\n ));\n })", "language": "typescript", "source_file": "./repos/ackjewtn/aws-cdk/packages/aws-cdk-lib/aws-applicationautoscaling/test/step-scaling-policy.test.ts", "start_line": null, "end_line": null, "dependencies": ["setupStepScaling", "reportFalse"], "repo": {"name": "ackjewtn/aws-cdk", "url": "https://github.com/ackjewtn/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60784, "name": "unknown", "code": "test('generated step intervals are valid intervals', () => {\n fc.assert(fc.property(\n arbitrary_input_intervals(),\n (intervals) => {\n const template = setupStepScaling(intervals);\n const steps = template.allStepsAbsolute();\n\n return reportFalse(steps.every(step => {\n return step.MetricIntervalLowerBound! < step.MetricIntervalUpperBound!;\n }), steps, 'template', JSON.stringify(template, undefined, 2));\n },\n ));\n })", "language": "typescript", "source_file": "./repos/ackjewtn/aws-cdk/packages/aws-cdk-lib/aws-applicationautoscaling/test/step-scaling-policy.test.ts", "start_line": null, "end_line": null, "dependencies": ["setupStepScaling", "reportFalse"], "repo": {"name": "ackjewtn/aws-cdk", "url": "https://github.com/ackjewtn/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60785, "name": "unknown", "code": "test('generated step intervals are nonoverlapping', () => {\n fc.assert(fc.property(\n arbitrary_input_intervals(),\n (intervals) => {\n const template = setupStepScaling(intervals);\n const steps = template.allStepsAbsolute();\n\n for (let i = 0; i < steps.length; i++) {\n const compareTo = steps.slice(i + 1);\n if (compareTo.some(x => overlaps(steps[i], x))) {\n return reportFalse(false, steps);\n }\n }\n\n return true;\n },\n ), { verbose: true });\n })", "language": "typescript", "source_file": "./repos/ackjewtn/aws-cdk/packages/aws-cdk-lib/aws-applicationautoscaling/test/step-scaling-policy.test.ts", "start_line": null, "end_line": null, "dependencies": ["setupStepScaling", "overlaps", "reportFalse"], "repo": {"name": "ackjewtn/aws-cdk", "url": "https://github.com/ackjewtn/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60786, "name": "unknown", "code": "test('all template intervals occur in input array', () => {\n fc.assert(fc.property(\n arbitrary_input_intervals(),\n (intervals) => {\n const template = setupStepScaling(intervals);\n const steps = template.allStepsAbsolute();\n\n return steps.every(step => {\n return reportFalse(intervals.find(interval => {\n const acceptableLowerBounds = step.MetricIntervalLowerBound === -Infinity ? [undefined, 0] : [undefined, step.MetricIntervalLowerBound];\n // eslint-disable-next-line max-len\n const acceptableUpperBounds = step.MetricIntervalUpperBound === Infinity ? [undefined, Infinity] : [undefined, step.MetricIntervalUpperBound];\n\n return (acceptableLowerBounds.includes(interval.lower) && acceptableUpperBounds.includes(interval.upper));\n }) !== undefined, step, intervals);\n });\n },\n ));\n })", "language": "typescript", "source_file": "./repos/ackjewtn/aws-cdk/packages/aws-cdk-lib/aws-applicationautoscaling/test/step-scaling-policy.test.ts", "start_line": null, "end_line": null, "dependencies": ["setupStepScaling", "reportFalse"], "repo": {"name": "ackjewtn/aws-cdk", "url": "https://github.com/ackjewtn/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56730, "name": "unknown", "code": "it(\"should throw error if private key is not in the prime subgroup l\", async () => {\n await fc.assert(\n fc.asyncProperty(fc.bigInt({ min: L, max: r - 1n }), async (privKey: bigint) => {\n const error = await circuit.expectFail({ privKey });\n\n return error.includes(\"Assert Failed\");\n }),\n );\n })", "language": "typescript", "source_file": "./repos/krisoshea-eth/CipherVote/maci/packages/circuits/ts/__tests__/PrivToPubKey.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "krisoshea-eth/CipherVote", "url": "https://github.com/krisoshea-eth/CipherVote.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": "Private keys not in the prime subgroup should cause the circuit to throw an error indicating \"Assert Failed\".", "mode": "fast-check"} {"id": 60787, "name": "unknown", "code": "test('lower alarm uses lower policy', () => {\n fc.assert(fc.property(\n arbitrary_input_intervals(),\n (intervals) => {\n const template = setupStepScaling(intervals);\n const alarm = template.resource(template.lowerAlarm);\n fc.pre(alarm !== undefined);\n\n return reportFalse(alarm.Properties.AlarmActions[0].Ref === template.lowerPolicy, alarm);\n },\n ));\n })", "language": "typescript", "source_file": "./repos/ackjewtn/aws-cdk/packages/aws-cdk-lib/aws-applicationautoscaling/test/step-scaling-policy.test.ts", "start_line": null, "end_line": null, "dependencies": ["setupStepScaling", "reportFalse"], "repo": {"name": "ackjewtn/aws-cdk", "url": "https://github.com/ackjewtn/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60788, "name": "unknown", "code": "test('upper alarm uses upper policy', () => {\n fc.assert(fc.property(\n arbitrary_input_intervals(),\n (intervals) => {\n const template = setupStepScaling(intervals);\n const alarm = template.resource(template.upperAlarm);\n fc.pre(alarm !== undefined);\n\n return reportFalse(alarm.Properties.AlarmActions[0].Ref === template.upperPolicy, alarm);\n },\n ));\n })", "language": "typescript", "source_file": "./repos/ackjewtn/aws-cdk/packages/aws-cdk-lib/aws-applicationautoscaling/test/step-scaling-policy.test.ts", "start_line": null, "end_line": null, "dependencies": ["setupStepScaling", "reportFalse"], "repo": {"name": "ackjewtn/aws-cdk", "url": "https://github.com/ackjewtn/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60789, "name": "unknown", "code": "test('lower alarm index is lower than higher alarm index', () => {\n fc.assert(fc.property(\n arbitrary_complete_intervals(),\n (intervals) => {\n const alarms = findAlarmThresholds(intervals);\n\n return (alarms.lowerAlarmIntervalIndex === undefined\n || alarms.upperAlarmIntervalIndex === undefined\n || alarms.lowerAlarmIntervalIndex < alarms.upperAlarmIntervalIndex);\n },\n ));\n })", "language": "typescript", "source_file": "./repos/ackjewtn/aws-cdk/packages/aws-cdk-lib/aws-autoscaling-common/test/intervals.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "ackjewtn/aws-cdk", "url": "https://github.com/ackjewtn/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60790, "name": "unknown", "code": "test('never pick undefined intervals for relative alarms', () => {\n fc.assert(fc.property(\n arbitrary_complete_intervals(),\n (intervals) => {\n const alarms = findAlarmThresholds(intervals);\n\n return (alarms.lowerAlarmIntervalIndex === undefined || intervals[alarms.lowerAlarmIntervalIndex].change !== undefined)\n && (alarms.upperAlarmIntervalIndex === undefined || intervals[alarms.upperAlarmIntervalIndex].change !== undefined);\n },\n ));\n })", "language": "typescript", "source_file": "./repos/ackjewtn/aws-cdk/packages/aws-cdk-lib/aws-autoscaling-common/test/intervals.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "ackjewtn/aws-cdk", "url": "https://github.com/ackjewtn/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60791, "name": "unknown", "code": "test('pick intervals on either side of the undefined interval, if present', () => {\n fc.assert(fc.property(\n arbitrary_complete_intervals(),\n (intervals) => {\n // There must be an undefined interval and it must not be at the edges\n const i = intervals.findIndex(x => x.change === undefined);\n fc.pre(i > 0 && i < intervals.length - 1);\n\n const alarms = findAlarmThresholds(intervals);\n return (alarms.lowerAlarmIntervalIndex === i - 1 && alarms.upperAlarmIntervalIndex === i + 1);\n },\n ));\n })", "language": "typescript", "source_file": "./repos/ackjewtn/aws-cdk/packages/aws-cdk-lib/aws-autoscaling-common/test/intervals.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "ackjewtn/aws-cdk", "url": "https://github.com/ackjewtn/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60792, "name": "unknown", "code": "test('no picking upper bound infinity for lower alarm', () => {\n fc.assert(fc.property(\n arbitrary_complete_intervals(),\n (intervals) => {\n const alarms = findAlarmThresholds(intervals);\n fc.pre(alarms.lowerAlarmIntervalIndex !== undefined);\n\n return intervals[alarms.lowerAlarmIntervalIndex!].upper !== Infinity;\n },\n ));\n })", "language": "typescript", "source_file": "./repos/ackjewtn/aws-cdk/packages/aws-cdk-lib/aws-autoscaling-common/test/intervals.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "ackjewtn/aws-cdk", "url": "https://github.com/ackjewtn/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60793, "name": "unknown", "code": "test('no picking lower bound 0 for upper alarm', () => {\n fc.assert(fc.property(\n arbitrary_complete_intervals(),\n (intervals) => {\n const alarms = findAlarmThresholds(intervals);\n fc.pre(alarms.upperAlarmIntervalIndex !== undefined);\n\n return intervals[alarms.upperAlarmIntervalIndex!].lower !== 0;\n },\n ));\n })", "language": "typescript", "source_file": "./repos/ackjewtn/aws-cdk/packages/aws-cdk-lib/aws-autoscaling-common/test/intervals.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "ackjewtn/aws-cdk", "url": "https://github.com/ackjewtn/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60794, "name": "unknown", "code": "test('every aspect gets executed at most once on every construct', () =>\n fc.assert(\n fc.property(appWithAspects(), fc.boolean(), (app, stabilizeAspects) => {\n afterSynth((testApp) => {\n forEveryVisitPair(testApp.actionLog, (a, b) => {\n if (sameConstruct(a, b) && sameAspect(a, b)) {\n throw new Error(`Duplicate visit: t=${a.index} and t=${b.index}`);\n }\n });\n }, stabilizeAspects)(app);\n }),\n ),\n )", "language": "typescript", "source_file": "./repos/ackjewtn/aws-cdk/packages/aws-cdk-lib/core/test/aspect.prop.test.ts", "start_line": null, "end_line": null, "dependencies": ["appWithAspects", "afterSynth", "forEveryVisitPair", "sameConstruct", "sameAspect"], "repo": {"name": "ackjewtn/aws-cdk", "url": "https://github.com/ackjewtn/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60795, "name": "unknown", "code": "test('all aspects that exist at the start of synthesis get invoked on all nodes in its scope at the start of synthesis', () =>\n fc.assert(\n fc.property(appWithAspects(), fc.boolean(), (app, stabilizeAspects) => {\n const originalConstructsOnApp = app.cdkApp.node.findAll();\n const originalAspectApplications = getAllAspectApplications(originalConstructsOnApp);\n afterSynth((testApp) => {\n const visitsMap = getVisitsMap(testApp.actionLog);\n\n for (const aspectApplication of originalAspectApplications) {\n // Check that each original AspectApplication also visited all child nodes of its original scope:\n for (const construct of originalConstructsOnApp) {\n if (isAncestorOf(aspectApplication.construct, construct)) {\n if (!visitsMap.get(construct)!.includes(aspectApplication.aspect)) {\n throw new Error(`Aspect ${aspectApplication.aspect} applied on ${aspectApplication.construct.node.path} did not visit construct ${construct.node.path} in its original scope.`);\n }\n }\n }\n }\n }, stabilizeAspects)(app);\n }),\n ),\n )", "language": "typescript", "source_file": "./repos/ackjewtn/aws-cdk/packages/aws-cdk-lib/core/test/aspect.prop.test.ts", "start_line": null, "end_line": null, "dependencies": ["appWithAspects", "getAllAspectApplications", "afterSynth", "getVisitsMap", "isAncestorOf"], "repo": {"name": "ackjewtn/aws-cdk", "url": "https://github.com/ackjewtn/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60796, "name": "unknown", "code": "test('with stabilization, every aspect applied on the tree eventually executes on all of its nodes in scope', () =>\n fc.assert(\n fc.property(appWithAspects(), (app) => {\n afterSynth((testApp) => {\n const allConstructsOnApp = testApp.cdkApp.node.findAll();\n const allAspectApplications = getAllAspectApplications(allConstructsOnApp);\n const visitsMap = getVisitsMap(testApp.actionLog);\n\n for (const aspectApplication of allAspectApplications) {\n // Check that each AspectApplication also visited all child nodes of its scope:\n for (const construct of allConstructsOnApp) {\n if (isAncestorOf(aspectApplication.construct, construct)) {\n if (!visitsMap.get(construct)!.includes(aspectApplication.aspect)) {\n throw new Error(`Aspect ${aspectApplication.aspect.constructor.name} applied on ${aspectApplication.construct.node.path} did not visit construct ${construct.node.path} in its scope.`);\n }\n }\n }\n }\n }, true)(app);\n }),\n ),\n )", "language": "typescript", "source_file": "./repos/ackjewtn/aws-cdk/packages/aws-cdk-lib/core/test/aspect.prop.test.ts", "start_line": null, "end_line": null, "dependencies": ["appWithAspects", "afterSynth", "getAllAspectApplications", "getVisitsMap", "isAncestorOf"], "repo": {"name": "ackjewtn/aws-cdk", "url": "https://github.com/ackjewtn/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60797, "name": "unknown", "code": "test('inherited aspects get invoked before locally defined aspects, if both have the same priority', () =>\n fc.assert(\n fc.property(appWithAspects(), fc.boolean(), (app, stabilizeAspects) => {\n afterSynth((testApp) => {\n forEveryVisitPair(testApp.actionLog, (a, b) => {\n if (!sameConstruct(a, b)) return;\n if (aspectAppliedT(testApp, a.aspect, a.construct) !== -1 ||\n aspectAppliedT(testApp, b.aspect, b.construct) !== -1) return;\n\n const aPrio = lowestAspectPrioFor(a.aspect, a.construct);\n const bPrio = lowestAspectPrioFor(b.aspect, b.construct);\n\n if (!(aPrio == bPrio)) return;\n\n const aInherited = allAncestorAspects(a.construct).includes(a.aspect);\n const bInherited = allAncestorAspects(b.construct).includes(b.aspect);\n\n if (!(aInherited == true && bInherited == false)) return;\n\n if (!(a.index < b.index)) {\n throw new Error(\n `Aspect ${a.aspect}@${aPrio} at ${a.index} should have been before ${b.aspect}@${bPrio} at ${b.index}, but was after`,\n );\n }\n });\n }, stabilizeAspects)(app);\n }),\n ),\n )", "language": "typescript", "source_file": "./repos/ackjewtn/aws-cdk/packages/aws-cdk-lib/core/test/aspect.prop.test.ts", "start_line": null, "end_line": null, "dependencies": ["appWithAspects", "afterSynth", "forEveryVisitPair", "sameConstruct", "aspectAppliedT", "lowestAspectPrioFor", "allAncestorAspects"], "repo": {"name": "ackjewtn/aws-cdk", "url": "https://github.com/ackjewtn/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56741, "name": "unknown", "code": "it(`should check the computation of correct merkle root (level ${level + 1}) [fuzz]`, async () => {\n await fc.assert(\n fc.asyncProperty(generateLeaves(level + 1), async (leaves: bigint[]) => quinCheckRootTest(leaves)),\n );\n })", "language": "typescript", "source_file": "./repos/krisoshea-eth/CipherVote/maci/packages/circuits/ts/__tests__/IncrementalQuinaryTree.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "krisoshea-eth/CipherVote", "url": "https://github.com/krisoshea-eth/CipherVote.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": "The test ensures that generating leaves for a Merkle tree and computing its root verifies the correctness of the root calculation at a specified level.", "mode": "fast-check"} {"id": 60798, "name": "unknown", "code": "test('for every construct, lower priorities go before higher priorities', () =>\n fc.assert(\n fc.property(appWithAspects(), fc.boolean(), (app, stabilizeAspects) => {\n afterSynth((testApp) => {\n forEveryVisitPair(testApp.actionLog, (a, b) => {\n if (!sameConstruct(a, b)) return;\n if (aspectAppliedT(testApp, a.aspect, a.construct) !== -1 ||\n aspectAppliedT(testApp, b.aspect, b.construct) !== -1) return;\n\n const aPrio = lowestAspectPrioFor(a.aspect, a.construct);\n const bPrio = lowestAspectPrioFor(b.aspect, b.construct);\n\n // But only if the application of aspect A exists at least as long as the application of aspect B\n const aAppliedT = aspectAppliedT(testApp, a.aspect, a.construct);\n const bAppliedT = aspectAppliedT(testApp, b.aspect, b.construct);\n\n if (!implies(aPrio < bPrio && aAppliedT <= bAppliedT, a.index < b.index)) {\n throw new Error(\n `Aspect ${a.aspect}@${aPrio} at ${a.index} should have been before ${b.aspect}@${bPrio} at ${b.index}, but was after`,\n );\n }\n });\n }, stabilizeAspects)(app);\n }),\n ),\n )", "language": "typescript", "source_file": "./repos/ackjewtn/aws-cdk/packages/aws-cdk-lib/core/test/aspect.prop.test.ts", "start_line": null, "end_line": null, "dependencies": ["appWithAspects", "afterSynth", "forEveryVisitPair", "sameConstruct", "aspectAppliedT", "lowestAspectPrioFor", "implies"], "repo": {"name": "ackjewtn/aws-cdk", "url": "https://github.com/ackjewtn/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60799, "name": "unknown", "code": "test('for every construct, if a invokes before b that must mean it is of equal or lower priority', () =>\n fc.assert(\n fc.property(appWithAspects(), fc.boolean(), (app, stabilizeAspects) => {\n afterSynth((testApp) => {\n forEveryVisitPair(testApp.actionLog, (a, b) => {\n if (!sameConstruct(a, b)) return;\n if (aspectAppliedT(testApp, a.aspect, a.construct) !== -1 ||\n aspectAppliedT(testApp, b.aspect, b.construct) !== -1) return;\n\n const aPrio = lowestAspectPrioFor(a.aspect, a.construct);\n const bPrio = lowestAspectPrioFor(b.aspect, b.construct);\n\n if (!implies(a.index < b.index, aPrio <= bPrio)) {\n throw new Error(\n `Aspect ${a.aspect}@${aPrio} at ${a.index} should have been before ${b.aspect}@${bPrio} at ${b.index}, but was after`,\n );\n }\n });\n }, stabilizeAspects)(app);\n }),\n ),\n )", "language": "typescript", "source_file": "./repos/ackjewtn/aws-cdk/packages/aws-cdk-lib/core/test/aspect.prop.test.ts", "start_line": null, "end_line": null, "dependencies": ["appWithAspects", "afterSynth", "forEveryVisitPair", "sameConstruct", "aspectAppliedT", "lowestAspectPrioFor", "implies"], "repo": {"name": "ackjewtn/aws-cdk", "url": "https://github.com/ackjewtn/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60800, "name": "unknown", "code": "test('visitLog is nonempty', () =>\n fc.assert(\n fc.property(appWithAspects(), fc.boolean(), (app, stabilizeAspects) => {\n afterSynth((testApp) => {\n expect(testApp.actionLog).not.toEqual([]);\n }, stabilizeAspects)(app);\n }),\n ),\n)", "language": "typescript", "source_file": "./repos/ackjewtn/aws-cdk/packages/aws-cdk-lib/core/test/aspect.prop.test.ts", "start_line": null, "end_line": null, "dependencies": ["appWithAspects", "afterSynth"], "repo": {"name": "ackjewtn/aws-cdk", "url": "https://github.com/ackjewtn/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60801, "name": "unknown", "code": "test('LinkedQueue behaves the same as array', () => {\n // define the possible commands and their inputs\n const allCommands = [\n fc.string().map((v) => new PushCommand(v)),\n fc.constant(new ShiftCommand()),\n ];\n\n // run everything\n fc.assert(\n fc.property(fc.commands(allCommands, { size: '+1' }), (cmds) => {\n const s = () => ({\n model: { array: [] } satisfies Model,\n real: new LinkedQueue(),\n });\n fc.modelRun(s, cmds);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/ackjewtn/aws-cdk/packages/aws-cdk-lib/core/test/private/linked-queue.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "ackjewtn/aws-cdk", "url": "https://github.com/ackjewtn/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60802, "name": "unknown", "code": "asyncTest(async () => {\n const stack = new Stack();\n fc.assert(\n fc.property(\n fc.string(), anyValue,\n (delimiter, value) => _.isEqual(stack.resolve(Fn.join(delimiter, [value as string])), value),\n ),\n { verbose: true },\n );\n })", "language": "typescript", "source_file": "./repos/ackjewtn/aws-cdk/packages/aws-cdk-lib/core/test/fn.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "ackjewtn/aws-cdk", "url": "https://github.com/ackjewtn/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60803, "name": "unknown", "code": "asyncTest(async () => {\n const stack = new Stack();\n fc.assert(\n fc.property(\n fc.string(), fc.array(nonEmptyString, { minLength: 1, maxLength: 15 }),\n (delimiter, values) => stack.resolve(Fn.join(delimiter, values)) === values.join(delimiter),\n ),\n { verbose: true },\n );\n })", "language": "typescript", "source_file": "./repos/ackjewtn/aws-cdk/packages/aws-cdk-lib/core/test/fn.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "ackjewtn/aws-cdk", "url": "https://github.com/ackjewtn/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60804, "name": "unknown", "code": "asyncTest(async () => {\n const stack = new Stack();\n fc.assert(\n fc.property(\n fc.string(), fc.array(nonEmptyString, { minLength: 1, maxLength: 3 }), tokenish, fc.array(nonEmptyString, { minLength: 1, maxLength: 3 }),\n (delimiter, prefix, obj, suffix) =>\n _.isEqual(stack.resolve(Fn.join(delimiter, [...prefix, stringToken(obj), ...suffix])),\n { 'Fn::Join': [delimiter, [prefix.join(delimiter), obj, suffix.join(delimiter)]] }),\n ),\n { verbose: true },\n );\n })", "language": "typescript", "source_file": "./repos/ackjewtn/aws-cdk/packages/aws-cdk-lib/core/test/fn.test.ts", "start_line": null, "end_line": null, "dependencies": ["stringToken"], "repo": {"name": "ackjewtn/aws-cdk", "url": "https://github.com/ackjewtn/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60805, "name": "unknown", "code": "asyncTest(async () => {\n const stack = new Stack();\n fc.assert(\n fc.property(\n fc.string(), fc.array(anyValue),\n fc.array(anyValue, { minLength: 1, maxLength: 3 }),\n fc.array(anyValue),\n (delimiter, prefix, nested, suffix) =>\n // Gonna test\n _.isEqual(stack.resolve(Fn.join(delimiter, [...prefix as string[], Fn.join(delimiter, nested as string[]), ...suffix as string[]])),\n stack.resolve(Fn.join(delimiter, [...prefix as string[], ...nested as string[], ...suffix as string[]]))),\n ),\n { verbose: true },\n );\n })", "language": "typescript", "source_file": "./repos/ackjewtn/aws-cdk/packages/aws-cdk-lib/core/test/fn.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "ackjewtn/aws-cdk", "url": "https://github.com/ackjewtn/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60806, "name": "unknown", "code": "asyncTest(async () => {\n const stack = new Stack();\n fc.assert(\n fc.property(\n fc.string(), fc.string(),\n fc.array(anyValue, { minLength: 1, maxLength: 3 }),\n fc.array(tokenish, { minLength: 2, maxLength: 3 }),\n fc.array(anyValue, { minLength: 3 }),\n (delimiter1, delimiter2, prefix, nested, suffix) => {\n fc.pre(delimiter1 !== delimiter2);\n const join = Fn.join(delimiter1, [...prefix as string[], Fn.join(delimiter2, stringListToken(nested)), ...suffix as string[]]);\n const resolved = stack.resolve(join);\n return resolved['Fn::Join'][1].find((e: any) => typeof e === 'object'\n && ('Fn::Join' in e)\n && e['Fn::Join'][0] === delimiter2) != null;\n },\n ),\n { verbose: true },\n );\n })", "language": "typescript", "source_file": "./repos/ackjewtn/aws-cdk/packages/aws-cdk-lib/core/test/fn.test.ts", "start_line": null, "end_line": null, "dependencies": ["stringListToken"], "repo": {"name": "ackjewtn/aws-cdk", "url": "https://github.com/ackjewtn/aws-cdk.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56750, "name": "unknown", "code": "test(\"Property-based testing (fast-check)\", () => {\n type Boundaries = {\n min: number;\n max: number;\n };\n\n const minmax =\n ({ min, max }: Boundaries) =>\n (n: number): number =>\n Math.min(max, Math.max(min, n));\n\n fc.assert(\n fc.property(fc.integer(), (n): boolean => {\n const result = minmax({ min: 1, max: 10 })(n);\n return 1 <= result && result <= 10;\n })\n );\n})", "language": "typescript", "source_file": "./repos/Lghova/Kata-Practice/src/index.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Lghova/Kata-Practice", "url": "https://github.com/Lghova/Kata-Practice.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56751, "name": "unknown", "code": "it(\"return the same value\", () => {\n fc.assert(\n fc.property(fc.tuple(fc.integer({ min: 0 }), fc.integer({ min: 0, max: 99999999 })), (v) => {\n const strV = removeTrailingZerosExceptOne(`${v[0]}.${v[1]}`);\n\n const bv = parseBigInt(strV);\n const r = formatBigInt(bv);\n expect(r).toStrictEqual(strV);\n })\n );\n })", "language": "typescript", "source_file": "./repos/pasteque-org/libjs/tests/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "pasteque-org/libjs", "url": "https://github.com/pasteque-org/libjs.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56752, "name": "unknown", "code": "it('Timestamp to DateTime', async () => {\n const dateTimeContract = await loadFixture(fixture)\n\n await fc.assert(\n fc.asyncProperty(\n fc.integer().filter((x) => x >= 0),\n async (timestamp) => {\n const dateTime = await dateTimeContract.timestampToDateTime(timestamp)\n const date = new Date(timestamp * 1_000)\n\n expect(dateTime.year.toNumber()).equal(date.getUTCFullYear())\n expect(dateTime.month.toNumber()).equal(date.getUTCMonth() + 1)\n expect(dateTime.day.toNumber()).equal(date.getUTCDate())\n expect(dateTime.hour.toNumber()).equal(date.getUTCHours())\n expect(dateTime.minute.toNumber()).equal(date.getUTCMinutes())\n expect(dateTime.second.toNumber()).equal(date.getUTCSeconds())\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/LLMAudit/LLMSmartAuditTool/evaluation/benchmark/Realworld/96/Timeswap/Convenience/test/convenience/libraries/DateTime.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "LLMAudit/LLMSmartAuditTool", "url": "https://github.com/LLMAudit/LLMSmartAuditTool.git", "license": "Apache-2.0", "stars": 29, "forks": 10}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56753, "name": "unknown", "code": "it('Timestamp to DateTime', async () => {\n const dateTimeContract = await loadFixture(fixture)\n\n await fc.assert(\n fc.asyncProperty(\n fc.integer().filter((x) => x >= 0),\n async (timestamp) => {\n const dateTime = await dateTimeContract.timestampToDateTime(timestamp)\n const date = new Date(timestamp * 1_000)\n\n expect(dateTime.year.toNumber()).equal(date.getUTCFullYear())\n expect(dateTime.month.toNumber()).equal(date.getUTCMonth() + 1)\n expect(dateTime.day.toNumber()).equal(date.getUTCDate())\n expect(dateTime.hour.toNumber()).equal(date.getUTCHours())\n expect(dateTime.minute.toNumber()).equal(date.getUTCMinutes())\n expect(dateTime.second.toNumber()).equal(date.getUTCSeconds())\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/LLMAudit/LLMSmartAuditTool/evaluation/benchmark/Realworld/74/Timeswap/Timeswap-V1-Convenience/test/convenience/libraries/DateTime.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "LLMAudit/LLMSmartAuditTool", "url": "https://github.com/LLMAudit/LLMSmartAuditTool.git", "license": "Apache-2.0", "stars": 29, "forks": 10}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56754, "name": "unknown", "code": "it('child transactions should always have a parent_id', async () => {\n await fc.assert(\n fc\n .asyncProperty(fc.array(messageArb, { maxLength: 100 }), async msgs => {\n const tracer = execTracer();\n tracer.start();\n const cleanup = addSyncListener((oldValues, newValues) => {\n const ts = newValues.get('transactions') as Map<\n string,\n { isChild: number; parent_id: string | null; id: string }\n >;\n if (\n ts &&\n [...ts.values()].find(\n t =>\n t.isChild === 1 && t.parent_id == null && t.id.includes('/'),\n )\n ) {\n } else {\n tracer.event('applied');\n }\n });\n\n await sendMessages(msgs);\n await tracer.expect('applied');\n\n const transactions = await db.all(\n 'SELECT * FROM transactions',\n [],\n );\n for (const trans of transactions) {\n const transMsgs = msgs\n .filter(msg => msg.row === trans.id)\n .sort((m1, m2) => {\n const t1 = m1.timestamp.toString();\n const t2 = m2.timestamp.toString();\n if (t1 < t2) {\n return 1;\n } else if (t1 > t2) {\n return -1;\n }\n return 0;\n });\n const msg = transMsgs.find(m => m.column === 'parent_id');\n\n if (\n trans.isChild === 1 &&\n trans.id.includes('/') &&\n (msg == null || msg.value == null)\n ) {\n // This is a child transaction didn't have a `parent_id`\n // set in the messages. It should have gotten set from\n // the `id`\n const [parentId] = trans.id.split('/');\n expect(parentId).not.toBe(null);\n expect(trans.parent_id).toBe(parentId);\n } else if (msg) {\n // At least one message set `parent_id`\n expect(trans.parent_id).toBe(msg.value);\n } else {\n // `parent_id` should never have been set\n expect(trans.parent_id).toBe(null);\n }\n }\n\n cleanup();\n tracer.end();\n })\n .beforeEach(() => {\n return db.execQuery(`DELETE FROM transactions`);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/actualbudget/actual/packages/loot-core/src/server/sync/migrate.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "actualbudget/actual", "url": "https://github.com/actualbudget/actual.git", "license": "MIT", "stars": 20189, "forks": 1634}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56755, "name": "unknown", "code": "it('queries with `splits: inline` returns only non-parents', async () => {\n await fc.assert(\n fc.asyncProperty(\n arbs.makeTransactionArray({\n splitFreq: 2,\n minLength: 2,\n maxLength: 20,\n }),\n async arr => {\n await insertTransactions(arr);\n\n const { data } = await aqlQuery(\n q('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .options({ splits: 'inline' })\n .serialize(),\n );\n\n expect(data.filter(t => t.is_parent).length).toBe(0);\n expect(data.filter(t => t.tombstone).length).toBe(0);\n\n const { data: defaultData } = await aqlQuery(\n q('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .serialize(),\n );\n\n // inline should be the default\n expect(defaultData).toEqual(data);\n },\n ),\n { numRuns: 50 },\n );\n })", "language": "typescript", "source_file": "./repos/actualbudget/actual/packages/loot-core/src/server/aql/schema/executors.test.ts", "start_line": null, "end_line": null, "dependencies": ["insertTransactions"], "repo": {"name": "actualbudget/actual", "url": "https://github.com/actualbudget/actual.git", "license": "MIT", "stars": 20189, "forks": 1634}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56756, "name": "unknown", "code": "it('queries with `splits: none` returns only parents', async () => {\n await fc.assert(\n fc.asyncProperty(\n arbs.makeTransactionArray({\n splitFreq: 2,\n minLength: 2,\n maxLength: 8,\n }),\n async arr => {\n await insertTransactions(arr);\n\n const { data } = await aqlQuery(\n q('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .options({ splits: 'none' })\n .serialize(),\n );\n\n expect(data.filter(t => t.is_child).length).toBe(0);\n },\n ),\n { numRuns: 50 },\n );\n })", "language": "typescript", "source_file": "./repos/actualbudget/actual/packages/loot-core/src/server/aql/schema/executors.test.ts", "start_line": null, "end_line": null, "dependencies": ["insertTransactions"], "repo": {"name": "actualbudget/actual", "url": "https://github.com/actualbudget/actual.git", "license": "MIT", "stars": 20189, "forks": 1634}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56757, "name": "unknown", "code": "it('aggregate queries work with `splits: grouped`', async () => {\n const payeeIds = ['payee1', 'payee2', 'payee3', 'payee4', 'payee5'];\n\n await fc.assert(\n fc\n .asyncProperty(\n arbs.makeTransactionArray({ splitFreq: 2, payeeIds, maxLength: 100 }),\n async arr => {\n await insertTransactions(arr, payeeIds);\n\n const aggQuery = q('transactions')\n .filter({\n $or: [{ amount: { $lt: -5 } }, { amount: { $gt: -2 } }],\n 'payee.name': { $gt: '' },\n })\n .options({ splits: 'grouped' })\n .calculate({ $sum: '$amount' });\n\n const { data } = await aqlQuery(aggQuery.serialize());\n\n const sum = aliveTransactions(arr).reduce((sum, trans) => {\n const amount = trans.amount || 0;\n const matched =\n (amount < -5 || amount > -2) && trans.payee != null;\n if (!trans.tombstone && !trans.is_parent && matched) {\n return sum + amount;\n }\n return sum;\n }, 0);\n\n expect(data).toBe(sum);\n },\n )\n .beforeEach(() => {\n setClock(null);\n setSyncingMode('import');\n return db.execQuery(`\n DELETE FROM transactions;\n DELETE FROM payees;\n DELETE FROM payee_mapping;\n `);\n }),\n );\n }, 20_000)", "language": "typescript", "source_file": "./repos/actualbudget/actual/packages/loot-core/src/server/aql/schema/executors.test.ts", "start_line": null, "end_line": null, "dependencies": ["insertTransactions", "aliveTransactions"], "repo": {"name": "actualbudget/actual", "url": "https://github.com/actualbudget/actual.git", "license": "MIT", "stars": 20189, "forks": 1634}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56758, "name": "unknown", "code": "describe('transaction executors', () => {\n it('queries with `splits: inline` returns only non-parents', async () => {\n await fc.assert(\n fc.asyncProperty(\n arbs.makeTransactionArray({\n splitFreq: 2,\n minLength: 2,\n maxLength: 20,\n }),\n async arr => {\n await insertTransactions(arr);\n\n const { data } = await aqlQuery(\n q('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .options({ splits: 'inline' })\n .serialize(),\n );\n\n expect(data.filter(t => t.is_parent).length).toBe(0);\n expect(data.filter(t => t.tombstone).length).toBe(0);\n\n const { data: defaultData } = await aqlQuery(\n q('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .serialize(),\n );\n\n // inline should be the default\n expect(defaultData).toEqual(data);\n },\n ),\n { numRuns: 50 },\n );\n });\n\n it('queries with `splits: none` returns only parents', async () => {\n await fc.assert(\n fc.asyncProperty(\n arbs.makeTransactionArray({\n splitFreq: 2,\n minLength: 2,\n maxLength: 8,\n }),\n async arr => {\n await insertTransactions(arr);\n\n const { data } = await aqlQuery(\n q('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .options({ splits: 'none' })\n .serialize(),\n );\n\n expect(data.filter(t => t.is_child).length).toBe(0);\n },\n ),\n { numRuns: 50 },\n );\n });\n\n it('aggregate queries work with `splits: grouped`', async () => {\n const payeeIds = ['payee1', 'payee2', 'payee3', 'payee4', 'payee5'];\n\n await fc.assert(\n fc\n .asyncProperty(\n arbs.makeTransactionArray({ splitFreq: 2, payeeIds, maxLength: 100 }),\n async arr => {\n await insertTransactions(arr, payeeIds);\n\n const aggQuery = q('transactions')\n .filter({\n $or: [{ amount: { $lt: -5 } }, { amount: { $gt: -2 } }],\n 'payee.name': { $gt: '' },\n })\n .options({ splits: 'grouped' })\n .calculate({ $sum: '$amount' });\n\n const { data } = await aqlQuery(aggQuery.serialize());\n\n const sum = aliveTransactions(arr).reduce((sum, trans) => {\n const amount = trans.amount || 0;\n const matched =\n (amount < -5 || amount > -2) && trans.payee != null;\n if (!trans.tombstone && !trans.is_parent && matched) {\n return sum + amount;\n }\n return sum;\n }, 0);\n\n expect(data).toBe(sum);\n },\n )\n .beforeEach(() => {\n setClock(null);\n setSyncingMode('import');\n return db.execQuery(`\n DELETE FROM transactions;\n DELETE FROM payees;\n DELETE FROM payee_mapping;\n `);\n }),\n );\n }, 20_000);\n\n function runTest(makeQuery) {\n const payeeIds = ['payee1', 'payee2', 'payee3', 'payee4', 'payee5'];\n\n async function check(arr) {\n const orderFields = ['payee.name', 'amount', 'id'];\n\n // Insert transactions and get a list of all the alive\n // ones to make it easier to check the data later (don't\n // have to always be filtering out dead ones)\n await insertTransactions(arr, payeeIds);\n const allTransactions = aliveTransactions(arr);\n\n // Query time\n const { query, expectedIds, expectedMatchedIds } = makeQuery(arr);\n\n // First to a query without order to make sure the default\n // order works\n const { data: defaultOrderData } = await aqlQuery(query.serialize());\n expectTransactionOrder(defaultOrderData);\n expect(new Set(defaultOrderData.map(t => t.id))).toEqual(expectedIds);\n\n // Now do the full test, and add a custom order to make\n // sure that doesn't effect anything\n const orderedQuery = query.orderBy(orderFields);\n const { data } = await aqlQuery(orderedQuery.serialize());\n expect(new Set(data.map(t => t.id))).toEqual(expectedIds);\n\n // Validate paging and ordering\n await expectPagedData(orderedQuery, arr.length, data);\n expectTransactionOrder(data, orderFields);\n\n const matchedIds = new Set();\n\n // Check that all the subtransactions were returned\n for (const trans of data) {\n expect(trans.tombstone).toBe(false);\n\n if (expectedMatchedIds) {\n if (!trans._unmatched) {\n expect(expectedMatchedIds.has(trans.id)).toBe(true);\n matchedIds.add(trans.id);\n } else {\n expect(expectedMatchedIds.has(trans.id)).not.toBe(true);\n }\n }\n\n if (trans.is_parent) {\n // Parent transactions should never have a category\n expect(trans.category).toBe(null);\n\n expect(trans.subtransactions.length).toBe(\n allTransactions.filter(t => t.parent_id === trans.id).length,\n );\n\n // Subtransactions should be ordered as well\n expectTransactionOrder(trans.subtransactions, orderFields);\n\n trans.subtransactions.forEach(subtrans => {\n expect(subtrans.tombstone).toBe(false);\n\n if (expectedMatchedIds) {\n if (!subtrans._unmatched) {\n expect(expectedMatchedIds.has(subtrans.id)).toBe(true);\n matchedIds.add(subtrans.id);\n } else {\n expect(expectedMatchedIds.has(subtrans.id)).not.toBe(true);\n }\n }\n });\n }\n }\n\n if (expectedMatchedIds) {\n // Check that transactions that should be matched are\n // marked as such\n expect(matchedIds).toEqual(expectedMatchedIds);\n }\n }\n\n return fc.assert(\n fc\n .asyncProperty(\n arbs.makeTransactionArray({\n splitFreq: 0.1,\n payeeIds,\n maxLength: 100,\n }),\n check,\n )\n .beforeEach(() => {\n setClock(null);\n setSyncingMode('import');\n return db.execQuery(`\n DELETE FROM transactions;\n DELETE FROM payees;\n DELETE FROM payee_mapping;\n `);\n }),\n { numRuns: 300 },\n );\n }\n\n it('queries the correct transactions without filters', async () => {\n return runTest(arr => {\n const expectedIds = new Set(\n arr.filter(t => !t.tombstone && !t.is_child).map(t => t.id),\n );\n\n // Even though we're applying some filters, these are always\n // guaranteed to return the full split transaction so they\n // should take the optimized path\n const happyQuery = q('transactions')\n .filter({\n date: { $gt: '2017-01-01' },\n })\n .options({ splits: 'grouped' })\n .select(['*', 'payee.name']);\n\n // Make sure it's actually taking the happy path\n expect(isHappyPathQuery(happyQuery.serialize())).toBe(true);\n\n return {\n expectedIds,\n query: happyQuery,\n };\n });\n }, 20_000);\n\n it(`queries the correct transactions with a filter`, async () => {\n return runTest(arr => {\n const expectedIds = new Set();\n\n // let parents = toGroup(\n // arr.filter(t => t.is_parent),\n // new Map(Object.entries(groupById(arr.filter(t => t.parent_id))))\n // );\n\n const parents = groupById(arr.filter(t => t.is_parent && !t.tombstone));\n const matched = new Set();\n\n // Pick out some ids to query\n let ids = arr.reduce((ids, trans, idx) => {\n if (idx % 2 === 0) {\n const amount = trans.amount == null ? 0 : trans.amount;\n const matches = (amount < -2 || amount > -1) && trans.payee > '';\n\n if (matches && isAlive(trans, parents)) {\n expectedIds.add(trans.parent_id || trans.id);\n matched.add(trans.id);\n }\n\n ids.push(trans.id);\n }\n\n return ids;\n }, []);\n\n // Because why not? It should deduplicate them\n ids = repeat(ids, 100);\n\n const unhappyQuery = q('transactions')\n .filter({\n id: [{ $oneof: ids }],\n payee: { $gt: '' },\n $or: [{ amount: { $lt: -2 } }, { amount: { $gt: -1 } }],\n })\n .options({ splits: 'grouped' })\n .select(['*', 'payee.name'])\n // Using this because we want `payee` to have ids for the above\n // filter regardless if it points to a dead one or not\n .withoutValidatedRefs();\n\n expect(isHappyPathQuery(unhappyQuery.serialize())).toBe(false);\n\n return {\n expectedIds,\n expectedMatchedIds: matched,\n query: unhappyQuery,\n };\n });\n }, 20_000);\n})", "language": "typescript", "source_file": "./repos/actualbudget/actual/packages/loot-core/src/server/aql/schema/executors.test.ts", "start_line": null, "end_line": null, "dependencies": ["insertTransactions", "aliveTransactions", "expectTransactionOrder", "expectPagedData", "isAlive", "repeat"], "repo": {"name": "actualbudget/actual", "url": "https://github.com/actualbudget/actual.git", "license": "MIT", "stars": 20189, "forks": 1634}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60807, "name": "unknown", "code": "it('should never crash on arbitrary input', () => {\n fc.assert(\n fc.property(\n fc.string(),\n fc.constantFrom('javascript', 'typescript', 'python', 'java', 'unknown'),\n (input, language) => {\n expect(() => {\n detector.detectURLs(input, language, 'test-file');\n }).not.toThrow();\n },\n ),\n { numRuns: 1000 },\n );\n })", "language": "typescript", "source_file": "./repos/morganstanley/url-detector/tests/fuzzing.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "morganstanley/url-detector", "url": "https://github.com/morganstanley/url-detector.git", "license": "Apache-2.0", "stars": 2, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60808, "name": "unknown", "code": "it('should handle extremely long inputs gracefully', () => {\n fc.assert(\n fc.property(\n fc.string({ minLength: 10000, maxLength: 50000 }),\n fc.constantFrom('javascript', 'typescript', 'python'),\n (input, language) => {\n const start = Date.now();\n const result = detector.detectURLs(input, language, 'long-file');\n const duration = Date.now() - start;\n\n expect(Array.isArray(result)).toBe(true);\n expect(duration).toBeLessThan(10000); // Should complete within 10 seconds\n },\n ),\n { numRuns: 10 },\n );\n })", "language": "typescript", "source_file": "./repos/morganstanley/url-detector/tests/fuzzing.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "morganstanley/url-detector", "url": "https://github.com/morganstanley/url-detector.git", "license": "Apache-2.0", "stars": 2, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60809, "name": "unknown", "code": "it('should handle valid URL patterns correctly', () => {\n const testCases = [\n { input: 'const url = \"https://example.com\";', language: 'javascript' },\n { input: 'url = \"http://localhost:3000\"', language: 'python' },\n { input: 'String url = \"https://api.github.com/users\";', language: 'java' },\n { input: 'let endpoint: string = \"https://www.google.com/search\";', language: 'typescript' },\n ];\n\n fc.assert(\n fc.property(fc.constantFrom(...testCases), testCase => {\n const results = detector.detectURLs(testCase.input, testCase.language, 'test-file');\n\n expect(Array.isArray(results)).toBe(true);\n expect(results.length).toBeGreaterThan(0);\n expect(results[0]).toHaveProperty('url');\n expect(results[0]).toHaveProperty('line');\n expect(results[0]).toHaveProperty('column');\n }),\n { numRuns: 20 },\n );\n })", "language": "typescript", "source_file": "./repos/morganstanley/url-detector/tests/fuzzing.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "morganstanley/url-detector", "url": "https://github.com/morganstanley/url-detector.git", "license": "Apache-2.0", "stars": 2, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60810, "name": "unknown", "code": "it('should handle mixed content with URLs and non-URLs', () => {\n fc.assert(\n fc.property(\n fc.array(\n fc.oneof(\n fc.constantFrom('https://example.com', 'http://test.org', 'https://api.service.com'),\n fc.string().filter(s => !s.includes('http')),\n ),\n ),\n fc.constantFrom('javascript', 'typescript', 'python'),\n (parts, language) => {\n const input = parts.join(' ');\n const results = detector.detectURLs(input, language, 'mixed-file');\n\n expect(Array.isArray(results)).toBe(true);\n results.forEach(result => {\n expect(result).toHaveProperty('url');\n expect(result).toHaveProperty('line');\n expect(result).toHaveProperty('column');\n expect(result).toHaveProperty('start');\n expect(result).toHaveProperty('end');\n expect(result.start).toBeGreaterThanOrEqual(0);\n expect(result.end).toBeGreaterThan(result.start);\n });\n },\n ),\n { numRuns: 200 },\n );\n })", "language": "typescript", "source_file": "./repos/morganstanley/url-detector/tests/fuzzing.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "morganstanley/url-detector", "url": "https://github.com/morganstanley/url-detector.git", "license": "Apache-2.0", "stars": 2, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60811, "name": "unknown", "code": "it('should handle special characters and unicode correctly', () => {\n fc.assert(\n fc.property(\n fc.string(),\n fc.constantFrom('https://example.com/path', 'http://localhost:8080'),\n fc.string(),\n fc.constantFrom('javascript', 'typescript'),\n (prefix, url, suffix, language) => {\n const input = prefix + url + suffix;\n const results = detector.detectURLs(input, language, 'unicode-file');\n\n expect(() => {\n JSON.stringify(results);\n }).not.toThrow();\n },\n ),\n { numRuns: 500 },\n );\n })", "language": "typescript", "source_file": "./repos/morganstanley/url-detector/tests/fuzzing.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "morganstanley/url-detector", "url": "https://github.com/morganstanley/url-detector.git", "license": "Apache-2.0", "stars": 2, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60812, "name": "unknown", "code": "it('should maintain consistent results for identical inputs', () => {\n fc.assert(\n fc.property(fc.string(), fc.constantFrom('javascript', 'typescript', 'python'), (input, language) => {\n const result1 = detector.detectURLs(input, language, 'consistency-test');\n const result2 = detector.detectURLs(input, language, 'consistency-test');\n\n expect(result1).toEqual(result2);\n }),\n { numRuns: 100 },\n );\n })", "language": "typescript", "source_file": "./repos/morganstanley/url-detector/tests/fuzzing.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "morganstanley/url-detector", "url": "https://github.com/morganstanley/url-detector.git", "license": "Apache-2.0", "stars": 2, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60813, "name": "unknown", "code": "it('should handle arbitrary language detection inputs', () => {\n fc.assert(\n fc.property(fc.string(), filename => {\n expect(() => {\n languageManager.detectLanguageFromPath(filename);\n }).not.toThrow();\n }),\n { numRuns: 1000 },\n );\n })", "language": "typescript", "source_file": "./repos/morganstanley/url-detector/tests/fuzzing.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "morganstanley/url-detector", "url": "https://github.com/morganstanley/url-detector.git", "license": "Apache-2.0", "stars": 2, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60814, "name": "unknown", "code": "it('should always return a valid language or undefined', () => {\n fc.assert(\n fc.property(fc.string(), extension => {\n const result = languageManager.getLanguage(extension);\n expect(result === undefined || typeof result === 'object').toBe(true);\n }),\n { numRuns: 500 },\n );\n })", "language": "typescript", "source_file": "./repos/morganstanley/url-detector/tests/fuzzing.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "morganstanley/url-detector", "url": "https://github.com/morganstanley/url-detector.git", "license": "Apache-2.0", "stars": 2, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60815, "name": "unknown", "code": "it('should handle null bytes and control characters', () => {\n fc.assert(\n fc.property(\n fc.string().map(s => s + '\\0' + s),\n fc.constantFrom('javascript', 'typescript'),\n (input, language) => {\n expect(() => {\n detector.detectURLs(input, language, 'null-byte-file');\n }).not.toThrow();\n },\n ),\n { numRuns: 100 },\n );\n })", "language": "typescript", "source_file": "./repos/morganstanley/url-detector/tests/fuzzing.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "morganstanley/url-detector", "url": "https://github.com/morganstanley/url-detector.git", "license": "Apache-2.0", "stars": 2, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60816, "name": "unknown", "code": "it('should handle deeply nested structures', () => {\n const createNestedString = (depth: number): string => {\n if (depth === 0) return 'https://example.com';\n return `{${createNestedString(depth - 1)}}`;\n };\n\n fc.assert(\n fc.property(\n fc.integer({ min: 1, max: 100 }),\n fc.constantFrom('javascript', 'json'),\n (depth, language) => {\n const input = createNestedString(depth);\n const results = detector.detectURLs(input, language, 'nested-file');\n\n expect(Array.isArray(results)).toBe(true);\n },\n ),\n { numRuns: 50 },\n );\n })", "language": "typescript", "source_file": "./repos/morganstanley/url-detector/tests/fuzzing.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "morganstanley/url-detector", "url": "https://github.com/morganstanley/url-detector.git", "license": "Apache-2.0", "stars": 2, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60817, "name": "unknown", "code": "it('should handle malformed URLs gracefully', () => {\n const malformedUrls = [\n 'http://',\n 'https://',\n 'http://.',\n 'https://.',\n 'http://..',\n 'https://..',\n 'http://...',\n 'https://...',\n ];\n\n fc.assert(\n fc.property(\n fc.constantFrom(...malformedUrls),\n fc.string(),\n fc.constantFrom('javascript', 'typescript'),\n (malformedUrl, context, language) => {\n const input = context + malformedUrl + context;\n\n expect(() => {\n detector.detectURLs(input, language, 'malformed-file');\n }).not.toThrow();\n },\n ),\n { numRuns: 100 },\n );\n })", "language": "typescript", "source_file": "./repos/morganstanley/url-detector/tests/fuzzing.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "morganstanley/url-detector", "url": "https://github.com/morganstanley/url-detector.git", "license": "Apache-2.0", "stars": 2, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60818, "name": "unknown", "code": "it('should handle extremely long URLs', () => {\n fc.assert(\n fc.property(\n fc.string({ minLength: 1000, maxLength: 10000 }),\n fc.constantFrom('javascript', 'typescript'),\n (longPath, language) => {\n const longUrl = `https://example.com/${longPath}`;\n const results = detector.detectURLs(longUrl, language, 'long-url-file');\n\n expect(Array.isArray(results)).toBe(true);\n if (results.length > 0) {\n // URL detector may normalize URLs, so check for domain presence more flexibly\n const hasExpectedDomain = results.some(r => r.url.includes('example.com'));\n expect(hasExpectedDomain).toBe(true);\n }\n },\n ),\n { numRuns: 20 },\n );\n })", "language": "typescript", "source_file": "./repos/morganstanley/url-detector/tests/fuzzing.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "morganstanley/url-detector", "url": "https://github.com/morganstanley/url-detector.git", "license": "Apache-2.0", "stars": 2, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60819, "name": "unknown", "code": "it('should complete within reasonable time bounds', () => {\n fc.assert(\n fc.property(\n fc.string({ minLength: 100, maxLength: 5000 }),\n fc.constantFrom('javascript', 'typescript'),\n (input, language) => {\n const start = Date.now();\n const results = detector.detectURLs(input, language, 'perf-test');\n const duration = Date.now() - start;\n\n expect(Array.isArray(results)).toBe(true);\n expect(duration).toBeLessThan(5000); // Should complete within 5 seconds\n },\n ),\n { numRuns: 20 },\n );\n })", "language": "typescript", "source_file": "./repos/morganstanley/url-detector/tests/fuzzing.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "morganstanley/url-detector", "url": "https://github.com/morganstanley/url-detector.git", "license": "Apache-2.0", "stars": 2, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60820, "name": "unknown", "code": "it('should handle common problematic patterns', () => {\n const problematicPatterns = [\n '//example.com', // Protocol-relative URL\n 'https://example.com//double-slash',\n 'https://example.com/path with spaces',\n 'https://example.com/path\"with\"quotes',\n \"https://example.com/path'with'quotes\",\n 'https://example.com/path\\nwith\\nnewlines',\n 'https://example.com/path\\twith\\ttabs',\n 'https://example.com/pathbrackets',\n 'https://example.com/path{with}braces',\n 'https://example.com/path[with]square',\n ];\n\n fc.assert(\n fc.property(\n fc.constantFrom(...problematicPatterns),\n fc.constantFrom('javascript', 'typescript', 'html'),\n (pattern, language) => {\n expect(() => {\n const results = detector.detectURLs(pattern, language, 'problematic-file');\n expect(Array.isArray(results)).toBe(true);\n }).not.toThrow();\n },\n ),\n { numRuns: 100 },\n );\n })", "language": "typescript", "source_file": "./repos/morganstanley/url-detector/tests/fuzzing.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "morganstanley/url-detector", "url": "https://github.com/morganstanley/url-detector.git", "license": "Apache-2.0", "stars": 2, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60821, "name": "unknown", "code": "test('url-friendly strings are URL-friendly', () =>\n fc.assert(\n fc.property(urlFriendlyString(), (input: string) =>\n /^[\\w~.-]+$/.test(input),\n ),\n ))", "language": "typescript", "source_file": "./repos/StorylineHQ/unleash/src/test/arbitraries.test.ts", "start_line": null, "end_line": null, "dependencies": ["urlFriendlyString"], "repo": {"name": "StorylineHQ/unleash", "url": "https://github.com/StorylineHQ/unleash.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60822, "name": "unknown", "code": "test('variant payloads are either present or undefined; never null', () =>\n fc.assert(\n fc.property(\n variant(),\n (generatedVariant) =>\n !!generatedVariant.payload ||\n generatedVariant.payload === undefined,\n ),\n ))", "language": "typescript", "source_file": "./repos/StorylineHQ/unleash/src/test/arbitraries.test.ts", "start_line": null, "end_line": null, "dependencies": ["variant"], "repo": {"name": "StorylineHQ/unleash", "url": "https://github.com/StorylineHQ/unleash.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56775, "name": "unknown", "code": "it(\"should create larger and larger levels\", () => {\n fc.assert(\n fc.property(fc.integer({ min: 1, max: 1000 }), (n) => {\n // Arrange / Act\n const tree = drawTree(n);\n\n // Assert\n const treeLevels = tree.split(\"\\n\").map((level) => level.trim());\n for (let index = 1; index < n; ++index) {\n expect(treeLevels[index]).toContain(treeLevels[index - 1]);\n }\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-20.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The test confirms that each subsequent level of a tree generated by `drawTree` contains all the elements of the previous level.", "mode": "fast-check"} {"id": 60823, "name": "unknown", "code": "test('should return the same enabled toggles as the raw SDK correctly mapped', async () => {\n await fc.assert(\n fc\n .asyncProperty(\n clientFeaturesAndSegments({ minLength: 1 }),\n fc\n .tuple(generateContext(), commonISOTimestamp())\n .map(([context, currentTime]) => ({\n ...context,\n userId: 'constant',\n sessionId: 'constant2',\n currentTime,\n })),\n fc.context(),\n async ({ segments, features }, context, ctx) => {\n const serviceToggles = await insertAndEvaluateFeatures({\n features: features,\n context,\n segments,\n });\n\n const [head, ...rest] =\n await featureToggleService.getClientFeatures();\n if (!head) {\n return serviceToggles.length === 0;\n }\n\n const client = await offlineUnleashClientNode({\n features: [head, ...rest],\n context,\n logError: console.log,\n segments: segments.map(mapSegmentSchemaToISegment),\n });\n\n const clientContext = {\n ...context,\n\n currentTime: context.currentTime\n ? new Date(context.currentTime)\n : undefined,\n };\n\n return serviceToggles.every((feature) => {\n ctx.log(\n `Examining feature ${\n feature.name\n }: ${JSON.stringify(feature)}`,\n );\n\n // the playground differs from a normal SDK in that\n // it _must_ evaluate all strategies and features\n // regardless of whether they're supposed to be\n // enabled in the current environment or not.\n const expectedSDKState = feature.isEnabled;\n\n const enabledStateMatches =\n expectedSDKState ===\n client.isEnabled(feature.name, clientContext);\n\n ctx.log(\n `feature.isEnabled, feature.isEnabledInCurrentEnvironment, presumedSDKState: ${feature.isEnabled}, ${feature.isEnabledInCurrentEnvironment}, ${expectedSDKState}`,\n );\n ctx.log(\n `client.isEnabled: ${client.isEnabled(\n feature.name,\n clientContext,\n )}`,\n );\n expect(enabledStateMatches).toBe(true);\n\n // if x is disabled, then the variant will be the\n // disabled variant.\n if (!feature.isEnabled) {\n ctx.log(`${feature.name} is not enabled`);\n ctx.log(JSON.stringify(feature.variant));\n ctx.log(JSON.stringify(enabledStateMatches));\n ctx.log(\n JSON.stringify(\n feature.variant?.name === 'disabled',\n ),\n );\n ctx.log(\n JSON.stringify(\n feature.variant?.enabled === false,\n ),\n );\n return (\n enabledStateMatches &&\n isDisabledVariant(feature.variant)\n );\n }\n ctx.log('feature is enabled');\n\n const clientVariant = client.getVariant(\n feature.name,\n clientContext,\n );\n\n // if x is enabled, but its variant is the disabled\n // variant, then the source does not have any\n // variants\n if (isDisabledVariant(feature.variant)) {\n return (\n enabledStateMatches &&\n isDisabledVariant(clientVariant)\n );\n }\n\n ctx.log(`feature \"${feature.name}\" has a variant`);\n ctx.log(\n `Feature variant: ${JSON.stringify(\n feature.variant,\n )}`,\n );\n ctx.log(\n `Client variant: ${JSON.stringify(\n clientVariant,\n )}`,\n );\n ctx.log(\n `enabledStateMatches: ${enabledStateMatches}`,\n );\n\n // variants should be the same if the\n // toggle is enabled in both versions. If\n // they're not and one of them has a\n // variant, then they should be different.\n if (expectedSDKState === true) {\n expect(feature.variant).toEqual(clientVariant);\n } else {\n expect(feature.variant).not.toEqual(\n clientVariant,\n );\n }\n\n return enabledStateMatches;\n });\n },\n )\n .afterEach(cleanup),\n { ...testParams, examples: [] },\n );\n })", "language": "typescript", "source_file": "./repos/StorylineHQ/unleash/src/test/e2e/services/playground-service.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "StorylineHQ/unleash", "url": "https://github.com/StorylineHQ/unleash.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60824, "name": "unknown", "code": "test(\"should return all of a feature's strategies\", async () => {\n await fc.assert(\n fc\n .asyncProperty(\n clientFeaturesAndSegments({ minLength: 1 }),\n generateContext(),\n fc.context(),\n async (data, context, ctx) => {\n const log = (x: unknown) => ctx.log(JSON.stringify(x));\n const serviceFeatures = await insertAndEvaluateFeatures(\n {\n ...data,\n context,\n },\n );\n\n const serviceFeaturesDict: {\n [key: string]: PlaygroundFeatureSchema;\n } = serviceFeatures.reduce(\n (acc, feature) => ({\n ...acc,\n [feature.name]: feature,\n }),\n {},\n );\n\n // for each feature, find the corresponding evaluated feature\n // and make sure that the evaluated\n // return genFeat.length === servFeat.length && zip(gen, serv).\n data.features.forEach((feature) => {\n const mappedFeature: PlaygroundFeatureSchema =\n serviceFeaturesDict[feature.name];\n\n // log(feature);\n log(mappedFeature);\n\n const featureStrategies = feature.strategies ?? [];\n\n expect(\n mappedFeature.strategies.data.length,\n ).toEqual(featureStrategies.length);\n\n // we can't guarantee that the order we inserted\n // strategies into the database is the same as it\n // was returned by the service , so we'll need to\n // scan through the list of strats.\n\n // extract the `result` property, because it\n // doesn't exist in the input\n\n const removeResult = ({\n result,\n ...rest\n }: T & {\n result: unknown;\n }) => rest;\n\n const cleanedReceivedStrategies =\n mappedFeature.strategies.data.map(\n (strategy) => {\n const {\n segments: mappedSegments,\n ...mappedStrategy\n } = removeResult(strategy);\n\n return {\n ...mappedStrategy,\n constraints:\n mappedStrategy.constraints?.map(\n removeResult,\n ),\n };\n },\n );\n\n feature.strategies?.forEach(\n ({ segments, ...strategy }) => {\n expect(cleanedReceivedStrategies).toEqual(\n expect.arrayContaining([\n {\n ...strategy,\n title: undefined,\n disabled: false,\n constraints:\n strategy.constraints ?? [],\n parameters:\n strategy.parameters ?? {},\n },\n ]),\n );\n },\n );\n });\n },\n )\n .afterEach(cleanup),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/StorylineHQ/unleash/src/test/e2e/services/playground-service.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "StorylineHQ/unleash", "url": "https://github.com/StorylineHQ/unleash.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60825, "name": "unknown", "code": "test('should return feature strategies with all their segments', async () => {\n await fc.assert(\n fc\n .asyncProperty(\n clientFeaturesAndSegments({ minLength: 1 }),\n generateContext(),\n async (\n { segments, features: generatedFeatures },\n context,\n ) => {\n const serviceFeatures = await insertAndEvaluateFeatures(\n {\n features: generatedFeatures,\n context,\n segments,\n },\n );\n\n const serviceFeaturesDict: {\n [key: string]: PlaygroundFeatureSchema;\n } = serviceFeatures.reduce(\n (acc, feature) => ({\n ...acc,\n [feature.name]: feature,\n }),\n {},\n );\n\n // ensure that segments are mapped on to features\n // correctly. We do not need to check whether the\n // evaluation is correct; that is taken care of by other\n // tests.\n\n // For each feature strategy, find its list of segments and\n // compare it to the input.\n //\n // We can assert three things:\n //\n // 1. The segments lists have the same length\n //\n // 2. All segment ids listed in an input id list are\n // also in the original segments list\n //\n // 3. If a feature is considered enabled, _all_ segments\n // must be true. If a feature is _disabled_, _at least_\n // one segment is not true.\n generatedFeatures.forEach((unmappedFeature) => {\n const strategies = serviceFeaturesDict[\n unmappedFeature.name\n ].strategies.data.reduce(\n (acc, strategy) => ({\n ...acc,\n [strategy.id]: strategy,\n }),\n {},\n );\n\n unmappedFeature.strategies?.forEach(\n (unmappedStrategy) => {\n const mappedStrategySegments: PlaygroundSegmentSchema[] =\n strategies[unmappedStrategy.id!]\n .segments;\n\n const unmappedSegments =\n unmappedStrategy.segments ?? [];\n\n // 1. The segments lists have the same length\n // 2. All segment ids listed in the input exist:\n expect(\n [\n ...mappedStrategySegments?.map(\n (segment) => segment.id,\n ),\n ].sort(),\n ).toEqual([...unmappedSegments].sort());\n\n switch (\n strategies[unmappedStrategy.id!].result\n ) {\n case true:\n // If a strategy is considered true, _all_ segments\n // must be true.\n expect(\n mappedStrategySegments.every(\n (segment) =>\n segment.result === true,\n ),\n ).toBeTruthy();\n break;\n case false:\n // empty -- all segments can be true and\n // the toggle still not enabled. We\n // can't check for anything here.\n case 'not found':\n // empty -- we can't evaluate this\n }\n },\n );\n });\n },\n )\n .afterEach(cleanup),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/StorylineHQ/unleash/src/test/e2e/services/playground-service.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "StorylineHQ/unleash", "url": "https://github.com/StorylineHQ/unleash.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60826, "name": "unknown", "code": "test(\"should evaluate a strategy to be unknown if it doesn't recognize the strategy and all constraints pass\", async () => {\n await fc.assert(\n fc\n .asyncProperty(\n clientFeaturesAndSegments({ minLength: 1 }).map(\n ({ features, ...rest }) => ({\n ...rest,\n features: features.map((feature) => ({\n ...feature,\n // remove any constraints and use a name that doesn't exist\n strategies: feature.strategies?.map(\n (strategy) => ({\n ...strategy,\n name: 'bogus-strategy',\n constraints: [],\n segments: [],\n }),\n ),\n })),\n }),\n ),\n generateContext(),\n fc.context(),\n async (featsAndSegments, context, ctx) => {\n const serviceFeatures = await insertAndEvaluateFeatures(\n {\n ...featsAndSegments,\n context,\n },\n );\n\n serviceFeatures.forEach((feature) =>\n feature.strategies.data.forEach((strategy) => {\n expect(strategy.result.evaluationStatus).toBe(\n playgroundStrategyEvaluation.evaluationIncomplete,\n );\n expect(strategy.result.enabled).toBe(\n playgroundStrategyEvaluation.unknownResult,\n );\n }),\n );\n\n ctx.log(JSON.stringify(serviceFeatures));\n serviceFeatures.forEach((feature) => {\n // if there are strategies and they're all\n // incomplete and unknown, then the feature can't be\n // evaluated fully\n if (feature.strategies.data.length) {\n expect(feature.isEnabled).toBe(false);\n }\n });\n },\n )\n .afterEach(cleanup),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/StorylineHQ/unleash/src/test/e2e/services/playground-service.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "StorylineHQ/unleash", "url": "https://github.com/StorylineHQ/unleash.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60827, "name": "unknown", "code": "test(\"should evaluate a strategy as false if it doesn't recognize the strategy and constraint checks fail\", async () => {\n await fc.assert(\n fc\n .asyncProperty(\n fc\n .tuple(\n fc.uuid(),\n clientFeaturesAndSegments({ minLength: 1 }),\n )\n .map(([uuid, { features, ...rest }]) => ({\n ...rest,\n features: features.map((feature) => ({\n ...feature,\n // use a constraint that will never be true\n strategies: feature.strategies?.map(\n (strategy) => ({\n ...strategy,\n name: 'bogusStrategy',\n constraints: [\n {\n contextName: 'appName',\n operator: 'IN' as const,\n values: [uuid],\n },\n ],\n }),\n ),\n })),\n })),\n generateContext(),\n fc.context(),\n async (featsAndSegments, context, ctx) => {\n const serviceFeatures = await insertAndEvaluateFeatures(\n {\n ...featsAndSegments,\n context,\n },\n );\n\n serviceFeatures.forEach((feature) =>\n feature.strategies.data.forEach((strategy) => {\n expect(strategy.result.evaluationStatus).toBe(\n playgroundStrategyEvaluation.evaluationIncomplete,\n );\n expect(strategy.result.enabled).toBe(false);\n }),\n );\n\n ctx.log(JSON.stringify(serviceFeatures));\n\n serviceFeatures.forEach((feature) => {\n if (feature.strategies.data.length) {\n // if there are strategies and they're all\n // incomplete and false, then the feature\n // is also false\n expect(feature.isEnabled).toEqual(false);\n }\n });\n },\n )\n .afterEach(cleanup),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/StorylineHQ/unleash/src/test/e2e/services/playground-service.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "StorylineHQ/unleash", "url": "https://github.com/StorylineHQ/unleash.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60828, "name": "unknown", "code": "test('should evaluate a feature as unknown if there is at least one incomplete strategy among all failed strategies', async () => {\n await fc.assert(\n fc\n .asyncProperty(\n fc\n .tuple(\n fc.uuid(),\n clientFeaturesAndSegments({ minLength: 1 }),\n )\n .map(([uuid, { features, ...rest }]) => ({\n ...rest,\n features: features.map((feature) => ({\n ...feature,\n // use a constraint that will never be true\n strategies: [\n ...feature.strategies!.map((strategy) => ({\n ...strategy,\n constraints: [\n {\n contextName: 'appName',\n operator: 'IN' as const,\n values: [uuid],\n },\n ],\n })),\n { name: 'my-custom-strategy' },\n ],\n })),\n })),\n generateContext(),\n async (featsAndSegments, context) => {\n const serviceFeatures = await insertAndEvaluateFeatures(\n {\n ...featsAndSegments,\n context,\n },\n );\n\n serviceFeatures.forEach((feature) => {\n if (feature.strategies.data.length) {\n // if there are strategies and they're\n // all incomplete and unknown, then\n // the feature is also unknown and\n // thus 'false' (from an SDK point of\n // view)\n expect(feature.isEnabled).toEqual(false);\n }\n });\n },\n )\n .afterEach(cleanup),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/StorylineHQ/unleash/src/test/e2e/services/playground-service.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "StorylineHQ/unleash", "url": "https://github.com/StorylineHQ/unleash.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60829, "name": "unknown", "code": "test(\"features can't be evaluated to true if they're not enabled in the current environment\", async () => {\n await fc.assert(\n fc\n .asyncProperty(\n clientFeaturesAndSegments({ minLength: 1 }).map(\n ({ features, ...rest }) => ({\n ...rest,\n features: features.map((feature) => ({\n ...feature,\n enabled: false,\n // remove any constraints and use a name that doesn't exist\n strategies: [{ name: 'default' }],\n })),\n }),\n ),\n generateContext(),\n fc.context(),\n async (featsAndSegments, context, ctx) => {\n const serviceFeatures = await insertAndEvaluateFeatures(\n {\n ...featsAndSegments,\n context,\n },\n );\n\n serviceFeatures.forEach((feature) =>\n feature.strategies.data.forEach((strategy) => {\n expect(strategy.result.evaluationStatus).toBe(\n playgroundStrategyEvaluation.evaluationComplete,\n );\n expect(strategy.result.enabled).toBe(true);\n }),\n );\n\n ctx.log(JSON.stringify(serviceFeatures));\n serviceFeatures.forEach((feature) => {\n expect(feature.isEnabled).toBe(false);\n expect(feature.isEnabledInCurrentEnvironment).toBe(\n false,\n );\n });\n },\n )\n .afterEach(cleanup),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/StorylineHQ/unleash/src/test/e2e/services/playground-service.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "StorylineHQ/unleash", "url": "https://github.com/StorylineHQ/unleash.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60830, "name": "unknown", "code": "test('output toggles should have the same variants as input toggles', async () => {\n await fc.assert(\n fc\n .asyncProperty(\n clientFeaturesAndSegments({ minLength: 1 }),\n generateContext(),\n async ({ features, segments }, context) => {\n const serviceFeatures = await insertAndEvaluateFeatures(\n {\n features,\n segments,\n context,\n },\n );\n\n const variantsMap = features.reduce(\n (acc, feature) => ({\n ...acc,\n [feature.name]: feature.variants,\n }),\n {},\n );\n\n serviceFeatures.forEach((feature) => {\n if (variantsMap[feature.name]) {\n expect(feature.variants).toEqual(\n expect.arrayContaining(\n variantsMap[feature.name],\n ),\n );\n expect(variantsMap[feature.name]).toEqual(\n expect.arrayContaining(feature.variants),\n );\n } else {\n expect(feature.variants).toStrictEqual([]);\n }\n });\n },\n )\n .afterEach(cleanup),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/StorylineHQ/unleash/src/test/e2e/services/playground-service.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "StorylineHQ/unleash", "url": "https://github.com/StorylineHQ/unleash.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60831, "name": "unknown", "code": "test('isEnabled matches strategies.results', async () => {\n await fc.assert(\n fc\n .asyncProperty(\n clientFeaturesAndSegments({ minLength: 1 }),\n generateContext(),\n async ({ features, segments }, context) => {\n const serviceFeatures = await insertAndEvaluateFeatures(\n {\n features,\n segments,\n context,\n },\n );\n\n serviceFeatures.forEach((feature) => {\n if (feature.isEnabled) {\n expect(\n feature.isEnabledInCurrentEnvironment,\n ).toBe(true);\n expect(feature.strategies.result).toBe(true);\n } else {\n expect(\n !feature.isEnabledInCurrentEnvironment ||\n feature.strategies.result !== true,\n ).toBe(true);\n }\n });\n },\n )\n .afterEach(cleanup),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/StorylineHQ/unleash/src/test/e2e/services/playground-service.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "StorylineHQ/unleash", "url": "https://github.com/StorylineHQ/unleash.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60832, "name": "unknown", "code": "test('strategies.results matches the individual strategy results', async () => {\n await fc.assert(\n fc\n .asyncProperty(\n clientFeaturesAndSegments({ minLength: 1 }),\n generateContext(),\n async ({ features, segments }, context) => {\n const serviceFeatures = await insertAndEvaluateFeatures(\n {\n features,\n segments,\n context,\n },\n );\n\n serviceFeatures.forEach(({ strategies }) => {\n if (strategies.result === false) {\n expect(\n strategies.data.every(\n (strategy) =>\n strategy.result.enabled === false,\n ),\n ).toBe(true);\n } else if (\n strategies.result ===\n playgroundStrategyEvaluation.unknownResult\n ) {\n expect(\n strategies.data.some(\n (strategy) =>\n strategy.result.enabled ===\n playgroundStrategyEvaluation.unknownResult,\n ),\n ).toBe(true);\n\n expect(\n strategies.data.every(\n (strategy) =>\n strategy.result.enabled !== true,\n ),\n ).toBe(true);\n } else {\n if (strategies.data.length > 0) {\n expect(\n strategies.data.some(\n (strategy) =>\n strategy.result.enabled ===\n true,\n ),\n ).toBe(true);\n }\n }\n });\n },\n )\n .afterEach(cleanup),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/StorylineHQ/unleash/src/test/e2e/services/playground-service.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "StorylineHQ/unleash", "url": "https://github.com/StorylineHQ/unleash.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56787, "name": "unknown", "code": "it(\"should have the same answer for s and reverse(s)\", () => {\n fc.assert(\n fc.property(fc.fullUnicodeString(), (s) => {\n // Arrange\n const reversedS = [...s].reverse().join(\"\");\n\n // Act / Assert\n expect(isPalindrome(reversedS)).toBe(isPalindrome(s));\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-18.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The property should hold that `isPalindrome` returns the same result for a string and its reversal.", "mode": "fast-check"} {"id": 60833, "name": "unknown", "code": "test('unevaluated features should not have variants', async () => {\n await fc.assert(\n fc\n .asyncProperty(\n clientFeaturesAndSegments({ minLength: 1 }),\n generateContext(),\n async ({ features, segments }, context) => {\n const serviceFeatures = await insertAndEvaluateFeatures(\n {\n features,\n segments,\n context,\n },\n );\n\n serviceFeatures.forEach((feature) => {\n if (\n feature.strategies.result ===\n playgroundStrategyEvaluation.unknownResult\n ) {\n expect(feature.variant).toEqual({\n name: 'disabled',\n enabled: false,\n feature_enabled: false,\n });\n }\n });\n },\n )\n .afterEach(cleanup),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/StorylineHQ/unleash/src/test/e2e/services/playground-service.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "StorylineHQ/unleash", "url": "https://github.com/StorylineHQ/unleash.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56789, "name": "unknown", "code": "it(\"should consider any composite of primes <=7 as humble\", () => {\n fc.assert(\n fc.property(\n fc.array(fc.integer({ min: 2, max: 7 }), { minLength: 1 }),\n (factors) => {\n // Arrange\n let n = 1;\n for (const f of factors) {\n if (n * f > 2 ** 31 - 1) break;\n n = n * f;\n }\n\n // Act / Assert\n expect(isHumbleNumber(n)).toBe(true);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-17.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "A number composed entirely of prime factors less than or equal to 7 should be identified as humble by `isHumbleNumber`.", "mode": "fast-check"} {"id": 60834, "name": "unknown", "code": "it('Returned features should be a subset of the provided flags', async () => {\n await fc.assert(\n fc\n .asyncProperty(\n clientFeatures({ minLength: 1 }),\n generateRequest(),\n async (features, request) => {\n // seed the database\n await seedDatabase(db, features, request.environment);\n\n const body = await playgroundRequest(\n app,\n token.secret,\n request,\n );\n\n // the returned list should always be a subset of the provided list\n expect(features.map((feature) => feature.name)).toEqual(\n expect.arrayContaining(\n body.features.map((feature) => feature.name),\n ),\n );\n },\n )\n .afterEach(reset(db)),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/StorylineHQ/unleash/src/test/e2e/api/admin/playground.e2e.test.ts", "start_line": null, "end_line": null, "dependencies": ["playgroundRequest", "reset"], "repo": {"name": "StorylineHQ/unleash", "url": "https://github.com/StorylineHQ/unleash.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60835, "name": "unknown", "code": "it('should filter the list according to the input parameters', async () => {\n await fc.assert(\n fc\n .asyncProperty(\n generateRequest(),\n clientFeatures({ minLength: 1 }),\n async (request, features) => {\n await seedDatabase(db, features, request.environment);\n\n // get a subset of projects that exist among the features\n const [projects] = fc.sample(\n fc.oneof(\n fc.constant(ALL as '*'),\n fc.uniqueArray(\n fc.constantFrom(\n ...features.map(\n (feature) => feature.project,\n ),\n ),\n ),\n ),\n );\n\n request.projects = projects as any;\n\n // create a list of features that can be filtered\n // pass in args that should filter the list\n const body = await playgroundRequest(\n app,\n token.secret,\n request,\n );\n\n switch (projects) {\n case ALL:\n // no features have been filtered out\n return body.features.length === features.length;\n case []:\n // no feature should be without a project\n return body.features.length === 0;\n default:\n // every feature should be in one of the prescribed projects\n return body.features.every((feature) =>\n projects.includes(feature.projectId),\n );\n }\n },\n )\n .afterEach(reset(db)),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/StorylineHQ/unleash/src/test/e2e/api/admin/playground.e2e.test.ts", "start_line": null, "end_line": null, "dependencies": ["playgroundRequest", "reset"], "repo": {"name": "StorylineHQ/unleash", "url": "https://github.com/StorylineHQ/unleash.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60836, "name": "unknown", "code": "it('should map project and name correctly', async () => {\n // note: we're not testing `isEnabled` and `variant` here, because\n // that's the SDK's responsibility and it's tested elsewhere.\n await fc.assert(\n fc\n .asyncProperty(\n clientFeatures(),\n fc.context(),\n async (features, ctx) => {\n await seedDatabase(db, features, 'default');\n\n const body = await playgroundRequest(\n app,\n token.secret,\n {\n projects: ALL,\n environment: DEFAULT_ENV,\n context: {\n appName: 'playground-test',\n },\n },\n );\n\n const createDict = (xs: { name: string }[]) =>\n xs.reduce(\n (acc, next) => ({ ...acc, [next.name]: next }),\n {},\n );\n\n const mappedToggles = createDict(body.features);\n\n if (features.length !== body.features.length) {\n ctx.log(\n `I expected the number of mapped flags (${body.features.length}) to be the same as the number of created toggles (${features.length}), but that was not the case.`,\n );\n return false;\n }\n\n return features.every((feature) => {\n const mapped: PlaygroundFeatureSchema =\n mappedToggles[feature.name];\n\n expect(mapped).toBeTruthy();\n\n return (\n feature.name === mapped.name &&\n feature.project === mapped.projectId\n );\n });\n },\n )\n .afterEach(reset(db)),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/StorylineHQ/unleash/src/test/e2e/api/admin/playground.e2e.test.ts", "start_line": null, "end_line": null, "dependencies": ["playgroundRequest", "reset"], "repo": {"name": "StorylineHQ/unleash", "url": "https://github.com/StorylineHQ/unleash.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60837, "name": "unknown", "code": "it('isEnabledInCurrentEnvironment should always match feature.enabled', async () => {\n await fc.assert(\n fc\n .asyncProperty(\n clientFeatures(),\n fc.context(),\n async (features, ctx) => {\n await seedDatabase(db, features, DEFAULT_ENV);\n\n const body = await playgroundRequest(\n app,\n token.secret,\n {\n projects: ALL,\n environment: DEFAULT_ENV,\n context: {\n appName: 'playground-test',\n },\n },\n );\n\n const createDict = (xs: { name: string }[]) =>\n xs.reduce(\n (acc, next) => ({ ...acc, [next.name]: next }),\n {},\n );\n\n const mappedToggles = createDict(body.features);\n\n ctx.log(JSON.stringify(features));\n ctx.log(JSON.stringify(mappedToggles));\n\n return features.every(\n (feature) =>\n feature.enabled ===\n mappedToggles[feature.name]\n .isEnabledInCurrentEnvironment,\n );\n },\n )\n .afterEach(reset(db)),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/StorylineHQ/unleash/src/test/e2e/api/admin/playground.e2e.test.ts", "start_line": null, "end_line": null, "dependencies": ["playgroundRequest", "reset"], "repo": {"name": "StorylineHQ/unleash", "url": "https://github.com/StorylineHQ/unleash.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60838, "name": "unknown", "code": "it('applies appName constraints correctly', async () => {\n const appNames = ['A', 'B', 'C'];\n\n // Choose one of the app names at random\n const appName = () => fc.constantFrom(...appNames);\n\n // generate a list of features that are active only for a specific\n // app name (constraints). Each feature will be constrained to a\n // random appName from the list above.\n const constrainedFeatures = (): Arbitrary =>\n fc.uniqueArray(\n fc\n .tuple(\n clientFeature(),\n fc.record({\n name: fc.constant('default'),\n constraints: fc\n .record({\n values: appName().map(toArray),\n inverted: fc.constant(false),\n operator: fc.constant('IN' as const),\n contextName: fc.constant('appName'),\n caseInsensitive: fc.boolean(),\n })\n .map(toArray),\n }),\n )\n .map(([feature, strategy]) => ({\n ...feature,\n enabled: true,\n strategies: [strategy],\n })),\n { selector: (feature) => feature.name },\n );\n\n await fc.assert(\n fc\n .asyncProperty(\n fc\n .tuple(appName(), generateRequest())\n .map(([generatedAppName, req]) => ({\n ...req,\n // generate a context that has appName set to\n // one of the above values\n context: {\n appName: generatedAppName,\n environment: DEFAULT_ENV,\n },\n })),\n constrainedFeatures(),\n async (req, features) => {\n await seedDatabase(db, features, req.environment);\n const body = await playgroundRequest(\n app,\n token.secret,\n req,\n );\n\n const shouldBeEnabled = features.reduce(\n (acc, next) => ({\n ...acc,\n [next.name]:\n // @ts-ignore\n next.strategies[0].constraints[0]\n .values[0] === req.context.appName,\n }),\n {},\n );\n\n return body.features.every(\n (feature) =>\n feature.isEnabled ===\n shouldBeEnabled[feature.name],\n );\n },\n )\n .afterEach(reset(db)),\n {\n ...testParams,\n examples: [],\n },\n );\n })", "language": "typescript", "source_file": "./repos/StorylineHQ/unleash/src/test/e2e/api/admin/playground.e2e.test.ts", "start_line": null, "end_line": null, "dependencies": ["playgroundRequest", "reset"], "repo": {"name": "StorylineHQ/unleash", "url": "https://github.com/StorylineHQ/unleash.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56805, "name": "unknown", "code": "it(\"should reject any expression not having the same number of openings and closings\", () => {\n fc.assert(\n fc.property(\n wellParenthesizedStringArbitrary,\n fc.constantFrom(\"(\", \"[\", \"{\", \")\", \"]\", \"}\"),\n fc.nat().noShrink(),\n (expression, extra, seed) => {\n const position = seed % (expression.length + 1);\n const invalidExpression =\n expression.substring(0, position) +\n extra +\n expression.substring(position);\n expect(validParentheses(invalidExpression)).toBe(false);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-12.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Expressions with mismatched numbers of opening and closing brackets are identified as invalid by the `validParentheses` function.", "mode": "fast-check"} {"id": 56806, "name": "unknown", "code": "it(\"should reject any expression with at least one reversed openings and closings\", () => {\n fc.assert(\n fc.property(reversedParenthesizedStringArbitrary, (expression) => {\n expect(validParentheses(expression)).toBe(false);\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-12.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Valid parentheses expressions should return false when they include at least one reversed opening and closing pair.", "mode": "fast-check"} {"id": 56807, "name": "unknown", "code": "it(\"should reject any expression with non-matching openings and closings\", () => {\n fc.assert(\n fc.property(nonMatchingEndParenthesizedStringArbitrary, (expression) => {\n expect(validParentheses(expression)).toBe(false);\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-12.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Expressions with non-matching opening and closing parentheses should return false when evaluated by `validParentheses`.", "mode": "fast-check"} {"id": 60839, "name": "unknown", "code": "it('applies dynamic context fields correctly', async () => {\n const contextValue = () =>\n fc.oneof(\n fc.record({\n name: fc.constant('remoteAddress'),\n value: fc.ipV4(),\n operator: fc.constant('IN' as const),\n }),\n fc.record({\n name: fc.constant('sessionId'),\n value: fc.uuid(),\n operator: fc.constant('IN' as const),\n }),\n fc.record({\n name: fc.constant('userId'),\n value: fc.emailAddress(),\n operator: fc.constant('IN' as const),\n }),\n );\n\n const constrainedFeatures = (): Arbitrary =>\n fc.uniqueArray(\n fc\n .tuple(\n clientFeature(),\n contextValue().map((context) => ({\n name: 'default',\n constraints: [\n {\n values: [context.value],\n inverted: false,\n operator: context.operator,\n contextName: context.name,\n caseInsensitive: false,\n },\n ],\n })),\n )\n .map(([feature, strategy]) => ({\n ...feature,\n enabled: true,\n strategies: [strategy],\n })),\n { selector: (feature) => feature.name },\n );\n await fc.assert(\n fc\n .asyncProperty(\n fc\n .tuple(contextValue(), generateRequest())\n .map(([generatedContextValue, req]) => ({\n ...req,\n // generate a context that has a dynamic context field set to\n // one of the above values\n context: {\n ...req.context,\n [generatedContextValue.name]:\n generatedContextValue.value,\n },\n })),\n constrainedFeatures(),\n async (req, features) => {\n await seedDatabase(db, features, 'default');\n\n const body = await playgroundRequest(\n app,\n token.secret,\n req,\n );\n\n const contextField = Object.values(req.context)[0];\n\n const shouldBeEnabled = features.reduce(\n (acc, next) => ({\n ...acc,\n [next.name]:\n next.strategies![0].constraints![0]\n .values![0] === contextField,\n }),\n {},\n );\n return body.features.every(\n (feature) =>\n feature.isEnabled ===\n shouldBeEnabled[feature.name],\n );\n },\n )\n .afterEach(reset(db)),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/StorylineHQ/unleash/src/test/e2e/api/admin/playground.e2e.test.ts", "start_line": null, "end_line": null, "dependencies": ["playgroundRequest", "reset"], "repo": {"name": "StorylineHQ/unleash", "url": "https://github.com/StorylineHQ/unleash.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56815, "name": "unknown", "code": "it(\"should be independent of the ordering of the arguments\", () => {\n fc.assert(\n fc.property(\n fc.fullUnicodeString(),\n fc.fullUnicodeString(),\n (source, target) => {\n // Arrange / Act\n const numChanges = minimalNumberOfChangesToBeOther(source, target);\n const numChangesReversed = minimalNumberOfChangesToBeOther(\n target,\n source\n );\n\n // Assert\n expect(numChangesReversed).toBe(numChanges);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-10.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The function `minimalNumberOfChangesToBeOther` should return the same result regardless of the order of the two input strings.", "mode": "fast-check"} {"id": 56816, "name": "unknown", "code": "it(\"should compute the minimal number of changes to mutate source into target\", () => {\n fc.assert(\n fc.property(changeArb(), (changes) => {\n // Arrange\n const source = sourceFromChanges(changes);\n const target = targetFromChanges(changes);\n\n // Act\n const numChanges = minimalNumberOfChangesToBeOther(source, target);\n\n // Assert\n expect(numChanges).toBeLessThanOrEqual(countRequestedOperations(changes));\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-10.spec.ts", "start_line": null, "end_line": null, "dependencies": ["changeArb", "sourceFromChanges", "targetFromChanges", "countRequestedOperations"], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The minimal number of changes required to transform a source string into a target string should be less than or equal to the number of non-\"no-op\" change operations specified.", "mode": "fast-check"} {"id": 56817, "name": "unknown", "code": "it(\"should have the same length as source\", () => {\n fc.assert(\n fc.property(fc.array(fc.integer()), (data) => {\n expect(sorted(data)).toHaveLength(data.length);\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-09.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The sorted array should have the same length as the source array.", "mode": "fast-check"} {"id": 60840, "name": "unknown", "code": "it('applies custom context fields correctly', async () => {\n const environment = 'default';\n const contextValue = () =>\n fc.record({\n name: fc.constantFrom('Context field A', 'Context field B'),\n value: fc.constantFrom(\n 'Context value 1',\n 'Context value 2',\n ),\n });\n const constrainedFeatures = (): Arbitrary =>\n fc.uniqueArray(\n fc\n .tuple(\n clientFeature(),\n contextValue().map((context) => ({\n name: 'default',\n constraints: [\n {\n values: [context.value],\n inverted: false,\n operator: 'IN' as const,\n contextName: context.name,\n caseInsensitive: false,\n },\n ],\n })),\n )\n .map(([feature, strategy]) => ({\n ...feature,\n enabled: true,\n strategies: [strategy],\n })),\n { selector: (feature) => feature.name },\n );\n\n // generate a constraint to be used for the context and a request\n // that contains that constraint value.\n const constraintAndRequest = () =>\n fc\n .tuple(\n contextValue(),\n fc.constantFrom('top', 'nested'),\n generateRequest(),\n )\n .map(([generatedContextValue, placement, req]) => {\n const request =\n placement === 'top'\n ? {\n ...req,\n environment,\n context: {\n ...req.context,\n [generatedContextValue.name]:\n generatedContextValue.value,\n },\n }\n : {\n ...req,\n environment,\n context: {\n ...req.context,\n properties: {\n [generatedContextValue.name]:\n generatedContextValue.value,\n },\n },\n };\n\n return {\n generatedContextValue,\n request,\n };\n });\n\n await fc.assert(\n fc\n .asyncProperty(\n constraintAndRequest(),\n constrainedFeatures(),\n fc.context(),\n async (\n { generatedContextValue, request },\n features,\n ctx,\n ) => {\n await seedDatabase(db, features, environment);\n\n const body = await playgroundRequest(\n app,\n token.secret,\n request,\n );\n\n const shouldBeEnabled = features.reduce(\n (acc, next) => {\n const constraint =\n next.strategies![0].constraints![0];\n\n return {\n ...acc,\n [next.name]:\n constraint.contextName ===\n generatedContextValue.name &&\n constraint.values![0] ===\n generatedContextValue.value,\n };\n },\n {},\n );\n\n ctx.log(\n `Got these ${JSON.stringify(\n body.features,\n )} and I expect them to be enabled/disabled: ${JSON.stringify(\n shouldBeEnabled,\n )}`,\n );\n\n return body.features.every(\n (feature) =>\n feature.isEnabled ===\n shouldBeEnabled[feature.name],\n );\n },\n )\n .afterEach(reset(db)),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/StorylineHQ/unleash/src/test/e2e/api/admin/playground.e2e.test.ts", "start_line": null, "end_line": null, "dependencies": ["playgroundRequest", "reset"], "repo": {"name": "StorylineHQ/unleash", "url": "https://github.com/StorylineHQ/unleash.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56820, "name": "unknown", "code": "it(\"should not detect any duplicates when array has only distinct values\", () => {\n fc.assert(\n fc.property(fc.set(fc.anything(), { compare: Object.is }), (data) => {\n expect(hasDuplicates(data)).toBe(false);\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-08.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`hasDuplicates` returns false for an array containing only distinct values.", "mode": "fast-check"} {"id": 56821, "name": "unknown", "code": "it(\"should always detect duplicates when there is at least one\", () => {\n fc.assert(\n fc.property(\n fc.array(fc.anything()),\n fc.array(fc.anything()),\n fc.array(fc.anything()),\n fc.anything(),\n (start, middle, end, dup) => {\n expect(hasDuplicates([...start, dup, ...middle, dup, ...end])).toBe(\n true\n );\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-08.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The function `hasDuplicates` should return true when the input array contains at least one duplicate element.", "mode": "fast-check"} {"id": 56826, "name": "unknown", "code": "it(\"should fulfill Cassini identity\", () => {\n fc.assert(\n fc.property(\n fc.integer({ min: 1, max: MaxN }),\n fc.integer({ min: 0, max: MaxN }),\n (p) => {\n const sign = p % 2 === 0 ? 1n : -1n; // (-1)^p\n expect(\n fibonacci(p + 1) * fibonacci(p - 1) - fibonacci(p) * fibonacci(p)\n ).toBe(sign);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-07.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The property verifies that the Cassini identity holds for Fibonacci numbers, ensuring that the expression \\((F_{p+1} \\times F_{p-1}) - (F_p \\times F_p)\\) equals \\((-1)^p\\).", "mode": "fast-check"} {"id": 56828, "name": "unknown", "code": "it(\"should fulfill gcd(fibo(a), fibo(b)) = fibo(gcd(a,b))\", () => {\n fc.assert(\n fc.property(\n fc.integer({ min: 1, max: MaxN }),\n fc.integer({ min: 1, max: MaxN }),\n (a, b) => {\n const gcdAB = Number(gcd(BigInt(a), BigInt(b)));\n expect(gcd(fibonacci(a), fibonacci(b))).toBe(fibonacci(gcdAB));\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-07.spec.ts", "start_line": null, "end_line": null, "dependencies": ["gcd"], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The greatest common divisor of Fibonacci numbers corresponding to two integers should equal the Fibonacci number of the greatest common divisor of those integers.", "mode": "fast-check"} {"id": 60841, "name": "unknown", "code": "test('creating an arbitrary context field should return the created context field', async () => {\n await fc.assert(\n fc\n .asyncProperty(contextFieldDto(), async (input) => {\n const { createdAt, ...storedData } =\n await stores.contextFieldStore.create(input);\n\n Object.entries(input).forEach(([key, value]) => {\n expect(storedData[key]).toStrictEqual(value);\n });\n })\n .afterEach(cleanup),\n );\n})", "language": "typescript", "source_file": "./repos/StorylineHQ/unleash/src/test/e2e/stores/context-field-store.e2e.test.ts", "start_line": null, "end_line": null, "dependencies": ["contextFieldDto"], "repo": {"name": "StorylineHQ/unleash", "url": "https://github.com/StorylineHQ/unleash.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56835, "name": "unknown", "code": "it(\"should only return messages built from words coming from the set of words\", () => {\n fc.assert(\n fc.property(\n fc.set(wordArb, { minLength: 1 }).chain((words) =>\n fc.record({\n words: fc.shuffledSubarray(words), // we potentially remove words from the dictionary to cover no match case\n originalMessage: fc\n .array(fc.constantFrom(...words))\n .map((items) => items.join(\" \")),\n })\n ),\n ({ words, originalMessage }) => {\n const spacelessMessage = originalMessage.replace(/ /g, \"\");\n const combinations = respace(spacelessMessage, words);\n for (const combination of combinations) {\n if (combination.length !== 0) {\n expect(words).toIncludeAnyMembers(combination.split(\" \"));\n }\n }\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-05.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Messages reconstructed by `respace` should consist only of words from the provided set.", "mode": "fast-check"} {"id": 56836, "name": "unknown", "code": "it(\"should not detect any cycle in a non-looping linked list\", () => {\n const noCycleLinkedListArbitrary = fc.letrec((tie) => ({\n node: fc.record({\n value: fc.integer(),\n next: fc.option(tie(\"node\") as fc.Arbitrary, {\n nil: undefined,\n depthFactor: 1,\n }),\n }),\n })).node;\n fc.assert(\n fc.property(noCycleLinkedListArbitrary, (linkedList) => {\n // Arrange / Act\n const cycleDetected = detectCycleInLinkedList(linkedList);\n\n // Assert\n expect(cycleDetected).toBe(false);\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-04.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Detects no cycles in a non-looping linked list.", "mode": "fast-check"} {"id": 56837, "name": "unknown", "code": "it(\"should detect a cycle in a looping linked list\", () => {\n fc.assert(\n fc.property(fc.array(fc.integer(), { minLength: 1 }), (nodes) => {\n // Arrange\n const lastNode: LinkedList = { value: nodes[0], next: undefined };\n const linkedList = nodes\n .slice(1)\n .reduce((acc, n) => ({ value: n, next: acc }), lastNode);\n lastNode.next = linkedList;\n\n // Act\n const cycleDetected = detectCycleInLinkedList(linkedList);\n\n // Assert\n expect(cycleDetected).toBe(true);\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-04.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Detects a cycle in a linked list that loops back to the start.", "mode": "fast-check"} {"id": 60842, "name": "unknown", "code": "test('updating a context field should update the specified fields and leave everything else untouched', async () => {\n await fc.assert(\n fc\n .asyncProperty(\n contextFieldDto(),\n contextFieldDto(),\n async (original, { name, ...updateData }) => {\n await stores.contextFieldStore.create(original);\n\n const { createdAt, ...updatedData } =\n await stores.contextFieldStore.update({\n name: original.name,\n ...updateData,\n });\n\n const allKeys = [\n 'sortOrder',\n 'stickiness',\n 'description',\n 'legalValues',\n ];\n const updateKeys = Object.keys(updateData);\n\n const unchangedKeys = allKeys.filter(\n (k) => !updateKeys.includes(k),\n );\n\n Object.entries(updateData).forEach(([key, value]) => {\n expect(updatedData[key]).toStrictEqual(value);\n });\n\n for (const key in unchangedKeys) {\n expect(updatedData[key]).toStrictEqual(original[key]);\n }\n },\n )\n .afterEach(cleanup),\n );\n})", "language": "typescript", "source_file": "./repos/StorylineHQ/unleash/src/test/e2e/stores/context-field-store.e2e.test.ts", "start_line": null, "end_line": null, "dependencies": ["contextFieldDto"], "repo": {"name": "StorylineHQ/unleash", "url": "https://github.com/StorylineHQ/unleash.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60843, "name": "unknown", "code": "test(\n 'playgroundResponseSchema',\n () =>\n fc.assert(\n fc.property(\n generate(),\n (data: PlaygroundResponseSchema) =>\n validateSchema(playgroundResponseSchema.$id, data) ===\n undefined,\n ),\n ),\n { timeout: 60000 },\n)", "language": "typescript", "source_file": "./repos/StorylineHQ/unleash/src/lib/openapi/spec/playground-response-schema.test.ts", "start_line": null, "end_line": null, "dependencies": ["generate"], "repo": {"name": "StorylineHQ/unleash", "url": "https://github.com/StorylineHQ/unleash.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56848, "name": "unknown", "code": "it(\"should be able to decompose a product of two numbers\", () => {\n fc.assert(\n fc.property(\n fc.integer({ min: 2, max: 2 ** 31 - 1 }),\n fc.integer({ min: 2, max: 2 ** 31 - 1 }),\n (a, b) => {\n const n = a * b;\n fc.pre(n <= 2 ** 31 - 1);\n const factors = decomposeIntoPrimes(n);\n return factors.length >= 2;\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-02.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The test verifies that a product of two integers can be decomposed into at least two prime factors.", "mode": "fast-check"} {"id": 56849, "name": "unknown", "code": "it(\"should compute the same factors as to the concatenation of the one of a and b for a times b\", () => {\n fc.assert(\n fc.property(\n fc.integer({ min: 2, max: 2 ** 31 - 1 }),\n fc.integer({ min: 2, max: 2 ** 31 - 1 }),\n (a, b) => {\n fc.pre(a * b <= 2 ** 31 - 1);\n const factorsA = decomposeIntoPrimes(a);\n const factorsB = decomposeIntoPrimes(b);\n const factorsAB = decomposeIntoPrimes(a * b);\n expect(sorted(factorsAB)).toEqual(sorted([...factorsA, ...factorsB]));\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-02.spec.ts", "start_line": null, "end_line": null, "dependencies": ["sorted"], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The factors of the product of two integers should match the concatenated factors of the individual integers when decomposed into primes.", "mode": "fast-check"} {"id": 56850, "name": "unknown", "code": "it(\"should detect a substring when there is one\", () => {\n fc.assert(\n fc.property(fc.string(), fc.string(), fc.string(), (a, b, c) => {\n const searchString = b;\n const text = `${a}${b}${c}`;\n expect(lastIndexOf(searchString, text)).not.toBe(-1);\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-01.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Verifies that the `lastIndexOf` function correctly identifies the presence of a given substring within a concatenated string.", "mode": "fast-check"} {"id": 60844, "name": "unknown", "code": "test('playgroundFeatureSchema', () =>\n fc.assert(\n fc.property(\n generate(),\n fc.context(),\n (data: PlaygroundFeatureSchema, ctx) => {\n const results = validateSchema(\n playgroundFeatureSchema.$id,\n data,\n );\n ctx.log(JSON.stringify(results));\n return results === undefined;\n },\n ),\n ))", "language": "typescript", "source_file": "./repos/StorylineHQ/unleash/src/lib/openapi/spec/playground-feature-schema.test.ts", "start_line": null, "end_line": null, "dependencies": ["generate"], "repo": {"name": "StorylineHQ/unleash", "url": "https://github.com/StorylineHQ/unleash.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60845, "name": "unknown", "code": "test('playgroundRequestSchema', () =>\n fc.assert(\n fc.property(\n generate(),\n (data: PlaygroundRequestSchema) =>\n validateSchema(playgroundRequestSchema.$id, data) === undefined,\n ),\n ))", "language": "typescript", "source_file": "./repos/StorylineHQ/unleash/src/lib/openapi/spec/playground-request-schema.test.ts", "start_line": null, "end_line": null, "dependencies": ["generate"], "repo": {"name": "StorylineHQ/unleash", "url": "https://github.com/StorylineHQ/unleash.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60846, "name": "unknown", "code": "test('sdkContextSchema', () =>\n fc.assert(\n fc.property(\n generate(),\n (data: SdkContextSchema) =>\n validateSchema(sdkContextSchema.$id, data) === undefined,\n ),\n ))", "language": "typescript", "source_file": "./repos/StorylineHQ/unleash/src/lib/openapi/spec/sdk-context-schema.test.ts", "start_line": null, "end_line": null, "dependencies": ["generate"], "repo": {"name": "StorylineHQ/unleash", "url": "https://github.com/StorylineHQ/unleash.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60847, "name": "unknown", "code": "it('generates toggles with unique names', () => {\n fc.assert(\n fc.property(\n clientFeatures({ minLength: 2 }),\n (toggles) =>\n toggles.length ===\n [...new Set(toggles.map((feature) => feature.name))].length,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/StorylineHQ/unleash/src/lib/features/playground/playground.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "StorylineHQ/unleash", "url": "https://github.com/StorylineHQ/unleash.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60848, "name": "unknown", "code": "it('should return the provided input arguments as part of the response', async () => {\n await fc.assert(\n fc.asyncProperty(\n generateRequest(),\n async (payload: PlaygroundRequestSchema) => {\n const { request, base } = await getSetup();\n const { body } = await request\n .post(`${base}/api/admin/playground`)\n .send(payload)\n .expect('Content-Type', /json/)\n .expect(200);\n\n expect(body.input).toStrictEqual(payload);\n\n return true;\n },\n ),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/StorylineHQ/unleash/src/lib/features/playground/playground.test.ts", "start_line": null, "end_line": null, "dependencies": ["getSetup"], "repo": {"name": "StorylineHQ/unleash", "url": "https://github.com/StorylineHQ/unleash.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60849, "name": "unknown", "code": "it('should return 400 if any of the required query properties are missing', async () => {\n await fc.assert(\n fc.asyncProperty(\n generateRequest(),\n fc.constantFrom(...playgroundRequestSchema.required),\n async (payload, requiredKey) => {\n const { request, base } = await getSetup();\n\n delete payload[requiredKey];\n\n const { status } = await request\n .post(`${base}/api/admin/playground`)\n .send(payload)\n .expect('Content-Type', /json/);\n\n expect(status).toBe(400);\n },\n ),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/StorylineHQ/unleash/src/lib/features/playground/playground.test.ts", "start_line": null, "end_line": null, "dependencies": ["getSetup"], "repo": {"name": "StorylineHQ/unleash", "url": "https://github.com/StorylineHQ/unleash.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56865, "name": "unknown", "code": "it(\"should check value insertion [fuzz]\", async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.nat(),\n fc.bigInt({ min: 0n, max: r - 1n }),\n fc.array(fc.bigInt({ min: 0n, max: r - 1n }), { minLength: leavesPerNode - 1, maxLength: leavesPerNode - 1 }),\n async (index: number, leaf: bigint, elements: bigint[]) => {\n fc.pre(index < elements.length);\n\n const witness = await splicerCircuit.calculateWitness({\n in: elements,\n leaf,\n index: BigInt(index),\n });\n await splicerCircuit.expectConstraintPass(witness);\n\n const out: bigint[] = [];\n\n for (let i = 0; i < elements.length + 1; i += 1) {\n // eslint-disable-next-line no-await-in-loop\n const value = await getSignal(splicerCircuit, witness, `out[${i}]`);\n out.push(value);\n }\n\n return out.toString() === [...elements.slice(0, index), leaf, ...elements.slice(index)].toString();\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/privacy-scaling-explorations/maci/packages/circuits/ts/__tests__/IncrementalQuinaryTree.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "privacy-scaling-explorations/maci", "url": "https://github.com/privacy-scaling-explorations/maci.git", "license": "MIT", "stars": 571, "forks": 180}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56866, "name": "unknown", "code": "it(\"should throw error if index is out of bounds [fuzz]\", async () => {\n const maxAllowedIndex = 7;\n\n await fc.assert(\n fc.asyncProperty(\n fc.integer({ min: maxAllowedIndex + 1 }),\n fc.bigInt({ min: 0n, max: r - 1n }),\n fc.array(fc.bigInt({ min: 0n, max: r - 1n }), { minLength: leavesPerNode - 1, maxLength: leavesPerNode - 1 }),\n async (index: number, leaf: bigint, elements: bigint[]) => {\n fc.pre(index > elements.length);\n\n return splicerCircuit\n .calculateWitness({\n in: elements,\n leaf,\n index: BigInt(index),\n })\n .then(() => false)\n .catch((error: Error) => error.message.includes(\"Assert Failed\"));\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/privacy-scaling-explorations/maci/packages/circuits/ts/__tests__/IncrementalQuinaryTree.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "privacy-scaling-explorations/maci", "url": "https://github.com/privacy-scaling-explorations/maci.git", "license": "MIT", "stars": 571, "forks": 180}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56872, "name": "unknown", "code": "it(\"should throw error if private key is not in the prime subgroup l\", async () => {\n await fc.assert(\n fc.asyncProperty(fc.bigInt({ min: L, max: r - 1n }), async (privateKey: bigint) => {\n const error = await circuit.expectFail({ privateKey });\n\n return error.includes(\"Assert Failed\");\n }),\n );\n })", "language": "typescript", "source_file": "./repos/privacy-scaling-explorations/maci/packages/circuits/ts/__tests__/PrivToPubKey.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "privacy-scaling-explorations/maci", "url": "https://github.com/privacy-scaling-explorations/maci.git", "license": "MIT", "stars": 571, "forks": 180}, "metrics": null, "summary": "An error should be thrown if the private key is not within the prime subgroup range specified by \\( L \\) and \\( r \\).", "mode": "fast-check"} {"id": 56873, "name": "unknown", "code": "it(\"should correctly produce different public keys for the different private keys [fuzz]\", async () => {\n await fc.assert(\n fc.asyncProperty(fc.bigInt({ min: 1n, max: L - 1n }), async (x: bigint) => {\n const publicKeys = new Map();\n const privateKeys: PrivateKey[] = [];\n\n let i = 0n;\n\n while (x + i * r <= 2n ** 253n) {\n privateKeys.push(new PrivateKey(x + i * r));\n i += 1n;\n }\n\n // eslint-disable-next-line no-restricted-syntax\n for (const privateKey of privateKeys) {\n const publicKey = mulPointEscalar(Base8, BigInt(privateKey.raw));\n\n // eslint-disable-next-line no-await-in-loop\n const witness = await circuit.calculateWitness({\n privateKey: BigInt(privateKey.raw),\n });\n // eslint-disable-next-line no-await-in-loop\n await circuit.expectConstraintPass(witness);\n // eslint-disable-next-line no-await-in-loop\n const derivedPublicKeyX = await getSignal(circuit, witness, \"publicKey[0]\");\n // eslint-disable-next-line no-await-in-loop\n const derivedPublicKeyY = await getSignal(circuit, witness, \"publicKey[1]\");\n\n expect(publicKey[0]).to.eq(derivedPublicKeyX);\n expect(publicKey[1]).to.eq(derivedPublicKeyY);\n\n publicKeys.set(privateKey.serialize(), new PublicKey([derivedPublicKeyX, derivedPublicKeyY]));\n }\n\n const uniquePublicKeys = [...publicKeys.values()].filter(\n (value, index, array) => array.findIndex((publicKey) => publicKey.equals(value)) === index,\n );\n\n return uniquePublicKeys.length === privateKeys.length && uniquePublicKeys.length === publicKeys.size;\n }),\n { numRuns: 10_000 },\n );\n })", "language": "typescript", "source_file": "./repos/privacy-scaling-explorations/maci/packages/circuits/ts/__tests__/PrivToPubKey.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "privacy-scaling-explorations/maci", "url": "https://github.com/privacy-scaling-explorations/maci.git", "license": "MIT", "stars": 571, "forks": 180}, "metrics": null, "summary": "Generating different public keys for different private keys, ensuring each derived public key matches the calculated witness and verifying the uniqueness of the public keys produced.", "mode": "fast-check"} {"id": 56870, "name": "unknown", "code": "it(`should check the computation of correct merkle root (level ${level + 1}) [fuzz]`, async () => {\n await fc.assert(\n fc.asyncProperty(generateLeaves(level + 1), async (leaves: bigint[]) => quinCheckRootTest(leaves)),\n );\n })", "language": "typescript", "source_file": "./repos/privacy-scaling-explorations/maci/packages/circuits/ts/__tests__/IncrementalQuinaryTree.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "privacy-scaling-explorations/maci", "url": "https://github.com/privacy-scaling-explorations/maci.git", "license": "MIT", "stars": 571, "forks": 180}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56877, "name": "unknown", "code": "test('normalizeUndefined', () => {\n fc.assert(\n fc.property(fc.constantFrom(null, undefined), v => {\n expect(normalizeUndefined(v)).toBe(null);\n }),\n );\n fc.assert(\n fc.property(fc.oneof(fc.boolean(), fc.double(), fc.string()), b => {\n expect(normalizeUndefined(b)).toBe(b);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/rocicorp/mono/packages/zql/src/ivm/data.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "rocicorp/mono", "url": "https://github.com/rocicorp/mono.git", "license": "Apache-2.0", "stars": 1802, "forks": 80}, "metrics": null, "summary": "`normalizeUndefined` converts `null` and `undefined` to `null`, while leaving other values unchanged.", "mode": "fast-check"} {"id": 56881, "name": "unknown", "code": "test('compareValues', () => {\n // null and undefined are equal to each other\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.constantFrom(null, undefined),\n (v1, v2) => {\n expect(compareValues(v1, v2)).toBe(0);\n },\n ),\n );\n\n // null and undefined are less than any other value\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.oneof(fc.boolean(), fc.double(), fc.fullUnicodeString()),\n (v1, v2) => {\n expect(compareValues(v1, v2)).lessThan(0);\n expect(compareValues(v2, v1)).greaterThan(0);\n },\n ),\n );\n\n // boolean\n fc.assert(\n fc.property(fc.boolean(), fc.boolean(), (b1, b2) => {\n expect(compareValues(b1, b2)).toBe(b1 === b2 ? 0 : b1 ? 1 : -1);\n }),\n );\n fc.assert(\n fc.property(\n fc.boolean(),\n fc.oneof(fc.double(), fc.fullUnicodeString()),\n (b, v) => {\n expect(() => compareValues(b, v)).toThrow('expected boolean');\n },\n ),\n );\n\n // number\n fc.assert(\n fc.property(fc.double(), fc.double(), (n1, n2) => {\n expect(compareValues(n1, n2)).toBe(n1 - n2);\n }),\n );\n fc.assert(\n fc.property(\n fc.double(),\n fc.oneof(fc.boolean(), fc.fullUnicodeString()),\n (n, v) => {\n expect(() => compareValues(n, v)).toThrow('expected number');\n },\n ),\n );\n\n // string\n fc.assert(\n fc.property(fc.fullUnicodeString(), fc.fullUnicodeString(), (s1, s2) => {\n expect(compareValues(s1, s2)).toBe(compareUTF8(s1, s2));\n }),\n );\n fc.assert(\n fc.property(\n fc.fullUnicodeString(),\n fc.oneof(fc.boolean(), fc.double()),\n (s, v) => {\n expect(() => compareValues(s, v)).toThrow('expected string');\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/rocicorp/mono/packages/zql/src/ivm/data.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "rocicorp/mono", "url": "https://github.com/rocicorp/mono.git", "license": "Apache-2.0", "stars": 1802, "forks": 80}, "metrics": null, "summary": "The `compareValues` function should treat null and undefined as equal, rank them lower than any other types, correctly compare booleans and numbers, and match UTF-8 string comparison, while throwing errors for type mismatches.", "mode": "fast-check"} {"id": 56883, "name": "unknown", "code": "test('compareValues', () => {\n // null and undefined are equal to each other\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.constantFrom(null, undefined),\n (v1, v2) => {\n expect(compareValues(v1, v2)).toBe(0);\n },\n ),\n );\n\n // null and undefined are less than any other value\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.oneof(fc.boolean(), fc.double(), fc.fullUnicodeString()),\n (v1, v2) => {\n expect(compareValues(v1, v2)).lessThan(0);\n expect(compareValues(v2, v1)).greaterThan(0);\n },\n ),\n );\n\n // boolean\n fc.assert(\n fc.property(fc.boolean(), fc.boolean(), (b1, b2) => {\n expect(compareValues(b1, b2)).toBe(b1 === b2 ? 0 : b1 ? 1 : -1);\n }),\n );\n fc.assert(\n fc.property(\n fc.boolean(),\n fc.oneof(fc.double(), fc.fullUnicodeString()),\n (b, v) => {\n expect(() => compareValues(b, v)).toThrow('expected boolean');\n },\n ),\n );\n\n // number\n fc.assert(\n fc.property(fc.double(), fc.double(), (n1, n2) => {\n expect(compareValues(n1, n2)).toBe(n1 - n2);\n }),\n );\n fc.assert(\n fc.property(\n fc.double(),\n fc.oneof(fc.boolean(), fc.fullUnicodeString()),\n (n, v) => {\n expect(() => compareValues(n, v)).toThrow('expected number');\n },\n ),\n );\n\n // string\n fc.assert(\n fc.property(fc.fullUnicodeString(), fc.fullUnicodeString(), (s1, s2) => {\n expect(compareValues(s1, s2)).toBe(compareUTF8(s1, s2));\n }),\n );\n fc.assert(\n fc.property(\n fc.fullUnicodeString(),\n fc.oneof(fc.boolean(), fc.double()),\n (s, v) => {\n expect(() => compareValues(s, v)).toThrow('expected string');\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/rocicorp/mono/packages/zql/src/ivm/data.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "rocicorp/mono", "url": "https://github.com/rocicorp/mono.git", "license": "Apache-2.0", "stars": 1802, "forks": 80}, "metrics": null, "summary": "`compareValues` should return 0 for null and undefined compared to each other, return a negative value for null or undefined compared to any other type, handle boolean comparisons correctly, throw an error for boolean compared to non-boolean values, handle number comparisons correctly, throw an error for numbers compared to non-numeric values, and handle string comparisons correctly while throwing an error for strings compared to non-string values.", "mode": "fast-check"} {"id": 56895, "name": "unknown", "code": "test('fuzz', () => {\n fc.assert(\n fc.property(\n fc.array(fc.array(fc.integer())),\n fc.boolean(),\n (arrays, noDupes) => {\n const sorted = arrays.map(a => a.slice().sort((l, r) => l - r));\n const result = mergeIterables(sorted, (l, r) => l - r, noDupes);\n const expected = sorted.flat().sort((l, r) => l - r);\n expect([...result]).toEqual(\n noDupes ? [...new Set(expected)] : expected,\n );\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/rocicorp/mono/packages/shared/src/iterables.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "rocicorp/mono", "url": "https://github.com/rocicorp/mono.git", "license": "Apache-2.0", "stars": 1802, "forks": 80}, "metrics": null, "summary": "Merging sorted arrays with `mergeIterables` should produce a sorted sequence, removing duplicates if `noDupes` is true.", "mode": "fast-check"} {"id": 56922, "name": "unknown", "code": "test(\n 'playgroundResponseSchema',\n () =>\n fc.assert(\n fc.property(\n generate(),\n (data: PlaygroundResponseSchema) =>\n validateSchema(playgroundResponseSchema.$id, data) ===\n undefined,\n ),\n ),\n { timeout: 60000 },\n)", "language": "typescript", "source_file": "./repos/Unleash/unleash/src/lib/openapi/spec/playground-response-schema.test.ts", "start_line": null, "end_line": null, "dependencies": ["generate"], "repo": {"name": "Unleash/unleash", "url": "https://github.com/Unleash/unleash.git", "license": "Apache-2.0", "stars": 12374, "forks": 783}, "metrics": null, "summary": "Valid `PlaygroundResponseSchema` instances should pass schema validation without errors.", "mode": "fast-check"} {"id": 56925, "name": "unknown", "code": "it('generates toggles with unique names', () => {\n fc.assert(\n fc.property(\n clientFeatures({ minLength: 2 }),\n (toggles) =>\n toggles.length ===\n [...new Set(toggles.map((feature) => feature.name))].length,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/Unleash/unleash/src/lib/features/playground/playground.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Unleash/unleash", "url": "https://github.com/Unleash/unleash.git", "license": "Apache-2.0", "stars": 12374, "forks": 783}, "metrics": null, "summary": "Toggles are generated with unique names to ensure no duplicates exist in their names.", "mode": "fast-check"} {"id": 56928, "name": "unknown", "code": "it('should handle any json value', () => {\n fc.assert(\n fc.property(fc.jsonValue(), fc.jsonValue(), (a, b) => {\n const yDoc = new Y.Doc();\n const rootMap = yDoc.getMap(ROOT_MAP_NAME);\n rootMap.set('stateSliceName', toSharedType(a));\n\n patchYjs(rootMap, 'stateSliceName', a, b);\n\n expect(rootMap.toJSON().stateSliceName).toStrictEqual(b);\n })\n );\n })", "language": "typescript", "source_file": "./repos/lscheibel/redux-yjs-bindings/src/patchYjs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "lscheibel/redux-yjs-bindings", "url": "https://github.com/lscheibel/redux-yjs-bindings.git", "license": "MIT", "stars": 36, "forks": 5}, "metrics": null, "summary": "The `patchYjs` function updates a Yjs map entry to match a given JSON value.", "mode": "fast-check"} {"id": 56950, "name": "unknown", "code": "it('should parse string', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, fc.string(), async (eid, message) => {\n const errorParser = await createContractErrorParser({ contract, eid })\n const parsedError = await errorParser(message)\n\n expect(parsedError).toEqual(new UnknownError(`Unknown error: ${message}`))\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/tests/devtools-evm-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56951, "name": "unknown", "code": "it('should parse an Error', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, fc.string(), async (eid, message) => {\n const errorParser = await createContractErrorParser({ contract, eid })\n const error = new Error(message)\n const parsedError = await errorParser(error)\n\n expect(parsedError).toEqual(new UnknownError(`Unknown error: ${error}`))\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/tests/devtools-evm-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56952, "name": "unknown", "code": "it('should never reject', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, fc.anything(), async (eid, error) => {\n const errorParser = await createContractErrorParser({ contract, eid })\n const parsedError = await errorParser(error)\n\n expect(parsedError).toBeInstanceOf(UnknownError)\n expect(parsedError.reason).toBeUndefined()\n expect(parsedError.message).toMatch(/Unknown error: /)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/tests/devtools-evm-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56953, "name": "unknown", "code": "it('should parse a custom an error with an argument coming from the contract itself', async () => {\n const errorParser = await createErrorParser()\n\n await fc.assert(\n fc.asyncProperty(fc.string(), async (arg) => {\n const error = await assertFailed(contract.throwWithCustomErrorAndArgument(arg))\n const parsedError = await errorParser(error)\n\n expect(parsedError).toEqual(new CustomError('CustomErrorWithAnArgument', [arg]))\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/tests/devtools-evm-hardhat-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56954, "name": "unknown", "code": "it('should parse a custom an error with an argument coming from a nested contract', async () => {\n const errorParser = await createErrorParser()\n\n await fc.assert(\n fc.asyncProperty(fc.string(), async (arg) => {\n const error = await assertFailed(contract.throwNestedWithCustomErrorAndArgument(arg))\n const parsedError = await errorParser(error)\n\n expect(parsedError).toEqual(new CustomError('NestedCustomErrorWithAnArgument', [arg]))\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/tests/devtools-evm-hardhat-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56955, "name": "unknown", "code": "it('should parse a custom an error with an different arguments defined in more contracts coming from the contract itself', async () => {\n const errorParser = await createErrorParser()\n\n await fc.assert(\n fc.asyncProperty(fc.string(), async (arg) => {\n const error = await assertFailed(contract.throwWithCommonErrorAndArgument(arg))\n const parsedError = await errorParser(error)\n\n expect(parsedError).toEqual(new CustomError('CommonErrorWithAnArgument', [arg]))\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/tests/devtools-evm-hardhat-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56956, "name": "unknown", "code": "it('should parse a custom an error with different arguments defined in more contracts coming from a nested contract', async () => {\n const errorParser = await createErrorParser()\n\n await fc.assert(\n fc.asyncProperty(fc.integer({ min: 0 }), async (arg) => {\n const error = await assertFailed(contract.throwNestedWithCommonErrorAndArgument(arg))\n const parsedError = await errorParser(error)\n\n expect(parsedError).toEqual(new CustomError('CommonErrorWithAnArgument', [BigNumber.from(arg)]))\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/tests/devtools-evm-hardhat-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56957, "name": "unknown", "code": "it('should never reject', async () => {\n const errorParser = await createErrorParser()\n\n await fc.assert(\n fc.asyncProperty(fc.anything(), async (error) => {\n const parsedError = await errorParser(error)\n\n expect(parsedError).toBeInstanceOf(UnknownError)\n expect(parsedError.reason).toBeUndefined()\n expect(parsedError.message).toMatch(/Unknown error: /)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/tests/devtools-evm-hardhat-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56958, "name": "unknown", "code": "it('should succeed with a valid config', () => {\n fc.assert(\n fc.property(oappNodeConfigArbitrary, (config) => {\n expect(OAppNodeConfigSchema.parse(config)).toEqual(config)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools/test/oapp/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56959, "name": "unknown", "code": "it('should pass any additional properties through', () => {\n fc.assert(\n fc.property(\n oappNodeConfigArbitrary,\n fc.dictionary(fc.string(), fc.anything()),\n (config, extraProperties) => {\n const combined = Object.assign({}, extraProperties, config)\n\n expect(combined).toMatchObject(OAppNodeConfigSchema.parse(combined))\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools/test/oapp/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56960, "name": "unknown", "code": "it('should call owner on the contract', async () => {\n await fc.assert(\n fc.asyncProperty(omniContractArbitrary, evmAddressArbitrary, async (omniContract, owner) => {\n omniContract.contract.owner.mockResolvedValue(owner)\n\n const sdk = new OApp(omniContract)\n const ownable = Object.assign(sdk, OwnableMixin)\n\n expect(await ownable.getOwner()).toBe(owner)\n expect(omniContract.contract.owner).toHaveBeenCalledTimes(1)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools-evm/test/ownable/mixin.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56961, "name": "unknown", "code": "it('should return true if the owner addresses match', async () => {\n await fc.assert(\n fc.asyncProperty(omniContractArbitrary, evmAddressArbitrary, async (omniContract, owner) => {\n omniContract.contract.owner.mockResolvedValue(owner)\n\n const sdk = new OApp(omniContract)\n const ownable = Object.assign(sdk, OwnableMixin)\n\n expect(await ownable.hasOwner(owner)).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools-evm/test/ownable/mixin.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56962, "name": "unknown", "code": "it('should return false if the owner addresses do not match', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n evmAddressArbitrary,\n evmAddressArbitrary,\n async (omniContract, owner, user) => {\n fc.pre(!areBytes32Equal(owner, user))\n\n omniContract.contract.owner.mockResolvedValue(owner)\n\n const sdk = new OApp(omniContract)\n const ownable = Object.assign(sdk, OwnableMixin)\n\n expect(await ownable.hasOwner(user)).toBeFalsy()\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools-evm/test/ownable/mixin.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56963, "name": "unknown", "code": "it('should encode data for a transferOwnership call', async () => {\n await fc.assert(\n fc.asyncProperty(omniContractArbitrary, evmAddressArbitrary, async (omniContract, owner) => {\n const sdk = new OApp(omniContract)\n const ownable = Object.assign(sdk, OwnableMixin)\n const encodeFunctionData = omniContract.contract.interface.encodeFunctionData as jest.Mock\n\n encodeFunctionData.mockClear()\n\n await ownable.setOwner(owner)\n\n expect(encodeFunctionData).toHaveBeenCalledTimes(1)\n expect(encodeFunctionData).toHaveBeenCalledWith('transferOwnership', [owner])\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools-evm/test/ownable/mixin.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56964, "name": "unknown", "code": "it('should call peers on the contract', async () => {\n await fc.assert(\n fc.asyncProperty(omniContractArbitrary, endpointArbitrary, async (omniContract, peerEid) => {\n const sdk = new OApp(omniContract)\n\n await sdk.getPeer(peerEid)\n\n expect(omniContract.contract.peers).toHaveBeenCalledTimes(1)\n expect(omniContract.contract.peers).toHaveBeenCalledWith(peerEid)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56965, "name": "unknown", "code": "it('should return undefined if peers() returns a zero address, null or undefined', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n evmEndpointArbitrary,\n nullishAddressArbitrary,\n async (omniContract, peerEid, peer) => {\n omniContract.contract.peers.mockResolvedValue(peer)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.getPeer(peerEid)).resolves.toBeUndefined()\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56966, "name": "unknown", "code": "it('should return an address if peers() returns a non-null bytes', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n evmEndpointArbitrary,\n evmAddressArbitrary,\n async (omniContract, peerEid, peer) => {\n fc.pre(!isZero(peer))\n\n omniContract.contract.peers.mockResolvedValue(peer)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.getPeer(peerEid)).resolves.toBe(peer)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56967, "name": "unknown", "code": "it('should return undefined if peers() returns a zero address, null or undefined', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n solanaEndpointArbitrary,\n nullishAddressArbitrary,\n async (omniContract, peerEid, peer) => {\n omniContract.contract.peers.mockResolvedValue(peer)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.getPeer(peerEid)).resolves.toBeUndefined()\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56968, "name": "unknown", "code": "it('should return an address if peers() returns a non-null bytes', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n evmEndpointArbitrary,\n solanaEndpointArbitrary,\n solanaAddressArbitrary,\n async (omniContract, eid, peerEid, peer) => {\n // For Solana we need to take the native address format and turn it into EVM bytes32\n //\n // We do this by normalizing the value into a UInt8Array,\n // then denormalizing it using an EVM eid\n const peerBytes = normalizePeer(peer, peerEid)\n const peerHex = makeBytes32(peerBytes)\n\n fc.pre(!isZero(peerHex))\n\n omniContract.contract.peers.mockResolvedValue(peerHex)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.getPeer(peerEid)).resolves.toBe(peer)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56969, "name": "unknown", "code": "it('should return undefined if peers() returns a zero address, null or undefined', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n aptosEndpointArbitrary,\n nullishAddressArbitrary,\n async (omniContract, peerEid, peer) => {\n omniContract.contract.peers.mockResolvedValue(peer)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.getPeer(peerEid)).resolves.toBeUndefined()\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56970, "name": "unknown", "code": "it('should return an address if peers() returns a non-null bytes', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n aptosEndpointArbitrary,\n aptosAddressArbitrary,\n async (omniContract, peerEid, peer) => {\n fc.pre(!isZero(peer))\n\n omniContract.contract.peers.mockResolvedValue(peer)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.getPeer(peerEid)).resolves.toBe(peer)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56971, "name": "unknown", "code": "it('should return true if peers returns a zero address', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n evmEndpointArbitrary,\n nullishAddressArbitrary,\n nullishAddressArbitrary,\n async (omniContract, peerEid, peer, probePeer) => {\n omniContract.contract.peers.mockResolvedValue(peer)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.hasPeer(peerEid, probePeer)).resolves.toBe(true)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56972, "name": "unknown", "code": "it('should return false if peers returns a non-zero address', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n evmEndpointArbitrary,\n nullishAddressArbitrary,\n evmAddressArbitrary,\n async (omniContract, peerEid, peer, probePeer) => {\n fc.pre(!isZero(probePeer))\n\n omniContract.contract.peers.mockResolvedValue(peer)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.hasPeer(peerEid, probePeer)).resolves.toBe(false)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56973, "name": "unknown", "code": "it('should return true if peers() returns a matching bytes32', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n evmEndpointArbitrary,\n evmAddressArbitrary,\n async (omniContract, peerEid, peer) => {\n omniContract.contract.peers.mockResolvedValue(makeBytes32(peer))\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.hasPeer(peerEid, peer)).resolves.toBe(true)\n await expect(sdk.hasPeer(peerEid, makeBytes32(peer))).resolves.toBe(true)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56974, "name": "unknown", "code": "it('should return true if peers returns a zero address', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n solanaEndpointArbitrary,\n nullishAddressArbitrary,\n async (omniContract, peerEid, peer) => {\n omniContract.contract.peers.mockResolvedValue(peer)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.hasPeer(peerEid, undefined)).resolves.toBe(true)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56975, "name": "unknown", "code": "it('should return false if peers returns a different value', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n solanaEndpointArbitrary,\n solanaAddressArbitrary,\n solanaAddressArbitrary,\n async (omniContract, peerEid, peer, probePeer) => {\n fc.pre(\n !areBytes32Equal(normalizePeer(peer, peerEid), normalizePeer(probePeer, peerEid))\n )\n\n const peerHex = makeBytes32(normalizePeer(peer, peerEid))\n\n omniContract.contract.peers.mockResolvedValue(peerHex)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.hasPeer(peerEid, probePeer)).resolves.toBe(false)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56976, "name": "unknown", "code": "it('should return true if peers() returns a matching value', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n solanaEndpointArbitrary,\n solanaAddressArbitrary,\n async (omniContract, peerEid, peer) => {\n const peerHex = makeBytes32(normalizePeer(peer, peerEid))\n\n omniContract.contract.peers.mockResolvedValue(peerHex)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.hasPeer(peerEid, peer)).resolves.toBe(true)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56977, "name": "unknown", "code": "it('should return true if peers returns a zero address', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n aptosEndpointArbitrary,\n nullishAddressArbitrary,\n nullishAddressArbitrary,\n async (omniContract, peerEid, peer, probePeer) => {\n omniContract.contract.peers.mockResolvedValue(peer)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.hasPeer(peerEid, probePeer)).resolves.toBe(true)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56978, "name": "unknown", "code": "it('should return false if peers returns a non-zero address', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n aptosEndpointArbitrary,\n nullishAddressArbitrary,\n aptosAddressArbitrary,\n async (omniContract, peerEid, peer, probePeer) => {\n fc.pre(!isZero(probePeer))\n\n omniContract.contract.peers.mockResolvedValue(peer)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.hasPeer(peerEid, probePeer)).resolves.toBe(false)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56979, "name": "unknown", "code": "it('should return true if peers() returns a matching bytes32', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n aptosEndpointArbitrary,\n aptosAddressArbitrary,\n async (omniContract, peerEid, peer) => {\n omniContract.contract.peers.mockResolvedValue(makeBytes32(peer))\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.hasPeer(peerEid, peer)).resolves.toBe(true)\n await expect(sdk.hasPeer(peerEid, makeBytes32(peer))).resolves.toBe(true)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56980, "name": "unknown", "code": "it('should encode data for a setPeer call', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n evmEndpointArbitrary,\n evmAddressArbitrary,\n async (omniContract, peerEid, peerAddress) => {\n const sdk = new OApp(omniContract)\n const encodeFunctionData = omniContract.contract.interface.encodeFunctionData\n\n ;(encodeFunctionData as jest.Mock).mockClear()\n\n await sdk.setPeer(peerEid, peerAddress)\n\n expect(encodeFunctionData).toHaveBeenCalledTimes(1)\n expect(encodeFunctionData).toHaveBeenCalledWith('setPeer', [\n peerEid,\n makeBytes32(peerAddress),\n ])\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56981, "name": "unknown", "code": "it('should return an OmniTransaction', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n evmEndpointArbitrary,\n evmAddressArbitrary,\n fc.string(),\n async (omniContract, peerEid, peerAddress, data) => {\n const encodeFunctionData = omniContract.contract.interface.encodeFunctionData as jest.Mock\n encodeFunctionData.mockReturnValue(data)\n\n const sdk = new OApp(omniContract)\n const transaction = await sdk.setPeer(peerEid, peerAddress)\n\n expect(transaction).toEqual({\n data,\n description: `Setting peer for eid ${peerEid} (${formatEid(peerEid)}) to address ${makeBytes32(peerAddress)}`,\n point: {\n eid: omniContract.eid,\n address: omniContract.contract.address,\n },\n })\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56982, "name": "unknown", "code": "it('should encode data for a setPeer call', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n solanaEndpointArbitrary,\n solanaAddressArbitrary,\n async (omniContract, peerEid, peerAddress) => {\n const sdk = new OApp(omniContract)\n const encodeFunctionData = omniContract.contract.interface.encodeFunctionData\n\n ;(encodeFunctionData as jest.Mock).mockClear()\n\n await sdk.setPeer(peerEid, peerAddress)\n\n expect(encodeFunctionData).toHaveBeenCalledTimes(1)\n expect(encodeFunctionData).toHaveBeenCalledWith('setPeer', [\n peerEid,\n makeBytes32(normalizePeer(peerAddress, peerEid)),\n ])\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56983, "name": "unknown", "code": "it('should return an OmniTransaction', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n solanaEndpointArbitrary,\n solanaAddressArbitrary,\n fc.string(),\n async (omniContract, peerEid, peerAddress, data) => {\n const encodeFunctionData = omniContract.contract.interface.encodeFunctionData as jest.Mock\n encodeFunctionData.mockReturnValue(data)\n\n const sdk = new OApp(omniContract)\n const transaction = await sdk.setPeer(peerEid, peerAddress)\n\n expect(transaction).toEqual({\n data,\n description: `Setting peer for eid ${peerEid} (${formatEid(peerEid)}) to address ${makeBytes32(normalizePeer(peerAddress, peerEid))}`,\n point: {\n eid: omniContract.eid,\n address: omniContract.contract.address,\n },\n })\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56984, "name": "unknown", "code": "it('should encode data for a setPeer call', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n aptosEndpointArbitrary,\n aptosAddressArbitrary,\n async (omniContract, peerEid, peerAddress) => {\n const sdk = new OApp(omniContract)\n const encodeFunctionData = omniContract.contract.interface.encodeFunctionData\n\n ;(encodeFunctionData as jest.Mock).mockClear()\n\n await sdk.setPeer(peerEid, peerAddress)\n\n expect(encodeFunctionData).toHaveBeenCalledTimes(1)\n expect(encodeFunctionData).toHaveBeenCalledWith('setPeer', [\n peerEid,\n makeBytes32(peerAddress),\n ])\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56985, "name": "unknown", "code": "it('should return an OmniTransaction', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n aptosEndpointArbitrary,\n aptosAddressArbitrary,\n fc.string(),\n async (omniContract, peerEid, peerAddress, data) => {\n const encodeFunctionData = omniContract.contract.interface.encodeFunctionData as jest.Mock\n encodeFunctionData.mockReturnValue(data)\n\n const sdk = new OApp(omniContract)\n const transaction = await sdk.setPeer(peerEid, peerAddress)\n\n expect(transaction).toEqual({\n data,\n description: `Setting peer for eid ${peerEid} (${formatEid(peerEid)}) to address ${makeBytes32(peerAddress)}`,\n point: {\n eid: omniContract.eid,\n address: omniContract.contract.address,\n },\n })\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56986, "name": "unknown", "code": "it('should reject if the call to endpoint() rejects', async () => {\n await fc.assert(\n fc.asyncProperty(omniContractArbitrary, async (omniContract) => {\n omniContract.contract.endpoint.mockRejectedValue('No you did not')\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.getEndpointSDK()).rejects.toThrow(/Failed to get EndpointV2 address for OApp/)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56987, "name": "unknown", "code": "it('should reject if the call to endpoint() resolves with a zeroish address', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n nullishAddressArbitrary,\n async (omniContract, endpointAddress) => {\n omniContract.contract.endpoint.mockResolvedValue(endpointAddress)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.getEndpointSDK()).rejects.toThrow(\n /EndpointV2 cannot be instantiated: EndpointV2 address has been set to a zero value for OApp/\n )\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56988, "name": "unknown", "code": "it('should return an EndpointV2 if the call to endpoint() resolves with a non-zeroish address', async () => {\n await fc.assert(\n fc.asyncProperty(omniContractArbitrary, evmAddressArbitrary, async (omniContract, endpointAddress) => {\n fc.pre(!isZero(endpointAddress))\n\n omniContract.contract.endpoint.mockResolvedValue(endpointAddress)\n\n const sdk = new OApp(omniContract)\n const endpoint = await sdk.getEndpointSDK()\n\n expect(endpoint).toBeInstanceOf(EndpointV2)\n expect(endpoint.point).toEqual({ eid: sdk.point.eid, address: endpointAddress })\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56989, "name": "unknown", "code": "it('should return the contract name', async () => {\n await fc.assert(\n fc.asyncProperty(omniContractArbitrary, fc.string(), async (omniContract, name) => {\n omniContract.contract.name.mockResolvedValue(name)\n\n const sdk = new ERC20(omniContract)\n\n await expect(sdk.getName()).resolves.toBe(name)\n\n expect(omniContract.contract.name).toHaveBeenCalledTimes(1)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools-evm/test/erc20/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56990, "name": "unknown", "code": "it('should return the contract symbol', async () => {\n await fc.assert(\n fc.asyncProperty(omniContractArbitrary, fc.string(), async (omniContract, symbol) => {\n omniContract.contract.symbol.mockResolvedValue(symbol)\n\n const sdk = new ERC20(omniContract)\n\n await expect(sdk.getSymbol()).resolves.toBe(symbol)\n\n expect(omniContract.contract.symbol).toHaveBeenCalledTimes(1)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools-evm/test/erc20/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56991, "name": "unknown", "code": "it('should return the contract decimals', async () => {\n await fc.assert(\n fc.asyncProperty(omniContractArbitrary, fc.integer({ min: 1 }), async (omniContract, decimals) => {\n omniContract.contract.decimals.mockResolvedValue(decimals)\n\n const sdk = new ERC20(omniContract)\n\n await expect(sdk.getDecimals()).resolves.toBe(decimals)\n\n expect(omniContract.contract.decimals).toHaveBeenCalledTimes(1)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools-evm/test/erc20/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56992, "name": "unknown", "code": "it('should return the user balance', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n evmAddressArbitrary,\n fc.bigInt({ min: BigInt(0) }),\n async (omniContract, user, balance) => {\n omniContract.contract.balanceOf.mockResolvedValue(BigNumber.from(balance))\n\n const sdk = new ERC20(omniContract)\n\n await expect(sdk.getBalanceOf(user)).resolves.toBe(balance)\n\n expect(omniContract.contract.balanceOf).toHaveBeenCalledTimes(1)\n expect(omniContract.contract.balanceOf).toHaveBeenCalledWith(user)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools-evm/test/erc20/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56993, "name": "unknown", "code": "it('should return the user balance', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n evmAddressArbitrary,\n evmAddressArbitrary,\n fc.bigInt({ min: BigInt(0) }),\n async (omniContract, owner, spender, allowance) => {\n omniContract.contract.allowance.mockResolvedValue(BigNumber.from(allowance))\n\n const sdk = new ERC20(omniContract)\n\n await expect(sdk.getAllowance(owner, spender)).resolves.toBe(allowance)\n\n expect(omniContract.contract.allowance).toHaveBeenCalledTimes(1)\n expect(omniContract.contract.allowance).toHaveBeenCalledWith(owner, spender)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/ua-devtools-evm/test/erc20/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56994, "name": "unknown", "code": "it('should not attempt to register libraries multiple times', async () => {\n await fc.assert(\n fc.asyncProperty(\n pointArbitrary,\n pointArbitrary,\n pointArbitrary,\n addressArbitrary,\n async (pointA, pointB, pointC, libraryAddress) => {\n fc.pre(!arePointsEqual(pointA, pointB))\n fc.pre(!arePointsEqual(pointB, pointC))\n fc.pre(!arePointsEqual(pointC, pointA))\n\n const config: EndpointV2EdgeConfig = {\n defaultReceiveLibrary: libraryAddress,\n defaultSendLibrary: libraryAddress,\n }\n\n const graph: EndpointV2OmniGraph = {\n contracts: [],\n connections: [\n {\n vector: { from: pointA, to: pointB },\n config,\n },\n {\n vector: { from: pointA, to: pointC },\n config,\n },\n {\n vector: { from: pointB, to: pointA },\n config,\n },\n {\n vector: { from: pointB, to: pointC },\n config,\n },\n {\n vector: { from: pointC, to: pointA },\n config,\n },\n {\n vector: { from: pointC, to: pointB },\n config,\n },\n ],\n }\n\n const createSdk = jest.fn((point: OmniPoint) => new MockSDK(point) as unknown as IEndpointV2)\n const result = await configureEndpointV2RegisterLibraries(graph, createSdk)\n\n // The result should not contain any duplicate library registrations\n expect(result).toEqual([\n { point: pointA, data: `0xREGISTERLIBRARY ${libraryAddress}` },\n { point: pointB, data: `0xREGISTERLIBRARY ${libraryAddress}` },\n { point: pointC, data: `0xREGISTERLIBRARY ${libraryAddress}` },\n ])\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools/test/endpointv2/config.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56995, "name": "unknown", "code": "it('should sort requiredDVNs and optionalDVNs before encoding', async () => {\n fc.assert(\n fc.property(dvnsArbitrary, (dvns) => {\n const sortedDvns = [...dvns].sort((a, b) => a.localeCompare(b))\n const ulnConfigUnsorted: UlnReadUlnConfig = {\n executor: AddressZero,\n optionalDVNThreshold: 0,\n optionalDVNs: dvns,\n requiredDVNs: dvns,\n }\n\n const ulnConfigSorted: UlnReadUlnConfig = {\n ...ulnConfigUnsorted,\n optionalDVNs: sortedDvns,\n requiredDVNs: sortedDvns,\n }\n\n const ulnConfigEncodedUnsorted = ulnSdk.encodeUlnConfig(ulnConfigUnsorted)\n const ulnConfigEncodedSorted = ulnSdk.encodeUlnConfig(ulnConfigSorted)\n expect(ulnConfigEncodedSorted).toBe(ulnConfigEncodedUnsorted)\n }),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56996, "name": "unknown", "code": "it('should sort requiredDVNs and optionalDVNs', async () => {\n await fc.assert(\n fc.asyncProperty(channelIdArbitrary, dvnsArbitrary, async (eid, dvns) => {\n const sortedDvns = [...dvns].sort((a, b) => a.localeCompare(b))\n const ulnConfigUnsorted: UlnReadUlnConfig = {\n executor: AddressZero,\n optionalDVNThreshold: 0,\n optionalDVNs: dvns,\n requiredDVNs: dvns,\n }\n\n const ulnConfigSorted: UlnReadUlnConfig = {\n ...ulnConfigUnsorted,\n optionalDVNs: sortedDvns,\n requiredDVNs: sortedDvns,\n }\n\n // Let's check that both the sorted and the unsorted config produce the same transaction\n const transactionUnsorted = await ulnSdk.setDefaultUlnConfig(eid, ulnConfigUnsorted)\n const transactionsSorted = await ulnSdk.setDefaultUlnConfig(eid, ulnConfigSorted)\n expect(transactionUnsorted).toEqual(transactionsSorted)\n\n // And let's check that the encoding call is correct and the DVNs are sorted\n expect(transactionsSorted.data).toBe(\n ulnSdk.contract.contract.interface.encodeFunctionData('setDefaultReadLibConfigs', [\n [\n {\n eid,\n config: {\n executor: AddressZero,\n optionalDVNThreshold: 0,\n optionalDVNs: sortedDvns.map(addChecksum),\n requiredDVNs: sortedDvns.map(addChecksum),\n requiredDVNCount: sortedDvns.length,\n optionalDVNCount: sortedDvns.length,\n },\n },\n ],\n ])\n )\n }),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56997, "name": "unknown", "code": "it('should default the missing attributes', async () => {\n await fc.assert(\n fc.asyncProperty(channelIdArbitrary, dvnsArbitrary, async (eid, dvns) => {\n const sortedDvns = [...dvns].sort((a, b) => a.localeCompare(b))\n const ulnUserConfig: UlnReadUlnUserConfig = {\n requiredDVNs: dvns,\n }\n const ulnConfig: UlnReadUlnConfig = {\n requiredDVNs: dvns,\n executor: AddressZero,\n optionalDVNThreshold: 0,\n optionalDVNs: [],\n }\n\n // Let's check that both the sorted and the unsorted config produce the same transaction\n const transactionsWithDefaults = await ulnSdk.setDefaultUlnConfig(eid, ulnUserConfig)\n const transactionsWithFullConfig = await ulnSdk.setDefaultUlnConfig(eid, ulnConfig)\n expect(transactionsWithDefaults).toEqual(transactionsWithFullConfig)\n\n // And let's check that the encoding call is correct and the DVNs are sorted\n expect(transactionsWithDefaults.data).toBe(\n ulnSdk.contract.contract.interface.encodeFunctionData('setDefaultReadLibConfigs', [\n [\n {\n eid,\n config: {\n executor: ulnConfig.executor,\n optionalDVNThreshold: ulnConfig.optionalDVNThreshold,\n optionalDVNs: ulnConfig.optionalDVNs,\n requiredDVNs: sortedDvns.map(addChecksum),\n requiredDVNCount: ulnConfig.requiredDVNs.length,\n optionalDVNCount: ulnConfig.optionalDVNs.length,\n },\n },\n ],\n ])\n )\n }),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56998, "name": "unknown", "code": "it('should return true if the configs are identical', async () => {\n await fc.assert(\n fc.asyncProperty(\n channelIdArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n async (channelId, oapp, ulnConfig) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(ulnSdk.hasAppUlnConfig(channelId, oapp, ulnConfig)).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 56999, "name": "unknown", "code": "it('should return true if config has extra properties', async () => {\n await fc.assert(\n fc.asyncProperty(\n channelIdArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n fc.object(),\n async (channelId, oapp, ulnConfig, extra) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(channelId, oapp, {\n ...extra,\n ...ulnConfig,\n })\n ).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57000, "name": "unknown", "code": "it('should return true if configs with defaults are identical', async () => {\n await fc.assert(\n fc.asyncProperty(\n channelIdArbitrary,\n evmAddressArbitrary,\n dvnsArbitrary,\n async (channelId, oapp, dvns) => {\n const ulnUserConfig: UlnReadUlnUserConfig = {\n requiredDVNs: dvns,\n }\n const ulnConfig: UlnReadUlnConfig = {\n requiredDVNs: dvns,\n optionalDVNs: [],\n optionalDVNThreshold: 0,\n executor: AddressZero,\n }\n\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(ulnSdk.hasAppUlnConfig(channelId, oapp, ulnUserConfig)).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57001, "name": "unknown", "code": "it('should return false if configs with defaults are not identical', async () => {\n await fc.assert(\n fc.asyncProperty(\n channelIdArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n async (channelId, oapp, ulnConfig) => {\n // We only want to test againsts configs that are not\n // equal to the default config\n fc.pre(\n ulnConfig.executor !== AddressZero ||\n ulnConfig.optionalDVNThreshold !== 0 ||\n ulnConfig.optionalDVNs.length !== 0\n )\n\n const ulnUserConfig: UlnReadUlnUserConfig = {\n requiredDVNs: ulnConfig.requiredDVNs,\n }\n\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(ulnSdk.hasAppUlnConfig(channelId, oapp, ulnUserConfig)).resolves.toBeFalsy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57002, "name": "unknown", "code": "it('should return true if the configs are identical except for the dvn casing', async () => {\n await fc.assert(\n fc.asyncProperty(\n channelIdArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n async (channelId, oapp, ulnConfig) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(channelId, oapp, {\n ...ulnConfig,\n requiredDVNs: ulnConfig.requiredDVNs.map(addChecksum),\n optionalDVNs: ulnConfig.optionalDVNs.map(addChecksum),\n })\n ).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57003, "name": "unknown", "code": "it('should return true if the configs are identical except for the dvn sorting and casing', async () => {\n await fc.assert(\n fc.asyncProperty(\n channelIdArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n async (channelId, oapp, ulnConfig) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(channelId, oapp, {\n ...ulnConfig,\n requiredDVNs: ulnConfig.requiredDVNs.map(addChecksum).sort(compareBytes32Ascending),\n optionalDVNs: ulnConfig.optionalDVNs.map(addChecksum).sort(compareBytes32Ascending),\n })\n ).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57004, "name": "unknown", "code": "it('should return false if the confirmations are different', async () => {\n await fc.assert(\n fc.asyncProperty(\n channelIdArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n evmAddressArbitrary,\n async (channelId, oapp, ulnConfig, executor) => {\n fc.pre(executor !== ulnConfig.executor)\n\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(channelId, oapp, {\n ...ulnConfig,\n executor,\n })\n ).resolves.toBeFalsy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57005, "name": "unknown", "code": "it('should return false if the optionalDVNThresholds are different', async () => {\n await fc.assert(\n fc.asyncProperty(\n channelIdArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n fc.integer(),\n async (channelId, oapp, ulnConfig, optionalDVNThreshold) => {\n fc.pre(optionalDVNThreshold !== ulnConfig.optionalDVNThreshold)\n\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(channelId, oapp, {\n ...ulnConfig,\n optionalDVNThreshold,\n })\n ).resolves.toBeFalsy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57006, "name": "unknown", "code": "it('should return false if the requiredDVNs are different', async () => {\n await fc.assert(\n fc.asyncProperty(\n channelIdArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n dvnsArbitrary,\n async (channelId, oapp, ulnConfig, extraRequiredDVNs) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(channelId, oapp, {\n ...ulnConfig,\n requiredDVNs: [...ulnConfig.requiredDVNs, ...extraRequiredDVNs],\n })\n ).resolves.toBeFalsy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57007, "name": "unknown", "code": "it('should return false if the optionalDVNs are different', async () => {\n await fc.assert(\n fc.asyncProperty(\n channelIdArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n dvnsArbitrary,\n async (channelId, oapp, ulnConfig, extraOptionalDVNs) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(channelId, oapp, {\n ...ulnConfig,\n optionalDVNs: [...ulnConfig.optionalDVNs, ...extraOptionalDVNs],\n })\n ).resolves.toBeFalsy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57008, "name": "unknown", "code": "it('should sort requiredDVNs and optionalDVNs before encoding', async () => {\n fc.assert(\n fc.property(dvnsArbitrary, (dvns) => {\n const sortedDvns = [...dvns].sort((a, b) => a.localeCompare(b))\n const ulnConfigUnsorted: Uln302UlnConfig = {\n confirmations: BigInt(100),\n optionalDVNThreshold: 0,\n optionalDVNs: dvns,\n requiredDVNs: dvns,\n }\n\n const ulnConfigSorted: Uln302UlnConfig = {\n ...ulnConfigUnsorted,\n optionalDVNs: sortedDvns,\n requiredDVNs: sortedDvns,\n }\n\n const ulnConfigEncodedUnsorted = ulnSdk.encodeUlnConfig(ulnConfigUnsorted)\n const ulnConfigEncodedSorted = ulnSdk.encodeUlnConfig(ulnConfigSorted)\n expect(ulnConfigEncodedSorted).toBe(ulnConfigEncodedUnsorted)\n }),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57009, "name": "unknown", "code": "it('should sort requiredDVNs and optionalDVNs', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, dvnsArbitrary, async (eid, dvns) => {\n const sortedDvns = [...dvns].sort((a, b) => a.localeCompare(b))\n const ulnConfigUnsorted: Uln302UlnConfig = {\n confirmations: BigInt(100),\n optionalDVNThreshold: 0,\n optionalDVNs: dvns,\n requiredDVNs: dvns,\n }\n\n const ulnConfigSorted: Uln302UlnConfig = {\n ...ulnConfigUnsorted,\n optionalDVNs: sortedDvns,\n requiredDVNs: sortedDvns,\n }\n\n // Let's check that both the sorted and the unsorted config produce the same transaction\n const transactionUnsorted = await ulnSdk.setDefaultUlnConfig(eid, ulnConfigUnsorted)\n const transactionsSorted = await ulnSdk.setDefaultUlnConfig(eid, ulnConfigSorted)\n expect(transactionUnsorted).toEqual(transactionsSorted)\n\n // And let's check that the encoding call is correct and the DVNs are sorted\n expect(transactionsSorted.data).toBe(\n ulnSdk.contract.contract.interface.encodeFunctionData('setDefaultUlnConfigs', [\n [\n {\n eid,\n config: {\n confirmations: BigInt(100),\n optionalDVNThreshold: 0,\n optionalDVNs: sortedDvns.map(addChecksum),\n requiredDVNs: sortedDvns.map(addChecksum),\n requiredDVNCount: sortedDvns.length,\n optionalDVNCount: sortedDvns.length,\n },\n },\n ],\n ])\n )\n }),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57010, "name": "unknown", "code": "it('should default the missing attributes', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, dvnsArbitrary, async (eid, dvns) => {\n const sortedDvns = [...dvns].sort((a, b) => a.localeCompare(b))\n const ulnUserConfig: Uln302UlnUserConfig = {\n requiredDVNs: dvns,\n }\n const ulnConfig: Uln302UlnConfig = {\n requiredDVNs: dvns,\n confirmations: BigInt(0),\n optionalDVNThreshold: 0,\n optionalDVNs: [],\n }\n\n // Let's check that both the sorted and the unsorted config produce the same transaction\n const transactionsWithDefaults = await ulnSdk.setDefaultUlnConfig(eid, ulnUserConfig)\n const transactionsWithFullConfig = await ulnSdk.setDefaultUlnConfig(eid, ulnConfig)\n expect(transactionsWithDefaults).toEqual(transactionsWithFullConfig)\n\n // And let's check that the encoding call is correct and the DVNs are sorted\n expect(transactionsWithDefaults.data).toBe(\n ulnSdk.contract.contract.interface.encodeFunctionData('setDefaultUlnConfigs', [\n [\n {\n eid,\n config: {\n confirmations: ulnConfig.confirmations,\n optionalDVNThreshold: ulnConfig.optionalDVNThreshold,\n optionalDVNs: ulnConfig.optionalDVNs,\n requiredDVNs: sortedDvns.map(addChecksum),\n requiredDVNCount: ulnConfig.requiredDVNs.length,\n optionalDVNCount: ulnConfig.optionalDVNs.length,\n },\n },\n ],\n ])\n )\n }),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57011, "name": "unknown", "code": "it('should return true if the configs are identical', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n async (eid, oapp, ulnConfig) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(eid, oapp, ulnConfig, Uln302ConfigType.Receive)\n ).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57012, "name": "unknown", "code": "it('should return true if config has extra properties', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n fc.object(),\n async (eid, oapp, ulnConfig, extra) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(\n eid,\n oapp,\n {\n ...extra,\n ...ulnConfig,\n },\n Uln302ConfigType.Receive\n )\n ).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57013, "name": "unknown", "code": "it('should return true if configs with defaults are identical', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, evmAddressArbitrary, dvnsArbitrary, async (eid, oapp, dvns) => {\n const ulnUserConfig: Uln302UlnUserConfig = {\n requiredDVNs: dvns,\n }\n const ulnConfig: Uln302UlnConfig = {\n requiredDVNs: dvns,\n optionalDVNs: [],\n optionalDVNThreshold: 0,\n confirmations: BigInt(0),\n }\n\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(eid, oapp, ulnUserConfig, Uln302ConfigType.Receive)\n ).resolves.toBeTruthy()\n }),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57014, "name": "unknown", "code": "it('should return false if configs with defaults are not identical', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n async (eid, oapp, ulnConfig) => {\n // We only want to test againsts configs that are not\n // equal to the default config\n fc.pre(\n ulnConfig.confirmations !== BigInt(0) ||\n ulnConfig.optionalDVNThreshold !== 0 ||\n ulnConfig.optionalDVNs.length !== 0\n )\n\n const ulnUserConfig: Uln302UlnUserConfig = {\n requiredDVNs: ulnConfig.requiredDVNs,\n }\n\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(eid, oapp, ulnUserConfig, Uln302ConfigType.Receive)\n ).resolves.toBeFalsy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57015, "name": "unknown", "code": "it('should return true if the configs are identical except for the dvn casing', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n async (eid, oapp, ulnConfig) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(\n eid,\n oapp,\n {\n ...ulnConfig,\n requiredDVNs: ulnConfig.requiredDVNs.map(addChecksum),\n optionalDVNs: ulnConfig.optionalDVNs.map(addChecksum),\n },\n Uln302ConfigType.Receive\n )\n ).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57016, "name": "unknown", "code": "it('should return true if the configs are identical except for the dvn sorting and casing', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n async (eid, oapp, ulnConfig) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(\n eid,\n oapp,\n {\n ...ulnConfig,\n requiredDVNs: ulnConfig.requiredDVNs.map(addChecksum).sort(compareBytes32Ascending),\n optionalDVNs: ulnConfig.optionalDVNs.map(addChecksum).sort(compareBytes32Ascending),\n },\n Uln302ConfigType.Receive\n )\n ).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57017, "name": "unknown", "code": "it('should return false if the confirmations are different', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n fc.bigInt(),\n async (eid, oapp, ulnConfig, confirmations) => {\n fc.pre(confirmations !== ulnConfig.confirmations)\n\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(\n eid,\n oapp,\n {\n ...ulnConfig,\n confirmations,\n },\n Uln302ConfigType.Receive\n )\n ).resolves.toBeFalsy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57018, "name": "unknown", "code": "it('should return false if the optionalDVNThresholds are different', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n fc.integer(),\n async (eid, oapp, ulnConfig, optionalDVNThreshold) => {\n fc.pre(optionalDVNThreshold !== ulnConfig.optionalDVNThreshold)\n\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(\n eid,\n oapp,\n {\n ...ulnConfig,\n optionalDVNThreshold,\n },\n Uln302ConfigType.Receive\n )\n ).resolves.toBeFalsy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57019, "name": "unknown", "code": "it('should return false if the requiredDVNs are different', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n dvnsArbitrary,\n async (eid, oapp, ulnConfig, extraRequiredDVNs) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(\n eid,\n oapp,\n {\n ...ulnConfig,\n requiredDVNs: [...ulnConfig.requiredDVNs, ...extraRequiredDVNs],\n },\n Uln302ConfigType.Receive\n )\n ).resolves.toBeFalsy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57020, "name": "unknown", "code": "it('should return false if the optionalDVNs are different', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n dvnsArbitrary,\n async (eid, oapp, ulnConfig, extraOptionalDVNs) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(\n eid,\n oapp,\n {\n ...ulnConfig,\n optionalDVNs: [...ulnConfig.optionalDVNs, ...extraOptionalDVNs],\n },\n Uln302ConfigType.Receive\n )\n ).resolves.toBeFalsy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57021, "name": "unknown", "code": "it('should return true if the configs are identical', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n executorConfigArbitrary,\n async (eid, oapp, executorConfig) => {\n getAppExecutorConfigSpy.mockReset()\n getAppExecutorConfigSpy.mockResolvedValue(executorConfig)\n\n await expect(ulnSdk.hasAppExecutorConfig(eid, oapp, executorConfig)).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57022, "name": "unknown", "code": "it('should return true if the configs are identical except for the executor casing', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n executorConfigArbitrary,\n async (eid, oapp, executorConfig) => {\n getAppExecutorConfigSpy.mockReset()\n getAppExecutorConfigSpy.mockResolvedValue(executorConfig)\n\n await expect(\n ulnSdk.hasAppExecutorConfig(eid, oapp, {\n ...executorConfig,\n executor: addChecksum(executorConfig.executor),\n })\n ).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57023, "name": "unknown", "code": "it('should return true if config has extra properties', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n executorConfigArbitrary,\n fc.object(),\n async (eid, oapp, executorConfig, extra) => {\n getAppExecutorConfigSpy.mockReset()\n getAppExecutorConfigSpy.mockResolvedValue(executorConfig)\n\n await expect(\n ulnSdk.hasAppExecutorConfig(eid, oapp, {\n ...extra,\n ...executorConfig,\n })\n ).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57024, "name": "unknown", "code": "it('should reject if the address is a zeroish address', async () => {\n await fc.assert(\n fc.asyncProperty(pointArbitrary, zeroishAddressArbitrary, async (point, address) => {\n const provider = new JsonRpcProvider()\n const sdk = new EndpointV2(provider, point)\n\n await expect(sdk.getUln302SDK(address)).rejects.toThrow(\n /Uln302 cannot be instantiated: Uln302 address cannot be a zero value for Endpoint/\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/endpoint/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57025, "name": "unknown", "code": "it('should return a ULN302 if the address is a non-zeroish address', async () => {\n await fc.assert(\n fc.asyncProperty(pointArbitrary, evmAddressArbitrary, async (point, address) => {\n fc.pre(!isZero(address))\n\n const provider = new JsonRpcProvider()\n\n const sdk = new EndpointV2(provider, point)\n const uln302 = await sdk.getUln302SDK(address)\n\n expect(uln302).toBeInstanceOf(Uln302)\n expect(uln302.point).toEqual({ eid: point.eid, address })\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/endpoint/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57026, "name": "unknown", "code": "it('should return a tuple if the call succeeds', async () => {\n await fc.assert(\n fc.asyncProperty(\n pointArbitrary,\n endpointArbitrary,\n evmAddressArbitrary,\n evmAddressArbitrary,\n fc.boolean(),\n async (point, eid, oappAddress, libraryAddress, isDefault) => {\n const provider = new JsonRpcProvider()\n const sdk = new EndpointV2(provider, point)\n\n jest.spyOn(provider, 'call').mockResolvedValue(\n sdk.contract.contract.interface.encodeFunctionResult('getReceiveLibrary', [\n libraryAddress,\n isDefault,\n ])\n )\n\n await expect(sdk.getReceiveLibrary(oappAddress, eid)).resolves.toEqual([\n addChecksum(libraryAddress),\n isDefault,\n ])\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/endpoint/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57027, "name": "unknown", "code": "it('should return undefined as the default lib if the call fails with LZ_DefaultReceiveLibUnavailable', async () => {\n await fc.assert(\n fc.asyncProperty(\n pointArbitrary,\n endpointArbitrary,\n evmAddressArbitrary,\n async (point, eid, oappAddress) => {\n const provider = new JsonRpcProvider()\n const sdk = new EndpointV2(provider, point)\n // The LZ_DefaultReceiveLibUnavailable error\n const error = { data: '0x78e84d06' }\n\n jest.spyOn(provider, 'call').mockRejectedValue(error)\n\n await expect(sdk.getReceiveLibrary(oappAddress, eid)).resolves.toEqual([undefined, true])\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/endpoint/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57028, "name": "unknown", "code": "it('should reject if call fails but not with LZ_DefaultReceiveLibUnavailable', async () => {\n await fc.assert(\n fc.asyncProperty(\n pointArbitrary,\n endpointArbitrary,\n evmAddressArbitrary,\n async (point, eid, oappAddress) => {\n const provider = new JsonRpcProvider()\n const sdk = new EndpointV2(provider, point)\n const error = { data: '0x86957466' }\n\n jest.spyOn(provider, 'call').mockRejectedValue(error)\n\n await expect(sdk.getReceiveLibrary(oappAddress, eid)).rejects.toEqual(error)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/endpoint/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57029, "name": "unknown", "code": "it('should return an address if the call succeeds', async () => {\n await fc.assert(\n fc.asyncProperty(\n pointArbitrary,\n endpointArbitrary,\n evmAddressArbitrary,\n evmAddressArbitrary,\n async (point, eid, oappAddress, libraryAddress) => {\n const provider = new JsonRpcProvider()\n const sdk = new EndpointV2(provider, point)\n\n jest.spyOn(provider, 'call').mockResolvedValue(\n sdk.contract.contract.interface.encodeFunctionResult('getSendLibrary', [libraryAddress])\n )\n\n await expect(sdk.getSendLibrary(oappAddress, eid)).resolves.toEqual(addChecksum(libraryAddress))\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/endpoint/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57030, "name": "unknown", "code": "it('should return undefined if the call fails with LZ_DefaultSendLibUnavailable', async () => {\n await fc.assert(\n fc.asyncProperty(\n pointArbitrary,\n endpointArbitrary,\n evmAddressArbitrary,\n async (point, eid, oappAddress) => {\n const provider = new JsonRpcProvider()\n const sdk = new EndpointV2(provider, point)\n // The LZ_DefaultReceiveLibUnavailable error\n const error = { data: '0x6c1ccdb5' }\n\n jest.spyOn(provider, 'call').mockRejectedValue(error)\n\n await expect(sdk.getSendLibrary(oappAddress, eid)).resolves.toEqual(undefined)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/endpoint/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57031, "name": "unknown", "code": "it('should reject if call fails but not with LZ_DefaultSendLibUnavailable', async () => {\n await fc.assert(\n fc.asyncProperty(\n pointArbitrary,\n endpointArbitrary,\n evmAddressArbitrary,\n async (point, eid, oappAddress) => {\n const provider = new JsonRpcProvider()\n const sdk = new EndpointV2(provider, point)\n const error = { data: '0x86957466' }\n\n jest.spyOn(provider, 'call').mockRejectedValue(error)\n\n await expect(sdk.getSendLibrary(oappAddress, eid)).rejects.toEqual(error)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/protocol-devtools-evm/test/endpoint/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57032, "name": "unknown", "code": "it('should call onStart & onSuccess when the callback resolves', async () => {\n await fc.assert(\n fc.asyncProperty(fc.array(fc.anything()), fc.anything(), async (args, returnValue) => {\n const fn = jest.fn().mockResolvedValue(returnValue)\n const onStart = jest.fn().mockImplementation((logger: Logger) => logger.debug(`onStart`))\n const onSuccess = jest.fn().mockImplementation((logger: Logger) => logger.debug(`onSuccess`))\n\n await expect(withAsyncLogger(fn, { onStart, onSuccess })(...args)).resolves.toBe(returnValue)\n\n expect(onStart).toHaveBeenCalledWith(expect.anything(), args)\n expect(onSuccess).toHaveBeenCalledWith(expect.anything(), args, returnValue)\n expect(onStart).toHaveBeenCalledBefore(onSuccess)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/io-devtools/test/stdio/logger.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57033, "name": "unknown", "code": "it('should call onStart & onFailure when callback rejects', async () => {\n await fc.assert(\n fc.asyncProperty(fc.array(fc.anything()), fc.anything(), async (args, error) => {\n const fn = jest.fn().mockRejectedValue(error)\n const onStart = jest.fn().mockImplementation((logger: Logger) => logger.debug(`onStart`))\n const onError = jest.fn().mockImplementation((logger: Logger) => logger.debug(`onSuccess`))\n\n await expect(withAsyncLogger(fn, { onStart, onError })(...args)).rejects.toBe(error)\n\n expect(onStart).toHaveBeenCalledWith(expect.anything(), args)\n expect(onError).toHaveBeenCalledWith(expect.anything(), args, error)\n expect(onStart).toHaveBeenCalledBefore(onError)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/io-devtools/test/stdio/logger.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57034, "name": "unknown", "code": "it('should resolve if onSuccess call throws', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.array(fc.anything()),\n fc.anything(),\n fc.anything(),\n async (args, returnValue, loggerError) => {\n const fn = jest.fn().mockResolvedValue(returnValue)\n const onStart = jest.fn().mockImplementation((logger: Logger) => logger.debug(`onStart`))\n const onSuccess = jest.fn().mockImplementation(() => {\n throw loggerError\n })\n\n await expect(withAsyncLogger(fn, { onStart, onSuccess })(...args)).resolves.toBe(\n returnValue\n )\n\n expect(onStart).toHaveBeenCalledWith(expect.anything(), args)\n expect(onSuccess).toHaveBeenCalledWith(expect.anything(), args, returnValue)\n expect(onStart).toHaveBeenCalledBefore(onSuccess)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/io-devtools/test/stdio/logger.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57035, "name": "unknown", "code": "it('should reject with the original error if onError callback throws', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.array(fc.anything()),\n fc.anything(),\n fc.anything(),\n async (args, error, loggerError) => {\n const fn = jest.fn().mockRejectedValue(error)\n const onStart = jest.fn().mockImplementation((logger: Logger) => logger.debug(`onStart`))\n const onError = jest.fn().mockImplementation(() => {\n throw loggerError\n })\n\n await expect(withAsyncLogger(fn, { onStart, onError })(...args)).rejects.toBe(error)\n\n expect(onStart).toHaveBeenCalledWith(expect.anything(), args)\n expect(onError).toHaveBeenCalledWith(expect.anything(), args, error)\n expect(onStart).toHaveBeenCalledBefore(onError)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/io-devtools/test/stdio/logger.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57036, "name": "unknown", "code": "it('should return an empty array when called with an array of nulls and undefineds', () => {\n fc.assert(\n fc.property(fc.array(nullableArbitrary), (transactions) => {\n expect(flattenTransactions(transactions)).toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/transactions/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57037, "name": "unknown", "code": "it('should remove any nulls or undefineds', () => {\n fc.assert(\n fc.property(fc.array(fc.oneof(transactionArbitrary, nullableArbitrary)), (transactions) => {\n const flattened = flattenTransactions(transactions)\n\n for (const transaction of flattened) {\n expect(transaction).not.toBeNull()\n expect(transaction).not.toBeUndefined()\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/transactions/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57038, "name": "unknown", "code": "it('should flatten any arrays', () => {\n fc.assert(\n fc.property(\n fc.array(fc.oneof(transactionArbitrary, nullableArbitrary, fc.array(transactionArbitrary))),\n (transactions) => {\n const flattened = flattenTransactions(transactions)\n\n for (const transaction of flattened) {\n expect(transaction).not.toBeInstanceOf(Array)\n }\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/transactions/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57039, "name": "unknown", "code": "it('should return a map with containing all the transactions passed in', () => {\n fc.assert(\n fc.property(fc.array(transactionArbitrary), (transactions) => {\n const grouped = groupTransactionsByEid(transactions)\n\n for (const transaction of transactions) {\n expect(grouped.get(transaction.point.eid)).toContain(transaction)\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/transactions/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57040, "name": "unknown", "code": "it('should preserve the order of transaction per group', () => {\n fc.assert(\n fc.property(fc.array(transactionArbitrary), (transactions) => {\n const grouped = groupTransactionsByEid(transactions)\n\n for (const transactionsForEid of grouped.values()) {\n // Here we want to make sure that within a group of transactions,\n // no transactions have changed order\n //\n // The logic here goes something like this:\n // - We look for the indices of transactions from the grouped array in the original array\n // - If two transactions swapped places, this array would then contain an inversion\n // (transaction at an earlier index in the grouped array would appear after a transaction\n // at a later index). So what we do is remove the inversions by sorting the array of indices\n // and make sure this sorted array matches the original one\n const transactionIndices = transactionsForEid.map((t) => transactions.indexOf(t))\n const sortedTransactionIndices = transactionIndices.slice().sort()\n\n expect(transactionIndices).toEqual(sortedTransactionIndices)\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/transactions/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57041, "name": "unknown", "code": "it('should parse successfully', () => {\n fc.assert(\n fc.property(pointArbitrary, good, (point, config) => {\n expect(schema.safeParse({ point, config }).success).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57042, "name": "unknown", "code": "it('should not parse', () => {\n fc.assert(\n fc.property(pointArbitrary, bad, (point, config) => {\n expect(schema.safeParse({ point, config }).success).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57043, "name": "unknown", "code": "it('should parse successfully', () => {\n fc.assert(\n fc.property(vectorArbitrary, good, (vector, config) => {\n expect(schema.safeParse({ vector, config }).success).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57044, "name": "unknown", "code": "it('should not parse', () => {\n fc.assert(\n fc.property(vectorArbitrary, bad, (vector, config) => {\n expect(schema.safeParse({ vector, config }).success).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57045, "name": "unknown", "code": "it('should work for non-negative bigints', () => {\n fc.assert(\n fc.property(fc.bigInt({ min: BigInt(0) }), (value) => {\n expect(UIntBigIntSchema.parse(value)).toBe(value)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57046, "name": "unknown", "code": "it('should not work for negative bigints', () => {\n fc.assert(\n fc.property(fc.bigInt({ max: BigInt(-1) }), (value) => {\n expect(() => UIntBigIntSchema.parse(value)).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57057, "name": "unknown", "code": "it('should not work for negative integer strings', () => {\n fc.assert(\n fc.property(fc.integer({ max: -1 }), (value) => {\n expect(() => UIntNumberSchema.parse(String(value))).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`UIntNumberSchema.parse` throws an error when attempting to parse negative integer strings.", "mode": "fast-check"} {"id": 57068, "name": "unknown", "code": "it('should be true for value equal vector', () => {\n fc.assert(\n fc.property(vectorArbitrary, (vector) => {\n expect(areVectorsEqual(vector, { ...vector })).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`areVectorsEqual` returns true when comparing a vector object to itself.", "mode": "fast-check"} {"id": 57077, "name": "unknown", "code": "it('should return true if two points are on the same stage', () => {\n fc.assert(\n fc.property(endpointArbitrary, endpointArbitrary, addressArbitrary, (eid1, eid2, address) => {\n fc.pre(endpointIdToStage(eid1) === endpointIdToStage(eid2))\n\n expect(\n isVectorPossible({ from: { eid: eid1, address }, to: { eid: eid2, address } })\n ).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`isVectorPossible` returns true for two points when their endpoint IDs correspond to the same stage.", "mode": "fast-check"} {"id": 57087, "name": "unknown", "code": "it('should not add a duplicate node', () => {\n fc.assert(\n fc.property(nodeArbitrary, (node) => {\n const builder = new OmniGraphBuilder()\n\n builder.addNodes(node, node)\n expect(builder.nodes).toEqual([node])\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Adding the same node twice to `OmniGraphBuilder` should result in a single node in the graph.", "mode": "fast-check"} {"id": 57091, "name": "unknown", "code": "it('should remove a node at a specified point', () => {\n fc.assert(\n fc.property(nodeArbitrary, (node) => {\n const builder = new OmniGraphBuilder()\n\n builder.addNodes(node)\n builder.removeNodeAt(node.point)\n expect(builder.nodes).toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Removing a node at a specified point in `OmniGraphBuilder` results in an empty node list.", "mode": "fast-check"} {"id": 57092, "name": "unknown", "code": "it('should not remove nodes at different points', () => {\n fc.assert(\n fc.property(nodeArbitrary, nodeArbitrary, (nodeA, nodeB) => {\n fc.pre(!arePointsEqual(nodeA.point, nodeB.point))\n\n const builder = new OmniGraphBuilder()\n\n builder.addNodes(nodeA, nodeB)\n builder.removeNodeAt(nodeA.point)\n expect(builder.nodes).toEqual([nodeB])\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`OmniGraphBuilder` should retain nodes with differing points when one is removed.", "mode": "fast-check"} {"id": 57100, "name": "unknown", "code": "it('should not do anything when there are no edges', () => {\n fc.assert(\n fc.property(edgeArbitrary, (edge) => {\n fc.pre(isVectorPossible(edge.vector))\n\n const builder = new OmniGraphBuilder()\n\n builder.removeEdgeAt(edge.vector)\n expect(builder.edges).toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`OmniGraphBuilder` retains an empty edge list when attempting to remove edges from a vector that doesn't exist.", "mode": "fast-check"} {"id": 57106, "name": "unknown", "code": "it('should return node when there is a node at a specified point', () => {\n fc.assert(\n fc.property(nodesArbitrary, (nodes) => {\n const node = nodes.at(-1)\n fc.pre(node != null)\n\n const builder = new OmniGraphBuilder()\n\n builder.addNodes(...nodes)\n expect(builder.getNodeAt(node!.point)).toBe(node)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`OmniGraphBuilder` returns the correct node when a node exists at a specified point.", "mode": "fast-check"} {"id": 57107, "name": "unknown", "code": "it('should return undefined when there are no edges', () => {\n const builder = new OmniGraphBuilder()\n\n fc.assert(\n fc.property(vectorArbitrary, (vector) => {\n expect(builder.getEdgeAt(vector)).toBeUndefined()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`OmniGraphBuilder.getEdgeAt` returns undefined when there are no edges.", "mode": "fast-check"} {"id": 57114, "name": "unknown", "code": "it('should return the first transaction as failed if createSigner fails', async () => {\n await fc.assert(\n fc.asyncProperty(fc.array(transactionArbitrary), async (transactions) => {\n const signerFactory: OmniSignerFactory = jest\n .fn()\n .mockImplementation((eid: EndpointId) => Promise.reject(new Error(`So sorry ${eid}`)))\n const signAndSendTransactions = createSignAndSend(signerFactory)\n\n // Now we send all the transactions to the flow and observe the output\n const [successful, errors, pending] = await signAndSendTransactions(transactions)\n\n const grouped = groupTransactionsByEid(transactions)\n\n // We expect none of the transactions to go through\n expect(successful).toEqual([])\n // We expect the errors to contain the first transaction and the wrapped error from the signer factory\n expect(errors).toEqual(\n Array.from(grouped.entries()).map(([eid, transactions]) => ({\n error: new Error(\n `Failed to create a signer for ${formatEid(eid)}: ${new Error(`So sorry ${eid}`)}`\n ),\n transaction: transactions[0],\n }))\n )\n // And we expect all the transactions to be pending\n expect(pending).toContainAllValues(\n Array.from(grouped.entries()).flatMap(([, transactions]) => transactions)\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "When `createSigner` fails, the first transaction should be marked as failed with the appropriate error, while no transactions are successful, and all are pending.", "mode": "fast-check"} {"id": 57124, "name": "unknown", "code": "it('should return identity for bytes32', () => {\n fc.assert(\n fc.property(evmBytes32Arbitrary, (bytes) => {\n expect(makeBytes32(bytes)).toBe(bytes)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`makeBytes32` returns the same value when given `bytes32`.", "mode": "fast-check"} {"id": 57130, "name": "unknown", "code": "it('should return true for identical UInt8Arrays', () => {\n fc.assert(\n fc.property(fc.uint8Array({ minLength: 1 }), (bytes) => {\n expect(areBytes32Equal(bytes, bytes)).toBe(true)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`areBytes32Equal` returns true for identical `UInt8Arrays`.", "mode": "fast-check"} {"id": 57131, "name": "unknown", "code": "it('should return true for a UInt8Array & its hex representation', () => {\n fc.assert(\n fc.property(fc.uint8Array({ minLength: 1, maxLength: 32 }), (bytes) => {\n expect(areBytes32Equal(bytes, makeBytes32(bytes))).toBe(true)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`areBytes32Equal` returns true when comparing a `UInt8Array` with its hex representation created by `makeBytes32`.", "mode": "fast-check"} {"id": 57134, "name": "unknown", "code": "it('should return false with non-zero address', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, (address) => {\n fc.pre(address !== AddressZero)\n\n expect(isZero(address)).toBe(false)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`isZero` should return false when given a non-zero address.", "mode": "fast-check"} {"id": 57135, "name": "unknown", "code": "it('should return false with non-zero bytes32', () => {\n fc.assert(\n fc.property(evmBytes32Arbitrary, (address) => {\n fc.pre(address !== ZERO_BYTES)\n\n expect(isZero(address)).toBe(false)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`isZero` returns false for non-zero `bytes32` values.", "mode": "fast-check"} {"id": 57137, "name": "unknown", "code": "it('should return false with a non-zero UInt8Array', () => {\n fc.assert(\n fc.property(fc.uint8Array({ minLength: 1 }), (bytes) => {\n fc.pre(bytes.some((byte) => byte !== 0))\n\n expect(isZero(bytes)).toBe(false)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`isZero` should return false for a `UInt8Array` containing non-zero elements.", "mode": "fast-check"} {"id": 57138, "name": "unknown", "code": "it('should return address with non-zero address', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, (address) => {\n fc.pre(address !== AddressZero)\n\n expect(ignoreZero(address)).toBe(address)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`ignoreZero` returns the same address if it is not the zero address.", "mode": "fast-check"} {"id": 57146, "name": "unknown", "code": "it('should execute one by one', async () => {\n await fc.assert(\n fc.asyncProperty(valuesArbitrary, async (values) => {\n fc.pre(values.length > 0)\n\n const tasks = values.map((value) => jest.fn().mockResolvedValue(value))\n\n await sequence(tasks)\n\n tasks.reduce((task1, task2) => {\n return expect(task1).toHaveBeenCalledBefore(task2), task2\n })\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Ensures that a sequence of tasks is executed in order, with each task being called before the next.", "mode": "fast-check"} {"id": 57147, "name": "unknown", "code": "it('should resolve if the first task resolves', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, valuesArbitrary, async (value, errors) => {\n const task = jest.fn().mockResolvedValue(value)\n const tasks = errors.map((error) => jest.fn().mockRejectedValue(error))\n\n expect(await first([task, ...tasks])).toBe(value)\n\n // Make sure none of the other factories got called\n for (const factory of tasks) {\n expect(factory).not.toHaveBeenCalled()\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57148, "name": "unknown", "code": "it('should resolve with the first successful task', async () => {\n await fc.assert(\n fc.asyncProperty(valuesArbitrary, valueArbitrary, async (errors, value) => {\n const tasks = errors.map((error) => jest.fn().mockRejectedValue(error))\n const task = jest.fn().mockResolvedValue(value)\n\n expect(await first([...tasks, task])).toBe(value)\n\n // Make sure all the tasks got called\n for (const factory of tasks) {\n expect(factory).toHaveBeenCalledTimes(1)\n }\n\n expect(task).toHaveBeenCalledTimes(1)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57149, "name": "unknown", "code": "it('should reject with the last rejected task error', async () => {\n await fc.assert(\n fc.asyncProperty(valuesArbitrary, valueArbitrary, async (errors, error) => {\n const tasks = errors.map((error) => jest.fn().mockRejectedValue(error))\n const task = jest.fn().mockRejectedValue(error)\n\n await expect(first([...tasks, task])).rejects.toBe(error)\n\n // Make sure all the tasks got called\n for (const factory of tasks) {\n expect(factory).toHaveBeenCalledTimes(1)\n }\n\n expect(task).toHaveBeenCalledTimes(1)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57150, "name": "unknown", "code": "it('should resolve if the first factory resolves', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, valuesArbitrary, async (value, values) => {\n const successful = jest.fn().mockResolvedValue(value)\n const successfulOther = values.map((value) => jest.fn().mockResolvedValue(value))\n const factory = firstFactory(successful, ...successfulOther)\n\n expect(await factory()).toBe(value)\n\n // Make sure none of the other factories got called\n for (const factory of successfulOther) {\n expect(factory).not.toHaveBeenCalled()\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57151, "name": "unknown", "code": "it('should resolve with the first successful factory', async () => {\n await fc.assert(\n fc.asyncProperty(valuesArbitrary, valueArbitrary, async (errors, value) => {\n const failing = errors.map((error) => jest.fn().mockRejectedValue(error))\n const successful = jest.fn().mockResolvedValue(value)\n const factory = firstFactory(...failing, successful)\n\n expect(await factory()).toBe(value)\n\n // Make sure all the tasks got called\n for (const factory of failing) {\n expect(factory).toHaveBeenCalledTimes(1)\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57152, "name": "unknown", "code": "it('should pass the input to factories', async () => {\n await fc.assert(\n fc.asyncProperty(valuesArbitrary, valueArbitrary, valuesArbitrary, async (errors, value, args) => {\n const failing = errors.map((error) => jest.fn().mockRejectedValue(error))\n const successful = jest.fn().mockResolvedValue(value)\n const factory = firstFactory(...failing, successful)\n\n expect(await factory(...args)).toBe(value)\n\n // Make sure all the tasks got called with the correct arguments\n for (const factory of failing) {\n expect(factory).toHaveBeenCalledTimes(1)\n expect(factory).toHaveBeenCalledWith(...args)\n }\n\n expect(successful).toHaveBeenCalledTimes(1)\n expect(successful).toHaveBeenCalledWith(...args)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57153, "name": "unknown", "code": "it('should resolve with the return value of a synchronous task', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, async (value) => {\n const task = jest.fn().mockReturnValue(value)\n const handleError = jest.fn()\n\n await expect(mapError(task, handleError)).resolves.toBe(value)\n expect(handleError).not.toHaveBeenCalled()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57154, "name": "unknown", "code": "it('should resolve with the resolution value of an asynchronous task', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, async (value) => {\n const task = jest.fn().mockResolvedValue(value)\n const handleError = jest.fn()\n\n await expect(mapError(task, handleError)).resolves.toBe(value)\n expect(handleError).not.toHaveBeenCalled()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57155, "name": "unknown", "code": "it('should reject and call the toError callback if a synchronous task throws', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, valueArbitrary, async (error, mappedError) => {\n const task = jest.fn().mockImplementation(() => {\n throw error\n })\n const handleError = jest.fn().mockReturnValue(mappedError)\n\n await expect(mapError(task, handleError)).rejects.toBe(mappedError)\n expect(handleError).toHaveBeenCalledOnce()\n expect(handleError).toHaveBeenCalledExactlyOnceWith(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57156, "name": "unknown", "code": "it('should reject and call the toError callback if an asynchronous task rejects', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, valueArbitrary, async (error, mappedError) => {\n const task = jest.fn().mockRejectedValue(error)\n const handleError = jest.fn().mockReturnValue(mappedError)\n\n await expect(mapError(task, handleError)).rejects.toBe(mappedError)\n expect(handleError).toHaveBeenCalledOnce()\n expect(handleError).toHaveBeenCalledExactlyOnceWith(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57157, "name": "unknown", "code": "it('should resolve with the return value of a synchronous task', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, async (value) => {\n const task = jest.fn().mockReturnValue(value)\n const handleError = jest.fn()\n\n await expect(tapError(task, handleError)).resolves.toBe(value)\n expect(handleError).not.toHaveBeenCalled()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57158, "name": "unknown", "code": "it('should resolve with the resolution value of an asynchronous task', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, async (value) => {\n const task = jest.fn().mockResolvedValue(value)\n const handleError = jest.fn()\n\n await expect(tapError(task, handleError)).resolves.toBe(value)\n expect(handleError).not.toHaveBeenCalled()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57159, "name": "unknown", "code": "it('should reject and call the onError callback if a synchronous task throws', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, async (error) => {\n const task = jest.fn().mockImplementation(() => {\n throw error\n })\n const handleError = jest.fn()\n\n await expect(tapError(task, handleError)).rejects.toBe(error)\n expect(handleError).toHaveBeenCalledOnce()\n expect(handleError).toHaveBeenCalledExactlyOnceWith(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57160, "name": "unknown", "code": "it('should reject and call the onError callback if an asynchronous task rejects', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, async (error) => {\n const task = jest.fn().mockRejectedValue(error)\n const handleError = jest.fn()\n\n await expect(tapError(task, handleError)).rejects.toBe(error)\n expect(handleError).toHaveBeenCalledOnce()\n expect(handleError).toHaveBeenCalledExactlyOnceWith(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57161, "name": "unknown", "code": "it('should reject with the original error if the onError callback throws', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, valueArbitrary, async (error, anotherError) => {\n const task = jest.fn().mockRejectedValue(error)\n const handleError = jest.fn().mockImplementation(() => {\n throw anotherError\n })\n\n await expect(tapError(task, handleError)).rejects.toBe(error)\n expect(handleError).toHaveBeenCalledOnce()\n expect(handleError).toHaveBeenCalledExactlyOnceWith(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57162, "name": "unknown", "code": "it('should reject with the original error if the onError callback rejects', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, valueArbitrary, async (error, anotherError) => {\n const task = jest.fn().mockRejectedValue(error)\n const handleError = jest.fn().mockRejectedValue(anotherError)\n\n await expect(tapError(task, handleError)).rejects.toBe(error)\n expect(handleError).toHaveBeenCalledOnce()\n expect(handleError).toHaveBeenCalledExactlyOnceWith(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57163, "name": "unknown", "code": "it('should throw', () => {\n fc.assert(\n fc.property(numAttemptsArbitrary, (numAttempts) => {\n expect(() => createSimpleRetryStrategy(numAttempts)).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57164, "name": "unknown", "code": "it('should return a function that returns true until numAttempts is reached', () => {\n fc.assert(\n fc.property(numAttemptsArbitrary, (numAttempts) => {\n const strategy = createSimpleRetryStrategy(numAttempts)\n\n // The first N attempts should return true since we want to retry them\n for (let attempt = 1; attempt <= numAttempts; attempt++) {\n expect(strategy(attempt, 'error', [], [])).toBeTruthy()\n }\n\n // The N+1th attempt should return false\n expect(strategy(numAttempts + 1, 'error', [], [])).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57165, "name": "unknown", "code": "it('should return false if the amount of attempts has been reached, the wrapped strategy value otherwise', () => {\n fc.assert(\n fc.property(numAttemptsArbitrary, (numAttempts) => {\n // We'll create a simple wrapped strategy\n const wrappedStrategy = (attempt: number) => [attempt]\n const strategy = createSimpleRetryStrategy(numAttempts, wrappedStrategy)\n\n // The first N attempts should return the return value of the wrapped strategy\n for (let attempt = 1; attempt <= numAttempts; attempt++) {\n expect(strategy(attempt, 'error', [0], [0])).toEqual(wrappedStrategy(attempt))\n }\n\n // The N+1th attempt should return false\n expect(strategy(numAttempts + 1, 'error', [0], [0])).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57166, "name": "unknown", "code": "it('should have addition, update and deletion working correctly', () => {\n fc.assert(\n fc.property(keyArbitrary, valueArbitrary, valueArbitrary, (key, value1, value2) => {\n const map = new TestMap()\n\n // Sanity check first\n expect(map.has(key)).toBeFalsy()\n\n // Set a value first\n map.set(key, value1)\n\n // Check whether the insertion worked\n expect(map.has(key)).toBeTruthy()\n expect(map.size).toBe(1)\n expect(map.get(key)).toBe(value1)\n expect(Array.from(map.keys())).toEqual([key])\n expect(Array.from(map.values())).toEqual([value1])\n expect(Array.from(map.entries())).toEqual([[key, value1]])\n\n // Now overwrite the value\n map.set(key, value2)\n\n // Check whether the insertion worked\n expect(map.has(key)).toBeTruthy()\n expect(map.size).toBe(1)\n expect(map.get(key)).toBe(value2)\n expect(Array.from(map.keys())).toEqual([key])\n expect(Array.from(map.values())).toEqual([value2])\n expect(Array.from(map.entries())).toEqual([[key, value2]])\n\n // Now delete the value\n map.delete(key)\n\n // And check that the deletion worked\n expect(map.has(key)).toBeFalsy()\n expect(map.size).toBe(0)\n expect(map.get(key)).toBeUndefined()\n expect(Array.from(map.keys())).toEqual([])\n expect(Array.from(map.values())).toEqual([])\n expect(Array.from(map.entries())).toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/map.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57167, "name": "unknown", "code": "it('should instantiate from entries', () => {\n fc.assert(\n fc.property(fc.array(fc.tuple(keyArbitrary, valueArbitrary)), (entries) => {\n const map = new TestMap(entries)\n\n // This looks like the simplest way of deduplicating the entries\n //\n // For the test below we want to make sure that we check that the map\n // contains the last value belonging to a key - entries can contain\n // duplicate keys so we need this helper data structure to store the last value set for a key\n const valuesByHash = Object.fromEntries(entries.map(([key, value]) => [hash(key), value]))\n\n for (const [key] of entries) {\n const hashedKey = hash(key)\n expect(hashedKey in valuesByHash).toBeTruthy()\n\n const value = valuesByHash[hashedKey]\n\n expect(map.has(key)).toBeTruthy()\n expect(map.get(key)).toBe(value)\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/map.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57168, "name": "unknown", "code": "it('should clear correctly', () => {\n fc.assert(\n fc.property(fc.array(fc.tuple(keyArbitrary, valueArbitrary)), (entries) => {\n const map = new TestMap(entries)\n\n map.clear()\n\n expect(map.size).toBe(0)\n expect(Array.from(map.keys())).toEqual([])\n expect(Array.from(map.values())).toEqual([])\n expect(Array.from(map.entries())).toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/map.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57169, "name": "unknown", "code": "it('should call forEach correctly', () => {\n fc.assert(\n fc.property(fc.array(fc.tuple(keyArbitrary, valueArbitrary)), (entries) => {\n const map = new TestMap(entries)\n const callback = jest.fn()\n\n map.forEach(callback)\n\n // We'll get the entries from the map since the original entries\n // might contain duplicates\n const mapEntries = Array.from(map.entries())\n expect(callback).toHaveBeenCalledTimes(mapEntries.length)\n\n for (const [key, value] of mapEntries) {\n expect(callback).toHaveBeenCalledWith(value, key, map)\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/map.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57170, "name": "unknown", "code": "it('should use orElse if a key is not defined', () => {\n fc.assert(\n fc.property(keyArbitrary, valueArbitrary, valueArbitrary, (key, value, orElseValue) => {\n const map = new TestMap()\n const orElse = jest.fn().mockReturnValue(orElseValue)\n\n // Sanity check first\n expect(map.has(key)).toBeFalsy()\n\n // If the key has not been set, the map should use orElse\n expect(map.getOrElse(key, orElse)).toBe(orElseValue)\n\n // Set a value first\n map.set(key, value)\n\n // And check that orElse is not being used\n expect(map.getOrElse(key, orElse)).toBe(value)\n\n // Now delete the value\n map.delete(key)\n\n // And check that orElse is being used again\n expect(map.getOrElse(key, orElse)).toBe(orElseValue)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/map.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57171, "name": "unknown", "code": "it('should normalize a nullish value to empty bytes', () => {\n fc.assert(\n fc.property(evmEndpointArbitrary, nullishArbitrary, (eid, address) => {\n const normalized = normalizePeer(address, eid)\n const denormalized = denormalizePeer(normalized, eid)\n\n expect(normalized).toEqual(new Uint8Array(32))\n expect(isZero(normalized)).toBe(true)\n expect(isZero(denormalized)).toBe(true)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57172, "name": "unknown", "code": "it('should normalize a peer correctly', () => {\n fc.assert(\n fc.property(evmEndpointArbitrary, evmAddressArbitrary, (eid, address) => {\n const normalized = normalizePeer(address, eid)\n const denormalized = denormalizePeer(normalized, eid)\n\n expect(denormalized).toBe(address)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57173, "name": "unknown", "code": "it('should normalize a nullish value to empty bytes', () => {\n fc.assert(\n fc.property(aptosEndpointArbitrary, nullishArbitrary, (eid, address) => {\n const normalized = normalizePeer(address, eid)\n const denormalized = denormalizePeer(normalized, eid)\n\n expect(normalized).toEqual(new Uint8Array(32))\n expect(isZero(normalized)).toBe(true)\n expect(isZero(denormalized)).toBe(true)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57174, "name": "unknown", "code": "it('should normalize a peer correctly', () => {\n fc.assert(\n fc.property(aptosEndpointArbitrary, aptosAddressArbitrary, (eid, address) => {\n const normalized = normalizePeer(address, eid)\n const denormalized = denormalizePeer(normalized, eid)\n\n expect(denormalized).toBe(address)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57175, "name": "unknown", "code": "it('should normalize a nullish value to empty bytes', () => {\n fc.assert(\n fc.property(solanaEndpointArbitrary, nullishArbitrary, (eid, address) => {\n const normalized = normalizePeer(address, eid)\n const denormalized = denormalizePeer(normalized, eid)\n\n expect(normalized).toEqual(new Uint8Array(32))\n expect(isZero(normalized)).toBe(true)\n expect(isZero(denormalized)).toBe(true)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57176, "name": "unknown", "code": "it('should normalize a peer correctly', () => {\n fc.assert(\n fc.property(solanaEndpointArbitrary, solanaAddressArbitrary, (eid, address) => {\n const normalized = normalizePeer(address, eid)\n const denormalized = denormalizePeer(normalized, eid)\n\n expect(denormalized).toBe(address)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57177, "name": "unknown", "code": "it('should return true for identical values', () => {\n fc.assert(\n fc.property(fc.anything(), (value) => {\n expect(isDeepEqual(value, value)).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/assertion.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57178, "name": "unknown", "code": "it('should return true for arrays containing the same values', () => {\n fc.assert(\n fc.property(arrayArbitrary, (array) => {\n expect(isDeepEqual(array, [...array])).toBeTruthy()\n expect(isDeepEqual([...array], array)).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/assertion.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57179, "name": "unknown", "code": "it('should return false for arrays containing different values', () => {\n fc.assert(\n fc.property(arrayArbitrary, arrayArbitrary, (arrayA, arrayB) => {\n // We'll do a very simplified precondition - we'll only run tests when the first elements are different\n fc.pre(!isDeepEqual(arrayA[0], arrayB[0]))\n\n expect(isDeepEqual(arrayA, arrayB)).toBeFalsy()\n expect(isDeepEqual(arrayB, arrayA)).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/assertion.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57180, "name": "unknown", "code": "it('should return false for arrays containing more values', () => {\n fc.assert(\n fc.property(arrayArbitrary, fc.anything(), (array, extraValue) => {\n expect(isDeepEqual(array, [...array, extraValue])).toBeFalsy()\n expect(isDeepEqual([...array, extraValue], array)).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/assertion.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57181, "name": "unknown", "code": "it('should return true for sets containing the same values', () => {\n fc.assert(\n fc.property(arrayArbitrary, (array) => {\n const setA = new Set(array)\n const setB = new Set(array)\n\n expect(isDeepEqual(setA, setB)).toBeTruthy()\n expect(isDeepEqual(setB, setA)).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/assertion.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57182, "name": "unknown", "code": "it('should return true for maps containing the same values', () => {\n fc.assert(\n fc.property(entriesArbitrary, (entries) => {\n const mapA = new Map(entries)\n const mapB = new Map(entries)\n\n expect(isDeepEqual(mapA, mapB)).toBeTruthy()\n expect(isDeepEqual(mapB, mapA)).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/assertion.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57183, "name": "unknown", "code": "it('should return true for objects containing the same values', () => {\n fc.assert(\n fc.property(\n fc.record({\n value: fc.anything(),\n }),\n (object) => {\n expect(isDeepEqual(object, { ...object })).toBeTruthy()\n expect(isDeepEqual({ ...object }, object)).toBeTruthy()\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/assertion.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57184, "name": "unknown", "code": "it('should return false for objects containing different values', () => {\n fc.assert(\n fc.property(\n fc.record({\n value: fc.anything(),\n }),\n fc.anything(),\n (object, value) => {\n fc.pre(!isDeepEqual(object.value, value))\n\n expect(isDeepEqual(object, { value })).toBeFalsy()\n expect(isDeepEqual({ value }, object)).toBeFalsy()\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/assertion.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57185, "name": "unknown", "code": "it('should serialize an internal message', () => {\n fc.assert(\n fc.property(fc.bigInt({ min: 0n, max: 1000n }), fc.boolean(), cellArbitrary, (value, bounce, body) => {\n const messageRelaxed = internal({\n value,\n to: wallet.address,\n bounce,\n body,\n })\n\n const serialized = serializeMessageRelaxed(messageRelaxed)\n const deserialized = deserializeMessageRelaxed(serialized)\n\n // FIXME Jest comparison operators don't work well with message objects\n // so a workaround expectation is used\n //\n // See https://github.com/ton-core/ton-core/blob/e0ed819973daf0484dfbacd0c30a0dcfe4714f8d/src/types/MessageRelaxed.spec.ts\n expect(Cell.fromBase64(serialized).equals(messageRelaxedToCell(messageRelaxed))).toBeTruthy()\n\n const reserialized = serializeMessageRelaxed(deserialized)\n expect(reserialized).toEqual(serialized)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-ton/test/transactions/serde.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57186, "name": "unknown", "code": "it('should serialize an external message', () => {\n fc.assert(\n fc.property(cellArbitrary, (body) => {\n const message = external({\n to: wallet.address,\n body,\n })\n\n const serialized = serializeMessage(message)\n const deserialized = deserializeMessage(serialized)\n\n // FIXME Jest comparison operators don't work well with message objects\n // so a workaround expectation is used\n //\n // See https://github.com/ton-core/ton-core/blob/e0ed819973daf0484dfbacd0c30a0dcfe4714f8d/src/types/MessageRelaxed.spec.ts\n expect(Cell.fromBase64(serialized).equals(messageToCell(message))).toBeTruthy()\n\n const reserialized = serializeMessage(deserialized)\n expect(reserialized).toEqual(serialized)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-ton/test/transactions/serde.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57187, "name": "unknown", "code": "it('should serialize an external message', () => {\n fc.assert(\n fc.property(cellArbitrary, (body) => {\n const message = external({\n to: wallet.address,\n body,\n })\n\n const serialized = serializeMessage(message)\n const deserialized = deserialize(serialized)\n\n // FIXME Jest comparison operators don't work well with message objects\n // so a workaround expectation is used\n //\n // See https://github.com/ton-core/ton-core/blob/e0ed819973daf0484dfbacd0c30a0dcfe4714f8d/src/types/MessageRelaxed.spec.ts\n expect(Cell.fromBase64(serialized).equals(messageToCell(message))).toBeTruthy()\n\n const reserialized = serializeMessage(deserialized as Message)\n expect(reserialized).toEqual(serialized)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-ton/test/transactions/serde.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57188, "name": "unknown", "code": "it('should serialize an internal message', () => {\n fc.assert(\n fc.property(fc.bigInt({ min: 0n, max: 1000n }), fc.boolean(), cellArbitrary, (value, bounce, body) => {\n const messageRelaxed = internal({\n value,\n to: wallet.address,\n bounce,\n body,\n })\n\n const serialized = serializeMessageRelaxed(messageRelaxed)\n const deserialized = deserialize(serialized)\n\n // FIXME Jest comparison operators don't work well with message objects\n // so a workaround expectation is used\n //\n // See https://github.com/ton-core/ton-core/blob/e0ed819973daf0484dfbacd0c30a0dcfe4714f8d/src/types/MessageRelaxed.spec.ts\n expect(Cell.fromBase64(serialized).equals(messageRelaxedToCell(messageRelaxed))).toBeTruthy()\n\n const reserialized = serializeMessage(deserialized as Message)\n expect(reserialized).toEqual(serialized)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-ton/test/transactions/serde.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57190, "name": "unknown", "code": "it('should throw if passed an invalid message', () => {\n fc.assert(\n fc.property(fc.base64String(), (serialized) => {\n expect(() => deserialize(serialized)).toThrow(/Failed to deserialize data./)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-ton/test/transactions/serde.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57191, "name": "unknown", "code": "it('should sign a transaction', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n solanaAddressArbitrary,\n keypairArbitrary,\n keypairArbitrary,\n async (eid, address, sender, recipient) => {\n const transfer = SystemProgram.transfer({\n fromPubkey: sender.publicKey,\n toPubkey: recipient.publicKey,\n lamports: 49,\n })\n\n const connection = new Connection('http://soyllama.com')\n const omniSigner = new OmniSignerSolana(eid, connection, sender)\n\n const transaction = new Transaction().add(transfer)\n transaction.recentBlockhash = 'EETubP5AKHgjPAhzPAFcb8BAY1hMH639CWCFTqi3hq1k'\n transaction.feePayer = sender.publicKey\n\n const omniTransaction: OmniTransaction = {\n point: { eid, address },\n data: serializeTransactionMessage(transaction),\n }\n\n const signature = await omniSigner.sign(omniTransaction)\n const serializedTransaction = (transaction.sign(sender), transaction.serialize())\n\n expect(deserializeTransactionBuffer(signature)).toEqual(serializedTransaction)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-solana/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57192, "name": "unknown", "code": "it('should sign and send a transaction', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n solanaAddressArbitrary,\n keypairArbitrary,\n keypairArbitrary,\n fc.string(),\n async (eid, address, sender, recipient, transactionHash) => {\n sendAndConfirmTransactionMock.mockResolvedValue(transactionHash)\n\n const transfer = SystemProgram.transfer({\n fromPubkey: sender.publicKey,\n toPubkey: recipient.publicKey,\n lamports: 49,\n })\n\n const connection = new Connection('http://soyllama.com')\n const omniSigner = new OmniSignerSolana(eid, connection, sender)\n\n const transaction = new Transaction().add(transfer)\n transaction.recentBlockhash = 'EETubP5AKHgjPAhzPAFcb8BAY1hMH639CWCFTqi3hq1k'\n transaction.feePayer = sender.publicKey\n\n const omniTransaction: OmniTransaction = {\n point: { eid, address },\n data: serializeTransactionMessage(transaction),\n }\n\n const response = await omniSigner.signAndSend(omniTransaction)\n expect(response).toEqual({\n transactionHash,\n wait: expect.any(Function),\n })\n\n expect(await response.wait()).toEqual({ transactionHash })\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-solana/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57193, "name": "unknown", "code": "it('should throw an error', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n solanaAddressArbitrary,\n keypairArbitrary,\n keypairArbitrary,\n async (eid, address, sender, recipient) => {\n const transfer = SystemProgram.transfer({\n fromPubkey: sender.publicKey,\n toPubkey: recipient.publicKey,\n lamports: 49,\n })\n\n const connection = new Connection('http://soyllama.com')\n const multiSigAddress = PublicKey.default\n const wallet = Keypair.generate()\n const omniSigner: OmniSigner = new OmniSignerSolanaSquads(\n eid,\n connection,\n multiSigAddress,\n wallet\n )\n\n const transaction = new Transaction().add(transfer)\n transaction.recentBlockhash = 'EETubP5AKHgjPAhzPAFcb8BAY1hMH639CWCFTqi3hq1k'\n transaction.feePayer = sender.publicKey\n\n const omniTransaction: OmniTransaction = {\n point: { eid, address },\n data: serializeTransactionMessage(transaction),\n }\n\n await expect(omniSigner.sign(omniTransaction)).rejects.toThrow(\n 'OmniSignerSolanaSquads does not support the sign() method. Please use signAndSend().'\n )\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-solana/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57194, "name": "unknown", "code": "it('should work', async () => {\n await fc.assert(\n fc.asyncProperty(keypairArbitrary, keypairArbitrary, async (sender, recipient) => {\n const transfer = SystemProgram.transfer({\n fromPubkey: sender.publicKey,\n toPubkey: recipient.publicKey,\n lamports: 49,\n })\n\n const transaction = new Transaction().add(transfer)\n\n // Transaction in Solana require a recent block hash to be set in order for them to be serialized\n transaction.recentBlockhash = 'EETubP5AKHgjPAhzPAFcb8BAY1hMH639CWCFTqi3hq1k'\n\n // Transactions in Solana require a fee payer to be set in order for them to be serialized\n transaction.feePayer = sender.publicKey\n\n // First we serialize the transaction\n const serializedTransaction = serializeTransactionMessage(transaction)\n // Then we deserialize it\n const deserializedTransaction = deserializeTransactionMessage(serializedTransaction)\n // And check that the fields match the original transaction\n //\n // The reason why we don't compare the transactions directly is that the signers will not match\n // after deserialization (the signers get stripped out of the original transaction)\n expect(deserializedTransaction.instructions).toEqual(transaction.instructions)\n expect(deserializedTransaction.recentBlockhash).toEqual(transaction.recentBlockhash)\n expect(deserializedTransaction.feePayer).toEqual(transaction.feePayer)\n\n // Now we serialize the deserialized transaction again and check that it fully matches the serialized transaction\n const reserializedTransaction = serializeTransactionMessage(deserializedTransaction)\n expect(reserializedTransaction).toEqual(serializedTransaction)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-solana/test/transactions/serde.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57195, "name": "unknown", "code": "it('should add a feePayer and the latest block hash to the transaction', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n solanaAddressArbitrary,\n keypairArbitrary,\n keypairArbitrary,\n solanaBlockhashArbitrary,\n async (eid, address, sender, recipient, blockhash) => {\n class TestOmniSDK extends OmniSDK {\n test() {\n const transfer = SystemProgram.transfer({\n fromPubkey: sender.publicKey,\n toPubkey: recipient.publicKey,\n lamports: 49,\n })\n const transaction = new Transaction().add(transfer)\n\n return this.createTransaction(transaction)\n }\n }\n\n const connection = new Connection('http://soyllama.com')\n jest.spyOn(connection, 'getLatestBlockhash').mockResolvedValue({\n blockhash,\n lastValidBlockHeight: NaN,\n })\n\n const sdk = new TestOmniSDK(connection, { eid, address }, sender.publicKey)\n const omniTransaction = await sdk.test()\n\n expect(omniTransaction).toEqual({\n data: expect.any(String),\n point: { eid, address },\n })\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-solana/test/omnigraph/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57196, "name": "unknown", "code": "it('should reject if urlFactory throws', async () => {\n await fc.assert(\n fc.asyncProperty(errorArbitrary, endpointArbitrary, async (error, eid) => {\n const urlFactory = jest.fn().mockImplementation(() => {\n throw error\n })\n const providerFactory = createConnectionFactory(urlFactory)\n\n await expect(providerFactory(eid)).rejects.toBe(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-solana/test/connection/factory.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57197, "name": "unknown", "code": "it('should reject if urlFactory rejects', async () => {\n await fc.assert(\n fc.asyncProperty(errorArbitrary, endpointArbitrary, async (error, eid) => {\n const urlFactory = jest.fn().mockRejectedValue(error)\n const providerFactory = createConnectionFactory(urlFactory)\n\n await expect(providerFactory(eid)).rejects.toBe(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-solana/test/connection/factory.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57198, "name": "unknown", "code": "it('should resolve with Connection if urlFactory returns a URL', async () => {\n await fc.assert(\n fc.asyncProperty(urlArbitrary, endpointArbitrary, async (url, eid) => {\n const urlFactory = jest.fn().mockReturnValue(url)\n const connectionFactory = createConnectionFactory(urlFactory)\n const connection = await connectionFactory(eid)\n\n expect(connection).toBeInstanceOf(Connection)\n expect(connection.rpcEndpoint).toBe(url)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-solana/test/connection/factory.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57199, "name": "unknown", "code": "it('should resolve with JsonRpcProvider if urlFactory resolves with a URL', async () => {\n await fc.assert(\n fc.asyncProperty(urlArbitrary, endpointArbitrary, async (url, eid) => {\n const urlFactory = jest.fn().mockResolvedValue(url)\n const connectionFactory = createConnectionFactory(urlFactory)\n const connection = await connectionFactory(eid)\n\n expect(connection).toBeInstanceOf(Connection)\n expect(connection.rpcEndpoint).toBe(url)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-solana/test/connection/factory.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57200, "name": "unknown", "code": "it('should throw an error for other endpoints', () => {\n fc.assert(\n fc.property(endpointArbitrary, (eid) => {\n fc.pre(eid !== EndpointId.SOLANA_V2_MAINNET)\n fc.pre(eid !== EndpointId.SOLANA_V2_TESTNET)\n fc.pre(eid !== EndpointId.SOLANA_MAINNET)\n fc.pre(eid !== EndpointId.SOLANA_TESTNET)\n\n expect(() => defaultRpcUrlFactory(eid)).toThrow(\n `Could not find a default Solana RPC URL for eid ${eid} (${formatEid(eid)})`\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-solana/test/connection/factory.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57201, "name": "unknown", "code": "it('should parse a BN instance', () => {\n fc.assert(\n fc.property(bnArbitrary, (bn) => {\n expect(BNBigIntSchema.parse(bn)).toBe(BigInt(bn.toString()))\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-solana/test/common/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57202, "name": "unknown", "code": "it('should not parse anything else', () => {\n fc.assert(\n fc.property(fc.anything(), (value) => {\n expect(() => BNBigIntSchema.parse(value)).toThrow(/Input not instance of BN/)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-solana/test/common/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57203, "name": "unknown", "code": "it('should parse a PublicKey instance', () => {\n fc.assert(\n fc.property(\n keypairArbitrary.map((keypair) => keypair.publicKey),\n (publicKey) => {\n expect(PublicKeySchema.parse(publicKey)).toBe(publicKey)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-solana/test/common/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57204, "name": "unknown", "code": "it('should not parse anything else', () => {\n fc.assert(\n fc.property(fc.anything(), (value) => {\n expect(() => PublicKeySchema.parse(value)).toThrow(/Input not instance of PublicKey/)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-solana/test/common/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57205, "name": "unknown", "code": "it('should return undefined if the account has not been initialized', async () => {\n getAccountInfoMock.mockResolvedValue(null)\n\n await fc.assert(\n fc.asyncProperty(solanaEndpointArbitrary, keypairArbitrary, async (eid, keypair) => {\n fc.pre(eid !== EndpointId.SOLANA_V2_SANDBOX)\n\n const address = keypair.publicKey.toBase58()\n\n const connection = await connectionFactory(oftConfig.eid)\n const getAccountInfo = createGetAccountInfo(connection)\n\n expect(await getAccountInfo(address)).toBeUndefined()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-solana/test/common/accounts.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57206, "name": "unknown", "code": "it('should serialize correctly with a message', () => {\n fc.assert(\n fc.property(messageArbitrary, (message) => {\n fc.pre(message !== '')\n\n expect(String(new UnknownError(message))).toBe(`UnknownError: ${message}`)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm/test/errors/errors.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57207, "name": "unknown", "code": "it('should serialize correctly when message is not passed', () => {\n fc.assert(\n fc.property(reasonArbitrary, (reason) => {\n expect(String(new PanicError(reason))).toBe(\n `PanicError: Contract panicked (assert() has been called). Error code ${reason}`\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm/test/errors/errors.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57208, "name": "unknown", "code": "it('should serialize correctly when message is empty', () => {\n fc.assert(\n fc.property(reasonArbitrary, (reason) => {\n expect(String(new PanicError(reason, ''))).toBe(`PanicError. Error code ${reason}`)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm/test/errors/errors.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57209, "name": "unknown", "code": "it('should serialize correctly with a message', () => {\n fc.assert(\n fc.property(reasonArbitrary, messageArbitrary, (reason, message) => {\n fc.pre(message !== '')\n\n expect(String(new PanicError(reason, message))).toBe(`PanicError: ${message}. Error code ${reason}`)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm/test/errors/errors.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57210, "name": "unknown", "code": "it('should serialize correctly when message is not passed', () => {\n fc.assert(\n fc.property(reasonArbitrary, (reason) => {\n expect(String(new RevertError(reason))).toBe(\n `RevertError: Contract reverted. Error reason '${reason}'`\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm/test/errors/errors.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57211, "name": "unknown", "code": "it('should serialize correctly when message is empty', () => {\n fc.assert(\n fc.property(reasonArbitrary, (reason) => {\n expect(String(new RevertError(reason, ''))).toBe(`RevertError. Error reason '${reason}'`)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm/test/errors/errors.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57212, "name": "unknown", "code": "it('should serialize correctly with a message', () => {\n fc.assert(\n fc.property(reasonArbitrary, messageArbitrary, (reason, message) => {\n fc.pre(message !== '')\n\n expect(String(new RevertError(reason, message))).toBe(\n `RevertError: ${message}. Error reason '${reason}'`\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm/test/errors/errors.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57213, "name": "unknown", "code": "it('should serialize correctly when args are empty', () => {\n fc.assert(\n fc.property(reasonArbitrary, (reason) => {\n expect(String(new CustomError(reason, []))).toBe(\n `CustomError: Contract reverted with custom error. Error ${reason}()`\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm/test/errors/errors.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57214, "name": "unknown", "code": "it('should serialize correctly when message is not passed', () => {\n fc.assert(\n fc.property(reasonArbitrary, argsArbitrary, (reason, args) => {\n const formattedArgs = args.map((arg) => printJson(arg, false))\n\n expect(String(new CustomError(reason, args))).toBe(\n `CustomError: Contract reverted with custom error. Error ${reason}(${formattedArgs})`\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm/test/errors/errors.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57215, "name": "unknown", "code": "it('should serialize correctly when message is empty', () => {\n fc.assert(\n fc.property(reasonArbitrary, argsArbitrary, (reason, args) => {\n const formattedArgs = args.map((arg) => printJson(arg, false))\n\n expect(String(new CustomError(reason, args, ''))).toBe(\n `CustomError. Error ${reason}(${formattedArgs})`\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm/test/errors/errors.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57216, "name": "unknown", "code": "it('should serialize correctly with a message', () => {\n fc.assert(\n fc.property(reasonArbitrary, argsArbitrary, messageArbitrary, (reason, args, message) => {\n fc.pre(message !== '')\n\n const formattedArgs = args.map((arg) => printJson(arg, false))\n\n expect(String(new CustomError(reason, args, message))).toBe(\n `CustomError: ${message}. Error ${reason}(${formattedArgs})`\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm/test/errors/errors.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57217, "name": "unknown", "code": "it('should parse BigNumberish', () => {\n fc.assert(\n fc.property(bigNumberishArbitrary, (bigNumberish) => {\n expect(BigNumberishSchema.parse(bigNumberish)).toBe(bigNumberish)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm/test/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57218, "name": "unknown", "code": "it('should parse BigNumberish into a bigint', () => {\n fc.assert(\n fc.property(bigNumberishArbitrary, (bigNumberish) => {\n const parsed = BigNumberishBigIntSchema.parse(bigNumberish)\n\n expect(typeof parsed).toBe('bigint')\n expect(BigNumber.from(parsed)).toEqual(BigNumber.from(bigNumberish))\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm/test/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57219, "name": "unknown", "code": "it('should parse BigNumberish into a number if within bounds', () => {\n fc.assert(\n fc.property(bigNumberishArbitrary, (bigNumberish) => {\n fc.pre(BigNumber.from(bigNumberish).abs().lte(BigInt(Number.MAX_SAFE_INTEGER)))\n\n const parsed = BigNumberishNumberSchema.parse(bigNumberish)\n\n expect(typeof parsed).toBe('number')\n expect(BigNumber.from(parsed)).toEqual(BigNumber.from(bigNumberish))\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm/test/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57220, "name": "unknown", "code": "it('should throw an error if there is an overflow', () => {\n fc.assert(\n fc.property(bigNumberishArbitrary, (bigNumberish) => {\n fc.pre(BigNumber.from(bigNumberish).abs().gt(BigInt(Number.MAX_SAFE_INTEGER)))\n\n expect(() => BigNumberishNumberSchema.parse(bigNumberish)).toThrow('overflow')\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm/test/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57221, "name": "unknown", "code": "it('should reject if the eid of the transaction does not match the eid of the signer', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, transactionArbitrary, async (eid, transaction) => {\n fc.pre(eid !== transaction.point.eid)\n\n const signer = {} as Signer\n const omniSigner = new OmniSignerEVM(eid, signer)\n\n await expect(() => omniSigner.sign(transaction)).rejects.toThrow(/Could not use signer/)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm/test/signer/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57222, "name": "unknown", "code": "it('should sign the transaction using the signer if the eids match', async () => {\n await fc.assert(\n fc.asyncProperty(\n transactionArbitrary,\n signedTransactionArbitrary,\n async (transaction, signedTransaction) => {\n const signTransaction = jest.fn().mockResolvedValue(signedTransaction)\n const signer = { signTransaction } as unknown as Signer\n const omniSigner = new OmniSignerEVM(transaction.point.eid, signer)\n\n expect(await omniSigner.sign(transaction)).toBe(signedTransaction)\n expect(signTransaction).toHaveBeenCalledWith({\n to: transaction.point.address,\n data: transaction.data,\n value: transaction.value,\n })\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm/test/signer/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57223, "name": "unknown", "code": "it('should reject if the eid of the transaction does not match the eid of the signer', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, transactionArbitrary, async (eid, transaction) => {\n fc.pre(eid !== transaction.point.eid)\n\n const signer = {} as Signer\n const omniSigner = new OmniSignerEVM(eid, signer)\n\n await expect(() => omniSigner.signAndSend(transaction)).rejects.toThrow(/Could not use signer/)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm/test/signer/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57224, "name": "unknown", "code": "it('should send the transaction using the signer if the eids match', async () => {\n await fc.assert(\n fc.asyncProperty(transactionArbitrary, transactionHashArbitrary, async (transaction, hash) => {\n const sendTransaction = jest.fn().mockResolvedValue({ hash })\n const signer = { sendTransaction } as unknown as Signer\n const omniSigner = new OmniSignerEVM(transaction.point.eid, signer)\n\n expect(await omniSigner.signAndSend(transaction)).toEqual({ transactionHash: hash })\n expect(sendTransaction).toHaveBeenCalledWith({\n to: transaction.point.address,\n data: transaction.data,\n value: transaction.value,\n })\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm/test/signer/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57225, "name": "unknown", "code": "it('should not be supported', async () => {\n await fc.assert(\n fc.asyncProperty(\n evmAddressArbitrary,\n endpointArbitrary,\n transactionArbitrary,\n async (safeAddress, eid, transaction) => {\n const signer = {} as Signer\n\n const apiKit = {\n getNextNonce: jest.fn(),\n } as unknown as SafeApiKit\n\n const safe = {\n createTransaction: jest.fn().mockResolvedValue({ data: 'transaction' }),\n getAddress: jest.fn().mockResolvedValue(safeAddress),\n signTransaction: jest.fn().mockResolvedValue({ data: { data: '0xsigned' } }),\n } as unknown as Safe\n\n const omniSigner = new GnosisOmniSignerEVM(eid, signer, '', {}, undefined, apiKit, safe)\n\n await expect(omniSigner.sign(transaction)).rejects.toThrow(\n /Signing transactions with safe is currently not supported, use signAndSend instead/\n )\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm/test/signer/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57226, "name": "unknown", "code": "it('should reject if the eid of the transaction does not match the eid of the signer', async () => {\n await fc.assert(\n fc.asyncProperty(\n evmAddressArbitrary,\n endpointArbitrary,\n transactionArbitrary,\n async (safeAddress, eid, transaction) => {\n fc.pre(eid !== transaction.point.eid)\n\n const signer = {} as Signer\n const safe = {\n createTransaction: jest.fn().mockResolvedValue({ data: 'transaction' }),\n getAddress: jest.fn().mockResolvedValue(safeAddress),\n signTransactionHash: jest.fn().mockResolvedValue({ data: 'signature' }),\n } as unknown as Safe\n const omniSigner = new GnosisOmniSignerEVM(eid, signer, '', {}, undefined, undefined, safe)\n\n await expect(() => omniSigner.signAndSend(transaction)).rejects.toThrow(\n /Could not use signer/\n )\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm/test/signer/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57227, "name": "unknown", "code": "it('should send the transaction using the signer if the eids match', async () => {\n await fc.assert(\n fc.asyncProperty(\n evmAddressArbitrary,\n transactionArbitrary,\n transactionHashArbitrary,\n async (safeAddress, transaction, transactionHash) => {\n const signer = { getAddress: jest.fn(), sendTransaction: jest.fn() } as unknown as Signer\n const apiKit = {\n proposeTransaction: jest.fn(),\n getNextNonce: jest.fn(),\n } as unknown as SafeApiKit\n const safe = {\n createTransaction: jest.fn().mockResolvedValue({ data: 'transaction' }),\n getTransactionHash: jest.fn().mockResolvedValue(transactionHash),\n getAddress: jest.fn().mockResolvedValue(safeAddress),\n signTransactionHash: jest.fn().mockResolvedValue({ data: 'signature' }),\n } as unknown as Safe\n\n const omniSigner = new GnosisOmniSignerEVM(\n transaction.point.eid,\n signer,\n '',\n {\n safeAddress,\n },\n undefined,\n apiKit,\n safe\n )\n\n const result = await omniSigner.signAndSend(transaction)\n expect(result.transactionHash).toEqual(transactionHash)\n\n expect(await result.wait()).toEqual({ transactionHash })\n\n expect(apiKit.getNextNonce).toHaveBeenCalledWith(safeAddress)\n expect(apiKit.proposeTransaction).toHaveBeenCalledWith({\n safeAddress,\n safeTransactionData: 'transaction',\n safeTxHash: transactionHash,\n senderAddress: undefined,\n senderSignature: 'signature',\n })\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm/test/signer/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57228, "name": "unknown", "code": "it('should reject with no transactions', async () => {\n await fc.assert(\n fc.asyncProperty(evmAddressArbitrary, endpointArbitrary, async (safeAddress, eid) => {\n const signer = {} as Signer\n const safe = {} as unknown as Safe\n const omniSigner = new GnosisOmniSignerEVM(eid, signer, '', {}, undefined, undefined, safe)\n\n await expect(() => omniSigner.signAndSendBatch([])).rejects.toThrow(\n /signAndSendBatch received 0 transactions/\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm/test/signer/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57229, "name": "unknown", "code": "it('should reject if at least one of the transaction eids do not match the signer eid', async () => {\n await fc.assert(\n fc.asyncProperty(\n evmAddressArbitrary,\n endpointArbitrary,\n fc.array(transactionArbitrary, { minLength: 1 }),\n async (safeAddress, eid, transactions) => {\n fc.pre(transactions.some((transaction) => eid !== transaction.point.eid))\n\n const signer = {} as Signer\n const safe = {\n createTransaction: jest.fn().mockResolvedValue({ data: 'transaction' }),\n getAddress: jest.fn().mockResolvedValue(safeAddress),\n signTransactionHash: jest.fn().mockResolvedValue({ data: 'signature' }),\n } as unknown as Safe\n const omniSigner = new GnosisOmniSignerEVM(eid, signer, '', {}, undefined, undefined, safe)\n\n await expect(() => omniSigner.signAndSendBatch(transactions)).rejects.toThrow(\n /Could not use signer/\n )\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm/test/signer/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57230, "name": "unknown", "code": "it('should send the transaction using the signer if the eids match', async () => {\n await fc.assert(\n fc.asyncProperty(\n evmAddressArbitrary,\n endpointArbitrary,\n fc.array(transactionArbitrary, { minLength: 1 }),\n transactionHashArbitrary,\n async (safeAddress, eid, transactions, transactionHash) => {\n const nonce = 17\n const signer = { getAddress: jest.fn(), sendTransaction: jest.fn() } as unknown as Signer\n const apiKit = {\n proposeTransaction: jest.fn(),\n getNextNonce: jest.fn().mockResolvedValue(nonce),\n } as unknown as SafeApiKit\n const safe = {\n createTransaction: jest.fn().mockResolvedValue({ data: 'transaction' }),\n getTransactionHash: jest.fn().mockResolvedValue(transactionHash),\n getAddress: jest.fn().mockResolvedValue(safeAddress),\n signTransactionHash: jest.fn().mockResolvedValue({ data: 'signature' }),\n } as unknown as Safe\n\n const omniSigner = new GnosisOmniSignerEVM(\n eid,\n signer,\n '',\n {\n safeAddress,\n },\n undefined,\n apiKit,\n safe\n )\n\n const transactionsWithMatchingEids = transactions.map((t) => ({\n ...t,\n point: { ...t.point, eid },\n }))\n\n const result = await omniSigner.signAndSendBatch(transactionsWithMatchingEids)\n expect(result.transactionHash).toEqual(transactionHash)\n\n expect(await result.wait()).toEqual({ transactionHash })\n\n expect(safe.createTransaction).toHaveBeenCalledWith({\n safeTransactionData: transactions.map((t) => ({\n to: t.point.address,\n data: t.data,\n value: String(t.value ?? 0),\n operation: OperationType.Call,\n })),\n options: { nonce },\n })\n\n expect(apiKit.getNextNonce).toHaveBeenCalledWith(safeAddress)\n expect(apiKit.proposeTransaction).toHaveBeenCalledWith({\n safeAddress,\n safeTransactionData: 'transaction',\n safeTxHash: transactionHash,\n senderAddress: undefined,\n senderSignature: 'signature',\n })\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm/test/signer/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57231, "name": "unknown", "code": "it('should reject if urlFactory throws', async () => {\n await fc.assert(\n fc.asyncProperty(errorArbitrary, endpointArbitrary, async (error, eid) => {\n const urlFactory = jest.fn().mockImplementation(() => {\n throw error\n })\n const providerFactory = createProviderFactory(urlFactory)\n\n await expect(providerFactory(eid)).rejects.toBe(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm/test/provider/factory.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57232, "name": "unknown", "code": "it('should reject if urlFactory rejects', async () => {\n await fc.assert(\n fc.asyncProperty(errorArbitrary, endpointArbitrary, async (error, eid) => {\n const urlFactory = jest.fn().mockRejectedValue(error)\n const providerFactory = createProviderFactory(urlFactory)\n\n await expect(providerFactory(eid)).rejects.toBe(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm/test/provider/factory.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57233, "name": "unknown", "code": "it('should resolve with JsonRpcProvider if urlFactory returns a URL', async () => {\n await fc.assert(\n fc.asyncProperty(urlArbitrary, endpointArbitrary, async (url, eid) => {\n const urlFactory = jest.fn().mockReturnValue(url)\n const providerFactory = createProviderFactory(urlFactory)\n const provider = await providerFactory(eid)\n\n expect(provider).toBeInstanceOf(JsonRpcProvider)\n expect(provider.connection.url).toBe(url)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm/test/provider/factory.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57234, "name": "unknown", "code": "it('should resolve with JsonRpcProvider if urlFactory resolves with a URL', async () => {\n await fc.assert(\n fc.asyncProperty(urlArbitrary, endpointArbitrary, async (url, eid) => {\n const urlFactory = jest.fn().mockResolvedValue(url)\n const providerFactory = createProviderFactory(urlFactory)\n const provider = await providerFactory(eid)\n\n expect(provider).toBeInstanceOf(JsonRpcProvider)\n expect(provider.connection.url).toBe(url)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm/test/provider/factory.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57235, "name": "unknown", "code": "it('should create an OmniPoint with the address of the contract', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, endpointArbitrary, (address, eid) => {\n const contract = new Contract(address, [])\n const omniContract: OmniContract = { eid, contract }\n\n expect(omniContractToPoint(omniContract)).toEqual({ eid, address })\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57236, "name": "unknown", "code": "it('should return address with non-zero address', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, (address) => {\n fc.pre(address !== AddressZero)\n\n expect(makeZeroAddress(address)).toBe(address)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm/test/address.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57237, "name": "unknown", "code": "it('should return the same address, just checksumed', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, (address) => {\n expect(addChecksum(address)).toEqualCaseInsensitive(address)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm/test/address.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57238, "name": "unknown", "code": "it('should return a valid EVM address', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, (address) => {\n expect(isAddress(addChecksum(address))).toBe(true)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm/test/address.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57239, "name": "unknown", "code": "it('should return undefined if called with undefined definition', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, async (eid) => {\n await expect(createSignerAddressOrIndexFactory()(eid)).resolves.toBeUndefined()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57240, "name": "unknown", "code": "it('should return address if called with address definition', async () => {\n await fc.assert(\n fc.asyncProperty(evmAddressArbitrary, endpointArbitrary, async (address, eid) => {\n await expect(createSignerAddressOrIndexFactory({ type: 'address', address })(eid)).resolves.toBe(\n address\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57241, "name": "unknown", "code": "it('should return index if called with index definition', async () => {\n await fc.assert(\n fc.asyncProperty(fc.integer(), endpointArbitrary, async (index, eid) => {\n await expect(createSignerAddressOrIndexFactory({ type: 'index', index })(eid)).resolves.toBe(index)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57242, "name": "unknown", "code": "it('should reject if called with a missing named definition', async () => {\n const mockGetNamedAccounts = jest.fn().mockResolvedValue({ wombat: '0xwombat' })\n const mockHre = {\n getNamedAccounts: mockGetNamedAccounts,\n }\n const hreFactory = jest.fn().mockResolvedValue(mockHre)\n\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, async (eid) => {\n await expect(\n createSignerAddressOrIndexFactory({ type: 'named', name: 'no-wombat' }, hreFactory)(eid)\n ).rejects.toThrow(`Missing named account 'no-wombat' for eid ${formatEid(eid)}`)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57243, "name": "unknown", "code": "it('should resolve with an address if called with a defined named definition', async () => {\n const mockGetNamedAccounts = jest.fn().mockResolvedValue({ wombat: '0xwombat' })\n const mockHre = {\n getNamedAccounts: mockGetNamedAccounts,\n }\n const hreFactory = jest.fn().mockResolvedValue(mockHre)\n\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, async (eid) => {\n await expect(\n createSignerAddressOrIndexFactory({ type: 'named', name: 'wombat' }, hreFactory)(eid)\n ).resolves.toBe('0xwombat')\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57244, "name": "unknown", "code": "it('should not override user values if provided', () => {\n fc.assert(\n fc.property(\n fc.integer(),\n fc.string(),\n mnemonicArbitrary,\n fc.boolean(),\n (port, directory, mnemonic, overwriteAccounts) => {\n expect(\n resolveSimulationConfig(\n { port, directory, overwriteAccounts, anvil: { mnemonic } },\n hre.config\n )\n ).toEqual({\n port,\n directory: resolve(hre.config.paths.root, directory),\n overwriteAccounts,\n anvil: {\n host: '0.0.0.0',\n port: 8545,\n mnemonic,\n },\n })\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/simulation/config.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57245, "name": "unknown", "code": "it('should work with anvil options', async () => {\n await fc.assert(\n fc.asyncProperty(anvilOptionsArbitrary, async (anvilOptions) => {\n const spec = serializeDockerComposeSpec({\n version: '3.9',\n services: {\n anvil: createEvmNodeServiceSpec(anvilOptions),\n },\n })\n\n await writeFile(SPEC_FILE_PATH, spec)\n\n const result = validateSpec()\n\n expect(result.stderr.toString('utf8')).toBe('')\n expect(result.status).toBe(0)\n }),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/simulation/compose.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57246, "name": "unknown", "code": "it('should work with anvil services', async () => {\n await fc.assert(\n fc.asyncProperty(portArbitrary, servicesArbitrary, async (port, services) => {\n const spec = serializeDockerComposeSpec({\n version: '3.9',\n services: {\n ...services,\n rpc: createEvmNodeProxyServiceSpec(port, services),\n },\n })\n\n await writeFile(SPEC_FILE_PATH, spec)\n\n const result = validateSpec()\n\n expect(result.stderr.toString('utf8')).toBe('')\n expect(result.status).toBe(0)\n }),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/simulation/compose.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57263, "name": "unknown", "code": "it('should reject if providerFactory rejects', async () => {\n await fc.assert(\n fc.asyncProperty(pointArbitrary, async (point) => {\n const error = new Error()\n const contractFactory = jest.fn().mockResolvedValue(new Contract(makeZeroAddress(undefined), []))\n const providerFactory = jest.fn().mockRejectedValue(error)\n const connectedContractFactory = createConnectedContractFactory(contractFactory, providerFactory)\n\n await expect(connectedContractFactory(point)).rejects.toBe(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/contracts.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "The function should reject if the `providerFactory` throws an error when creating a connected contract.", "mode": "fast-check"} {"id": 57273, "name": "unknown", "code": "it('should parse all valid endpoint labels', () => {\n fc.assert(\n fc.property(endpointArbitrary, (eid) => {\n expect(types.eid.parse('eid', EndpointId[eid]!)).toEqual(eid)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/cli.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Parsing a valid endpoint label results in successfully matching its corresponding `eid`.", "mode": "fast-check"} {"id": 57274, "name": "unknown", "code": "it('should not parse invalid strings', () => {\n fc.assert(\n fc.property(fc.string(), (eid) => {\n // We filter out the values that by any slim chance could be valid endpoint IDs\n fc.pre(EndpointId[eid] == null)\n fc.pre(EndpointId[parseInt(eid)] == null)\n\n expect(() => types.eid.parse('eid', eid)).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/cli.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Parsing invalid strings with `types.eid.parse` should throw an error when the strings are not valid endpoint IDs.", "mode": "fast-check"} {"id": 57275, "name": "unknown", "code": "it('should not parse invalid numbers', () => {\n fc.assert(\n fc.property(fc.integer(), (eid) => {\n fc.pre(EndpointId[eid] == null)\n\n expect(() => types.eid.parse('eid', String(eid))).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/cli.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "The test checks that attempting to parse invalid numbers using `types.eid.parse` results in an exception.", "mode": "fast-check"} {"id": 57276, "name": "unknown", "code": "it('should not run tsc', async () => {\n await fc.assert(\n fc.asyncProperty(fc.oneof(fc.string(), fc.constantFrom(undefined)), async (env) => {\n fc.pre(env !== 'production')\n\n const plugin = createDeclarationBuild({ enabled: undefined })\n\n await plugin.buildEnd.call(pluginContext)\n\n expect(spawnSyncMock).not.toHaveBeenCalled()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/build-devtools/test/tsup/declarations.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`tsc` should not be run when the environment is not 'production' during the build process.", "mode": "fast-check"} {"id": 57284, "name": "unknown", "code": "it(\"generates 128-bit unsigned integers in range [0, 2^128 - 1]\", () => {\n fc.assert(\n fc.property(\n uint128,\n (actual) =>\n actual >= BigInt(0) &&\n actual <= BigInt(\"340282366920938463463374607431768211455\")\n )\n );\n })", "language": "typescript", "source_file": "./repos/stacks-network/clarunit/tests/clarity-parser-string-to-cv.prop.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "stacks-network/clarunit", "url": "https://github.com/stacks-network/clarunit.git", "license": "MIT", "stars": 5, "forks": 7}, "metrics": null, "summary": "Generated 128-bit unsigned integers should be within the range [0, 2^128 - 1].", "mode": "fast-check"} {"id": 57285, "name": "unknown", "code": "it(\"generates 128-bit signed integers in range [-2^127, 2^127 - 1]\", () => {\n fc.assert(\n fc.property(\n int128,\n (actual) =>\n actual >= BigInt(\"-170141183460469231731687303715884105728\") &&\n actual <= BigInt(\"170141183460469231731687303715884105727\")\n )\n );\n })", "language": "typescript", "source_file": "./repos/stacks-network/clarunit/tests/clarity-parser-string-to-cv.prop.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "stacks-network/clarunit", "url": "https://github.com/stacks-network/clarunit.git", "license": "MIT", "stars": 5, "forks": 7}, "metrics": null, "summary": "Generated 128-bit signed integers should fall within the range \\([-2^{127}, 2^{127} - 1]\\).", "mode": "fast-check"} {"id": 57287, "name": "unknown", "code": "it('Can generate a random symptom given only a name', () => {\n\t\tfc.assert(\n\t\t\tfc.property(fc.string(), (name: string) => {\n\t\t\t\tconst symptom = randomSymptom(name);\n\t\t\t\treturn symptom.name === name;\n\t\t\t})\n\t\t);\n\t})", "language": "typescript", "source_file": "./repos/Elsa-Health/model-runtime/test/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Elsa-Health/model-runtime", "url": "https://github.com/Elsa-Health/model-runtime.git", "license": "Apache-2.0", "stars": 2, "forks": 1}, "metrics": null, "summary": "Generating a random symptom with a specified name results in a symptom with that exact name.", "mode": "fast-check"} {"id": 57288, "name": "unknown", "code": "it('Calculates the mean without breaking', () => {\n\t\tfc.assert(\n\t\t\tfc.property(\n\t\t\t\tfc.float64Array(),\n\t\t\t\tlist => typeof mean((list as unknown) as number[]) === 'number'\n\t\t\t)\n\t\t);\n\t})", "language": "typescript", "source_file": "./repos/Elsa-Health/model-runtime/test/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Elsa-Health/model-runtime", "url": "https://github.com/Elsa-Health/model-runtime.git", "license": "Apache-2.0", "stars": 2, "forks": 1}, "metrics": null, "summary": "The `mean` function should return a numeric result when applied to an array of 64-bit floating-point numbers.", "mode": "fast-check"} {"id": 57289, "name": "unknown", "code": "it('Creates a normal variable', () => {\n\t\tfc.assert(\n\t\t\tfc.property(\n\t\t\t\tfc.float(),\n\t\t\t\tfc.float({ next: false, min: 0.01 }),\n\t\t\t\t(a, b) => {\n\t\t\t\t\tconst rv = createNormal('testNormal', a, b);\n\t\t\t\t\treturn (\n\t\t\t\t\t\trv._.dist === 'normal' && rv.mean === a && rv.sd === b\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t)\n\t\t);\n\t})", "language": "typescript", "source_file": "./repos/Elsa-Health/model-runtime/test/lib/distributions.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Elsa-Health/model-runtime", "url": "https://github.com/Elsa-Health/model-runtime.git", "license": "Apache-2.0", "stars": 2, "forks": 1}, "metrics": null, "summary": "`createNormal` function creates a normal distribution variable with the specified mean and standard deviation.", "mode": "fast-check"} {"id": 57290, "name": "unknown", "code": "it('Creates a weibull variable', () => {\n\t\tfc.assert(\n\t\t\tfc.property(\n\t\t\t\tfc.float({ next: false, min: 0.01 }),\n\t\t\t\tfc.float({ next: false, min: 0.01 }),\n\t\t\t\tfc.float({ next: false, min: 0.01 }),\n\t\t\t\t(a, b, c) => {\n\t\t\t\t\tconst rv = createWeibull('testWeibull', a, b, c);\n\t\t\t\t\treturn (\n\t\t\t\t\t\trv._.dist === 'weibull' &&\n\t\t\t\t\t\trv.threshold === a &&\n\t\t\t\t\t\trv.shape === b &&\n\t\t\t\t\t\trv.scale === c\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t)\n\t\t);\n\t})", "language": "typescript", "source_file": "./repos/Elsa-Health/model-runtime/test/lib/distributions.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Elsa-Health/model-runtime", "url": "https://github.com/Elsa-Health/model-runtime.git", "license": "Apache-2.0", "stars": 2, "forks": 1}, "metrics": null, "summary": "Creating a Weibull variable ensures the distribution type is 'weibull' and checks that threshold, shape, and scale parameters are accurately set.", "mode": "fast-check"} {"id": 57300, "name": "unknown", "code": "it(\"should do nothing when dependency does not exist\", () => {\n fc.assert(\n fc.property(arbDomainName, (packumentName) => {\n let manifest = emptyProjectManifest;\n\n manifest = removeDependency(manifest, packumentName);\n\n expect(manifest.dependencies).toEqual({});\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/project-manifest.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "Removing a non-existent dependency from a manifest leaves the dependencies unchanged.", "mode": "fast-check"} {"id": 57301, "name": "unknown", "code": "it(\"should not add testables which already exist\", () => {\n fc.assert(\n fc.property(arbDomainName, (packumentName) => {\n let manifest = emptyProjectManifest;\n\n manifest = addTestable(manifest, packumentName);\n manifest = addTestable(manifest, packumentName);\n\n expect(manifest.testables).toEqual([packumentName]);\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/project-manifest.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "Adding the same `packumentName` twice to a project manifest should result in it appearing only once in the `testables` array.", "mode": "fast-check"} {"id": 57302, "name": "unknown", "code": "it('should have no effect for undefined \"scopedRegistries\"', () => {\n fc.assert(\n fc.property(arbDomainName, (scope) => {\n const original: UnityProjectManifest = { dependencies: {} };\n\n const actual = removeScopeFromAllScopedRegistries(original, scope);\n\n expect(actual).toEqual(original);\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/project-manifest.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "Removing a scope from an undefined \"scopedRegistries\" in a Unity project manifest should have no effect on the manifest.", "mode": "fast-check"} {"id": 57310, "name": "unknown", "code": "it(\"should be ok for file\", () => {\n fc.assert(\n fc.property(arbDomainName, (packumentName) => {\n const input = `file:/path/to/${{ packumentName }}`;\n expect(isZod(input, PackageUrl)).toBeTruthy();\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/package-url.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "`isZod` should return true for file URL strings containing a domain name.", "mode": "fast-check"} {"id": 57311, "name": "unknown", "code": "it(\"should be ok for just name\", () => {\n fc.assert(\n fc.property(arbDomainName, (packumentName) => {\n expect(isPackageSpec(packumentName)).toBeTruthy();\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/package-spec.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "`isPackageSpec` should return true for valid domain names.", "mode": "fast-check"} {"id": 57312, "name": "unknown", "code": "it(\"should be ok for name with semantic version\", () => {\n fc.assert(\n fc.property(arbDomainName, (packumentName) => {\n const input = `${packumentName}@1.2.3`;\n expect(isPackageSpec(input)).toBeTruthy();\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/package-spec.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "A package name with a semantic version appended should be recognized as a valid package specification by `isPackageSpec`.", "mode": "fast-check"} {"id": 57313, "name": "unknown", "code": "it(\"should be ok for name with file version\", () => {\n fc.assert(\n fc.property(arbDomainName, (packumentName) => {\n const input = `${packumentName}@file:/path/to/${packumentName}`;\n expect(isPackageSpec(input)).toBeTruthy();\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/package-spec.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "`isPackageSpec` should return true for names formatted with file version syntax.", "mode": "fast-check"} {"id": 57314, "name": "unknown", "code": "it(\"should be ok for name with http version\", () => {\n fc.assert(\n fc.property(arbDomainName, (packumentName) => {\n const input = `${packumentName}@http://my.server/${packumentName}`;\n expect(isPackageSpec(input)).toBeTruthy();\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/package-spec.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "`isPackageSpec` returns true for package names combined with HTTP URLs.", "mode": "fast-check"} {"id": 57315, "name": "unknown", "code": "it(\"should be ok for name with git version\", () => {\n fc.assert(\n fc.property(arbDomainName, (packumentName) => {\n const input = `${packumentName}@git@github:user/${packumentName}`;\n expect(isPackageSpec(input)).toBeTruthy();\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/package-spec.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "`isPackageSpec` returns true for names with a Git version format.", "mode": "fast-check"} {"id": 57325, "name": "unknown", "code": "it(\"should remove from scoped registries\", () => {\n fc.assert(\n fc.property(arbNonEmptyManifest, (manifest) => {\n const packageName = recordKeys(manifest.dependencies)[0]!;\n\n const [updated] = tryRemoveProjectDependency(\n manifest,\n packageName\n ).unwrap();\n\n const anyScopedRegistryHasScope =\n updated.scopedRegistries?.some((it) =>\n it.scopes.includes(packageName)\n ) ?? false;\n expect(anyScopedRegistryHasScope).toBeFalsy();\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/dependency-management.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "Removing a project dependency from a manifest should result in no scoped registries containing the dependency's scope.", "mode": "fast-check"} {"id": 57328, "name": "unknown", "code": "it(\"should remove scoped registries property if empty\", () => {\n fc.assert(\n fc.property(arbManifestWithDependencyCount(1), (manifest) => {\n const packageName = recordKeys(manifest.dependencies)[0]!;\n\n const [updated] = tryRemoveProjectDependency(\n manifest,\n packageName\n ).unwrap();\n\n expect(updated.scopedRegistries).not.toBeDefined();\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/dependency-management.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "Removing a project dependency from a manifest should result in the `scopedRegistries` property being undefined if it becomes empty.", "mode": "fast-check"} {"id": 57334, "name": "unknown", "code": "it(\"should have correct change for added dependency\", () => {\n fc.assert(\n fc.property(\n arbManifest,\n arbDomainName,\n abrDependencyVersion,\n (manifest, packageName, version) => {\n // Make sure manifest does not have dependency\n manifest = removeDependency(manifest, packageName);\n\n const [, change] = addProjectDependency(\n manifest,\n packageName,\n version\n );\n\n expect(change).toEqual({ type: \"added\", version });\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/dependency-management.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "Adding a dependency to a manifest where it was previously removed should result in a change of type \"added\" with the correct version.", "mode": "fast-check"} {"id": 57343, "name": "unknown", "code": "it('succeeds', async () => {\n await fc.assert(fc.asyncProperty(fc.integer(), async (i) => {\n const actual = await PromiseUtils.succeed(i);\n assert.equal(actual, i);\n }));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/utils/PromiseUtilsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "`PromiseUtils.succeed` should return a promise that resolves to the input integer value.", "mode": "fast-check"} {"id": 57347, "name": "unknown", "code": "it('succeeds with right on success', async () => {\n await fc.assert(fc.asyncProperty(fc.integer(), async (i) => {\n await assert.becomes(PromiseUtils.tryPromise(PromiseUtils.succeed(i)), E.right(i));\n }));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/utils/PromiseUtilsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "`PromiseUtils.tryPromise` with `PromiseUtils.succeed` results in a promise that resolves to `E.right` with the input integer.", "mode": "fast-check"} {"id": 57348, "name": "unknown", "code": "it('succeeds with left on failure', async () => {\n await fc.assert(fc.asyncProperty(fc.integer(), async (i) => {\n await assert.becomes(PromiseUtils.tryPromise(PromiseUtils.fail(i)), E.left(i));\n }));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/utils/PromiseUtilsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "`PromiseUtils.tryPromise` returns `E.left(i)` when the promise fails with the value `i`.", "mode": "fast-check"} {"id": 57352, "name": "unknown", "code": "it('returns empty array when all elements are none', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (xs) => {\n assert.deepEqual(\n OptionUtils.somes(xs.map(() => O.none)),\n []\n );\n }));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/utils/OptionUtilsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "`OptionUtils.somes` returns an empty array when all elements in the input array are `none`.", "mode": "fast-check"} {"id": 57357, "name": "unknown", "code": "it('returns the same number of elements', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (xs) => {\n assert.equal(ArrayUtils.sort(xs).length, xs.length);\n }));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/utils/ArrayUtilsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "`ArrayUtils.sort` maintains the same number of elements as the input array.", "mode": "fast-check"} {"id": 57358, "name": "unknown", "code": "it('parses a correct 3-point version', async () => {\n await fc.assert(fc.asyncProperty(smallNat, smallNat, smallNat, async (major, minor, patch) => {\n const input = `${major}.${minor}.${patch}`;\n const expected = { major, minor, patch, preRelease: undefined, buildMetaData: undefined };\n await assert.becomes(Version.parseVersion(input), expected);\n }));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/core/VersionTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "Parses a 3-point version string into its major, minor, patch components, and verifies the absence of preRelease and buildMetaData.", "mode": "fast-check"} {"id": 57359, "name": "unknown", "code": "it('fails on 2-point versions', async () => {\n await fc.assert(fc.asyncProperty(smallNat, smallNat, async (major, minor) => {\n const input = `${major}.${minor}`;\n await assert.isRejected(Version.parseVersion(input), 'Could not parse version string');\n }));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/core/VersionTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "The parsing of 2-point version strings (e.g., \"major.minor\") should be rejected by `Version.parseVersion`.", "mode": "fast-check"} {"id": 57362, "name": "unknown", "code": "it('parses 2-point version', async () => {\n await fc.assert(fc.asyncProperty(smallNat, smallNat, async (major, minor) => {\n await assert.becomes(Version.parseMajorMinorVersion(`${major}.${minor}`), { major, minor });\n }));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/core/VersionTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "`Version.parseMajorMinorVersion` should return an object with `major` and `minor` properties that match input major and minor version numbers provided as a string.", "mode": "fast-check"} {"id": 57365, "name": "unknown", "code": "it('round-trips for version with prerelease', async () => {\n await fc.assert(fc.asyncProperty(smallNat, smallNat, smallNat, smallNatString,\n async (major, minor, patch, preRelease) => {\n const input = `${major}.${minor}.${patch}-${preRelease}`;\n const version = await Version.parseVersion(input);\n const actual = Version.versionToString(version);\n assert.deepEqual(actual, input);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/core/VersionTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "Parsing and converting a version string with a prerelease component should maintain the original version string after a round-trip conversion through `Version.parseVersion` and `Version.versionToString`.", "mode": "fast-check"} {"id": 57370, "name": "unknown", "code": "it('compares major versions', () => {\n fc.assert(fc.property(fc.integer({ min: 0, max: 1000 }), fc.integer(), fc.integer(), fc.integer(), fc.integer(), fc.hexaString(), fc.hexaString(),\n (major, minor1, minor2, patch1, patch2, preRelease1, preRelease2) => {\n assert.equal(Version.compareVersions(\n { major, minor: minor1, patch: patch1, preRelease: preRelease1 },\n { major: major + 1, minor: minor2, patch: patch2, preRelease: preRelease2 }\n ), Comparison.LT);\n\n assert.equal(Version.compareVersions(\n { major: major + 1, minor: minor2, patch: patch2, preRelease: preRelease2 },\n { major, minor: minor1, patch: patch1, preRelease: preRelease1 }\n ), Comparison.GT);\n }));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/core/VersionTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "The `Version.compareVersions` function compares major version numbers, ensuring a lower major version results in `LT`, and a higher major version results in `GT`.", "mode": "fast-check"} {"id": 57378, "name": "unknown", "code": "it('succeeds for advance command with major.minor arg', async () => {\n await fc.assert(fc.asyncProperty(fc.nat(100), fc.nat(100), async (major, minor) => {\n await assert.becomes(\n parseArgs([ 'advance', `${major}.${minor}` ]),\n O.some(BeehiveArgs.advanceArgs(false, process.cwd(), O.none, O.none, `release/${major}.${minor}`))\n );\n await assert.becomes(\n parseArgs([ 'advance', `${major}.${minor}`, '--dry-run' ]),\n O.some(BeehiveArgs.advanceArgs(true, process.cwd(), O.none, O.none, `release/${major}.${minor}`))\n );\n }));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/args/ParserTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "Parsing the 'advance' command with a `major.minor` argument should return the correct command object, with an optional dry-run flag.", "mode": "fast-check"} {"id": 57380, "name": "unknown", "code": "it(\"Returns the same as the uncurried function\", () => {\n fc.assert(\n fc.property(fc.string(), fc.integer(), fc.boolean(), (a, b, c) =>\n expect(curry(f)(a)(b)(c)).toEqual(f(a, b, c)),\n ),\n );\n })", "language": "typescript", "source_file": "./repos/jhbertra/data-grace/test/prelude.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "jhbertra/data-grace", "url": "https://github.com/jhbertra/data-grace.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": "The curried version of function `f` should return the same result as the uncurried version with the same arguments.", "mode": "fast-check"} {"id": 57381, "name": "unknown", "code": "it(\"Returns its input\", () => {\n fc.assert(fc.property(fc.anything(), x => expect(id(x)).toEqual(x)));\n })", "language": "typescript", "source_file": "./repos/jhbertra/data-grace/test/prelude.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "jhbertra/data-grace", "url": "https://github.com/jhbertra/data-grace.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": "The function `id` consistently returns its input unchanged, regardless of the input type.", "mode": "fast-check"} {"id": 57385, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(MAC(), async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57386, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.MAC), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57387, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n hexaString({ minLength: 4, maxLength: 4 }),\n async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57388, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(hexaString({ minLength: 5 }), async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57389, "name": "unknown", "code": "it('does not allow to edit characters < 4', async () =>\n await fc.assert(\n fc.asyncProperty(\n hexaString({ minLength: 0, maxLength: 3 }),\n async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57390, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n hexaString({ minLength: 3, maxLength: 3 }),\n async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57391, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(hexaString({ minLength: 4 }), async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57392, "name": "unknown", "code": "it('does not allow to edit characters < 3', async () =>\n await fc.assert(\n fc.asyncProperty(\n hexaString({ minLength: 0, maxLength: 2 }),\n async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57393, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 0, max: 7 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57394, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 8 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57395, "name": "unknown", "code": "it('edits name attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tAsciName, 1, 32), async name => {\n inputs[0].value = name;\n await (inputs[0]).requestUpdate();\n expect(inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57396, "name": "unknown", "code": "it('rejects name attribute starting with decimals', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal, 1, 1), async name => {\n inputs[0].value = name;\n await (inputs[0]).requestUpdate();\n expect(inputs[0].checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57397, "name": "unknown", "code": "it('edits smpRate attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 0 }).map(num => `${num}`),\n async smpRate => {\n inputs[4].value = smpRate;\n await (inputs[4]).requestUpdate();\n expect(inputs[4].checkValidity()).to.be.true;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57398, "name": "unknown", "code": "it('rejects smpRate attribute in case input is not unsigned int', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.uint, 1),\n async smpRate => {\n inputs[4].value = smpRate;\n await (inputs[4]).requestUpdate();\n expect(inputs[4].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57399, "name": "unknown", "code": "it('edits nofASDU attribute only for valid inputs', async () => {\n const input = inputs[5];\n input.nullSwitch?.click();\n await input.requestUpdate();\n\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 0 }).map(num => `${num}`),\n async nofASDU => {\n input.value = nofASDU;\n await input.requestUpdate();\n expect(input.checkValidity()).to.be.true;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57400, "name": "unknown", "code": "it('rejects nofASDU attribute in case input is not unsigned int', async () => {\n const input = inputs[5];\n input.nullSwitch?.click();\n await input.requestUpdate();\n\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.uint, 1),\n async nofASDU => {\n input.value = nofASDU;\n await input.requestUpdate();\n expect(input.checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57401, "name": "unknown", "code": "it('edits name attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tAsciName, 1, 32), async name => {\n inputs[0].value = name;\n await (inputs[0]).requestUpdate();\n expect(inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57402, "name": "unknown", "code": "it('rejects name attribute starting with decimals', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal, 1, 1), async name => {\n inputs[0].value = name;\n await (inputs[0]).requestUpdate();\n expect(inputs[0].checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57403, "name": "unknown", "code": "it('edits bufTime attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 0 }).map(num => `${num}`),\n async bufTime => {\n inputs[6].value = bufTime;\n await (inputs[6]).requestUpdate();\n expect(inputs[6].checkValidity()).to.be.true;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57404, "name": "unknown", "code": "it('rejects bufTime attribute starting with not being a unsigned int', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.uint, 1),\n async bufTime => {\n inputs[6].value = bufTime;\n await (inputs[6]).requestUpdate();\n expect(inputs[6].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57405, "name": "unknown", "code": "it('edits intgPd attribute only for valid inputs', async () => {\n const input = inputs[7];\n input.nullSwitch?.click();\n await input.requestUpdate();\n\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 0 }).map(num => `${num}`),\n async intgPd => {\n input.value = intgPd;\n await input.requestUpdate();\n expect(input.checkValidity()).to.be.true;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57406, "name": "unknown", "code": "it('rejects intgPd attribute starting with not being a unsigned int', async () => {\n const input = inputs[7];\n input.nullSwitch?.click();\n await input.requestUpdate();\n\n await fc.assert(\n fc.asyncProperty(regexString(inverseRegExp.uint, 1), async intgPd => {\n input.value = intgPd;\n await input.requestUpdate();\n expect(input.checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57407, "name": "unknown", "code": "it('edits prefix attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tAsciName, 1, 11), async name => {\n inputs[2].value = name;\n await (inputs[2]).requestUpdate();\n expect(inputs[2].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/lnode.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57408, "name": "unknown", "code": "it('rejects name attribute starting with decimals', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal, 1, 1), async name => {\n inputs[2].value = name;\n await (inputs[2]).requestUpdate();\n expect(inputs[2].checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/lnode.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57409, "name": "unknown", "code": "it('edits name attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tAsciName, 1, 32), async name => {\n nameTextField.value = name;\n await nameTextField.requestUpdate();\n expect(nameTextField.checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/gsecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57410, "name": "unknown", "code": "it('rejects name attribute starting with decimals', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal, 1, 1), async name => {\n nameTextField.value = name;\n await nameTextField.requestUpdate();\n expect(nameTextField.checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/gsecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57411, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV4(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57412, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv4), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57413, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV4(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57414, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv4), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57415, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV4(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57416, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv4), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57417, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(regExp.OSI, 1, 8), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57418, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57419, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSI, 1, 16),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57420, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57421, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSI, 1, 16),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57422, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57423, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(regExp.OSIAPi, 1), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57424, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSIAPi), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57425, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSIid, 1, 5),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57426, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSIid), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57427, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSIid, 1, 5),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57428, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSIid), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57429, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSIid, 1, 5),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57430, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSIid), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57431, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSI, 1, 40),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57432, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57433, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(regExp.OSI, 3, 3), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57434, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57435, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(/^[0-7]$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57436, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-7]$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57437, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n nat({ max: 65535 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57438, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57439, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n nat({ max: 65535 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57440, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57441, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(/^\\S*$/, 1), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57442, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n nat({ max: 65535 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57443, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57444, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n nat({ max: 65535 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57445, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57446, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 1025, max: 65535 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57456, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n nat({ max: 255 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Editing is allowed for valid numerical string inputs, confirming they pass validity checks.", "mode": "fast-check"} {"id": 57457, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The input field should be invalid for any value that does not match the regex pattern for digits only (`/^[0-9]*$/`).", "mode": "fast-check"} {"id": 57465, "name": "unknown", "code": "it('rejects name attribute starting with decimals', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal, 1, 1), async name => {\n nameTextField.value = name;\n await nameTextField.requestUpdate();\n expect(nameTextField.checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/abstractda.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that the `nameTextField` validity check returns false for names starting with a decimal character.", "mode": "fast-check"} {"id": 57466, "name": "unknown", "code": "it('for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.lnClass, 4, 4),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/editors/templates/lnodetype-wizard.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Setting the input value to a string matching `regExp.lnClass` of length 4 ensures `input!.checkValidity()` returns true after update.", "mode": "fast-check"} {"id": 57468, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc), async desc => {\n parent.wizardUI.inputs[1].value = desc;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[1].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/integration/editors/communication/subnetwork-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property checks that when a description is set in `wizardUI.inputs[1]` using regex-generated strings, the input validity is true after updating the UI.", "mode": "fast-check"} {"id": 57469, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc, 1), async type => {\n parent.wizardUI.inputs[2].value = type;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[2].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/integration/editors/communication/subnetwork-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that when a valid input matches a specified regular expression, the input field's validity state is true.", "mode": "fast-check"} {"id": 57478, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal), async nomFreq => {\n parent.wizardUI.inputs[4].value = nomFreq;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[4].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures that when a nominal frequency matching a decimal regex is set as an input, the input validity check returns true.", "mode": "fast-check"} {"id": 57485, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc), async desc => {\n parent.wizardUI.inputs[1].value = desc;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[1].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/integration/editors/substation/bay-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Editing operations should only occur for inputs that match the specified regular expression, ensuring validity.", "mode": "fast-check"} {"id": 57486, "name": "unknown", "code": "it('TINY-6891: Should be able to convert to and from numbers/list numbering', () => {\n const arbitrary = Arr.map([\n fc.mapToConstant({ num: 26, build: (v) => String.fromCharCode(65 + v) }),\n fc.mapToConstant({ num: 26, build: (v) => String.fromCharCode(97 + v) }),\n fc.mapToConstant({ num: 10, build: (v) => v.toString() })\n ], (c) => fc.stringOf(c, 1, 5));\n\n fc.assert(fc.property(\n fc.oneof(...arbitrary),\n (start) => {\n assert.equal(\n start,\n parseStartValue(start).map(parseDetail).getOrDie(),\n 'Should be initial start value'\n );\n }\n ), { endOnFailure: true });\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/tinymce/src/plugins/lists/test/ts/atomic/ListNumberingTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57487, "name": "unknown", "code": "it('no initial data', () => {\n const dialogChange = DialogChanges.init({ title: '', text: '' } as LinkDialogData, { } as LinkDialogCatalog);\n\n fc.assert(fc.property(fc.webUrl(), fc.asciiString(), fc.asciiString(), (url, title, text) => {\n const data = Fun.constant({ url: {\n value: url,\n meta: { title, text }\n }} as LinkDialogData);\n const dataNoMeta = Fun.constant({ url: {\n value: url,\n meta: { }\n }} as LinkDialogData);\n\n Assert.eq('on url change should include url title and text',\n Optional.some>({ title, text }),\n dialogChange.onChange(data, { name: 'url' }),\n tOptional()\n );\n\n Assert.eq('on url change should fallback to url for text',\n Optional.some>({ title: '', text: url }),\n dialogChange.onChange(dataNoMeta, { name: 'url' }),\n tOptional()\n );\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/tinymce/src/plugins/link/test/ts/atomic/DialogChangesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57488, "name": "unknown", "code": "it('with original data', () => {\n const dialogChange = DialogChanges.init({ title: 'orig title', text: 'orig text' } as LinkDialogData, { } as LinkDialogCatalog);\n const dialogChangeNoTitle = DialogChanges.init({ title: '', text: 'orig text' } as LinkDialogData, { } as LinkDialogCatalog);\n const dialogChangeNoText = DialogChanges.init({ title: 'orig title', text: '' } as LinkDialogData, { } as LinkDialogCatalog);\n\n fc.assert(fc.property(fc.webUrl(), fc.asciiString(), fc.asciiString(), (url, title, text) => {\n const data = Fun.constant({ url: {\n value: url,\n meta: { title, text }\n }} as LinkDialogData);\n\n Assert.eq('on url change should not try to change title and text',\n Optional.none(),\n dialogChange.onChange(data, { name: 'url' }),\n tOptional()\n );\n\n Assert.eq('No Title - on url change should only try to change title',\n Optional.some>({ title }),\n dialogChangeNoTitle.onChange(data, { name: 'url' }),\n tOptional()\n );\n\n Assert.eq('No Text - on url change should only try to change text',\n Optional.some>({ text }),\n dialogChangeNoText.onChange(data, { name: 'url' }),\n tOptional()\n );\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/tinymce/src/plugins/link/test/ts/atomic/DialogChangesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57489, "name": "unknown", "code": "it('TINY-4773: multiple @ characters', () => {\n const editor = hook.editor();\n fc.assert(fc.property(fc.hexaString(0, 30), fc.hexaString(0, 30), fc.hexaString(0, 30), (s1, s2, s3) => {\n assertNoLink(editor, `${s1}@@${s2}@.@${s3}`, `${s1}@@${s2}@.@${s3}`);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/tinymce/src/plugins/autolink/test/ts/browser/AutoLinkPluginTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57490, "name": "unknown", "code": "it('TINY-4773: ending in @ character', () => {\n const editor = hook.editor();\n fc.assert(fc.property(fc.hexaString(0, 100), (s1) => {\n assertNoLink(editor, `${s1}@`, `${s1}@`);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/tinymce/src/plugins/autolink/test/ts/browser/AutoLinkPluginTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57497, "name": "unknown", "code": "UnitTest.test('KAssert.eqValue: success', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n KAssert.eqValue('eq', i, Result.value(i));\n KAssert.eqValue('eq', i, Result.value(i), tNumber);\n KAssert.eqValue('eq', i, Result.value(i), tNumber, tBoom());\n }));\n})", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "`KAssert.eqValue` successfully evaluates when comparing an integer with a `Result` containing the same integer, with optional types and a function that's not executed.", "mode": "fast-check"} {"id": 57498, "name": "unknown", "code": "UnitTest.test('KAssert.eqValue: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('should throw if numbers differ #1', () => {\n KAssert.eqValue('eq', a, Result.value(b));\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqValue('eq', a, Result.value(b), tNumber);\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqValue('eq', a, Result.value(b), tNumber, tBoom());\n });\n }));\n\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.throws('should throw if error #1', () => {\n KAssert.eqValue('eq', i, Result.error(s));\n });\n Assert.throws('should throw if error #2', () => {\n KAssert.eqValue('eq', i, Result.error(s), tBoom());\n });\n Assert.throws('should throw if error #3', () => {\n KAssert.eqValue('eq', i, Result.error(s), tBoom(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "`KAssert.eqValue` should throw an error when comparing two different numbers or when a Result is an error rather than a value.", "mode": "fast-check"} {"id": 57504, "name": "unknown", "code": "UnitTest.test('KAssert.eqSome: success (reflexivity)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n KAssert.eqSome('eq', i, Optional.some(i));\n KAssert.eqSome('eq', i, Optional.some(i), tNumber);\n }));\n})", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "`KAssert.eqSome` verifies the reflexivity of equality by checking if an integer matches an `Optional.some` of itself, with and without a specified type.", "mode": "fast-check"} {"id": 57505, "name": "unknown", "code": "UnitTest.test('KAssert.eqSome: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #1', () => {\n KAssert.eqSome('eq', a, Optional.some(b));\n });\n }));\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #2', () => {\n KAssert.eqSome('eq', a, Optional.some(b), tNumber);\n });\n }));\n})", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57506, "name": "unknown", "code": "UnitTest.test('KAssert.eqSome: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #1', () => {\n KAssert.eqSome('eq', a, Optional.some(b));\n });\n }));\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #2', () => {\n KAssert.eqSome('eq', a, Optional.some(b), tNumber);\n });\n }));\n})", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57507, "name": "unknown", "code": "UnitTest.test('KAssert.eqNone: failure', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('some(i) != none', () => {\n KAssert.eqNone('eq', Optional.some(i));\n });\n }));\n})", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57508, "name": "unknown", "code": "UnitTest.test('KAssert.eqOption: success (reflexivity)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.some(i));\n KAssert.eqOptional('eq', Optional.some(i), Optional.some(i), tNumber);\n }));\n KAssert.eqOptional('eq', Optional.none(), Optional.none());\n})", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57509, "name": "unknown", "code": "UnitTest.test('KAssert.eqOption: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #1', () => {\n KAssert.eqOptional('eq', Optional.some(a), Optional.some(b));\n });\n }));\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #2', () => {\n KAssert.eqOptional('eq', Optional.some(a), Optional.some(b), tNumber);\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('none != some(i) #1', () => {\n KAssert.eqOptional('eq', Optional.none(), Optional.some(i));\n });\n Assert.throws('none != some(i) #2', () => {\n KAssert.eqOptional('eq', Optional.none(), Optional.some(i), tBoom());\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('some(i) != none #1', () => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.none());\n });\n Assert.throws('some(i) != none #2', () => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.none(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57510, "name": "unknown", "code": "UnitTest.test('KAssert.eqOption: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #1', () => {\n KAssert.eqOptional('eq', Optional.some(a), Optional.some(b));\n });\n }));\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #2', () => {\n KAssert.eqOptional('eq', Optional.some(a), Optional.some(b), tNumber);\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('none != some(i) #1', () => {\n KAssert.eqOptional('eq', Optional.none(), Optional.some(i));\n });\n Assert.throws('none != some(i) #2', () => {\n KAssert.eqOptional('eq', Optional.none(), Optional.some(i), tBoom());\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('some(i) != none #1', () => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.none());\n });\n Assert.throws('some(i) != none #2', () => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.none(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57511, "name": "unknown", "code": "UnitTest.test('KAssert.eqOption: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #1', () => {\n KAssert.eqOptional('eq', Optional.some(a), Optional.some(b));\n });\n }));\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #2', () => {\n KAssert.eqOptional('eq', Optional.some(a), Optional.some(b), tNumber);\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('none != some(i) #1', () => {\n KAssert.eqOptional('eq', Optional.none(), Optional.some(i));\n });\n Assert.throws('none != some(i) #2', () => {\n KAssert.eqOptional('eq', Optional.none(), Optional.some(i), tBoom());\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('some(i) != none #1', () => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.none());\n });\n Assert.throws('some(i) != none #2', () => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.none(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57512, "name": "unknown", "code": "UnitTest.test('KAssert.eqOption: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #1', () => {\n KAssert.eqOptional('eq', Optional.some(a), Optional.some(b));\n });\n }));\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #2', () => {\n KAssert.eqOptional('eq', Optional.some(a), Optional.some(b), tNumber);\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('none != some(i) #1', () => {\n KAssert.eqOptional('eq', Optional.none(), Optional.some(i));\n });\n Assert.throws('none != some(i) #2', () => {\n KAssert.eqOptional('eq', Optional.none(), Optional.some(i), tBoom());\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('some(i) != none #1', () => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.none());\n });\n Assert.throws('some(i) != none #2', () => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.none(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57513, "name": "unknown", "code": "it('returns matching keys and values', () => {\n fc.assert(fc.property(\n fc.array(fc.asciiString(1, 30)),\n (rawValues: string[]) => {\n const values = Unique.stringArray(rawValues);\n\n const keys = Arr.map(values, (v, i) => i);\n\n const output = Zip.zipToObject(keys, values);\n\n const oKeys = Obj.keys(output);\n assert.deepEqual(values.length, oKeys.length);\n\n assert.deepEqual(Arr.forall(oKeys, (oKey) => {\n const index = parseInt(oKey, 10);\n const expected = values[index];\n return output[oKey] === expected;\n }), true);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/ZipTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57514, "name": "unknown", "code": "it('matches corresponding tuples', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.array(fc.integer()),\n (keys, values) => {\n if (keys.length !== values.length) {\n assert.throws(() => Zip.zipToTuples(keys, values));\n } else {\n const output = Zip.zipToTuples(keys, values);\n assert.equal(output.length, keys.length);\n assert.isTrue(Arr.forall(output, (x, i) => x.k === keys[i] && x.v === values[i]));\n }\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/ZipTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57515, "name": "unknown", "code": "it('Check that if the filter always returns false, then everything is in \"fail\"', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n (arr) => {\n const output = Arr.partition(arr, Fun.never);\n assert.deepEqual(output.pass.length, 0);\n assert.deepEqual(output.fail, arr);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/PartitionTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "If the filter always returns false, all elements should be in the \"fail\" partition and \"pass\" should be empty.", "mode": "fast-check"} {"id": 57520, "name": "unknown", "code": "it('filter const true is identity', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.integer()), (obj) => {\n assert.deepEqual(Obj.filter(obj, Fun.always), obj);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/ObjFilterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Filtering an object with a function that always returns true should return the original object unchanged.", "mode": "fast-check"} {"id": 57524, "name": "unknown", "code": "it('finds element in middle of array', () => {\n fc.assert(fc.property(fc.array(fc.nat()), arbNegativeInteger(), fc.array(fc.nat()), (prefix, element, suffix) => {\n const arr = prefix.concat([ element ]).concat(suffix);\n assertSome(Arr.indexOf(arr, element), prefix.length);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/IndexOfTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "`Arr.indexOf` correctly identifies the position of an element located in the middle of an array.", "mode": "fast-check"} {"id": 57534, "name": "unknown", "code": "it('wrap then flatten array is identity', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n assert.deepEqual(arr, Arr.flatten(Arr.pure(arr)));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/FlattenTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Flattening an array that has been wrapped using `Arr.pure` should result in the original array.", "mode": "fast-check"} {"id": 57535, "name": "unknown", "code": "it('mapping pure then flattening array is identity', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n assert.deepEqual(arr, Arr.flatten(Arr.map(arr, Arr.pure)));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/FlattenTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Mapping an array with `Arr.pure` and then flattening it should result in the original array.", "mode": "fast-check"} {"id": 57536, "name": "unknown", "code": "it('flattening two lists === concat', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.array(fc.integer()), (xs, ys) => {\n assert.deepEqual(xs.concat(ys), Arr.flatten([ xs, ys ]));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/FlattenTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Flattening two integer arrays should produce the same result as concatenating them using `concat`.", "mode": "fast-check"} {"id": 57537, "name": "unknown", "code": "describe('finds element in middle of array', () => {\n fc.assert(fc.property(fc.array(fc.nat()), arbNegativeInteger(), fc.array(fc.nat()), (prefix, element, suffix) => {\n const arr = [ ...prefix, element, ...suffix ];\n assertSome(\n Arr.findIndex(arr, (x) => x === element),\n prefix.length\n );\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/FindIndexTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Verification that `Arr.findIndex` returns the index of an element located in the middle of an array.", "mode": "fast-check"} {"id": 57543, "name": "unknown", "code": "it('Element exists in singleton array of itself', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (i) => {\n assert.isTrue(Arr.exists([ i ], eqc(i)));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/ExistsTest.ts", "start_line": null, "end_line": null, "dependencies": ["eqc"], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "An element should exist in a singleton array that contains only itself.", "mode": "fast-check"} {"id": 57547, "name": "unknown", "code": "it('ys-xs contains no elements from xs', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.array(fc.integer()), (xs, ys) => {\n const diff = Arr.difference(ys, xs);\n return Arr.forall(xs, (x) => !Arr.contains(diff, x));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/DifferenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57548, "name": "unknown", "code": "it('every member of ys-xs is in ys', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.array(fc.integer()), (xs, ys) => {\n const diff = Arr.difference(ys, xs);\n return Arr.forall(diff, (d) => Arr.contains(ys, d));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/DifferenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57549, "name": "unknown", "code": "it('returns true when element is in array', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), fc.array(fc.integer()), (prefix, element, suffix) => {\n const arr2 = [ ...prefix, element, ...suffix ];\n assert.isTrue(Arr.contains(arr2, element));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/ContainsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57550, "name": "unknown", "code": "it('creates an array of the appropriate length except for the last one', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.nat(),\n (arr, rawChunkSize) => {\n // ensure chunkSize is at least one\n const chunkSize = rawChunkSize + 1;\n const chunks = Arr.chunk(arr, chunkSize);\n\n const numChunks = chunks.length;\n const firstParts = chunks.slice(0, numChunks - 1);\n\n for (const firstPart of firstParts) {\n assert.lengthOf(firstPart, chunkSize);\n }\n\n if (arr.length === 0) {\n assert.deepEqual(chunks, []);\n } else {\n assert.isAtMost(chunks[chunks.length - 1].length, chunkSize);\n }\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/ChunkTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57551, "name": "unknown", "code": "it('is idempotent', () => {\n fc.assert(fc.property(\n fc.array(fc.nat()), (arr) => {\n assert.deepEqual(Arr.sort(Arr.sort(arr)), Arr.sort(arr));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/ArrSortTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57552, "name": "unknown", "code": "it('returns last element when non-empty', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), (init, last) => {\n const arr = init.concat([ last ]);\n assertSome(Arr.last(arr), last);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/ArrLastTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57553, "name": "unknown", "code": "it('returns first element when nonEmpty', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), (t, h) => {\n const arr = [ h, ...t ];\n assertSome(Arr.head(arr), h);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/ArrHeadTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57554, "name": "unknown", "code": "it('returns none for element of empty list', () => {\n fc.assert(fc.property(fc.integer(), (n) => {\n assertNone(Arr.get([], n));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/ArrGetTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57555, "name": "unknown", "code": "it('returns some for valid index (property test)', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), fc.integer(), (array, h, t) => {\n const arr = [ h ].concat(array);\n const length = arr.push(t);\n const midIndex = Math.round(arr.length / 2);\n\n assertSome(Arr.get(arr, 0), h);\n assertSome(Arr.get(arr, midIndex), arr[midIndex]);\n assertSome(Arr.get(arr, length - 1), t);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/ArrGetTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57556, "name": "unknown", "code": "it('finds a value in the array', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), fc.array(fc.integer()), (prefix, i, suffix) => {\n const arr = prefix.concat([ i ]).concat(suffix);\n const pred = (x: number) => x === i;\n const result = Arr.find(arr, pred);\n assertSome(result, i);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/ArrFindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57557, "name": "unknown", "code": "it('cannot find a nonexistent value', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n const result = Arr.find(arr, Fun.never);\n assertNone(result);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/ArrFindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57558, "name": "unknown", "code": "it('Arr.findMap of non-empty is first if f is Optional.some', () => {\n fc.assert(fc.property(\n fc.integer(),\n fc.array(fc.integer()),\n (head, tail) => {\n const arr = [ head, ...tail ];\n assertSome(Arr.findMap(arr, Optional.some), head);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/ArrFindMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57559, "name": "unknown", "code": "it('Arr.findMap of non-empty is none if f is Optional.none', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n (arr) => {\n assertNone(Arr.findMap(arr, Optional.none));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/ArrFindMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57560, "name": "unknown", "code": "it('Arr.findMap finds an element', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.integer(),\n fc.integer(),\n fc.array(fc.integer()),\n (prefix, element, ret, suffix) => {\n const arr = [ ...prefix, element, ...suffix ];\n assertSome(Arr.findMap(arr, (x) => Optionals.someIf(x === element, ret)), ret);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/ArrFindMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57561, "name": "unknown", "code": "it('Arr.findMap does not find an element', () => {\n fc.assert(fc.property(\n fc.array(fc.nat()),\n fc.nat(),\n (arr, ret) => {\n assertNone(Arr.findMap(arr, (x) => Optionals.someIf(x === -1, ret)));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/ArrFindMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57562, "name": "unknown", "code": "it('binding an array of empty arrays with identity equals an empty array', () => {\n fc.assert(fc.property(fc.array(fc.constant([])), (arr) => {\n assert.deepEqual(Arr.bind(arr, Fun.identity), []);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/ArrBindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57563, "name": "unknown", "code": "it('bind (pure .) is map', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), (arr, j) => {\n const f = (x: number) => x + j;\n assert.deepEqual(Arr.bind(arr, Fun.compose(Arr.pure, f)), Arr.map(arr, f));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/ArrBindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57564, "name": "unknown", "code": "it('obeys left identity law', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), (i, j) => {\n const f = (x: number) => [ x, j, x + j ];\n assert.deepEqual(Arr.bind(Arr.pure(i), f), f(i));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/ArrBindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57565, "name": "unknown", "code": "it('obeys right identity law', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n assert.deepEqual(Arr.bind(arr, Arr.pure), arr);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/ArrBindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57566, "name": "unknown", "code": "it('is associative', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), (arr, j) => {\n const f = (x: number) => [ x, j, x + j ];\n const g = (x: number) => [ j, x, x + j ];\n assert.deepEqual(Arr.bind(Arr.bind(arr, f), g), Arr.bind(arr, (x) => Arr.bind(f(x), g)));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/ArrBindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57567, "name": "unknown", "code": "it('Reversing twice is identity', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n assert.deepEqual(Arr.reverse(Arr.reverse(arr)), arr);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/ReverseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57568, "name": "unknown", "code": "it('reversing a one element array is identity', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (a) => {\n assert.deepEqual(Arr.reverse([ a ]), [ a ]);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/ReverseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57569, "name": "unknown", "code": "it('reverses 2 elements', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), (a, b) => {\n assert.deepEqual(Arr.reverse([ a, b ]), [ b, a ]);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/ReverseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57570, "name": "unknown", "code": "it('reverses 3 elements', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), fc.integer(), (a, b, c) => {\n assert.deepEqual(Arr.reverse([ a, b, c ]), [ c, b, a ]);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/ReverseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57571, "name": "unknown", "code": "it('every element in the input is in the output, and vice-versa', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (xs) => {\n const rxs = Arr.reverse(xs);\n assert.isTrue(Arr.forall(rxs, (x) => Arr.contains(xs, x)));\n assert.isTrue(Arr.forall(xs, (x) => Arr.contains(rxs, x)));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/ReverseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57572, "name": "unknown", "code": "it('cell(x).get() === x', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n const cell = Cell(i);\n assert.equal(cell.get(), i);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/struct/CellTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57573, "name": "unknown", "code": "it('cell.get() === last set call', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), fc.integer(), (a, b, c) => {\n const cell = Cell(a);\n assert.equal(cell.get(), a);\n cell.set(b);\n assert.equal(cell.get(), b);\n cell.set(c);\n assert.equal(cell.get(), c);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/struct/CellTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57574, "name": "unknown", "code": "it('Error is thrown if not all arguments are supplied', () => {\n fc.assert(fc.property(arbAdt, fc.array(arbKeys, 1, 40), (subject, exclusions) => {\n const original = Arr.filter(allKeys, (k) => !Arr.contains(exclusions, k));\n\n try {\n const branches = Arr.mapToObject(original, () => Fun.identity);\n subject.match(branches);\n return false;\n } catch (err: any) {\n return err.message.indexOf('nothing') > -1;\n }\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57575, "name": "unknown", "code": "it('adt.nothing.match should pass [ ]', () => {\n fc.assert(fc.property(arbNothing, (subject) => {\n const contents = subject.match({\n nothing: record,\n unknown: Fun.die('should not be unknown'),\n exact: Fun.die('should not be exact')\n });\n assert.deepEqual(contents, []);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57576, "name": "unknown", "code": "it('adt.nothing.match should be same as fold', () => {\n fc.assert(fc.property(arbNothing, (subject) => {\n const matched = subject.match({\n nothing: record,\n unknown: Fun.die('should not be unknown'),\n exact: Fun.die('should not be exact')\n });\n\n const folded = subject.fold(record, Fun.die('should not be unknown'), Fun.die('should not be exact'));\n assert.deepEqual(folded, matched);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57577, "name": "unknown", "code": "it('adt.unknown.match should pass 1 parameter: [ guesses ]', () => {\n fc.assert(fc.property(arbUnknown, (subject) => {\n const contents = subject.match({\n nothing: Fun.die('should not be nothing'),\n unknown: record,\n exact: Fun.die('should not be exact')\n });\n assert.deepEqual(contents.length, 1);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57578, "name": "unknown", "code": "it('adt.unknown.match should be same as fold', () => {\n fc.assert(fc.property(arbUnknown, (subject) => {\n const matched = subject.match({\n nothing: Fun.die('should not be nothing'),\n unknown: record,\n exact: Fun.die('should not be exact')\n });\n\n const folded = subject.fold(Fun.die('should not be nothing'), record, Fun.die('should not be exact'));\n assert.deepEqual(folded, matched);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57579, "name": "unknown", "code": "it('adt.exact.match should pass 2 parameters [ value, precision ]', () => {\n fc.assert(fc.property(arbExact, (subject) => {\n const contents = subject.match({\n nothing: Fun.die('should not be nothing'),\n unknown: Fun.die('should not be unknown'),\n exact: record\n });\n assert.deepEqual(contents.length, 2);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57580, "name": "unknown", "code": "it('adt.exact.match should be same as fold', () => {\n fc.assert(fc.property(arbExact, (subject) => {\n const matched = subject.match({\n nothing: Fun.die('should not be nothing'),\n unknown: Fun.die('should not be unknown'),\n exact: record\n });\n\n const folded = subject.fold(Fun.die('should not be nothing'), Fun.die('should not be unknown'), record);\n assert.deepEqual(folded, matched);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57581, "name": "unknown", "code": "it('adt.match must have the right arguments, not just the right number', () => {\n fc.assert(fc.property(arbAdt, (subject) => {\n try {\n subject.match({\n not: Fun.identity,\n the: Fun.identity,\n right: Fun.identity\n });\n return false;\n } catch (err: any) {\n return err.message.indexOf('nothing') > -1;\n }\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57582, "name": "unknown", "code": "it('leftTrim(whitespace + s) === leftTrim(s)', () => {\n fc.assert(fc.property(\n fc.string(),\n (s) => {\n assert.equal(Strings.lTrim(s), Strings.lTrim(' ' + s));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/str/TrimTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57583, "name": "unknown", "code": "it('rightTrim(s + whitespace) === rightTrim(s)', () => {\n fc.assert(fc.property(\n fc.string(),\n (s) => {\n assert.equal(Strings.rTrim(s), Strings.rTrim(s + ' '));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/str/TrimTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57584, "name": "unknown", "code": "it('trim(whitespace + s) === trim(s)', () => {\n fc.assert(fc.property(\n fc.string(),\n (s) => {\n assert.equal(Strings.trim(s), Strings.trim(' ' + s));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/str/TrimTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57585, "name": "unknown", "code": "it('trim(s + whitespace) === trim(s)', () => {\n fc.assert(fc.property(\n fc.string(),\n (s) => {\n assert.equal(Strings.trim(s), Strings.trim(s + ' '));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/str/TrimTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57586, "name": "unknown", "code": "it('trim(whitespace + s + whitespace) === trim(s)', () => {\n fc.assert(fc.property(\n fc.string(),\n (s) => {\n assert.equal(Strings.trim(s), Strings.trim(' ' + s + ' '));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/str/TrimTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57587, "name": "unknown", "code": "it('StringMatch.matches(StringMatch.starts(s1), s1 + s) === true', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(),\n (s, s1) => {\n assert.isTrue(StringMatch.matches(\n StringMatch.starts(s1, StringMatch.caseInsensitive),\n s1 + s\n ));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57588, "name": "unknown", "code": "it('StringMatch.matches(StringMatch.contains(s1), s1 + s) === true', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(),\n (s, s1) => {\n assert.isTrue(StringMatch.matches(\n StringMatch.contains(s1, StringMatch.caseInsensitive),\n s1 + s\n ));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57589, "name": "unknown", "code": "it('StringMatch.matches(StringMatch.contains(s1), s + s1) === true', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(),\n (s, s1) => {\n assert.isTrue(StringMatch.matches(\n StringMatch.contains(s1, StringMatch.caseInsensitive),\n s + s1\n ));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57590, "name": "unknown", "code": "it('StringMatch.matches(StringMatch.contains(s1), s) === s.indexOf(s1)', () => {\n fc.assert(fc.property(\n fc.asciiString(),\n fc.asciiString(1, 40),\n (s, s1) => {\n assert.equal(StringMatch.matches(\n StringMatch.contains(s1, StringMatch.caseInsensitive),\n s\n ), s.toLowerCase().indexOf(s1.toLowerCase()) > -1);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57591, "name": "unknown", "code": "it('StringMatch.matches(StringMatch.contains(s), s) === true', () => {\n fc.assert(fc.property(\n fc.string(),\n (s) => {\n assert.isTrue(StringMatch.matches(\n StringMatch.contains(s, StringMatch.caseInsensitive),\n s\n ));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57592, "name": "unknown", "code": "it('StringMatch.matches(StringMatch.exact(s), s + s1) === false', () => {\n fc.assert(fc.property(\n fc.string(1, 40),\n fc.string(1, 40),\n (s, s1) => {\n assert.isFalse(StringMatch.matches(\n StringMatch.exact(s, StringMatch.caseInsensitive),\n s + s1\n ));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57593, "name": "unknown", "code": "it('StringMatch.matches(StringMatch.exact(s), s1 + s) === false', () => {\n fc.assert(fc.property(\n fc.string(1, 40),\n fc.string(1, 40),\n (s, s1) => {\n assert.isFalse(StringMatch.matches(\n StringMatch.exact(s, StringMatch.caseInsensitive),\n s1 + s\n ));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57594, "name": "unknown", "code": "it('StringMatch.matches(StringMatch.exact(s), s) === true', () => {\n fc.assert(fc.property(\n fc.string(1, 40),\n (s) => {\n assert.isTrue(StringMatch.matches(\n StringMatch.exact(s, StringMatch.caseInsensitive),\n s\n ));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57595, "name": "unknown", "code": "it('StringMatch.matches(StringMatch.exact(s), s) === false when different case and case-insensitive', () => {\n fc.assert(fc.property(\n fc.asciiString(1, 40),\n (s) => s.toUpperCase() === s.toLowerCase() || StringMatch.matches(\n StringMatch.exact(s.toLowerCase(), StringMatch.caseInsensitive),\n s.toUpperCase()\n )\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57596, "name": "unknown", "code": "it('StringMatch.matches(StringMatch.exact(s), s) === false when different case and case-sensitive', () => {\n fc.assert(fc.property(\n fc.asciiString(1, 40),\n (s) => s.toUpperCase() === s.toLowerCase() || !StringMatch.matches(\n StringMatch.exact(s.toLowerCase(), StringMatch.caseSensitive),\n s.toUpperCase()\n )\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57597, "name": "unknown", "code": "it('StringMatch.matches(StringMatch.all(s1), *) === true', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(),\n (s) => {\n assert.isTrue(StringMatch.matches(\n StringMatch.all(),\n s\n ));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57598, "name": "unknown", "code": "it('positive range', () => {\n fc.assert(fc.property(fc.char(), fc.integer(1, 100), (c, count) => {\n const actual = Strings.repeat(c, count);\n assert.equal(actual.length, count);\n assert.equal(actual.charAt(0), c);\n assert.equal(actual.charAt(actual.length - 1), c);\n }));\n\n fc.assert(fc.property(fc.asciiString(5), fc.integer(1, 100), (s, count) => {\n const actual = Strings.repeat(s, count);\n assert.equal(actual.length, count * s.length);\n assert.equal(actual.indexOf(s), 0);\n assert.equal(actual.lastIndexOf(s), actual.length - s.length);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/str/RepeatTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57599, "name": "unknown", "code": "it('positive range', () => {\n fc.assert(fc.property(fc.char(), fc.integer(1, 100), (c, count) => {\n const actual = Strings.repeat(c, count);\n assert.equal(actual.length, count);\n assert.equal(actual.charAt(0), c);\n assert.equal(actual.charAt(actual.length - 1), c);\n }));\n\n fc.assert(fc.property(fc.asciiString(5), fc.integer(1, 100), (s, count) => {\n const actual = Strings.repeat(s, count);\n assert.equal(actual.length, count * s.length);\n assert.equal(actual.indexOf(s), 0);\n assert.equal(actual.lastIndexOf(s), actual.length - s.length);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/str/RepeatTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57600, "name": "unknown", "code": "it('negative range', () => {\n fc.assert(fc.property(fc.char(), fc.integer(-100, 0), (c, count) => {\n const actual = Strings.repeat(c, count);\n assert.equal(actual.length, 0);\n assert.equal(actual, '');\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/str/RepeatTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57601, "name": "unknown", "code": "it('removeTrailing property', () => {\n fc.assert(fc.property(\n fc.asciiString(),\n fc.asciiString(),\n (prefix, suffix) => {\n assert.equal(Strings.removeTrailing(prefix + suffix, suffix), prefix);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/str/RemoveTrailingTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57602, "name": "unknown", "code": "it('removeLeading removes prefix', () => {\n fc.assert(fc.property(\n fc.asciiString(),\n fc.asciiString(),\n (prefix, suffix) => {\n assert.equal(Strings.removeLeading(prefix + suffix, prefix), suffix);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/str/RemoveLeadingTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57603, "name": "unknown", "code": "it('ensureTrailing is identity if string already ends with suffix', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(),\n (prefix, suffix) => {\n const s = prefix + suffix;\n assert.equal(Strings.ensureTrailing(s, suffix), s);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/str/EnsureTrailingTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57604, "name": "unknown", "code": "it('ensureTrailing endsWith', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(),\n (s, suffix) => Strings.endsWith(Strings.ensureTrailing(s, suffix), suffix)\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/str/EnsureTrailingTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57605, "name": "unknown", "code": "it('startsWith a prefix', () => {\n fc.assert(fc.property(fc.string(), fc.string(),\n (prefix, suffix) => Strings.startsWith(prefix + suffix, prefix)\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/str/EnsureLeadingTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57606, "name": "unknown", "code": "it('A string added to a string (at the end) must have endsWith as true', () => {\n fc.assert(fc.property(\n fc.asciiString(),\n fc.asciiString(),\n (str, contents) => Strings.endsWith(str + contents, contents)\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/str/EndsWithTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57607, "name": "unknown", "code": "it('A string with length 1 or larger should never be empty', () => {\n fc.assert(fc.property(fc.string(1, 40), (str) => {\n assert.isFalse(Strings.isEmpty(str));\n assert.isTrue(Strings.isNotEmpty(str));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/str/EmptyTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57608, "name": "unknown", "code": "it('A string added to a string (at the end) must be contained within it', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(1, 40),\n (str, contents) => {\n const r = str + contents;\n assert.isTrue(Strings.contains(r, contents));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/str/ContainsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57609, "name": "unknown", "code": "it('A string added to a string (at the start) must be contained within it', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(1, 40),\n (str, contents) => {\n const r = contents = str;\n assert.isTrue(Strings.contains(r, contents));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/str/ContainsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57610, "name": "unknown", "code": "it('An empty string should contain nothing', () => {\n fc.assert(fc.property(\n fc.string(1, 40),\n (value) => !Strings.contains('', value)\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/str/ContainsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57611, "name": "unknown", "code": "it('tail of the string is unchanged', () => {\n fc.assert(fc.property(fc.ascii(), fc.asciiString(30), (h, t) => {\n assert.equal(Strings.capitalize(h + t).substring(1), t);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/str/CapitalizeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57612, "name": "unknown", "code": "it('head is uppercase', () => {\n fc.assert(fc.property(fc.ascii(), fc.asciiString(30), (h, t) => {\n const actualH = Strings.capitalize(h + t).charAt(0);\n assert.equal(actualH, h.toUpperCase());\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/str/CapitalizeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57613, "name": "unknown", "code": "it('value(x) = value(x)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n assertResult(Result.value(i), Result.value(i));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/ResultInstancesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57614, "name": "unknown", "code": "it('error(x) = error(x)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n assertResult(Result.error(i), Result.error(i));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/ResultInstancesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57615, "name": "unknown", "code": "it('value(a) != error(e)', () => {\n fc.assert(fc.property(fc.integer(), fc.string(), (a, e) => {\n assert.isFalse(tResult(tNumber, tString).eq(\n Result.value(a),\n Result.error(e)\n ));\n\n assert.isFalse(tResult(tNumber, tString).eq(\n Result.error(e),\n Result.value(a)\n ));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/ResultInstancesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57616, "name": "unknown", "code": "it('(a = b) = (value(a) = value(b))', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), (a, b) => {\n assert.equal(tResult(tNumber, tString).eq(\n Result.value(a),\n Result.value(b)\n ), a === b);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/ResultInstancesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57617, "name": "unknown", "code": "it('(a = b) = (error(a) = error(b))', () => {\n fc.assert(fc.property(fc.string(), fc.string(), (a, b) => {\n assert.equal(tResult(tNumber, tString).eq(\n Result.error(a),\n Result.error(b)\n ), a === b);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/ResultInstancesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57618, "name": "unknown", "code": "it('ResultInstances.pprint', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n assert.equal(Pprint.render(Result.value(i), tResult(tNumber, tString)), `Result.value(\n ${i}\n)`);\n\n assert.equal(Pprint.render(Result.error(i), tResult(tString, tNumber)), `Result.error(\n ${i}\n)`);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/ResultInstancesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57619, "name": "unknown", "code": "it('Optionals.cat of only nones should be an empty array', () => {\n fc.assert(fc.property(\n fc.array(ArbDataTypes.arbOptionalNone()),\n (options) => {\n const output = Optionals.cat(options);\n assert.deepEqual(output, []);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57620, "name": "unknown", "code": "it('Optionals.cat of only somes should have the same length', () => {\n fc.assert(fc.property(\n fc.array(ArbDataTypes.arbOptionalSome(fc.integer())),\n (options) => {\n const output = Optionals.cat(options);\n assert.lengthOf(output, options.length);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57621, "name": "unknown", "code": "it('Optionals.cat of Arr.map(xs, Optional.some) should be xs', () => {\n fc.assert(fc.property(\n fc.array(fc.json()),\n (arr) => {\n const options = Arr.map(arr, Optional.some);\n const output = Optionals.cat(options);\n assert.deepEqual(output, arr);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57622, "name": "unknown", "code": "it('Optionals.cat of somes and nones should have length <= original', () => {\n fc.assert(fc.property(\n fc.array(ArbDataTypes.arbOptional(fc.integer())),\n (arr) => {\n const output = Optionals.cat(arr);\n assert.isAtMost(output.length, arr.length);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57623, "name": "unknown", "code": "it('Optionals.cat of nones.concat(somes).concat(nones) should be somes', () => {\n fc.assert(fc.property(\n fc.array(fc.json()),\n fc.array(fc.json()),\n fc.array(fc.json()),\n (before, on, after) => {\n const beforeNones: Optional[] = Arr.map(before, Optional.none);\n const afterNones = Arr.map(after, Optional.none);\n const onSomes = Arr.map(on, Optional.some);\n const output = Optionals.cat(beforeNones.concat(onSomes).concat(afterNones));\n assert.deepEqual(output, on);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57624, "name": "unknown", "code": "it('someIf(false) is none', () => {\n fc.assert(fc.property(fc.integer(), (n) => {\n assertNone(Optionals.someIf(false, n));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalsSomeIfTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57625, "name": "unknown", "code": "it('someIf(true) is some', () => {\n fc.assert(fc.property(fc.integer(), (n) => {\n assertSome(Optionals.someIf(true, n), n);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalsSomeIfTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57626, "name": "unknown", "code": "it('Single some value', () => {\n fc.assert(fc.property(fc.integer(), (n) => {\n assertOptional(Optionals.sequence([ Optional.some(n) ]), Optional.some([ n ]));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalsSequenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57627, "name": "unknown", "code": "it('Two some values', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), (n, m) => {\n assertOptional(Optionals.sequence([ Optional.some(n), Optional.some(m) ]), Optional.some([ n, m ]));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalsSequenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57628, "name": "unknown", "code": "it('Array of numbers', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (n) => {\n const someNumbers = Arr.map(n, (x) => Optional.some(x));\n assertOptional(Optionals.sequence(someNumbers), Optional.some(n));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalsSequenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57629, "name": "unknown", "code": "it('Some then none', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (n) => {\n const someNumbers = Arr.map(n, (x) => Optional.some(x));\n assertNone(Optionals.sequence([ ...someNumbers, Optional.none() ]));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalsSequenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57630, "name": "unknown", "code": "it('None then some', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (n) => {\n const someNumbers = Arr.map(n, (x) => Optional.some(x));\n assertNone(Optionals.sequence([ Optional.none(), ...someNumbers ]));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalsSequenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57631, "name": "unknown", "code": "it('all some', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (n) =>\n assertOptional(Optionals.sequence(Arr.map(n, (x) => Optional.some(x))), Optionals.traverse(n, (x) => Optional.some(x)))\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalsSequenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57632, "name": "unknown", "code": "it('flattens some(some(x)) to some(x)', () => {\n fc.assert(fc.property(fc.integer(), (n) => {\n assertOptional(Optionals.flatten(Optional.some(Optional.some(n))), Optional.some(n));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalsFlattenTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57633, "name": "unknown", "code": "it('Optional.none() !== Optional.some(x)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n assert.isFalse(Optionals.equals(Optional.none(), Optional.some(i)));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57634, "name": "unknown", "code": "it('Optional.some(x) !== Optional.none()', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n assert.isFalse((Optionals.equals(Optional.some(i), Optional.none())));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57635, "name": "unknown", "code": "it('Optional.some(x) === Optional.some(x)', () => {\n fc.assert(fc.property(fc.integer(), (i) => assert.isTrue(Optionals.equals(Optional.some(i), Optional.some(i)))));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57636, "name": "unknown", "code": "it('Optional.some(x) === Optional.some(x) (same ref)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n const ob = Optional.some(i);\n assert.isTrue(Optionals.equals(ob, ob));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57637, "name": "unknown", "code": "it('Optional.some(x) !== Optional.some(x + y) where y is not identity', () => {\n fc.assert(fc.property(fc.string(), fc.string(1, 40), (a, b) => {\n assert.isFalse(Optionals.equals(Optional.some(a), Optional.some(a + b)));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57638, "name": "unknown", "code": "it('some !== none, for any predicate', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt1) => {\n assert.isFalse(Optionals.equals(opt1, Optional.none(), boom));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57639, "name": "unknown", "code": "it('none !== some, for any predicate', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt1) => {\n assert.isFalse(Optionals.equals(Optional.none(), opt1, boom));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57640, "name": "unknown", "code": "it('Checking Optionals.equals(some(x), some(y), _, _ -> false) === false', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), arbOptionSome(fc.integer()), (opt1, opt2) => {\n assert.isFalse(Optionals.equals(opt1, opt2, Fun.never));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57641, "name": "unknown", "code": "it('Checking Optionals.equals(some(x), some(y), _, _ -> true) === true', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), (a, b) => {\n const opt1 = Optional.some(a);\n const opt2 = Optional.some(b);\n assert.isTrue(Optionals.equals(opt1, opt2, Fun.always));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57642, "name": "unknown", "code": "it('Checking Optionals.equals(some(x), some(y), f) iff. f(x, y)', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), arbOptionSome(fc.integer()), fc.func(fc.boolean()), (a, b, f) => {\n const opt1 = Optional.some(a);\n const opt2 = Optional.some(b);\n return f(a, b) === Optionals.equals(opt1, opt2, f);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57643, "name": "unknown", "code": "it('Checking some(x).fold(die, id) === x', () => {\n fc.assert(fc.property(fc.integer(), (json) => {\n const opt = Optional.some(json);\n const actual = opt.fold(Fun.die('Should not be none!'), Fun.identity);\n assert.deepEqual(actual, json);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57644, "name": "unknown", "code": "it('Checking some(x).is(x) === true', () => {\n fc.assert(fc.property(fc.integer(), (json) => {\n const opt = Optional.some(json);\n assert.isTrue(Optionals.is(opt, json));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57645, "name": "unknown", "code": "it('Checking some(x).isSome === true', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => opt.isSome()));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57646, "name": "unknown", "code": "it('Checking some(x).isNone === false', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => !opt.isNone()));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57647, "name": "unknown", "code": "it('Checking some(x).getOr(v) === x', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), arbOptionSome(fc.integer()), (a, b) => {\n assert.equal(Optional.some(a).getOr(b), a);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57648, "name": "unknown", "code": "it('Checking some(x).getOrThunk(_ -> v) === x', () => {\n fc.assert(fc.property(fc.integer(), fc.func(fc.integer()), (a, thunk) => {\n assert.equal(Optional.some(a).getOrThunk(thunk), a);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57649, "name": "unknown", "code": "it('Checking some.getOrDie() never throws', () => {\n fc.assert(fc.property(fc.integer(), fc.string(1, 40), (i, s) => {\n const opt = Optional.some(i);\n opt.getOrDie(s);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57650, "name": "unknown", "code": "it('Checking some(x).or(oSomeValue) === some(x)', () => {\n fc.assert(fc.property(fc.integer(), arbOptionSome(fc.integer()), (json, other) => {\n const output = Optional.some(json).or(other);\n assert.isTrue(Optionals.is(output, json));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57651, "name": "unknown", "code": "it('Checking some(x).orThunk(_ -> oSomeValue) === some(x)', () => {\n fc.assert(fc.property(fc.integer(), arbOptionSome(fc.integer()), (i, other) => {\n const output = Optional.some(i).orThunk(() => other);\n assert.isTrue(Optionals.is(output, i));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57652, "name": "unknown", "code": "it('Checking some(x).map(f) === some(f(x))', () => {\n fc.assert(fc.property(fc.integer(), fc.func(fc.integer()), (a, f) => {\n const opt = Optional.some(a);\n const actual = opt.map(f);\n assert.equal(actual.getOrDie(), f(a));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57653, "name": "unknown", "code": "it('Checking some(x).each(f) === undefined and f gets x', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => {\n let hack: number | null = null;\n const actual = opt.each((x) => {\n hack = x;\n });\n assert.isUndefined(actual);\n assert.equal(opt.getOrDie(), hack);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57654, "name": "unknown", "code": "it('Given f :: s -> some(b), checking some(x).bind(f) === some(b)', () => {\n fc.assert(fc.property(fc.integer(), fc.func(arbOptionSome(fc.integer())), (i, f) => {\n const actual = Optional.some(i).bind(f);\n assert.deepEqual(actual, f(i));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57655, "name": "unknown", "code": "it('Given f :: s -> none, checking some(x).bind(f) === none', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), fc.func(arbOptionNone()), (opt, f) => {\n const actual = opt.bind(f);\n assertNone(actual);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57656, "name": "unknown", "code": "it('Checking some(x).exists(_ -> false) === false', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => !opt.exists(Fun.never)));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57657, "name": "unknown", "code": "it('Checking some(x).exists(_ -> true) === true', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => opt.exists(Fun.always)));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57658, "name": "unknown", "code": "it('Checking some(x).exists(f) iff. f(x)', () => {\n fc.assert(fc.property(fc.integer(), fc.func(fc.boolean()), (i, f) => {\n const opt = Optional.some(i);\n if (f(i)) {\n assert.isTrue(opt.exists(f));\n } else {\n assert.isFalse(opt.exists(f));\n }\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57659, "name": "unknown", "code": "it('Checking some(x).forall(_ -> false) === false', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => !opt.forall(Fun.never)));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57660, "name": "unknown", "code": "it('Checking some(x).forall(_ -> true) === true', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => opt.forall(Fun.always)));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57661, "name": "unknown", "code": "it('Checking some(x).forall(f) iff. f(x)', () => {\n fc.assert(fc.property(fc.integer(), fc.func(fc.boolean()), (i, f) => {\n const opt = Optional.some(i);\n if (f(i)) {\n assert.isTrue(opt.forall(f));\n } else {\n assert.isFalse(opt.forall(f));\n }\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57662, "name": "unknown", "code": "it('Checking some(x).toArray equals [ x ]', () => {\n fc.assert(fc.property(fc.integer(), (json) => {\n assert.deepEqual(Optional.some(json).toArray(), [ json ]);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57663, "name": "unknown", "code": "it('Checking some(x).toString equals \"some(x)\"', () => {\n fc.assert(fc.property(fc.integer(), (json) => {\n assert.equal(Optional.some(json).toString(), 'some(' + json + ')');\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57664, "name": "unknown", "code": "it('Checking none.fold(_ -> x, die) === x', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n const actual = Optional.none().fold(Fun.constant(i), Fun.die('Should not be called'));\n assert.equal(actual, i);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57665, "name": "unknown", "code": "it('Checking none.is === false', () => {\n fc.assert(fc.property(fc.integer(), (v) => {\n assert.isFalse(Optionals.is(Optional.none(), v));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57666, "name": "unknown", "code": "it('Checking none.getOr(v) === v', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n assert.equal(Optional.none().getOr(i), i);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57667, "name": "unknown", "code": "it('Checking none.getOrThunk(_ -> v) === v', () => {\n fc.assert(fc.property(fc.func(fc.integer()), (thunk) => {\n assert.equal(Optional.none().getOrThunk(thunk), thunk());\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57668, "name": "unknown", "code": "it('Checking none.getOrDie() always throws', () => {\n // Require non empty string of msg falsiness gets in the way.\n fc.assert(fc.property(fc.string(1, 40), (s) => {\n assert.throws(() => {\n Optional.none().getOrDie(s);\n });\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57669, "name": "unknown", "code": "it('Checking none.or(oSomeValue) === oSomeValue', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n const output = Optional.none().or(Optional.some(i));\n assert.isTrue(Optionals.is(output, i));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57670, "name": "unknown", "code": "it('Checking none.orThunk(_ -> v) === v', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n const output = Optional.none().orThunk(() => Optional.some(i));\n assert.isTrue(Optionals.is(output, i));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57671, "name": "unknown", "code": "it('none is not some', () => {\n assert.isFalse(Optional.none().isSome());\n fc.assert(fc.property(fc.anything(), (x) => {\n assert.isTrue(Optional.some(x).isSome());\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalIsSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57672, "name": "unknown", "code": "it('Optional.isNone', () => {\n assert.isTrue(Optional.none().isNone());\n fc.assert(fc.property(fc.anything(), (x) => {\n assert.isFalse(Optional.some(x).isNone());\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalIsNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57673, "name": "unknown", "code": "it('Optional.getOr', () => {\n fc.assert(fc.property(fc.integer(), (x) => {\n assert.equal(Optional.none().getOr(x), x);\n assert.equal(Optional.none().getOrThunk(() => x), x);\n }));\n fc.assert(fc.property(fc.integer(), fc.integer(), (x, y) => {\n assert.equal(Optional.some(x).getOr(y), x);\n assert.equal(Optional.some(x).getOrThunk(Fun.die('boom')), x);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalGetOrTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57674, "name": "unknown", "code": "it('Optional.getOr', () => {\n fc.assert(fc.property(fc.integer(), (x) => {\n assert.equal(Optional.none().getOr(x), x);\n assert.equal(Optional.none().getOrThunk(() => x), x);\n }));\n fc.assert(fc.property(fc.integer(), fc.integer(), (x, y) => {\n assert.equal(Optional.some(x).getOr(y), x);\n assert.equal(Optional.some(x).getOrThunk(Fun.die('boom')), x);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalGetOrTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57675, "name": "unknown", "code": "it('Checking some(x).filter(_ -> false) === none', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => {\n assertNone(opt.filter(Fun.never));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalFilterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57676, "name": "unknown", "code": "it('Checking some(x).filter(_ -> true) === some(x)', () => {\n fc.assert(fc.property(fc.integer(), (x) => {\n assertSome(some(x).filter(Fun.always), x);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalFilterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57677, "name": "unknown", "code": "it('Checking some(x).filter(f) === some(x) iff. f(x)', () => {\n fc.assert(fc.property(fc.integer(), fc.func(fc.boolean()), (i, f) => {\n if (f(i)) {\n assertSome(some(i).filter(f), i);\n } else {\n assertNone(some(i).filter(f));\n }\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/OptionalFilterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57678, "name": "unknown", "code": "it('fails for none vs some', () => {\n fc.assert(fc.property(fc.nat(), (n) => {\n assert.throw(() => {\n assertOptional(Optional.none(), Optional.some(n));\n });\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/AssertOptionalTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57679, "name": "unknown", "code": "it('fails for some vs none', () => {\n fc.assert(fc.property(fc.nat(), (n) => {\n assert.throw(() => {\n assertOptional(Optional.some(n), Optional.none());\n });\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/AssertOptionalTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57680, "name": "unknown", "code": "it('fails when some values are different', () => {\n fc.assert(fc.property(fc.nat(), (n) => {\n assert.throw(() => {\n assertOptional(Optional.some(n), Optional.some(n + 1));\n });\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/AssertOptionalTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57681, "name": "unknown", "code": "it('passes for identical somes', () => {\n fc.assert(fc.property(fc.nat(), (n) => {\n assertOptional(Optional.some(n), Optional.some(n));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/AssertOptionalTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57682, "name": "unknown", "code": "it('passes for identical some arrays', () => {\n fc.assert(fc.property(fc.array(fc.nat()), (n) => {\n assertOptional(Optional.some(n), Optional.some(n));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/optional/AssertOptionalTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57683, "name": "unknown", "code": "it('Checking that creating a namespace (forge) from an obj will enable that value to be retrieved by resolving (path)', () => {\n fc.assert(fc.property(\n // NOTE: This value is being modified, so it cannot be shrunk.\n fc.dictionary(fc.asciiString(),\n // We want to make sure every path in the object is an object\n // also, because that is a limitation of forge.\n fc.dictionary(fc.asciiString(),\n fc.dictionary(fc.asciiString(), fc.constant({}))\n )\n ),\n fc.array(fc.asciiString(1, 30), 1, 40),\n fc.asciiString(1, 30),\n fc.asciiString(1, 30),\n (dict, parts, field, newValue) => {\n const created = Resolve.forge(parts, dict);\n created[field] = newValue;\n const resolved = Resolve.path(parts.concat([ field ]), dict);\n assert.deepEqual(resolved, newValue);\n }\n ), { endOnFailure: true });\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/obj/ResolveTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57684, "name": "unknown", "code": "it('map id obj = obj', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.integer()), (obj) => {\n const actual = Obj.map(obj, Fun.identity);\n assert.deepEqual(actual, obj);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/obj/ObjMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57685, "name": "unknown", "code": "it('map constant obj means that values(obj) are all the constant', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.integer()), fc.integer(), (obj, x) => {\n const output = Obj.map(obj, Fun.constant(x));\n const values = Obj.values(output);\n return Arr.forall(values, (v) => v === x);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/obj/ObjMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57686, "name": "unknown", "code": "it('tupleMap obj (x, i) -> { k: i, v: x }', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.integer()), (obj) => {\n const output = Obj.tupleMap(obj, (x, i) => ({ k: i, v: x }));\n assert.deepEqual(output, obj);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/obj/ObjMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57687, "name": "unknown", "code": "it('mapToArray is symmetric with tupleMap', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.integer()), (obj) => {\n const array = Obj.mapToArray(obj, (x, i) => ({ k: i, v: x }));\n\n const aKeys = Arr.map(array, (x) => x.k);\n const aValues = Arr.map(array, (x) => x.v);\n\n const keys = Obj.keys(obj);\n const values = Obj.values(obj);\n\n assert.deepEqual(Arr.sort(aKeys), Arr.sort(keys));\n assert.deepEqual(Arr.sort(aValues), Arr.sort(values));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/obj/ObjMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57688, "name": "unknown", "code": "it('single key/value', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.json(),\n (k: string, v: any) => {\n const o = { [k]: v };\n assert.isFalse(Obj.isEmpty(o));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/obj/ObjIsEmptyTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57689, "name": "unknown", "code": "it('the value found by find always passes predicate', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(), fc.json()),\n fc.func(fc.boolean()),\n (obj, pred) => {\n // It looks like the way that fc.fun works is it cares about all of its arguments, so therefore\n // we have to only pass in one if we want it to be deterministic. Just an assumption\n const value = Obj.find(obj, (v) => {\n return pred(v);\n });\n return value.fold(() => {\n const values = Obj.values(obj);\n return !Arr.exists(values, (v) => {\n return pred(v);\n });\n }, (v) => {\n return pred(v);\n });\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/obj/ObjFindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57690, "name": "unknown", "code": "it('If predicate is always false, then find is always none', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(), fc.json()),\n (obj) => {\n const value = Obj.find(obj, Fun.never);\n return value.isNone();\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/obj/ObjFindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57691, "name": "unknown", "code": "it('If object is empty, find is always none', () => {\n fc.assert(fc.property(\n fc.func(fc.boolean()),\n (pred) => {\n const value = Obj.find({}, pred);\n return value.isNone();\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/obj/ObjFindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57692, "name": "unknown", "code": "it('If predicate is always true, then value is always the some(first), or none if dict is empty', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(), fc.json()),\n (obj) => {\n const value = Obj.find(obj, Fun.always);\n // No order is specified, so we cannot know what \"first\" is\n return Obj.keys(obj).length === 0 ? value.isNone() : true;\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/obj/ObjFindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57693, "name": "unknown", "code": "it('Each + set should equal the same object', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(), fc.json()),\n (obj) => {\n const values: Record = {};\n const output = Obj.each(obj, (x, i) => {\n values[i] = x;\n });\n assert.deepEqual(values, obj);\n assert.isUndefined(output);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/obj/ObjEachTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57694, "name": "unknown", "code": "it('Merged with identity on left', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), (obj) => {\n assert.deepEqual(Merger.merge({}, obj), obj);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57695, "name": "unknown", "code": "it('Merged with identity on right', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), (obj) => {\n assert.deepEqual(Merger.merge(obj, {}), obj);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57696, "name": "unknown", "code": "it('Merged with itself is itself', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), (obj) => {\n assert.deepEqual(Merger.merge(obj, obj), obj);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57697, "name": "unknown", "code": "it('Merge(a, Merge(b, c)) === Merge(Merge(a, b), c)', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), fc.dictionary(fc.asciiString(), fc.json()), fc.dictionary(fc.asciiString(), fc.json()), (a, b, c) => {\n const one = Merger.merge(a, Merger.merge(b, c));\n const other = Merger.merge(Merger.merge(a, b), c);\n assert.deepEqual(other, one);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57698, "name": "unknown", "code": "it('Merge(a, b) contains all the keys of b', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), fc.dictionary(fc.asciiString(), fc.json()), (a, b) => {\n const output = Merger.merge(a, b);\n const keys = Obj.keys(b);\n const oKeys = Obj.keys(output);\n return Arr.forall(keys, (k) => {\n return Arr.contains(oKeys, k);\n });\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57699, "name": "unknown", "code": "it('Deep-merged with identity on left', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), (obj) => {\n assert.deepEqual(Merger.deepMerge({}, obj), obj);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57700, "name": "unknown", "code": "it('Deep-merged with identity on right', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), (obj) => {\n assert.deepEqual(Merger.deepMerge(obj, {}), obj);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57701, "name": "unknown", "code": "it('Deep-merged with itself is itself', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), (obj) => {\n assert.deepEqual(Merger.deepMerge(obj, obj), obj);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57702, "name": "unknown", "code": "it('Deep-merge(a, Deep-merge(b, c)) === Deep-merge(Deep-merge(a, b), c)', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), fc.dictionary(fc.asciiString(), fc.json()), fc.dictionary(fc.asciiString(), fc.json()), (a, b, c) => {\n const one = Merger.merge(a, Merger.merge(b, c));\n const other = Merger.merge(Merger.merge(a, b), c);\n assert.deepEqual(other, one);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57703, "name": "unknown", "code": "it('Deep-merge(a, b) contains all the keys of b', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), fc.dictionary(fc.asciiString(), fc.json()), (a, b) => {\n const output = Merger.deepMerge(a, b);\n const keys = Obj.keys(b);\n const oKeys = Obj.keys(output);\n return Arr.forall(keys, (k) => {\n return Arr.contains(oKeys, k);\n });\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57704, "name": "unknown", "code": "it('Check that if the filter always returns false, then everything is in \"f\"', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(), fc.string(1, 40)),\n (obj) => {\n const output = Obj.bifilter(obj, Fun.never);\n assert.lengthOf(Obj.keys(output.f), Obj.keys(obj).length);\n assert.lengthOf(Obj.keys(output.t), 0);\n return true;\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/obj/BiFilterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57705, "name": "unknown", "code": "it('Check that if the filter always returns true, then everything is in \"t\"', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(), fc.string(1, 40)),\n (obj) => {\n const output = Obj.bifilter(obj, Fun.always);\n assert.lengthOf(Obj.keys(output.f), 0);\n assert.lengthOf(Obj.keys(output.t), Obj.keys(obj).length);\n return true;\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/obj/BiFilterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57706, "name": "unknown", "code": "it('Check that everything in f fails predicate and everything in t passes predicate', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(1, 30), fc.integer()),\n (obj) => {\n const predicate = (x: number) => x % 2 === 0;\n const output = Obj.bifilter(obj, predicate);\n\n const matches = (k: string) => predicate(obj[k]);\n\n const falseKeys = Obj.keys(output.f);\n const trueKeys = Obj.keys(output.t);\n\n assert.isFalse(Arr.exists(falseKeys, matches));\n assert.isTrue(Arr.forall(trueKeys, matches));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/obj/BiFilterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57707, "name": "unknown", "code": "it('should have an adjustment of delta, or be the min or max', () => {\n fc.assert(fc.property(\n fc.nat(),\n fc.integer(),\n fc.nat(),\n fc.nat(),\n (value, delta, min, range) => {\n const max = min + range;\n const actual = Num.cycleBy(value, delta, min, max);\n return (actual - value) === delta || actual === min || actual === max;\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/num/NumCycleByTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57708, "name": "unknown", "code": "it('0 has no effect', () => {\n fc.assert(fc.property(fc.nat(), fc.nat(), (value, delta) => {\n const actual = Num.cycleBy(value, 0, value, value + delta);\n assert.equal(actual, value);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/num/NumCycleByTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57709, "name": "unknown", "code": "it('delta is max', () => {\n fc.assert(fc.property(fc.nat(), fc.nat(), (value, delta) => {\n const max = value + delta;\n const actual = Num.cycleBy(value, delta, value, max);\n assert.equal(actual, max);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/num/NumCycleByTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57710, "name": "unknown", "code": "it('Num.clamp', () => {\n fc.assert(fc.property(\n fc.nat(1000),\n fc.nat(1000),\n fc.nat(1000),\n (a, b, c) => {\n const low = a;\n const med = low + b;\n const high = med + c;\n // low <= med <= high\n assert.equal(Num.clamp(med, low, high), med);\n assert.equal(Num.clamp(med, low, high), med);\n assert.equal(Num.clamp(high, low, med), med);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/num/NumClampTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57711, "name": "unknown", "code": "it('mirrors bind', () => {\n const arbInner = fc.tuple(fc.boolean(), fc.string()).map(([ isJust, value ]) => {\n if (isJust) {\n return Maybes.just(value);\n } else {\n return Maybes.nothing();\n }\n });\n const arbNested = fc.tuple(fc.boolean(), arbInner).map(([ isJust, value ]) => {\n if (isJust) {\n return Maybes.just(value);\n } else {\n return Maybes.nothing>();\n }\n });\n fc.assert(fc.property(arbNested, (maybe) => {\n const flattened = Maybes.flatten(maybe);\n const bound = Maybes.bind, string>(Fun.identity)(maybe);\n assert.deepEqual(flattened, bound);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/maybe/MonadTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57712, "name": "unknown", "code": "it('allows creating \"Just\" maybes', () => {\n fc.assert(fc.property(fc.anything(), (thing) => {\n const item = Maybes.just(thing);\n assert.isTrue(Maybes.isJust(item));\n assert.isFalse(Maybes.isNothing(item));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/maybe/IdentityTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57713, "name": "unknown", "code": "it('allows folding on \"Just\" maybes', () => {\n // Simple value, complex assertions\n Fun.pipe(\n Maybes.just('test'),\n Maybes.fold(\n Fun.die('Should call other branch'),\n (test) => {\n assert.equal(test, 'test');\n return 'other-test';\n }\n ),\n (result) => assert.equal(result, 'other-test')\n );\n\n // Complex values, simple assertions\n fc.assert(fc.property(fc.anything(), (thing) => {\n Fun.pipe(\n Maybes.just(thing),\n Maybes.fold(Fun.die('Should call other branch'), Fun.noop)\n );\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/maybe/IdentityTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57714, "name": "unknown", "code": "it('gets the value on \"Just\"', () => {\n fc.assert(fc.property(fc.string(), (s) => {\n const val = Fun.pipe(\n Maybes.just(s),\n Maybes.getOrDie\n );\n assert.equal(val, s);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/maybe/GetterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57715, "name": "unknown", "code": "it('never turns Just to Nothing (or vice versa)', () => {\n const mapper = Maybes.map(Fun.identity);\n\n const nothing = mapper(Maybes.nothing());\n assert.isTrue(Maybes.isNothing(nothing));\n\n fc.assert(fc.property(fc.anything(), (thing) => {\n const just = mapper(Maybes.just(thing));\n assert.isTrue(Maybes.isJust(just));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/maybe/FunctorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57716, "name": "unknown", "code": "it('is always false for \"Nothing\"', () => {\n fc.assert(fc.property(fc.anything(), (thing) => {\n const matches = Fun.pipe(\n Maybes.nothing(),\n Maybes.is(thing)\n );\n\n assert.isFalse(matches);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/maybe/ComparatorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57717, "name": "unknown", "code": "it('is always false for \"Nothing\" with explicit comparator', () => {\n fc.assert(fc.property(fc.anything(), (thing) => {\n const matches = Fun.pipe(\n Maybes.nothing(),\n Maybes.is(thing, Fun.die('should not be called'))\n );\n\n assert.isFalse(matches);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/maybe/ComparatorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57718, "name": "unknown", "code": "it('is correct for \"Just\"', () => {\n fc.assert(fc.property(fc.string(), (thing) => {\n const matches = Fun.pipe(\n Maybes.just(thing),\n Maybes.is(thing)\n );\n\n assert.isTrue(matches);\n }));\n\n fc.assert(fc.property(fc.string(), (thing) => {\n const matches = Fun.pipe(\n Maybes.just(thing),\n Maybes.is(thing + 'foo')\n );\n\n assert.isFalse(matches);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/maybe/ComparatorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57719, "name": "unknown", "code": "it('is correct for \"Just\"', () => {\n fc.assert(fc.property(fc.string(), (thing) => {\n const matches = Fun.pipe(\n Maybes.just(thing),\n Maybes.is(thing)\n );\n\n assert.isTrue(matches);\n }));\n\n fc.assert(fc.property(fc.string(), (thing) => {\n const matches = Fun.pipe(\n Maybes.just(thing),\n Maybes.is(thing + 'foo')\n );\n\n assert.isFalse(matches);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/maybe/ComparatorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57720, "name": "unknown", "code": "it('is correct for \"Just\" with an explicit comparator', () => {\n\n // Just an example data type that doesn't have a simple equality\n const thunkEq = (a: () => string, b: () => string): boolean => a() === b();\n\n fc.assert(fc.property(fc.string(), (thing) => {\n const matches = Fun.pipe(\n Maybes.just(Fun.constant(thing)),\n Maybes.is(Fun.constant(thing), thunkEq)\n );\n\n assert.isTrue(matches);\n }));\n\n fc.assert(fc.property(fc.string(), (thing) => {\n const matches = Fun.pipe(\n Maybes.just(Fun.constant(thing)),\n Maybes.is(() => thing + 'foo', thunkEq)\n );\n\n assert.isFalse(matches);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/maybe/ComparatorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57721, "name": "unknown", "code": "it('is correct for \"Just\" with an explicit comparator', () => {\n\n // Just an example data type that doesn't have a simple equality\n const thunkEq = (a: () => string, b: () => string): boolean => a() === b();\n\n fc.assert(fc.property(fc.string(), (thing) => {\n const matches = Fun.pipe(\n Maybes.just(Fun.constant(thing)),\n Maybes.is(Fun.constant(thing), thunkEq)\n );\n\n assert.isTrue(matches);\n }));\n\n fc.assert(fc.property(fc.string(), (thing) => {\n const matches = Fun.pipe(\n Maybes.just(Fun.constant(thing)),\n Maybes.is(() => thing + 'foo', thunkEq)\n );\n\n assert.isFalse(matches);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/maybe/ComparatorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57722, "name": "unknown", "code": "it('is false for one \"Nothing\"', () => {\n fc.assert(fc.property(fc.anything(), (thing) => {\n assert.isFalse(Maybes.equals(Maybes.nothing(), Maybes.just(thing)));\n assert.isFalse(Maybes.equals(Maybes.just(thing), Maybes.nothing()));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/maybe/ComparatorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57723, "name": "unknown", "code": "it('compares normally for two \"Just\"s', () => {\n const different = fc.tuple(fc.anything(), fc.anything()).filter(([ lhs, rhs ]) => lhs !== rhs);\n fc.assert(fc.property(different, ([ lhs, rhs ]) => {\n assert.isFalse(Maybes.equals(Maybes.just(lhs), Maybes.just(rhs)));\n }));\n\n const theSame = fc.string().map((x) => [ x, x ]);\n fc.assert(fc.property(theSame, ([ lhs, rhs ]) => {\n assert.isTrue(Maybes.equals(Maybes.just(lhs), Maybes.just(rhs)));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/maybe/ComparatorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57724, "name": "unknown", "code": "it('compares normally for two \"Just\"s', () => {\n const different = fc.tuple(fc.anything(), fc.anything()).filter(([ lhs, rhs ]) => lhs !== rhs);\n fc.assert(fc.property(different, ([ lhs, rhs ]) => {\n assert.isFalse(Maybes.equals(Maybes.just(lhs), Maybes.just(rhs)));\n }));\n\n const theSame = fc.string().map((x) => [ x, x ]);\n fc.assert(fc.property(theSame, ([ lhs, rhs ]) => {\n assert.isTrue(Maybes.equals(Maybes.just(lhs), Maybes.just(rhs)));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/maybe/ComparatorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57725, "name": "unknown", "code": "it('is false for one \"Nothing\"', () => {\n fc.assert(fc.property(fc.anything(), (thing) => {\n assert.isFalse(Maybes.equals(Maybes.nothing(), Maybes.just(thing), unusedComparator));\n assert.isFalse(Maybes.equals(Maybes.just(thing), Maybes.nothing(), unusedComparator));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/maybe/ComparatorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57726, "name": "unknown", "code": "it('Thunk.cached counter', () => {\n fc.assert(fc.property(fc.json(), fc.func(fc.json()), fc.json(), (a, f, b) => {\n let counter = 0;\n const thunk = Thunk.cached((x) => {\n counter++;\n return {\n counter,\n output: f(x)\n };\n });\n const value = thunk(a);\n const other = thunk(b);\n assert.deepEqual(other, value);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/fun/ThunkTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57727, "name": "unknown", "code": "it('Check compose :: compose(f, g)(x) = f(g(x))', () => {\n fc.assert(fc.property(fc.string(), fc.func(fc.string()), fc.func(fc.string()), (x, f, g) => {\n const h = Fun.compose(f, g);\n assert.deepEqual(h(x), f(g(x)));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57728, "name": "unknown", "code": "it('Check compose1 :: compose1(f, g)(x) = f(g(x))', () => {\n fc.assert(fc.property(fc.string(), fc.func(fc.string()), fc.func(fc.string()), (x, f, g) => {\n const h = Fun.compose1(f, g);\n assert.deepEqual(h(x), f(g(x)));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57729, "name": "unknown", "code": "it('Check constant :: constant(a)() === a', () => {\n fc.assert(fc.property(fc.json(), (json) => {\n assert.deepEqual(Fun.constant(json)(), json);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57730, "name": "unknown", "code": "it('Check identity :: identity(a) === a', () => {\n fc.assert(fc.property(fc.json(), (json) => {\n assert.deepEqual(Fun.identity(json), json);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57731, "name": "unknown", "code": "it('Check always :: f(x) === true', () => {\n fc.assert(fc.property(fc.json(), (json) => {\n assert.isTrue(Fun.always(json));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57732, "name": "unknown", "code": "it('Check never :: f(x) === false', () => {\n fc.assert(fc.property(fc.json(), (json) => {\n assert.isFalse(Fun.never(json));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57733, "name": "unknown", "code": "it('Check curry', () => {\n fc.assert(fc.property(fc.json(), fc.json(), fc.json(), fc.json(), (a, b, c, d) => {\n const f = (a: string, b: string, c: string, d: string) => [ a, b, c, d ];\n\n assert.deepEqual([ a, b, c, d ], Fun.curry(f, a)(b, c, d));\n assert.deepEqual([ a, b, c, d ], Fun.curry(f, a, b)(c, d));\n assert.deepEqual([ a, b, c, d ], Fun.curry(f, a, b, c)(d));\n assert.deepEqual([ a, b, c, d ], Fun.curry(f, a, b, c, d)());\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57734, "name": "unknown", "code": "it('Check not :: not(f(x)) === !f(x)', () => {\n fc.assert(fc.property(fc.json(), fc.func(fc.boolean()), (x, f) => {\n const g = Fun.not(f);\n assert.deepEqual(!g(x), f(x));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57735, "name": "unknown", "code": "it('Check not :: not(not(f(x))) === f(x)', () => {\n fc.assert(fc.property(fc.json(), fc.func(fc.boolean()), (x, f) => {\n const g = Fun.not(Fun.not(f));\n assert.deepEqual(g(x), f(x));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57736, "name": "unknown", "code": "it('Check apply :: apply(constant(a)) === a', () => {\n fc.assert(fc.property(fc.json(), (x) => {\n assert.deepEqual(Fun.apply(Fun.constant(x)), x);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57737, "name": "unknown", "code": "it('Check call :: apply(constant(a)) === undefined', () => {\n fc.assert(fc.property(fc.json(), (x) => {\n let hack: any = null;\n const output = Fun.call(() => {\n hack = x;\n });\n\n assert.isUndefined(output);\n assert.deepEqual(hack, x);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57738, "name": "unknown", "code": "it('Check that values should be empty and errors should be all if we only generate errors', () => {\n fc.assert(fc.property(\n fc.array(arbResultError(fc.integer())),\n (resErrors) => {\n const actual = Results.partition(resErrors);\n if (actual.values.length !== 0) {\n assert.fail('Values length should be 0');\n } else if (resErrors.length !== actual.errors.length) {\n assert.fail('Errors length should be ' + resErrors.length);\n }\n return true;\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57739, "name": "unknown", "code": "it('Check that errors should be empty and values should be all if we only generate values', () => {\n fc.assert(fc.property(\n fc.array(arbResultValue(fc.integer())),\n (resValues) => {\n const actual = Results.partition(resValues);\n if (actual.errors.length !== 0) {\n assert.fail('Errors length should be 0');\n } else if (resValues.length !== actual.values.length) {\n assert.fail('Values length should be ' + resValues.length);\n }\n return true;\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57740, "name": "unknown", "code": "it('Check that the total number of values and errors matches the input size', () => {\n fc.assert(fc.property(\n fc.array(arbResult(fc.integer(), fc.string())),\n (results) => {\n const actual = Results.partition(results);\n assert.equal(actual.errors.length + actual.values.length, results.length);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57741, "name": "unknown", "code": "it('Check that two errors always equal comparison.bothErrors', () => {\n fc.assert(fc.property(\n arbResultError(fc.integer()),\n arbResultError(fc.integer()),\n (r1, r2) => {\n const comparison = Results.compare(r1, r2);\n return comparison.match({\n bothErrors: Fun.always,\n firstError: Fun.never,\n secondError: Fun.never,\n bothValues: Fun.never\n });\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57742, "name": "unknown", "code": "it('Check that error, value always equal comparison.firstError', () => {\n fc.assert(fc.property(\n arbResultError(fc.integer()),\n arbResultValue(fc.string()),\n (r1, r2) => {\n const comparison = Results.compare(r1, r2);\n return comparison.match({\n bothErrors: Fun.never,\n firstError: Fun.always,\n secondError: Fun.never,\n bothValues: Fun.never\n });\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57743, "name": "unknown", "code": "it('Check that value, error always equal comparison.secondError', () => {\n fc.assert(fc.property(\n arbResultValue(fc.integer()),\n arbResultError(fc.string()),\n (r1, r2) => {\n const comparison = Results.compare(r1, r2);\n return comparison.match({\n bothErrors: Fun.never,\n firstError: Fun.never,\n secondError: Fun.always,\n bothValues: Fun.never\n });\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57744, "name": "unknown", "code": "it('Check that value, value always equal comparison.bothValues', () => {\n fc.assert(fc.property(\n arbResultValue(fc.integer()),\n arbResultValue(fc.integer()),\n (r1, r2) => {\n const comparison = Results.compare(r1, r2);\n return comparison.match({\n bothErrors: Fun.never,\n firstError: Fun.never,\n secondError: Fun.never,\n bothValues: Fun.always\n });\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57745, "name": "unknown", "code": "it('Results.unite', () => {\n fc.assert(fc.property(fc.integer(), (a) => {\n assert.equal(Results.unite(Result.error(a)), a);\n assert.equal(Results.unite(Result.value(a)), a);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57746, "name": "unknown", "code": "it('Checking value.is(value.getOrDie()) === true', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), (res) => {\n assert.isTrue(Results.is(res, res.getOrDie()));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57747, "name": "unknown", "code": "it('Checking value.isValue === true', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), (res) => {\n assert.isTrue(res.isValue());\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57748, "name": "unknown", "code": "it('Checking value.isError === false', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), (res) => {\n assert.isFalse(res.isError());\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57749, "name": "unknown", "code": "it('Checking value.getOr(v) === value.value', () => {\n fc.assert(fc.property(fc.integer(), (a) => {\n assert.equal(Result.value(a).getOr(a), a);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57750, "name": "unknown", "code": "it('Checking value.getOrDie() does not throw', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), (res) => {\n res.getOrDie();\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57751, "name": "unknown", "code": "it('Checking value.or(oValue) === value', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), (a, b) => {\n assertResult(Result.value(a).or(Result.value(b)), Result.value(a));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57752, "name": "unknown", "code": "it('Checking error.or(value) === value', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), (a, b) => {\n assertResult(Result.error(a).or(Result.value(b)), Result.value(b));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57753, "name": "unknown", "code": "it('Checking value.orThunk(die) does not throw', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), (res) => {\n res.orThunk(Fun.die('dies'));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57754, "name": "unknown", "code": "it('Checking value.fold(die, id) === value.getOrDie()', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), (res) => {\n const actual = res.getOrDie();\n assert.equal(res.fold(Fun.die('should not get here'), Fun.identity), actual);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57755, "name": "unknown", "code": "it('Checking value.map(f) === f(value.getOrDie())', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), fc.func(fc.json()), (res, f) => {\n assert.equal(f(res.getOrDie()), res.map(f).getOrDie());\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57756, "name": "unknown", "code": "it('Checking value.each(f) === undefined', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), fc.func(fc.json()), (res, f) => {\n const actual = res.each(f);\n assert.isUndefined(actual);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57757, "name": "unknown", "code": "it('Given f :: s -> RV, checking value.bind(f).getOrDie() === f(value.getOrDie()).getOrDie()', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), fc.func(arbResultValue(fc.integer())), (res, f) => {\n assert.equal(f(res.getOrDie()).getOrDie(), res.bind(f).getOrDie());\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57758, "name": "unknown", "code": "it('Given f :: s -> RE, checking value.bind(f).fold(id, die) === f(value.getOrDie()).fold(id, die)', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), fc.func(arbResultError(fc.integer())), (res, f) => {\n const toErrString = (r: Result) => r.fold(Fun.identity, Fun.die('Not a Result.error'));\n assert.equal(toErrString(f(res.getOrDie())), toErrString(res.bind(f)));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57759, "name": "unknown", "code": "it('Checking value.forall is true iff. f(value.getOrDie() === true)', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), fc.func(fc.boolean()), (res, f) => {\n assert.equal(res.forall(f), f(res.getOrDie()));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57760, "name": "unknown", "code": "it('Checking value.exists is true iff. f(value.getOrDie() === true)', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), fc.func(fc.boolean()), (res, f) => {\n assert.equal(res.exists(f), f(res.getOrDie()));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57761, "name": "unknown", "code": "it('Checking value.toOptional is always Optional.some(value.getOrDie())', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), (res) => {\n assert.equal(res.toOptional().getOrDie(), res.getOrDie());\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57762, "name": "unknown", "code": "it('error.is === false', () => {\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n assert.isFalse(Results.is(Result.error(s), i));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57763, "name": "unknown", "code": "it('error.isValue === false', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), (res) => {\n assert.isFalse(res.isValue());\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57764, "name": "unknown", "code": "it('error.isError === true', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), (res) => {\n assert.isTrue(res.isError());\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57765, "name": "unknown", "code": "it('error.getOr(v) === v', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), fc.json(), (res, json) => {\n assert.deepEqual(res.getOr(json), json);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57766, "name": "unknown", "code": "it('error.getOrDie() always throws', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), (res) => {\n assert.throws(() => {\n res.getOrDie();\n });\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57767, "name": "unknown", "code": "it('error.or(oValue) === oValue', () => {\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n assertResult(Result.error(s).or(Result.value(i)), Result.value(i));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57768, "name": "unknown", "code": "it('error.orThunk(_ -> v) === v', () => {\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n assertResult(Result.error(s).orThunk(() => Result.value(i)), Result.value(i));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57769, "name": "unknown", "code": "it('error.fold(_ -> x, die) === x', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), fc.json(), (res, json) => {\n const actual = res.fold(Fun.constant(json), Fun.die('Should not die'));\n assert.deepEqual(actual, json);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57770, "name": "unknown", "code": "it('error.map returns an error', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n assertResult(Result.error(i).map(Fun.die('should not be called')), Result.error(i));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57771, "name": "unknown", "code": "it('error.mapError(f) === f(error)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n const f = (x: number) => x % 3;\n assertResult(Result.error(i).mapError(f), Result.error(f(i)));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57772, "name": "unknown", "code": "it('error.each returns undefined', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), (res) => {\n const actual = res.each(Fun.die('should not be called'));\n assert.isUndefined(actual);\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57773, "name": "unknown", "code": "it('Given f :: s -> RV, error.bind(f) === error', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), fc.func(arbResultValue(fc.integer())), (res, f) => {\n const actual = res.bind(f);\n assert.deepEqual(getErrorOrDie(actual), getErrorOrDie(res));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57774, "name": "unknown", "code": "it('Given f :: s -> RE, error.bind(f) === error', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), fc.func(arbResultError(fc.integer())), (res, f) => {\n const actual = res.bind(f);\n assert.deepEqual(getErrorOrDie(actual), getErrorOrDie(res));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57775, "name": "unknown", "code": "it('error.forall === true', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), fc.func(fc.boolean()), (res, f) => {\n assert.isTrue(res.forall(f));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57776, "name": "unknown", "code": "it('error.exists === false', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n assert.isFalse(Result.error(i).exists(Fun.die('should not be called')));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57777, "name": "unknown", "code": "it('error.toOptional is always none', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), (res) => {\n assertNone(res.toOptional());\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57778, "name": "unknown", "code": "it('should not generate identical IDs', () => {\n const arbId = fc.string(1, 30).map(Id.generate);\n fc.assert(fc.property(arbId, arbId, (id1, id2) => id1 !== id2));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/data/IdTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57779, "name": "unknown", "code": "it('pure', () =>\n fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n LazyValue.pure(i).get((v) => {\n eqAsync('LazyValue.pure', i, v, reject);\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/async/LazyValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57780, "name": "unknown", "code": "it('pure, map', () =>\n fc.assert(fc.asyncProperty(fc.integer(), fc.func(fc.string()), (i, f) => new Promise((resolve, reject) => {\n LazyValue.pure(i).map(f).get((v) => {\n eqAsync('LazyValue.map', f(i), v, reject);\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/async/LazyValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57781, "name": "unknown", "code": "it('delayed, map', () =>\n fc.assert(fc.asyncProperty(fc.integer(), fc.func(fc.string()), (i, f) => new Promise((resolve, reject) => {\n LazyValue.nu((c) => {\n setTimeout(() => {\n c(i);\n }, 2);\n }).map(f).get((v) => {\n eqAsync('LazyValue.map', f(i), v, reject);\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/async/LazyValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57782, "name": "unknown", "code": "it('parallel spec', () => fc.assert(fc.asyncProperty(fc.array(fc.integer(), 0, 20), (vals) => new Promise((resolve, reject) => {\n const lazyVals = Arr.map(vals, LazyValue.pure);\n LazyValues.par(lazyVals).get((actual) => {\n eqAsync('pars', vals, actual, reject);\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/async/LazyValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57783, "name": "unknown", "code": "it('nu', () => fc.assert(fc.asyncProperty(arbResult(fc.integer(), fc.integer()), (r) => new Promise((resolve, reject) => {\n FutureResult.nu((completer) => {\n completer(r);\n }).get((ii) => {\n eqAsync('eq', r, ii, reject, tResult());\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57784, "name": "unknown", "code": "it('fromFuture', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.fromFuture(Future.pure(i)).get((ii) => {\n eqAsync('eq', Result.value(i), ii, reject, tResult());\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57785, "name": "unknown", "code": "it('wrap get', () => fc.assert(fc.asyncProperty(arbResult(fc.integer(), fc.integer()), (r) => new Promise((resolve, reject) => {\n FutureResult.wrap(Future.pure(r)).get((ii) => {\n eqAsync('eq', r, ii, reject, tResult());\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57786, "name": "unknown", "code": "it('fromResult get', () => fc.assert(fc.asyncProperty(arbResult(fc.integer(), fc.integer()), (r) => new Promise((resolve, reject) => {\n FutureResult.fromResult(r).get((ii) => {\n eqAsync('eq', r, ii, reject, tResult());\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57787, "name": "unknown", "code": "it('pure get', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.pure(i).get((ii) => {\n eqAsync('eq', Result.value(i), ii, reject, tResult());\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57788, "name": "unknown", "code": "it('value get', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.value(i).get((ii) => {\n eqAsync('eq', Result.value(i), ii, reject, tResult());\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57789, "name": "unknown", "code": "it('error get', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.error(i).get((ii) => {\n eqAsync('eq', Result.error(i), ii, reject, tResult());\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57790, "name": "unknown", "code": "it('value mapResult', () => {\n const f = (x: number) => x + 3;\n return fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.value(i).mapResult(f).get((ii) => {\n eqAsync('eq', Result.value(f(i)), ii, reject, tResult());\n resolve();\n });\n })));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57791, "name": "unknown", "code": "it('error mapResult', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.error(i).mapResult(Fun.die('should not be called')).get((ii) => {\n eqAsync('eq', Result.error(i), ii, reject, tResult());\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57792, "name": "unknown", "code": "it('value mapError', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.value(i).mapError(Fun.die('should not be called')).get((ii) => {\n eqAsync('eq', Result.value(i), ii, reject, tResult());\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57793, "name": "unknown", "code": "it('err mapError', () => {\n const f = (x: number) => x + 3;\n return fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.error(i).mapError(f).get((ii) => {\n eqAsync('eq', Result.error(f(i)), ii, reject, tResult());\n resolve();\n });\n })));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57794, "name": "unknown", "code": "it('value bindFuture value', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n const f = (x: number) => x % 4;\n FutureResult.value(i).bindFuture((x) => FutureResult.value(f(x))).get((actual) => {\n eqAsync('bind result', Result.value(f(i)), actual, reject, tResult(tNumber));\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57795, "name": "unknown", "code": "it('bindFuture: value bindFuture error', () => fc.assert(fc.asyncProperty(fc.integer(), fc.string(), (i, s) => new Promise((resolve, reject) => {\n FutureResult.value(i).bindFuture(() => FutureResult.error(s)).get((actual) => {\n eqAsync('bind result', Result.error(s), actual, reject, tResult(tNumber));\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57796, "name": "unknown", "code": "it('error bindFuture', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.error(i).bindFuture(Fun.die('should not be called')).get((actual) => {\n eqAsync('bind result', Result.error(i), actual, reject, tResult(tNumber));\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57797, "name": "unknown", "code": "it('pure get', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) =>\n Future.pure(i).get((ii) => {\n eqAsync('pure get', i, ii, reject, tNumber);\n resolve();\n })))))", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/async/FutureTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57798, "name": "unknown", "code": "it('future soon get', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) =>\n Future.nu((cb) => setTimeout(() => cb(i), 3)).get((ii) => {\n eqAsync('get', i, ii, reject, tNumber);\n resolve();\n })))))", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/async/FutureTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57799, "name": "unknown", "code": "it('map', () => fc.assert(fc.asyncProperty(fc.integer(), fc.func(fc.string()), (i, f) => new Promise((resolve, reject) =>\n Future.pure(i).map(f).get((ii) => {\n eqAsync('get', f(i), ii, reject, tString);\n resolve();\n })))))", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/async/FutureTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57800, "name": "unknown", "code": "it('bind', () => fc.assert(fc.asyncProperty(fc.integer(), fc.func(fc.string()), (i, f) => new Promise((resolve, reject) =>\n Future.pure(i).bind(Fun.compose(Future.pure, f)).get((ii) => {\n eqAsync('get', f(i), ii, reject, tString);\n resolve();\n })))))", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/async/FutureTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57801, "name": "unknown", "code": "it('anonBind', () => fc.assert(fc.asyncProperty(fc.integer(), fc.string(), (i, s) => new Promise((resolve, reject) =>\n Future.pure(i).anonBind(Future.pure(s)).get((ii) => {\n eqAsync('get', s, ii, reject, tString);\n resolve();\n })))))", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/async/FutureTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57802, "name": "unknown", "code": "it('parallel spec', () => fc.assert(fc.asyncProperty(fc.array(fc.tuple(fc.integer(1, 10), fc.integer())), (tuples) => new Promise((resolve, reject) =>\n Futures.par(Arr.map(tuples, ([ timeout, value ]) => Future.nu((cb) => setTimeout(() => cb(value), timeout)))).get((ii) => {\n eqAsync('pars', tuples.map(([ _, i ]) => i), ii, reject, tArray(tNumber));\n resolve();\n }))))\n )", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/async/FutureTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57803, "name": "unknown", "code": "it('mapM spec', () =>\n fc.assert(fc.asyncProperty(fc.array(fc.tuple(fc.integer(1, 10), fc.integer())), (tuples) => new Promise((resolve, reject) =>\n Futures.mapM(tuples, ([ timeout, value ]) => Future.nu((cb) => setTimeout(() => cb(value), timeout))).get((ii) => {\n eqAsync('pars', tuples.map(([ _, i ]) => i), ii, reject, tArray(tNumber));\n resolve();\n }))))\n )", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/async/FutureTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57804, "name": "unknown", "code": "it('TINY-9226: basic property - no outside constraints', () => {\n fc.assert(\n fc.property(arbBounds, arbBounds, (original, constraint) => {\n const actual = Boxes.constrain(original, constraint);\n assert.isAtLeast(actual.x, constraint.x);\n assert.isAtMost(actual.right, constraint.right);\n assert.isAtLeast(actual.y, constraint.y);\n assert.isAtMost(actual.bottom, constraint.bottom);\n })\n );\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/alloy/src/test/ts/atomic/alien/BoxesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57805, "name": "unknown", "code": "it('TINY-9226: no constrants', () => {\n fc.assert(\n fc.property(arbBounds, (original) => {\n const actual = Boxes.constrainByMany(original, [ ]);\n assert.deepEqual(actual, original);\n })\n );\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/alloy/src/test/ts/atomic/alien/BoxesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57806, "name": "unknown", "code": "it('TINY-9226: basic property', () => {\n fc.assert(\n fc.property(arbBounds, arbBounds, fc.array(arbBounds), (original, first, rest) => {\n const constraints = [ first ].concat(rest);\n const all = [ original ].concat(constraints);\n const actual = Boxes.constrainByMany(original, constraints);\n const optLargestLeft = Arr.last(sortNumbers(Arr.map(all, (c) => c.x)));\n const optLargestTop = Arr.last(sortNumbers(Arr.map(all, (c) => c.y)));\n const optSmallestRight = Arr.head(sortNumbers(Arr.map(all, (c) => c.right)));\n const optSmallestBottom = Arr.head(sortNumbers(Arr.map(all, (c) => c.bottom)));\n\n const assertOpt = (label: string, optValue: Optional, actualValue: number): void => {\n optValue.fold(\n () => assert.fail('There were no candidates. Actual value: ' + actualValue),\n (v) => assert.equal(\n actualValue,\n v,\n `Property ${label}. Expected: ${v}, Actual: ${actualValue}, \\n\n All: ${JSON.stringify(all, null, 2)}`\n )\n );\n };\n\n assertOpt('left', optLargestLeft, actual.x);\n assertOpt('right', optSmallestRight, actual.right);\n assertOpt('top', optLargestTop, actual.y);\n assertOpt('bottom', optSmallestBottom, actual.bottom);\n })\n );\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/alloy/src/test/ts/atomic/alien/BoxesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57811, "name": "unknown", "code": "describe('transaction executors', () => {\n it('queries with `splits: inline` returns only non-parents', async () => {\n await fc.assert(\n fc.asyncProperty(\n arbs.makeTransactionArray({\n splitFreq: 2,\n minLength: 2,\n maxLength: 20,\n }),\n async arr => {\n await insertTransactions(arr);\n\n const { data } = await runQuery(\n q('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .options({ splits: 'inline' })\n .serialize(),\n );\n\n expect(data.filter(t => t.is_parent).length).toBe(0);\n expect(data.filter(t => t.tombstone).length).toBe(0);\n\n const { data: defaultData } = await runQuery(\n q('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .serialize(),\n );\n\n // inline should be the default\n expect(defaultData).toEqual(data);\n },\n ),\n { numRuns: 50 },\n );\n });\n\n it('queries with `splits: none` returns only parents', async () => {\n await fc.assert(\n fc.asyncProperty(\n arbs.makeTransactionArray({\n splitFreq: 2,\n minLength: 2,\n maxLength: 8,\n }),\n async arr => {\n await insertTransactions(arr);\n\n const { data } = await runQuery(\n q('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .options({ splits: 'none' })\n .serialize(),\n );\n\n expect(data.filter(t => t.is_child).length).toBe(0);\n },\n ),\n { numRuns: 50 },\n );\n });\n\n it('aggregate queries work with `splits: grouped`', async () => {\n const payeeIds = ['payee1', 'payee2', 'payee3', 'payee4', 'payee5'];\n\n await fc.assert(\n fc\n .asyncProperty(\n arbs.makeTransactionArray({ splitFreq: 2, payeeIds, maxLength: 100 }),\n async arr => {\n await insertTransactions(arr, payeeIds);\n\n const aggQuery = q('transactions')\n .filter({\n $or: [{ amount: { $lt: -5 } }, { amount: { $gt: -2 } }],\n 'payee.name': { $gt: '' },\n })\n .options({ splits: 'grouped' })\n .calculate({ $sum: '$amount' });\n\n const { data } = await runQuery(aggQuery.serialize());\n\n const sum = aliveTransactions(arr).reduce((sum, trans) => {\n const amount = trans.amount || 0;\n const matched =\n (amount < -5 || amount > -2) && trans.payee != null;\n if (!trans.tombstone && !trans.is_parent && matched) {\n return sum + amount;\n }\n return sum;\n }, 0);\n\n expect(data).toBe(sum);\n },\n )\n .beforeEach(() => {\n setClock(null);\n setSyncingMode('import');\n return db.execQuery(`\n DELETE FROM transactions;\n DELETE FROM payees;\n DELETE FROM payee_mapping;\n `);\n }),\n );\n });\n\n function runTest(makeQuery) {\n const payeeIds = ['payee1', 'payee2', 'payee3', 'payee4', 'payee5'];\n\n async function check(arr) {\n const orderFields = ['payee.name', 'amount', 'id'];\n\n // Insert transactions and get a list of all the alive\n // ones to make it easier to check the data later (don't\n // have to always be filtering out dead ones)\n await insertTransactions(arr, payeeIds);\n const allTransactions = aliveTransactions(arr);\n\n // Query time\n const { query, expectedIds, expectedMatchedIds } = makeQuery(arr);\n\n // First to a query without order to make sure the default\n // order works\n const { data: defaultOrderData } = await runQuery(query.serialize());\n expectTransactionOrder(defaultOrderData);\n expect(new Set(defaultOrderData.map(t => t.id))).toEqual(expectedIds);\n\n // Now do the full test, and add a custom order to make\n // sure that doesn't effect anything\n const orderedQuery = query.orderBy(orderFields);\n const { data } = await runQuery(orderedQuery.serialize());\n expect(new Set(data.map(t => t.id))).toEqual(expectedIds);\n\n // Validate paging and ordering\n await expectPagedData(orderedQuery, arr.length, data);\n expectTransactionOrder(data, orderFields);\n\n const matchedIds = new Set();\n\n // Check that all the subtransactions were returned\n for (const trans of data) {\n expect(trans.tombstone).toBe(false);\n\n if (expectedMatchedIds) {\n if (!trans._unmatched) {\n expect(expectedMatchedIds.has(trans.id)).toBe(true);\n matchedIds.add(trans.id);\n } else {\n expect(expectedMatchedIds.has(trans.id)).not.toBe(true);\n }\n }\n\n if (trans.is_parent) {\n // Parent transactions should never have a category\n expect(trans.category).toBe(null);\n\n expect(trans.subtransactions.length).toBe(\n allTransactions.filter(t => t.parent_id === trans.id).length,\n );\n\n // Subtransactions should be ordered as well\n expectTransactionOrder(trans.subtransactions, orderFields);\n\n trans.subtransactions.forEach(subtrans => {\n expect(subtrans.tombstone).toBe(false);\n\n if (expectedMatchedIds) {\n if (!subtrans._unmatched) {\n expect(expectedMatchedIds.has(subtrans.id)).toBe(true);\n matchedIds.add(subtrans.id);\n } else {\n expect(expectedMatchedIds.has(subtrans.id)).not.toBe(true);\n }\n }\n });\n }\n }\n\n if (expectedMatchedIds) {\n // Check that transactions that should be matched are\n // marked as such\n expect(matchedIds).toEqual(expectedMatchedIds);\n }\n }\n\n return fc.assert(\n fc\n .asyncProperty(\n arbs.makeTransactionArray({\n splitFreq: 0.1,\n payeeIds,\n maxLength: 100,\n }),\n check,\n )\n .beforeEach(() => {\n setClock(null);\n setSyncingMode('import');\n return db.execQuery(`\n DELETE FROM transactions;\n DELETE FROM payees;\n DELETE FROM payee_mapping;\n `);\n }),\n { numRuns: 300 },\n );\n }\n\n it('queries the correct transactions without filters', async () => {\n return runTest(arr => {\n const expectedIds = new Set(\n arr.filter(t => !t.tombstone && !t.is_child).map(t => t.id),\n );\n\n // Even though we're applying some filters, these are always\n // guaranteed to return the full split transaction so they\n // should take the optimized path\n const happyQuery = q('transactions')\n .filter({\n date: { $gt: '2017-01-01' },\n })\n .options({ splits: 'grouped' })\n .select(['*', 'payee.name']);\n\n // Make sure it's actually taking the happy path\n expect(isHappyPathQuery(happyQuery.serialize())).toBe(true);\n\n return {\n expectedIds,\n query: happyQuery,\n };\n });\n });\n\n it(`queries the correct transactions with a filter`, async () => {\n return runTest(arr => {\n const expectedIds = new Set();\n\n // let parents = toGroup(\n // arr.filter(t => t.is_parent),\n // new Map(Object.entries(groupById(arr.filter(t => t.parent_id))))\n // );\n\n const parents = groupById(arr.filter(t => t.is_parent && !t.tombstone));\n const matched = new Set();\n\n // Pick out some ids to query\n let ids = arr.reduce((ids, trans, idx) => {\n if (idx % 2 === 0) {\n const amount = trans.amount == null ? 0 : trans.amount;\n const matches = (amount < -2 || amount > -1) && trans.payee > '';\n\n if (matches && isAlive(trans, parents)) {\n expectedIds.add(trans.parent_id || trans.id);\n matched.add(trans.id);\n }\n\n ids.push(trans.id);\n }\n\n return ids;\n }, []);\n\n // Because why not? It should deduplicate them\n ids = repeat(ids, 100);\n\n const unhappyQuery = q('transactions')\n .filter({\n id: [{ $oneof: ids }],\n payee: { $gt: '' },\n $or: [{ amount: { $lt: -2 } }, { amount: { $gt: -1 } }],\n })\n .options({ splits: 'grouped' })\n .select(['*', 'payee.name'])\n // Using this because we want `payee` to have ids for the above\n // filter regardless if it points to a dead one or not\n .withoutValidatedRefs();\n\n expect(isHappyPathQuery(unhappyQuery.serialize())).toBe(false);\n\n return {\n expectedIds,\n expectedMatchedIds: matched,\n query: unhappyQuery,\n };\n });\n });\n})", "language": "typescript", "source_file": "./repos/my2/actual/packages/loot-core/src/server/aql/schema/executors.test.ts", "start_line": null, "end_line": null, "dependencies": ["insertTransactions", "aliveTransactions", "expectTransactionOrder", "expectPagedData", "isAlive", "repeat"], "repo": {"name": "my2/actual", "url": "https://github.com/my2/actual.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test suite validates that transaction queries handle different `splits` options correctly by checking:\n\n- Queries with `splits: inline` return only non-parent, non-tombstone transactions.\n- Queries with `splits: none` return only parent transactions.\n- Aggregate queries with `splits: grouped` calculate the correct sum of amounts for specific conditions.\n- A separate `runTest` function confirms transaction queries return the expected results with and without filters, ensuring ordered and paged data retrieval aligns with expectations.", "mode": "fast-check"} {"id": 57821, "name": "unknown", "code": "describe('transaction executors', () => {\n it('queries with `splits: inline` returns only non-parents', async () => {\n await fc.assert(\n fc.asyncProperty(\n arbs.makeTransactionArray({\n splitFreq: 2,\n minLength: 2,\n maxLength: 20,\n }),\n async arr => {\n await insertTransactions(arr);\n\n const { data } = await runQuery(\n q('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .options({ splits: 'inline' })\n .serialize(),\n );\n\n expect(data.filter(t => t.is_parent).length).toBe(0);\n expect(data.filter(t => t.tombstone).length).toBe(0);\n\n const { data: defaultData } = await runQuery(\n q('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .serialize(),\n );\n\n // inline should be the default\n expect(defaultData).toEqual(data);\n },\n ),\n { numRuns: 50 },\n );\n });\n\n it('queries with `splits: none` returns only parents', async () => {\n await fc.assert(\n fc.asyncProperty(\n arbs.makeTransactionArray({\n splitFreq: 2,\n minLength: 2,\n maxLength: 8,\n }),\n async arr => {\n await insertTransactions(arr);\n\n const { data } = await runQuery(\n q('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .options({ splits: 'none' })\n .serialize(),\n );\n\n expect(data.filter(t => t.is_child).length).toBe(0);\n },\n ),\n { numRuns: 50 },\n );\n });\n\n it('aggregate queries work with `splits: grouped`', async () => {\n const payeeIds = ['payee1', 'payee2', 'payee3', 'payee4', 'payee5'];\n\n await fc.assert(\n fc\n .asyncProperty(\n arbs.makeTransactionArray({ splitFreq: 2, payeeIds, maxLength: 100 }),\n async arr => {\n await insertTransactions(arr, payeeIds);\n\n const aggQuery = q('transactions')\n .filter({\n $or: [{ amount: { $lt: -5 } }, { amount: { $gt: -2 } }],\n 'payee.name': { $gt: '' },\n })\n .options({ splits: 'grouped' })\n .calculate({ $sum: '$amount' });\n\n const { data } = await runQuery(aggQuery.serialize());\n\n const sum = aliveTransactions(arr).reduce((sum, trans) => {\n const amount = trans.amount || 0;\n const matched =\n (amount < -5 || amount > -2) && trans.payee != null;\n if (!trans.tombstone && !trans.is_parent && matched) {\n return sum + amount;\n }\n return sum;\n }, 0);\n\n expect(data).toBe(sum);\n },\n )\n .beforeEach(() => {\n setClock(null);\n setSyncingMode('import');\n return db.execQuery(`\n DELETE FROM transactions;\n DELETE FROM payees;\n DELETE FROM payee_mapping;\n `);\n }),\n );\n });\n\n function runTest(makeQuery) {\n const payeeIds = ['payee1', 'payee2', 'payee3', 'payee4', 'payee5'];\n\n async function check(arr) {\n const orderFields = ['payee.name', 'amount', 'id'];\n\n // Insert transactions and get a list of all the alive\n // ones to make it easier to check the data later (don't\n // have to always be filtering out dead ones)\n await insertTransactions(arr, payeeIds);\n const allTransactions = aliveTransactions(arr);\n\n // Query time\n const { query, expectedIds, expectedMatchedIds } = makeQuery(arr);\n\n // First to a query without order to make sure the default\n // order works\n const { data: defaultOrderData } = await runQuery(query.serialize());\n expectTransactionOrder(defaultOrderData);\n expect(new Set(defaultOrderData.map(t => t.id))).toEqual(expectedIds);\n\n // Now do the full test, and add a custom order to make\n // sure that doesn't effect anything\n const orderedQuery = query.orderBy(orderFields);\n const { data } = await runQuery(orderedQuery.serialize());\n expect(new Set(data.map(t => t.id))).toEqual(expectedIds);\n\n // Validate paging and ordering\n await expectPagedData(orderedQuery, arr.length, data);\n expectTransactionOrder(data, orderFields);\n\n const matchedIds = new Set();\n\n // Check that all the subtransactions were returned\n for (const trans of data) {\n expect(trans.tombstone).toBe(false);\n\n if (expectedMatchedIds) {\n if (!trans._unmatched) {\n expect(expectedMatchedIds.has(trans.id)).toBe(true);\n matchedIds.add(trans.id);\n } else {\n expect(expectedMatchedIds.has(trans.id)).not.toBe(true);\n }\n }\n\n if (trans.is_parent) {\n // Parent transactions should never have a category\n expect(trans.category).toBe(null);\n\n expect(trans.subtransactions.length).toBe(\n allTransactions.filter(t => t.parent_id === trans.id).length,\n );\n\n // Subtransactions should be ordered as well\n expectTransactionOrder(trans.subtransactions, orderFields);\n\n trans.subtransactions.forEach(subtrans => {\n expect(subtrans.tombstone).toBe(false);\n\n if (expectedMatchedIds) {\n if (!subtrans._unmatched) {\n expect(expectedMatchedIds.has(subtrans.id)).toBe(true);\n matchedIds.add(subtrans.id);\n } else {\n expect(expectedMatchedIds.has(subtrans.id)).not.toBe(true);\n }\n }\n });\n }\n }\n\n if (expectedMatchedIds) {\n // Check that transactions that should be matched are\n // marked as such\n expect(matchedIds).toEqual(expectedMatchedIds);\n }\n }\n\n return fc.assert(\n fc\n .asyncProperty(\n arbs.makeTransactionArray({\n splitFreq: 0.1,\n payeeIds,\n maxLength: 100,\n }),\n check,\n )\n .beforeEach(() => {\n setClock(null);\n setSyncingMode('import');\n return db.execQuery(`\n DELETE FROM transactions;\n DELETE FROM payees;\n DELETE FROM payee_mapping;\n `);\n }),\n { numRuns: 300 },\n );\n }\n\n it('queries the correct transactions without filters', async () => {\n return runTest(arr => {\n const expectedIds = new Set(\n arr.filter(t => !t.tombstone && !t.is_child).map(t => t.id),\n );\n\n // Even though we're applying some filters, these are always\n // guaranteed to return the full split transaction so they\n // should take the optimized path\n const happyQuery = q('transactions')\n .filter({\n date: { $gt: '2017-01-01' },\n })\n .options({ splits: 'grouped' })\n .select(['*', 'payee.name']);\n\n // Make sure it's actually taking the happy path\n expect(isHappyPathQuery(happyQuery.serialize())).toBe(true);\n\n return {\n expectedIds,\n query: happyQuery,\n };\n });\n });\n\n it(`queries the correct transactions with a filter`, async () => {\n return runTest(arr => {\n const expectedIds = new Set();\n\n // let parents = toGroup(\n // arr.filter(t => t.is_parent),\n // new Map(Object.entries(groupById(arr.filter(t => t.parent_id))))\n // );\n\n const parents = groupById(arr.filter(t => t.is_parent && !t.tombstone));\n const matched = new Set();\n\n // Pick out some ids to query\n let ids = arr.reduce((ids, trans, idx) => {\n if (idx % 2 === 0) {\n const amount = trans.amount == null ? 0 : trans.amount;\n const matches = (amount < -2 || amount > -1) && trans.payee > '';\n\n if (matches && isAlive(trans, parents)) {\n expectedIds.add(trans.parent_id || trans.id);\n matched.add(trans.id);\n }\n\n ids.push(trans.id);\n }\n\n return ids;\n }, []);\n\n // Because why not? It should deduplicate them\n ids = repeat(ids, 100);\n\n const unhappyQuery = q('transactions')\n .filter({\n id: [{ $oneof: ids }],\n payee: { $gt: '' },\n $or: [{ amount: { $lt: -2 } }, { amount: { $gt: -1 } }],\n })\n .options({ splits: 'grouped' })\n .select(['*', 'payee.name'])\n // Using this because we want `payee` to have ids for the above\n // filter regardless if it points to a dead one or not\n .withoutValidatedRefs();\n\n expect(isHappyPathQuery(unhappyQuery.serialize())).toBe(false);\n\n return {\n expectedIds,\n expectedMatchedIds: matched,\n query: unhappyQuery,\n };\n });\n });\n})", "language": "typescript", "source_file": "./repos/dchaves93/richfamily/packages/loot-core/src/server/aql/schema/executors.test.ts", "start_line": null, "end_line": null, "dependencies": ["insertTransactions", "aliveTransactions", "expectTransactionOrder", "expectPagedData", "isAlive", "repeat"], "repo": {"name": "dchaves93/richfamily", "url": "https://github.com/dchaves93/richfamily.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "When the query is executed with `splits: inline`, it returns only non-parent transactions that are not marked as tombstones, ensuring consistency with default query results. Using `splits: none` ensures that only parent transactions are returned. Aggregate queries with `splits: grouped` accurately calculate sums of non-parent, non-tombstone transactions matching specific criteria. Transaction queries without filters ensure all non-tombstone, non-child transactions are fetched correctly. When applying filters, transactions are correctly identified, deduplicated, and returned according to specific conditions.", "mode": "fast-check"} {"id": 57828, "name": "unknown", "code": "test('normalizeUndefined', () => {\n fc.assert(\n fc.property(fc.constantFrom(null, undefined), v => {\n expect(normalizeUndefined(v)).toBe(null);\n }),\n );\n fc.assert(\n fc.property(fc.oneof(fc.boolean(), fc.double(), fc.string()), b => {\n expect(normalizeUndefined(b)).toBe(b);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/johnnyhuynh-sportsbet/mono/packages/zql/src/ivm/data.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "johnnyhuynh-sportsbet/mono", "url": "https://github.com/johnnyhuynh-sportsbet/mono.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57829, "name": "unknown", "code": "test('normalizeUndefined', () => {\n fc.assert(\n fc.property(fc.constantFrom(null, undefined), v => {\n expect(normalizeUndefined(v)).toBe(null);\n }),\n );\n fc.assert(\n fc.property(fc.oneof(fc.boolean(), fc.double(), fc.string()), b => {\n expect(normalizeUndefined(b)).toBe(b);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/johnnyhuynh-sportsbet/mono/packages/zql/src/ivm/data.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "johnnyhuynh-sportsbet/mono", "url": "https://github.com/johnnyhuynh-sportsbet/mono.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57830, "name": "unknown", "code": "test('compareValues', () => {\n // null and undefined are equal to each other\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.constantFrom(null, undefined),\n (v1, v2) => {\n expect(compareValues(v1, v2)).toBe(0);\n },\n ),\n );\n\n // null and undefined are less than any other value\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.oneof(fc.boolean(), fc.double(), fc.fullUnicodeString()),\n (v1, v2) => {\n expect(compareValues(v1, v2)).lessThan(0);\n expect(compareValues(v2, v1)).greaterThan(0);\n },\n ),\n );\n\n // boolean\n fc.assert(\n fc.property(fc.boolean(), fc.boolean(), (b1, b2) => {\n expect(compareValues(b1, b2)).toBe(b1 === b2 ? 0 : b1 ? 1 : -1);\n }),\n );\n fc.assert(\n fc.property(\n fc.boolean(),\n fc.oneof(fc.double(), fc.fullUnicodeString()),\n (b, v) => {\n expect(() => compareValues(b, v)).toThrow('expected boolean');\n },\n ),\n );\n\n // number\n fc.assert(\n fc.property(fc.double(), fc.double(), (n1, n2) => {\n expect(compareValues(n1, n2)).toBe(n1 - n2);\n }),\n );\n fc.assert(\n fc.property(\n fc.double(),\n fc.oneof(fc.boolean(), fc.fullUnicodeString()),\n (n, v) => {\n expect(() => compareValues(n, v)).toThrow('expected number');\n },\n ),\n );\n\n // string\n fc.assert(\n fc.property(fc.fullUnicodeString(), fc.fullUnicodeString(), (s1, s2) => {\n expect(compareValues(s1, s2)).toBe(compareUTF8(s1, s2));\n }),\n );\n fc.assert(\n fc.property(\n fc.fullUnicodeString(),\n fc.oneof(fc.boolean(), fc.double()),\n (s, v) => {\n expect(() => compareValues(s, v)).toThrow('expected string');\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/johnnyhuynh-sportsbet/mono/packages/zql/src/ivm/data.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "johnnyhuynh-sportsbet/mono", "url": "https://github.com/johnnyhuynh-sportsbet/mono.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57831, "name": "unknown", "code": "test('compareValues', () => {\n // null and undefined are equal to each other\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.constantFrom(null, undefined),\n (v1, v2) => {\n expect(compareValues(v1, v2)).toBe(0);\n },\n ),\n );\n\n // null and undefined are less than any other value\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.oneof(fc.boolean(), fc.double(), fc.fullUnicodeString()),\n (v1, v2) => {\n expect(compareValues(v1, v2)).lessThan(0);\n expect(compareValues(v2, v1)).greaterThan(0);\n },\n ),\n );\n\n // boolean\n fc.assert(\n fc.property(fc.boolean(), fc.boolean(), (b1, b2) => {\n expect(compareValues(b1, b2)).toBe(b1 === b2 ? 0 : b1 ? 1 : -1);\n }),\n );\n fc.assert(\n fc.property(\n fc.boolean(),\n fc.oneof(fc.double(), fc.fullUnicodeString()),\n (b, v) => {\n expect(() => compareValues(b, v)).toThrow('expected boolean');\n },\n ),\n );\n\n // number\n fc.assert(\n fc.property(fc.double(), fc.double(), (n1, n2) => {\n expect(compareValues(n1, n2)).toBe(n1 - n2);\n }),\n );\n fc.assert(\n fc.property(\n fc.double(),\n fc.oneof(fc.boolean(), fc.fullUnicodeString()),\n (n, v) => {\n expect(() => compareValues(n, v)).toThrow('expected number');\n },\n ),\n );\n\n // string\n fc.assert(\n fc.property(fc.fullUnicodeString(), fc.fullUnicodeString(), (s1, s2) => {\n expect(compareValues(s1, s2)).toBe(compareUTF8(s1, s2));\n }),\n );\n fc.assert(\n fc.property(\n fc.fullUnicodeString(),\n fc.oneof(fc.boolean(), fc.double()),\n (s, v) => {\n expect(() => compareValues(s, v)).toThrow('expected string');\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/johnnyhuynh-sportsbet/mono/packages/zql/src/ivm/data.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "johnnyhuynh-sportsbet/mono", "url": "https://github.com/johnnyhuynh-sportsbet/mono.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57832, "name": "unknown", "code": "test('compareValues', () => {\n // null and undefined are equal to each other\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.constantFrom(null, undefined),\n (v1, v2) => {\n expect(compareValues(v1, v2)).toBe(0);\n },\n ),\n );\n\n // null and undefined are less than any other value\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.oneof(fc.boolean(), fc.double(), fc.fullUnicodeString()),\n (v1, v2) => {\n expect(compareValues(v1, v2)).lessThan(0);\n expect(compareValues(v2, v1)).greaterThan(0);\n },\n ),\n );\n\n // boolean\n fc.assert(\n fc.property(fc.boolean(), fc.boolean(), (b1, b2) => {\n expect(compareValues(b1, b2)).toBe(b1 === b2 ? 0 : b1 ? 1 : -1);\n }),\n );\n fc.assert(\n fc.property(\n fc.boolean(),\n fc.oneof(fc.double(), fc.fullUnicodeString()),\n (b, v) => {\n expect(() => compareValues(b, v)).toThrow('expected boolean');\n },\n ),\n );\n\n // number\n fc.assert(\n fc.property(fc.double(), fc.double(), (n1, n2) => {\n expect(compareValues(n1, n2)).toBe(n1 - n2);\n }),\n );\n fc.assert(\n fc.property(\n fc.double(),\n fc.oneof(fc.boolean(), fc.fullUnicodeString()),\n (n, v) => {\n expect(() => compareValues(n, v)).toThrow('expected number');\n },\n ),\n );\n\n // string\n fc.assert(\n fc.property(fc.fullUnicodeString(), fc.fullUnicodeString(), (s1, s2) => {\n expect(compareValues(s1, s2)).toBe(compareUTF8(s1, s2));\n }),\n );\n fc.assert(\n fc.property(\n fc.fullUnicodeString(),\n fc.oneof(fc.boolean(), fc.double()),\n (s, v) => {\n expect(() => compareValues(s, v)).toThrow('expected string');\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/johnnyhuynh-sportsbet/mono/packages/zql/src/ivm/data.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "johnnyhuynh-sportsbet/mono", "url": "https://github.com/johnnyhuynh-sportsbet/mono.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57833, "name": "unknown", "code": "test('compareValues', () => {\n // null and undefined are equal to each other\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.constantFrom(null, undefined),\n (v1, v2) => {\n expect(compareValues(v1, v2)).toBe(0);\n },\n ),\n );\n\n // null and undefined are less than any other value\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.oneof(fc.boolean(), fc.double(), fc.fullUnicodeString()),\n (v1, v2) => {\n expect(compareValues(v1, v2)).lessThan(0);\n expect(compareValues(v2, v1)).greaterThan(0);\n },\n ),\n );\n\n // boolean\n fc.assert(\n fc.property(fc.boolean(), fc.boolean(), (b1, b2) => {\n expect(compareValues(b1, b2)).toBe(b1 === b2 ? 0 : b1 ? 1 : -1);\n }),\n );\n fc.assert(\n fc.property(\n fc.boolean(),\n fc.oneof(fc.double(), fc.fullUnicodeString()),\n (b, v) => {\n expect(() => compareValues(b, v)).toThrow('expected boolean');\n },\n ),\n );\n\n // number\n fc.assert(\n fc.property(fc.double(), fc.double(), (n1, n2) => {\n expect(compareValues(n1, n2)).toBe(n1 - n2);\n }),\n );\n fc.assert(\n fc.property(\n fc.double(),\n fc.oneof(fc.boolean(), fc.fullUnicodeString()),\n (n, v) => {\n expect(() => compareValues(n, v)).toThrow('expected number');\n },\n ),\n );\n\n // string\n fc.assert(\n fc.property(fc.fullUnicodeString(), fc.fullUnicodeString(), (s1, s2) => {\n expect(compareValues(s1, s2)).toBe(compareUTF8(s1, s2));\n }),\n );\n fc.assert(\n fc.property(\n fc.fullUnicodeString(),\n fc.oneof(fc.boolean(), fc.double()),\n (s, v) => {\n expect(() => compareValues(s, v)).toThrow('expected string');\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/johnnyhuynh-sportsbet/mono/packages/zql/src/ivm/data.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "johnnyhuynh-sportsbet/mono", "url": "https://github.com/johnnyhuynh-sportsbet/mono.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57834, "name": "unknown", "code": "test('compareValues', () => {\n // null and undefined are equal to each other\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.constantFrom(null, undefined),\n (v1, v2) => {\n expect(compareValues(v1, v2)).toBe(0);\n },\n ),\n );\n\n // null and undefined are less than any other value\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.oneof(fc.boolean(), fc.double(), fc.fullUnicodeString()),\n (v1, v2) => {\n expect(compareValues(v1, v2)).lessThan(0);\n expect(compareValues(v2, v1)).greaterThan(0);\n },\n ),\n );\n\n // boolean\n fc.assert(\n fc.property(fc.boolean(), fc.boolean(), (b1, b2) => {\n expect(compareValues(b1, b2)).toBe(b1 === b2 ? 0 : b1 ? 1 : -1);\n }),\n );\n fc.assert(\n fc.property(\n fc.boolean(),\n fc.oneof(fc.double(), fc.fullUnicodeString()),\n (b, v) => {\n expect(() => compareValues(b, v)).toThrow('expected boolean');\n },\n ),\n );\n\n // number\n fc.assert(\n fc.property(fc.double(), fc.double(), (n1, n2) => {\n expect(compareValues(n1, n2)).toBe(n1 - n2);\n }),\n );\n fc.assert(\n fc.property(\n fc.double(),\n fc.oneof(fc.boolean(), fc.fullUnicodeString()),\n (n, v) => {\n expect(() => compareValues(n, v)).toThrow('expected number');\n },\n ),\n );\n\n // string\n fc.assert(\n fc.property(fc.fullUnicodeString(), fc.fullUnicodeString(), (s1, s2) => {\n expect(compareValues(s1, s2)).toBe(compareUTF8(s1, s2));\n }),\n );\n fc.assert(\n fc.property(\n fc.fullUnicodeString(),\n fc.oneof(fc.boolean(), fc.double()),\n (s, v) => {\n expect(() => compareValues(s, v)).toThrow('expected string');\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/johnnyhuynh-sportsbet/mono/packages/zql/src/ivm/data.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "johnnyhuynh-sportsbet/mono", "url": "https://github.com/johnnyhuynh-sportsbet/mono.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57835, "name": "unknown", "code": "test('compareValues', () => {\n // null and undefined are equal to each other\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.constantFrom(null, undefined),\n (v1, v2) => {\n expect(compareValues(v1, v2)).toBe(0);\n },\n ),\n );\n\n // null and undefined are less than any other value\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.oneof(fc.boolean(), fc.double(), fc.fullUnicodeString()),\n (v1, v2) => {\n expect(compareValues(v1, v2)).lessThan(0);\n expect(compareValues(v2, v1)).greaterThan(0);\n },\n ),\n );\n\n // boolean\n fc.assert(\n fc.property(fc.boolean(), fc.boolean(), (b1, b2) => {\n expect(compareValues(b1, b2)).toBe(b1 === b2 ? 0 : b1 ? 1 : -1);\n }),\n );\n fc.assert(\n fc.property(\n fc.boolean(),\n fc.oneof(fc.double(), fc.fullUnicodeString()),\n (b, v) => {\n expect(() => compareValues(b, v)).toThrow('expected boolean');\n },\n ),\n );\n\n // number\n fc.assert(\n fc.property(fc.double(), fc.double(), (n1, n2) => {\n expect(compareValues(n1, n2)).toBe(n1 - n2);\n }),\n );\n fc.assert(\n fc.property(\n fc.double(),\n fc.oneof(fc.boolean(), fc.fullUnicodeString()),\n (n, v) => {\n expect(() => compareValues(n, v)).toThrow('expected number');\n },\n ),\n );\n\n // string\n fc.assert(\n fc.property(fc.fullUnicodeString(), fc.fullUnicodeString(), (s1, s2) => {\n expect(compareValues(s1, s2)).toBe(compareUTF8(s1, s2));\n }),\n );\n fc.assert(\n fc.property(\n fc.fullUnicodeString(),\n fc.oneof(fc.boolean(), fc.double()),\n (s, v) => {\n expect(() => compareValues(s, v)).toThrow('expected string');\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/johnnyhuynh-sportsbet/mono/packages/zql/src/ivm/data.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "johnnyhuynh-sportsbet/mono", "url": "https://github.com/johnnyhuynh-sportsbet/mono.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57836, "name": "unknown", "code": "test('compareValues', () => {\n // null and undefined are equal to each other\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.constantFrom(null, undefined),\n (v1, v2) => {\n expect(compareValues(v1, v2)).toBe(0);\n },\n ),\n );\n\n // null and undefined are less than any other value\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.oneof(fc.boolean(), fc.double(), fc.fullUnicodeString()),\n (v1, v2) => {\n expect(compareValues(v1, v2)).lessThan(0);\n expect(compareValues(v2, v1)).greaterThan(0);\n },\n ),\n );\n\n // boolean\n fc.assert(\n fc.property(fc.boolean(), fc.boolean(), (b1, b2) => {\n expect(compareValues(b1, b2)).toBe(b1 === b2 ? 0 : b1 ? 1 : -1);\n }),\n );\n fc.assert(\n fc.property(\n fc.boolean(),\n fc.oneof(fc.double(), fc.fullUnicodeString()),\n (b, v) => {\n expect(() => compareValues(b, v)).toThrow('expected boolean');\n },\n ),\n );\n\n // number\n fc.assert(\n fc.property(fc.double(), fc.double(), (n1, n2) => {\n expect(compareValues(n1, n2)).toBe(n1 - n2);\n }),\n );\n fc.assert(\n fc.property(\n fc.double(),\n fc.oneof(fc.boolean(), fc.fullUnicodeString()),\n (n, v) => {\n expect(() => compareValues(n, v)).toThrow('expected number');\n },\n ),\n );\n\n // string\n fc.assert(\n fc.property(fc.fullUnicodeString(), fc.fullUnicodeString(), (s1, s2) => {\n expect(compareValues(s1, s2)).toBe(compareUTF8(s1, s2));\n }),\n );\n fc.assert(\n fc.property(\n fc.fullUnicodeString(),\n fc.oneof(fc.boolean(), fc.double()),\n (s, v) => {\n expect(() => compareValues(s, v)).toThrow('expected string');\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/johnnyhuynh-sportsbet/mono/packages/zql/src/ivm/data.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "johnnyhuynh-sportsbet/mono", "url": "https://github.com/johnnyhuynh-sportsbet/mono.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57837, "name": "unknown", "code": "test('compareValues', () => {\n // null and undefined are equal to each other\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.constantFrom(null, undefined),\n (v1, v2) => {\n expect(compareValues(v1, v2)).toBe(0);\n },\n ),\n );\n\n // null and undefined are less than any other value\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.oneof(fc.boolean(), fc.double(), fc.fullUnicodeString()),\n (v1, v2) => {\n expect(compareValues(v1, v2)).lessThan(0);\n expect(compareValues(v2, v1)).greaterThan(0);\n },\n ),\n );\n\n // boolean\n fc.assert(\n fc.property(fc.boolean(), fc.boolean(), (b1, b2) => {\n expect(compareValues(b1, b2)).toBe(b1 === b2 ? 0 : b1 ? 1 : -1);\n }),\n );\n fc.assert(\n fc.property(\n fc.boolean(),\n fc.oneof(fc.double(), fc.fullUnicodeString()),\n (b, v) => {\n expect(() => compareValues(b, v)).toThrow('expected boolean');\n },\n ),\n );\n\n // number\n fc.assert(\n fc.property(fc.double(), fc.double(), (n1, n2) => {\n expect(compareValues(n1, n2)).toBe(n1 - n2);\n }),\n );\n fc.assert(\n fc.property(\n fc.double(),\n fc.oneof(fc.boolean(), fc.fullUnicodeString()),\n (n, v) => {\n expect(() => compareValues(n, v)).toThrow('expected number');\n },\n ),\n );\n\n // string\n fc.assert(\n fc.property(fc.fullUnicodeString(), fc.fullUnicodeString(), (s1, s2) => {\n expect(compareValues(s1, s2)).toBe(compareUTF8(s1, s2));\n }),\n );\n fc.assert(\n fc.property(\n fc.fullUnicodeString(),\n fc.oneof(fc.boolean(), fc.double()),\n (s, v) => {\n expect(() => compareValues(s, v)).toThrow('expected string');\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/johnnyhuynh-sportsbet/mono/packages/zql/src/ivm/data.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "johnnyhuynh-sportsbet/mono", "url": "https://github.com/johnnyhuynh-sportsbet/mono.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57838, "name": "unknown", "code": "test('valuesEquals', () => {\n fc.assert(\n fc.property(\n fc.oneof(fc.boolean(), fc.double(), fc.fullUnicodeString()),\n fc.oneof(fc.boolean(), fc.double(), fc.fullUnicodeString()),\n (v1, v2) => {\n expect(valuesEqual(v1, v2)).toBe(v1 === v2);\n },\n ),\n );\n\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.oneof(\n fc.constantFrom(null, undefined),\n fc.boolean(),\n fc.double(),\n fc.fullUnicodeString(),\n ),\n (v1, v2) => {\n expect(valuesEqual(v1, v2)).false;\n expect(valuesEqual(v2, v1)).false;\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/johnnyhuynh-sportsbet/mono/packages/zql/src/ivm/data.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "johnnyhuynh-sportsbet/mono", "url": "https://github.com/johnnyhuynh-sportsbet/mono.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57839, "name": "unknown", "code": "test('valuesEquals', () => {\n fc.assert(\n fc.property(\n fc.oneof(fc.boolean(), fc.double(), fc.fullUnicodeString()),\n fc.oneof(fc.boolean(), fc.double(), fc.fullUnicodeString()),\n (v1, v2) => {\n expect(valuesEqual(v1, v2)).toBe(v1 === v2);\n },\n ),\n );\n\n fc.assert(\n fc.property(\n fc.constantFrom(null, undefined),\n fc.oneof(\n fc.constantFrom(null, undefined),\n fc.boolean(),\n fc.double(),\n fc.fullUnicodeString(),\n ),\n (v1, v2) => {\n expect(valuesEqual(v1, v2)).false;\n expect(valuesEqual(v2, v1)).false;\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/johnnyhuynh-sportsbet/mono/packages/zql/src/ivm/data.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "johnnyhuynh-sportsbet/mono", "url": "https://github.com/johnnyhuynh-sportsbet/mono.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57840, "name": "unknown", "code": "test('basics', () => {\n // nulls and undefined are false in all conditions except IS NULL and IS NOT NULL\n fc.assert(\n fc.property(\n fc.oneof(fc.constant(null), fc.constant(undefined)),\n fc.oneof(\n fc.constant('='),\n fc.constant('!='),\n fc.constant('<'),\n fc.constant('<='),\n fc.constant('>'),\n fc.constant('>='),\n fc.constant('LIKE'),\n fc.constant('NOT LIKE'),\n fc.constant('ILIKE'),\n fc.constant('NOT ILIKE'),\n ),\n // hexastring to avoid sending escape chars to like\n fc.oneof(fc.hexaString(), fc.double(), fc.boolean(), fc.constant(null)),\n (a, operator, b) => {\n const condition: SimpleCondition = {\n type: 'simple',\n left: {\n type: 'column',\n name: 'foo',\n },\n op: operator as SimpleOperator,\n right: {\n type: 'literal',\n value: b,\n },\n };\n const predicate = createPredicate(condition);\n expect(predicate({foo: a})).toBe(false);\n },\n ),\n );\n\n let condition: SimpleCondition = {\n type: 'simple',\n left: {\n type: 'column',\n name: 'foo',\n },\n op: 'IS',\n right: {\n type: 'literal',\n value: null,\n },\n };\n let predicate = createPredicate(condition);\n expect(predicate({foo: null})).toBe(true);\n expect(predicate({foo: 1})).toBe(false);\n expect(predicate({foo: 'null'})).toBe(false);\n expect(predicate({foo: true})).toBe(false);\n expect(predicate({foo: false})).toBe(false);\n\n condition = {\n type: 'simple',\n left: {\n type: 'column',\n name: 'foo',\n },\n op: 'IS NOT',\n right: {\n type: 'literal',\n value: null,\n },\n };\n predicate = createPredicate(condition);\n expect(predicate({foo: null})).toBe(false);\n expect(predicate({foo: 1})).toBe(true);\n expect(predicate({foo: 'null'})).toBe(true);\n expect(predicate({foo: true})).toBe(true);\n expect(predicate({foo: false})).toBe(true);\n\n // basic operators\n fc.assert(\n fc.property(\n fc.oneof(fc.boolean(), fc.double(), fc.string()),\n fc.oneof(\n fc.constant('='),\n fc.constant('!='),\n fc.constant('<'),\n fc.constant('<='),\n fc.constant('>'),\n fc.constant('>='),\n ),\n fc.oneof(fc.boolean(), fc.double(), fc.string()),\n (a, op, b) => {\n const condition: SimpleCondition = {\n type: 'simple',\n left: {\n type: 'column',\n name: 'foo',\n },\n op: op as SimpleOperator,\n right: {\n type: 'literal',\n value: b,\n },\n };\n const predicate = createPredicate(condition);\n const jsOp = {'=': '===', '!=': '!=='}[op] ?? op;\n expect(predicate({foo: a})).toBe(eval(`a ${jsOp} b`));\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/johnnyhuynh-sportsbet/mono/packages/zql/src/builder/filter.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "johnnyhuynh-sportsbet/mono", "url": "https://github.com/johnnyhuynh-sportsbet/mono.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57841, "name": "unknown", "code": "test('basics', () => {\n // nulls and undefined are false in all conditions except IS NULL and IS NOT NULL\n fc.assert(\n fc.property(\n fc.oneof(fc.constant(null), fc.constant(undefined)),\n fc.oneof(\n fc.constant('='),\n fc.constant('!='),\n fc.constant('<'),\n fc.constant('<='),\n fc.constant('>'),\n fc.constant('>='),\n fc.constant('LIKE'),\n fc.constant('NOT LIKE'),\n fc.constant('ILIKE'),\n fc.constant('NOT ILIKE'),\n ),\n // hexastring to avoid sending escape chars to like\n fc.oneof(fc.hexaString(), fc.double(), fc.boolean(), fc.constant(null)),\n (a, operator, b) => {\n const condition: SimpleCondition = {\n type: 'simple',\n left: {\n type: 'column',\n name: 'foo',\n },\n op: operator as SimpleOperator,\n right: {\n type: 'literal',\n value: b,\n },\n };\n const predicate = createPredicate(condition);\n expect(predicate({foo: a})).toBe(false);\n },\n ),\n );\n\n let condition: SimpleCondition = {\n type: 'simple',\n left: {\n type: 'column',\n name: 'foo',\n },\n op: 'IS',\n right: {\n type: 'literal',\n value: null,\n },\n };\n let predicate = createPredicate(condition);\n expect(predicate({foo: null})).toBe(true);\n expect(predicate({foo: 1})).toBe(false);\n expect(predicate({foo: 'null'})).toBe(false);\n expect(predicate({foo: true})).toBe(false);\n expect(predicate({foo: false})).toBe(false);\n\n condition = {\n type: 'simple',\n left: {\n type: 'column',\n name: 'foo',\n },\n op: 'IS NOT',\n right: {\n type: 'literal',\n value: null,\n },\n };\n predicate = createPredicate(condition);\n expect(predicate({foo: null})).toBe(false);\n expect(predicate({foo: 1})).toBe(true);\n expect(predicate({foo: 'null'})).toBe(true);\n expect(predicate({foo: true})).toBe(true);\n expect(predicate({foo: false})).toBe(true);\n\n // basic operators\n fc.assert(\n fc.property(\n fc.oneof(fc.boolean(), fc.double(), fc.string()),\n fc.oneof(\n fc.constant('='),\n fc.constant('!='),\n fc.constant('<'),\n fc.constant('<='),\n fc.constant('>'),\n fc.constant('>='),\n ),\n fc.oneof(fc.boolean(), fc.double(), fc.string()),\n (a, op, b) => {\n const condition: SimpleCondition = {\n type: 'simple',\n left: {\n type: 'column',\n name: 'foo',\n },\n op: op as SimpleOperator,\n right: {\n type: 'literal',\n value: b,\n },\n };\n const predicate = createPredicate(condition);\n const jsOp = {'=': '===', '!=': '!=='}[op] ?? op;\n expect(predicate({foo: a})).toBe(eval(`a ${jsOp} b`));\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/johnnyhuynh-sportsbet/mono/packages/zql/src/builder/filter.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "johnnyhuynh-sportsbet/mono", "url": "https://github.com/johnnyhuynh-sportsbet/mono.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57843, "name": "unknown", "code": "test('no clashes - single pk', () => {\n fc.assert(\n fc.property(\n fc.oneof(\n fc.tuple(fc.string(), fc.string()),\n fc.tuple(fc.double(), fc.double()),\n fc.tuple(fc.boolean(), fc.boolean()),\n ),\n ([a, b]) => {\n const keyA = toPrimaryKeyStringImpl('issue', ['id'], {id: a});\n const keyB = toPrimaryKeyStringImpl('issue', ['id'], {id: b});\n if (a === b) {\n expect(keyA).toBe(keyB);\n } else {\n expect(keyA).not.toBe(keyB);\n }\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/johnnyhuynh-sportsbet/mono/packages/zero-client/src/client/keys.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "johnnyhuynh-sportsbet/mono", "url": "https://github.com/johnnyhuynh-sportsbet/mono.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57844, "name": "unknown", "code": "test('no clashes - multiple pk', () => {\n const primaryKey = ['id', 'name'] as const;\n fc.assert(\n fc.property(\n fc.tuple(\n fc.oneof(fc.string(), fc.double(), fc.boolean()),\n fc.oneof(fc.string(), fc.double(), fc.boolean()),\n fc.oneof(fc.string(), fc.double(), fc.boolean()),\n fc.oneof(fc.string(), fc.double(), fc.boolean()),\n ),\n ([a1, a2, b1, b2]) => {\n const keyA = toPrimaryKeyStringImpl('issue', primaryKey, {\n id: a1,\n name: a2,\n });\n const keyB = toPrimaryKeyStringImpl('issue', primaryKey, {\n id: b1,\n name: b2,\n });\n if (a1 === b1 && a2 === b2) {\n expect(keyA).toBe(keyB);\n } else {\n expect(keyA).not.toBe(keyB);\n }\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/johnnyhuynh-sportsbet/mono/packages/zero-client/src/client/keys.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "johnnyhuynh-sportsbet/mono", "url": "https://github.com/johnnyhuynh-sportsbet/mono.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57845, "name": "unknown", "code": "test('random using fast check', () => {\n fc.assert(\n fc.property(\n fc.bigInt({min: 0n}),\n fc.integer({min: 2, max: 36}),\n (n, radix) => {\n const s = n.toString(radix);\n const actual = parseBigInt(s, radix);\n expect(actual).toBe(n);\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/johnnyhuynh-sportsbet/mono/packages/shared/src/parse-big-int.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "johnnyhuynh-sportsbet/mono", "url": "https://github.com/johnnyhuynh-sportsbet/mono.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57846, "name": "unknown", "code": "test('random with fast-check', () => {\n fc.assert(\n fc.property(fc.float(), fc.float(), (a, b) => {\n const as = encodeFloat64AsString(a);\n const bs = encodeFloat64AsString(b);\n\n const a2 = decodeFloat64AsString(as);\n const b2 = decodeFloat64AsString(bs);\n\n expect(a2).toBe(a);\n expect(b2).toBe(b);\n\n if (Object.is(a, b)) {\n expect(as).toBe(bs);\n } else {\n expect(as).not.toBe(bs);\n if (!Number.isNaN(a) && !Number.isNaN(b)) {\n expect(as < bs).toBe(a < b);\n }\n }\n }),\n );\n})", "language": "typescript", "source_file": "./repos/johnnyhuynh-sportsbet/mono/packages/shared/src/float-to-ordered-string.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "johnnyhuynh-sportsbet/mono", "url": "https://github.com/johnnyhuynh-sportsbet/mono.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57849, "name": "unknown", "code": "test('fuzz', () => {\n fc.assert(\n fc.property(\n fc.array(fc.array(fc.integer())),\n fc.boolean(),\n (arrays, noDupes) => {\n const sorted = arrays.map(a => a.slice().sort((l, r) => l - r));\n const result = mergeIterables(sorted, (l, r) => l - r, noDupes);\n const expected = sorted.flat().sort((l, r) => l - r);\n expect([...result]).toEqual(\n noDupes ? [...new Set(expected)] : expected,\n );\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/johnnyhuynh-sportsbet/mono/packages/shared/src/iterables.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "johnnyhuynh-sportsbet/mono", "url": "https://github.com/johnnyhuynh-sportsbet/mono.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57850, "name": "unknown", "code": "UnitTest.test('KAssert.eqError: success (reflexivity)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n KAssert.eqError('eq', i, Result.error(i));\n KAssert.eqError('eq', i, Result.error(i), tBoom());\n KAssert.eqError('eq', i, Result.error(i), tBoom(), tNumber);\n }));\n})", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57851, "name": "unknown", "code": "UnitTest.test('KAssert.eqError: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('should throw if numbers differ #1', () => {\n KAssert.eqError('eq', a, Result.error(b));\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqError('eq', a, Result.error(b), tBoom());\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqError('eq', a, Result.error(b), tBoom(), tNumber);\n });\n }));\n\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.throws('should throw if value #1', () => {\n KAssert.eqError('eq', i, Result.value(s));\n });\n Assert.throws('should throw if value #2', () => {\n KAssert.eqError('eq', i, Result.value(s), tBoom());\n });\n Assert.throws('should throw if value #3', () => {\n KAssert.eqError('eq', i, Result.value(s), tBoom(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57852, "name": "unknown", "code": "UnitTest.test('KAssert.eqError: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('should throw if numbers differ #1', () => {\n KAssert.eqError('eq', a, Result.error(b));\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqError('eq', a, Result.error(b), tBoom());\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqError('eq', a, Result.error(b), tBoom(), tNumber);\n });\n }));\n\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.throws('should throw if value #1', () => {\n KAssert.eqError('eq', i, Result.value(s));\n });\n Assert.throws('should throw if value #2', () => {\n KAssert.eqError('eq', i, Result.value(s), tBoom());\n });\n Assert.throws('should throw if value #3', () => {\n KAssert.eqError('eq', i, Result.value(s), tBoom(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57853, "name": "unknown", "code": "UnitTest.test('KAssert.eqValue: success', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n KAssert.eqValue('eq', i, Result.value(i));\n KAssert.eqValue('eq', i, Result.value(i), tNumber);\n KAssert.eqValue('eq', i, Result.value(i), tNumber, tBoom());\n }));\n})", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57854, "name": "unknown", "code": "UnitTest.test('KAssert.eqValue: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('should throw if numbers differ #1', () => {\n KAssert.eqValue('eq', a, Result.value(b));\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqValue('eq', a, Result.value(b), tNumber);\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqValue('eq', a, Result.value(b), tNumber, tBoom());\n });\n }));\n\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.throws('should throw if error #1', () => {\n KAssert.eqValue('eq', i, Result.error(s));\n });\n Assert.throws('should throw if error #2', () => {\n KAssert.eqValue('eq', i, Result.error(s), tBoom());\n });\n Assert.throws('should throw if error #3', () => {\n KAssert.eqValue('eq', i, Result.error(s), tBoom(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57855, "name": "unknown", "code": "UnitTest.test('KAssert.eqValue: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('should throw if numbers differ #1', () => {\n KAssert.eqValue('eq', a, Result.value(b));\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqValue('eq', a, Result.value(b), tNumber);\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqValue('eq', a, Result.value(b), tNumber, tBoom());\n });\n }));\n\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.throws('should throw if error #1', () => {\n KAssert.eqValue('eq', i, Result.error(s));\n });\n Assert.throws('should throw if error #2', () => {\n KAssert.eqValue('eq', i, Result.error(s), tBoom());\n });\n Assert.throws('should throw if error #3', () => {\n KAssert.eqValue('eq', i, Result.error(s), tBoom(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57856, "name": "unknown", "code": "UnitTest.test('KAssert.eqResult: success', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n KAssert.eqResult('eq', Result.value(i), Result.value(i));\n KAssert.eqResult('eq', Result.value(i), Result.value(i), tNumber);\n KAssert.eqResult('eq', Result.value(i), Result.value(i), tNumber, tBoom());\n KAssert.eqResult('eq', Result.error(i), Result.error(i));\n KAssert.eqResult('eq', Result.error(i), Result.error(i), tBoom());\n KAssert.eqResult('eq', Result.error(i), Result.error(i), tBoom(), tNumber);\n }));\n})", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57857, "name": "unknown", "code": "UnitTest.test('KAssert.eqResult: fail', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('value(a) != (value(!a)) #1', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b));\n });\n Assert.throws('value(a) != (value(!a)) #2', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b), tNumber);\n });\n Assert.throws('value(a) != (value(!a)) #2', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b), tNumber, tBoom());\n });\n }));\n\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('error(a) != (error(!a)) #1', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b));\n });\n Assert.throws('error(a) != (error(!a)) #2', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b), tBoom());\n });\n Assert.throws('result(a) != (result(!a)) #2', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b), tBoom(), tNumber);\n });\n }));\n\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.throws('value != error #1', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s));\n });\n Assert.throws('value != error #2', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s), tBoom());\n });\n Assert.throws('value != error #3', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s), tBoom());\n });\n\n Assert.throws('error != value #1', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s));\n });\n Assert.throws('error != value #2', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s), tBoom());\n });\n Assert.throws('error != value #3', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s), tBoom(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57858, "name": "unknown", "code": "UnitTest.test('KAssert.eqResult: fail', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('value(a) != (value(!a)) #1', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b));\n });\n Assert.throws('value(a) != (value(!a)) #2', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b), tNumber);\n });\n Assert.throws('value(a) != (value(!a)) #2', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b), tNumber, tBoom());\n });\n }));\n\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('error(a) != (error(!a)) #1', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b));\n });\n Assert.throws('error(a) != (error(!a)) #2', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b), tBoom());\n });\n Assert.throws('result(a) != (result(!a)) #2', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b), tBoom(), tNumber);\n });\n }));\n\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.throws('value != error #1', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s));\n });\n Assert.throws('value != error #2', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s), tBoom());\n });\n Assert.throws('value != error #3', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s), tBoom());\n });\n\n Assert.throws('error != value #1', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s));\n });\n Assert.throws('error != value #2', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s), tBoom());\n });\n Assert.throws('error != value #3', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s), tBoom(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57859, "name": "unknown", "code": "UnitTest.test('KAssert.eqResult: fail', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('value(a) != (value(!a)) #1', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b));\n });\n Assert.throws('value(a) != (value(!a)) #2', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b), tNumber);\n });\n Assert.throws('value(a) != (value(!a)) #2', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b), tNumber, tBoom());\n });\n }));\n\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('error(a) != (error(!a)) #1', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b));\n });\n Assert.throws('error(a) != (error(!a)) #2', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b), tBoom());\n });\n Assert.throws('result(a) != (result(!a)) #2', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b), tBoom(), tNumber);\n });\n }));\n\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.throws('value != error #1', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s));\n });\n Assert.throws('value != error #2', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s), tBoom());\n });\n Assert.throws('value != error #3', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s), tBoom());\n });\n\n Assert.throws('error != value #1', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s));\n });\n Assert.throws('error != value #2', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s), tBoom());\n });\n Assert.throws('error != value #3', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s), tBoom(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57860, "name": "unknown", "code": "UnitTest.test('KAssert.eqSome: success (reflexivity)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n KAssert.eqSome('eq', i, Optional.some(i));\n KAssert.eqSome('eq', i, Optional.some(i), tNumber);\n }));\n})", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57861, "name": "unknown", "code": "UnitTest.test('KAssert.eqSome: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #1', () => {\n KAssert.eqSome('eq', a, Optional.some(b));\n });\n }));\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #2', () => {\n KAssert.eqSome('eq', a, Optional.some(b), tNumber);\n });\n }));\n})", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57862, "name": "unknown", "code": "UnitTest.test('KAssert.eqSome: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #1', () => {\n KAssert.eqSome('eq', a, Optional.some(b));\n });\n }));\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #2', () => {\n KAssert.eqSome('eq', a, Optional.some(b), tNumber);\n });\n }));\n})", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57863, "name": "unknown", "code": "UnitTest.test('KAssert.eqNone: failure', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('some(i) != none', () => {\n KAssert.eqNone('eq', Optional.some(i));\n });\n }));\n})", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57864, "name": "unknown", "code": "UnitTest.test('KAssert.eqOption: success (reflexivity)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.some(i));\n KAssert.eqOptional('eq', Optional.some(i), Optional.some(i), tNumber);\n }));\n KAssert.eqOptional('eq', Optional.none(), Optional.none());\n})", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57865, "name": "unknown", "code": "UnitTest.test('KAssert.eqOption: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #1', () => {\n KAssert.eqOptional('eq', Optional.some(a), Optional.some(b));\n });\n }));\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #2', () => {\n KAssert.eqOptional('eq', Optional.some(a), Optional.some(b), tNumber);\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('none != some(i) #1', () => {\n KAssert.eqOptional('eq', Optional.none(), Optional.some(i));\n });\n Assert.throws('none != some(i) #2', () => {\n KAssert.eqOptional('eq', Optional.none(), Optional.some(i), tBoom());\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('some(i) != none #1', () => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.none());\n });\n Assert.throws('some(i) != none #2', () => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.none(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57866, "name": "unknown", "code": "UnitTest.test('KAssert.eqOption: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #1', () => {\n KAssert.eqOptional('eq', Optional.some(a), Optional.some(b));\n });\n }));\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #2', () => {\n KAssert.eqOptional('eq', Optional.some(a), Optional.some(b), tNumber);\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('none != some(i) #1', () => {\n KAssert.eqOptional('eq', Optional.none(), Optional.some(i));\n });\n Assert.throws('none != some(i) #2', () => {\n KAssert.eqOptional('eq', Optional.none(), Optional.some(i), tBoom());\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('some(i) != none #1', () => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.none());\n });\n Assert.throws('some(i) != none #2', () => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.none(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57867, "name": "unknown", "code": "UnitTest.test('KAssert.eqOption: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #1', () => {\n KAssert.eqOptional('eq', Optional.some(a), Optional.some(b));\n });\n }));\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #2', () => {\n KAssert.eqOptional('eq', Optional.some(a), Optional.some(b), tNumber);\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('none != some(i) #1', () => {\n KAssert.eqOptional('eq', Optional.none(), Optional.some(i));\n });\n Assert.throws('none != some(i) #2', () => {\n KAssert.eqOptional('eq', Optional.none(), Optional.some(i), tBoom());\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('some(i) != none #1', () => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.none());\n });\n Assert.throws('some(i) != none #2', () => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.none(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57868, "name": "unknown", "code": "UnitTest.test('KAssert.eqOption: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #1', () => {\n KAssert.eqOptional('eq', Optional.some(a), Optional.some(b));\n });\n }));\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #2', () => {\n KAssert.eqOptional('eq', Optional.some(a), Optional.some(b), tNumber);\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('none != some(i) #1', () => {\n KAssert.eqOptional('eq', Optional.none(), Optional.some(i));\n });\n Assert.throws('none != some(i) #2', () => {\n KAssert.eqOptional('eq', Optional.none(), Optional.some(i), tBoom());\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('some(i) != none #1', () => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.none());\n });\n Assert.throws('some(i) != none #2', () => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.none(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57869, "name": "unknown", "code": "it('TINY-6891: Should be able to convert to and from numbers/list numbering', () => {\n const arbitrary = Arr.map([\n fc.mapToConstant({ num: 26, build: (v) => String.fromCharCode(65 + v) }),\n fc.mapToConstant({ num: 26, build: (v) => String.fromCharCode(97 + v) }),\n fc.mapToConstant({ num: 10, build: (v) => v.toString() })\n ], (c) => fc.stringOf(c, 1, 5));\n\n fc.assert(fc.property(\n fc.oneof(...arbitrary),\n (start) => {\n assert.equal(\n start,\n parseStartValue(start).map(parseDetail).getOrDie(),\n 'Should be initial start value'\n );\n }\n ), { endOnFailure: true });\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/tinymce/src/plugins/lists/test/ts/atomic/ListNumberingTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57870, "name": "unknown", "code": "it('no initial data', () => {\n const dialogChange = DialogChanges.init({ title: '', text: '' } as LinkDialogData, { } as LinkDialogCatalog);\n\n fc.assert(fc.property(fc.webUrl(), fc.asciiString(), fc.asciiString(), (url, title, text) => {\n const data = Fun.constant({ url: {\n value: url,\n meta: { title, text }\n }} as LinkDialogData);\n const dataNoMeta = Fun.constant({ url: {\n value: url,\n meta: { }\n }} as LinkDialogData);\n\n Assert.eq('on url change should include url title and text',\n Optional.some>({ title, text }),\n dialogChange.onChange(data, { name: 'url' }),\n tOptional()\n );\n\n Assert.eq('on url change should fallback to url for text',\n Optional.some>({ title: '', text: url }),\n dialogChange.onChange(dataNoMeta, { name: 'url' }),\n tOptional()\n );\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/tinymce/src/plugins/link/test/ts/atomic/DialogChangesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57871, "name": "unknown", "code": "it('with original data', () => {\n const dialogChange = DialogChanges.init({ title: 'orig title', text: 'orig text' } as LinkDialogData, { } as LinkDialogCatalog);\n const dialogChangeNoTitle = DialogChanges.init({ title: '', text: 'orig text' } as LinkDialogData, { } as LinkDialogCatalog);\n const dialogChangeNoText = DialogChanges.init({ title: 'orig title', text: '' } as LinkDialogData, { } as LinkDialogCatalog);\n\n fc.assert(fc.property(fc.webUrl(), fc.asciiString(), fc.asciiString(), (url, title, text) => {\n const data = Fun.constant({ url: {\n value: url,\n meta: { title, text }\n }} as LinkDialogData);\n\n Assert.eq('on url change should not try to change title and text',\n Optional.none(),\n dialogChange.onChange(data, { name: 'url' }),\n tOptional()\n );\n\n Assert.eq('No Title - on url change should only try to change title',\n Optional.some>({ title }),\n dialogChangeNoTitle.onChange(data, { name: 'url' }),\n tOptional()\n );\n\n Assert.eq('No Text - on url change should only try to change text',\n Optional.some>({ text }),\n dialogChangeNoText.onChange(data, { name: 'url' }),\n tOptional()\n );\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/tinymce/src/plugins/link/test/ts/atomic/DialogChangesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57872, "name": "unknown", "code": "it('TINY-4773: multiple @ characters', () => {\n const editor = hook.editor();\n fc.assert(fc.property(fc.hexaString(0, 30), fc.hexaString(0, 30), fc.hexaString(0, 30), (s1, s2, s3) => {\n assertNoLink(editor, `${s1}@@${s2}@.@${s3}`, `${s1}@@${s2}@.@${s3}`);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/tinymce/src/plugins/autolink/test/ts/browser/AutoLinkPluginTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57873, "name": "unknown", "code": "it('TINY-4773: ending in @ character', () => {\n const editor = hook.editor();\n fc.assert(fc.property(fc.hexaString(0, 100), (s1) => {\n assertNoLink(editor, `${s1}@`, `${s1}@`);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/tinymce/src/plugins/autolink/test/ts/browser/AutoLinkPluginTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57874, "name": "unknown", "code": "UnitTest.test('ShadowDom - SelectorFind.descendant', () => {\n if (SugarShadowDom.isSupported()) {\n fc.assert(fc.property(htmlBlockTagName(), htmlInlineTagName(), fc.hexaString(), (block, inline, text) => {\n withShadowElement((ss) => {\n const id = 'theid';\n const inner = SugarElement.fromHtml(`<${block}>

hello<${inline} id=\"${id}\">${text}

`);\n Insert.append(ss, inner);\n\n const frog: SugarElement = SelectorFind.descendant(ss, `#${id}`).getOrDie('Element not found');\n Assert.eq('textcontent', text, frog.dom.textContent);\n });\n }));\n }\n})", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/sugar/src/test/ts/browser/ShadowDomTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57875, "name": "unknown", "code": "UnitTest.test('All valid floats are valid', () => {\n fc.assert(fc.property(fc.oneof(\n // small to medium floats\n fc.float(),\n // big floats\n fc.tuple(fc.float(), fc.integer(-20, 20)).map(([ mantissa, exponent ]) => mantissa * Math.pow(10, exponent))\n ), (num) => {\n const parsed = Dimension.parse(num.toString(), [ 'empty' ]).getOrDie();\n Assert.eq('Number is unchanged by stringifying and parsing', num, parsed.value);\n Assert.eq('Unit is empty', '', parsed.unit);\n return true;\n }));\n})", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/sugar/src/test/ts/atomic/DimensionParseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57876, "name": "unknown", "code": "UnitTest.test('All valid integers are valid', () => {\n fc.assert(fc.property(fc.integer(), (num) => {\n const parsed = Dimension.parse(num.toString(), [ 'empty' ]).getOrDie();\n Assert.eq('Number is unchanged by stringifying and parsing', num, parsed.value);\n Assert.eq('Unit is empty', '', parsed.unit);\n return true;\n }));\n})", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/sugar/src/test/ts/atomic/DimensionParseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57885, "name": "unknown", "code": "it('adt.exact.match should be same as fold', () => {\n fc.assert(fc.property(arbExact, (subject) => {\n const matched = subject.match({\n nothing: Fun.die('should not be nothing'),\n unknown: Fun.die('should not be unknown'),\n exact: record\n });\n\n const folded = subject.fold(Fun.die('should not be nothing'), Fun.die('should not be unknown'), record);\n assert.deepEqual(folded, matched);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`adt.exact.match` produces the same result as `fold` when both are supplied with the same `exact` function.", "mode": "fast-check"} {"id": 57887, "name": "unknown", "code": "it('leftTrim(whitespace + s) === leftTrim(s)', () => {\n fc.assert(fc.property(\n fc.string(),\n (s) => {\n assert.equal(Strings.lTrim(s), Strings.lTrim(' ' + s));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/str/TrimTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`leftTrim` applied to a string with added leading whitespace should yield the same result as applying `leftTrim` to the original string.", "mode": "fast-check"} {"id": 57892, "name": "unknown", "code": "it('StringMatch.matches(StringMatch.starts(s1), s1 + s) === true', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(),\n (s, s1) => {\n assert.isTrue(StringMatch.matches(\n StringMatch.starts(s1, StringMatch.caseInsensitive),\n s1 + s\n ));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57893, "name": "unknown", "code": "it('StringMatch.matches(StringMatch.contains(s1), s1 + s) === true', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(),\n (s, s1) => {\n assert.isTrue(StringMatch.matches(\n StringMatch.contains(s1, StringMatch.caseInsensitive),\n s1 + s\n ));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57894, "name": "unknown", "code": "it('StringMatch.matches(StringMatch.contains(s1), s + s1) === true', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(),\n (s, s1) => {\n assert.isTrue(StringMatch.matches(\n StringMatch.contains(s1, StringMatch.caseInsensitive),\n s + s1\n ));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57895, "name": "unknown", "code": "it('StringMatch.matches(StringMatch.contains(s1), s) === s.indexOf(s1)', () => {\n fc.assert(fc.property(\n fc.asciiString(),\n fc.asciiString(1, 40),\n (s, s1) => {\n assert.equal(StringMatch.matches(\n StringMatch.contains(s1, StringMatch.caseInsensitive),\n s\n ), s.toLowerCase().indexOf(s1.toLowerCase()) > -1);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57896, "name": "unknown", "code": "it('StringMatch.matches(StringMatch.contains(s), s) === true', () => {\n fc.assert(fc.property(\n fc.string(),\n (s) => {\n assert.isTrue(StringMatch.matches(\n StringMatch.contains(s, StringMatch.caseInsensitive),\n s\n ));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57897, "name": "unknown", "code": "it('StringMatch.matches(StringMatch.exact(s), s + s1) === false', () => {\n fc.assert(fc.property(\n fc.string(1, 40),\n fc.string(1, 40),\n (s, s1) => {\n assert.isFalse(StringMatch.matches(\n StringMatch.exact(s, StringMatch.caseInsensitive),\n s + s1\n ));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57898, "name": "unknown", "code": "it('StringMatch.matches(StringMatch.exact(s), s1 + s) === false', () => {\n fc.assert(fc.property(\n fc.string(1, 40),\n fc.string(1, 40),\n (s, s1) => {\n assert.isFalse(StringMatch.matches(\n StringMatch.exact(s, StringMatch.caseInsensitive),\n s1 + s\n ));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57899, "name": "unknown", "code": "it('StringMatch.matches(StringMatch.exact(s), s) === true', () => {\n fc.assert(fc.property(\n fc.string(1, 40),\n (s) => {\n assert.isTrue(StringMatch.matches(\n StringMatch.exact(s, StringMatch.caseInsensitive),\n s\n ));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57900, "name": "unknown", "code": "it('StringMatch.matches(StringMatch.exact(s), s) === false when different case and case-insensitive', () => {\n fc.assert(fc.property(\n fc.asciiString(1, 40),\n (s) => s.toUpperCase() === s.toLowerCase() || StringMatch.matches(\n StringMatch.exact(s.toLowerCase(), StringMatch.caseInsensitive),\n s.toUpperCase()\n )\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57901, "name": "unknown", "code": "it('StringMatch.matches(StringMatch.exact(s), s) === false when different case and case-sensitive', () => {\n fc.assert(fc.property(\n fc.asciiString(1, 40),\n (s) => s.toUpperCase() === s.toLowerCase() || !StringMatch.matches(\n StringMatch.exact(s.toLowerCase(), StringMatch.caseSensitive),\n s.toUpperCase()\n )\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57902, "name": "unknown", "code": "it('StringMatch.matches(StringMatch.all(s1), *) === true', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(),\n (s) => {\n assert.isTrue(StringMatch.matches(\n StringMatch.all(),\n s\n ));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57903, "name": "unknown", "code": "it('positive range', () => {\n fc.assert(fc.property(fc.char(), fc.integer(1, 100), (c, count) => {\n const actual = Strings.repeat(c, count);\n assert.equal(actual.length, count);\n assert.equal(actual.charAt(0), c);\n assert.equal(actual.charAt(actual.length - 1), c);\n }));\n\n fc.assert(fc.property(fc.asciiString(5), fc.integer(1, 100), (s, count) => {\n const actual = Strings.repeat(s, count);\n assert.equal(actual.length, count * s.length);\n assert.equal(actual.indexOf(s), 0);\n assert.equal(actual.lastIndexOf(s), actual.length - s.length);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/str/RepeatTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57904, "name": "unknown", "code": "it('positive range', () => {\n fc.assert(fc.property(fc.char(), fc.integer(1, 100), (c, count) => {\n const actual = Strings.repeat(c, count);\n assert.equal(actual.length, count);\n assert.equal(actual.charAt(0), c);\n assert.equal(actual.charAt(actual.length - 1), c);\n }));\n\n fc.assert(fc.property(fc.asciiString(5), fc.integer(1, 100), (s, count) => {\n const actual = Strings.repeat(s, count);\n assert.equal(actual.length, count * s.length);\n assert.equal(actual.indexOf(s), 0);\n assert.equal(actual.lastIndexOf(s), actual.length - s.length);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/str/RepeatTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57905, "name": "unknown", "code": "it('negative range', () => {\n fc.assert(fc.property(fc.char(), fc.integer(-100, 0), (c, count) => {\n const actual = Strings.repeat(c, count);\n assert.equal(actual.length, 0);\n assert.equal(actual, '');\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/str/RepeatTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57906, "name": "unknown", "code": "it('removeTrailing property', () => {\n fc.assert(fc.property(\n fc.asciiString(),\n fc.asciiString(),\n (prefix, suffix) => {\n assert.equal(Strings.removeTrailing(prefix + suffix, suffix), prefix);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/str/RemoveTrailingTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57907, "name": "unknown", "code": "it('removeLeading removes prefix', () => {\n fc.assert(fc.property(\n fc.asciiString(),\n fc.asciiString(),\n (prefix, suffix) => {\n assert.equal(Strings.removeLeading(prefix + suffix, prefix), suffix);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/str/RemoveLeadingTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57908, "name": "unknown", "code": "it('ensureTrailing is identity if string already ends with suffix', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(),\n (prefix, suffix) => {\n const s = prefix + suffix;\n assert.equal(Strings.ensureTrailing(s, suffix), s);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/str/EnsureTrailingTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57909, "name": "unknown", "code": "it('ensureTrailing endsWith', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(),\n (s, suffix) => Strings.endsWith(Strings.ensureTrailing(s, suffix), suffix)\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/str/EnsureTrailingTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57910, "name": "unknown", "code": "it('startsWith a prefix', () => {\n fc.assert(fc.property(fc.string(), fc.string(),\n (prefix, suffix) => Strings.startsWith(prefix + suffix, prefix)\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/str/EnsureLeadingTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57911, "name": "unknown", "code": "it('A string added to a string (at the end) must have endsWith as true', () => {\n fc.assert(fc.property(\n fc.asciiString(),\n fc.asciiString(),\n (str, contents) => Strings.endsWith(str + contents, contents)\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/str/EndsWithTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57912, "name": "unknown", "code": "it('A string with length 1 or larger should never be empty', () => {\n fc.assert(fc.property(fc.string(1, 40), (str) => {\n assert.isFalse(Strings.isEmpty(str));\n assert.isTrue(Strings.isNotEmpty(str));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/str/EmptyTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57913, "name": "unknown", "code": "it('A string added to a string (at the end) must be contained within it', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(1, 40),\n (str, contents) => {\n const r = str + contents;\n assert.isTrue(Strings.contains(r, contents));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/str/ContainsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57914, "name": "unknown", "code": "it('A string added to a string (at the start) must be contained within it', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(1, 40),\n (str, contents) => {\n const r = contents = str;\n assert.isTrue(Strings.contains(r, contents));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/str/ContainsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57915, "name": "unknown", "code": "it('An empty string should contain nothing', () => {\n fc.assert(fc.property(\n fc.string(1, 40),\n (value) => !Strings.contains('', value)\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/str/ContainsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57916, "name": "unknown", "code": "it('tail of the string is unchanged', () => {\n fc.assert(fc.property(fc.ascii(), fc.asciiString(30), (h, t) => {\n assert.equal(Strings.capitalize(h + t).substring(1), t);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/str/CapitalizeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57917, "name": "unknown", "code": "it('head is uppercase', () => {\n fc.assert(fc.property(fc.ascii(), fc.asciiString(30), (h, t) => {\n const actualH = Strings.capitalize(h + t).charAt(0);\n assert.equal(actualH, h.toUpperCase());\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/str/CapitalizeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57926, "name": "unknown", "code": "it('Optionals.cat of Arr.map(xs, Optional.some) should be xs', () => {\n fc.assert(fc.property(\n fc.array(fc.json()),\n (arr) => {\n const options = Arr.map(arr, Optional.some);\n const output = Optionals.cat(options);\n assert.deepEqual(output, arr);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optionals.cat` applied to an array of `Optional.some` values should reconstruct the original array.", "mode": "fast-check"} {"id": 57931, "name": "unknown", "code": "it('Single some value', () => {\n fc.assert(fc.property(fc.integer(), (n) => {\n assertOptional(Optionals.sequence([ Optional.some(n) ]), Optional.some([ n ]));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalsSequenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optionals.sequence` with a single `Optional.some` value should return `Optional.some` containing an array with that value.", "mode": "fast-check"} {"id": 57929, "name": "unknown", "code": "it('someIf(false) is none', () => {\n fc.assert(fc.property(fc.integer(), (n) => {\n assertNone(Optionals.someIf(false, n));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalsSomeIfTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57930, "name": "unknown", "code": "it('someIf(true) is some', () => {\n fc.assert(fc.property(fc.integer(), (n) => {\n assertSome(Optionals.someIf(true, n), n);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalsSomeIfTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57935, "name": "unknown", "code": "it('None then some', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (n) => {\n const someNumbers = Arr.map(n, (x) => Optional.some(x));\n assertNone(Optionals.sequence([ Optional.none(), ...someNumbers ]));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalsSequenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57936, "name": "unknown", "code": "it('all some', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (n) =>\n assertOptional(Optionals.sequence(Arr.map(n, (x) => Optional.some(x))), Optionals.traverse(n, (x) => Optional.some(x)))\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalsSequenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57937, "name": "unknown", "code": "it('flattens some(some(x)) to some(x)', () => {\n fc.assert(fc.property(fc.integer(), (n) => {\n assertOptional(Optionals.flatten(Optional.some(Optional.some(n))), Optional.some(n));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalsFlattenTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57938, "name": "unknown", "code": "it('Optional.none() !== Optional.some(x)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n assert.isFalse(Optionals.equals(Optional.none(), Optional.some(i)));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57939, "name": "unknown", "code": "it('Optional.some(x) !== Optional.none()', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n assert.isFalse((Optionals.equals(Optional.some(i), Optional.none())));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57940, "name": "unknown", "code": "it('Optional.some(x) === Optional.some(x)', () => {\n fc.assert(fc.property(fc.integer(), (i) => assert.isTrue(Optionals.equals(Optional.some(i), Optional.some(i)))));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57941, "name": "unknown", "code": "it('Optional.some(x) === Optional.some(x) (same ref)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n const ob = Optional.some(i);\n assert.isTrue(Optionals.equals(ob, ob));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57942, "name": "unknown", "code": "it('Optional.some(x) !== Optional.some(x + y) where y is not identity', () => {\n fc.assert(fc.property(fc.string(), fc.string(1, 40), (a, b) => {\n assert.isFalse(Optionals.equals(Optional.some(a), Optional.some(a + b)));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57943, "name": "unknown", "code": "it('some !== none, for any predicate', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt1) => {\n assert.isFalse(Optionals.equals(opt1, Optional.none(), boom));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57944, "name": "unknown", "code": "it('none !== some, for any predicate', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt1) => {\n assert.isFalse(Optionals.equals(Optional.none(), opt1, boom));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57945, "name": "unknown", "code": "it('Checking Optionals.equals(some(x), some(y), _, _ -> false) === false', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), arbOptionSome(fc.integer()), (opt1, opt2) => {\n assert.isFalse(Optionals.equals(opt1, opt2, Fun.never));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57946, "name": "unknown", "code": "it('Checking Optionals.equals(some(x), some(y), _, _ -> true) === true', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), (a, b) => {\n const opt1 = Optional.some(a);\n const opt2 = Optional.some(b);\n assert.isTrue(Optionals.equals(opt1, opt2, Fun.always));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57947, "name": "unknown", "code": "it('Checking Optionals.equals(some(x), some(y), f) iff. f(x, y)', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), arbOptionSome(fc.integer()), fc.func(fc.boolean()), (a, b, f) => {\n const opt1 = Optional.some(a);\n const opt2 = Optional.some(b);\n return f(a, b) === Optionals.equals(opt1, opt2, f);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57948, "name": "unknown", "code": "it('Checking some(x).fold(die, id) === x', () => {\n fc.assert(fc.property(fc.integer(), (json) => {\n const opt = Optional.some(json);\n const actual = opt.fold(Fun.die('Should not be none!'), Fun.identity);\n assert.deepEqual(actual, json);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57949, "name": "unknown", "code": "it('Checking some(x).is(x) === true', () => {\n fc.assert(fc.property(fc.integer(), (json) => {\n const opt = Optional.some(json);\n assert.isTrue(Optionals.is(opt, json));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57950, "name": "unknown", "code": "it('Checking some(x).isSome === true', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => opt.isSome()));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57951, "name": "unknown", "code": "it('Checking some(x).isNone === false', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => !opt.isNone()));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57952, "name": "unknown", "code": "it('Checking some(x).getOr(v) === x', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), arbOptionSome(fc.integer()), (a, b) => {\n assert.equal(Optional.some(a).getOr(b), a);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57953, "name": "unknown", "code": "it('Checking some(x).getOrThunk(_ -> v) === x', () => {\n fc.assert(fc.property(fc.integer(), fc.func(fc.integer()), (a, thunk) => {\n assert.equal(Optional.some(a).getOrThunk(thunk), a);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57954, "name": "unknown", "code": "it('Checking some.getOrDie() never throws', () => {\n fc.assert(fc.property(fc.integer(), fc.string(1, 40), (i, s) => {\n const opt = Optional.some(i);\n opt.getOrDie(s);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57955, "name": "unknown", "code": "it('Checking some(x).or(oSomeValue) === some(x)', () => {\n fc.assert(fc.property(fc.integer(), arbOptionSome(fc.integer()), (json, other) => {\n const output = Optional.some(json).or(other);\n assert.isTrue(Optionals.is(output, json));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57956, "name": "unknown", "code": "it('Checking some(x).orThunk(_ -> oSomeValue) === some(x)', () => {\n fc.assert(fc.property(fc.integer(), arbOptionSome(fc.integer()), (i, other) => {\n const output = Optional.some(i).orThunk(() => other);\n assert.isTrue(Optionals.is(output, i));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57957, "name": "unknown", "code": "it('Checking some(x).map(f) === some(f(x))', () => {\n fc.assert(fc.property(fc.integer(), fc.func(fc.integer()), (a, f) => {\n const opt = Optional.some(a);\n const actual = opt.map(f);\n assert.equal(actual.getOrDie(), f(a));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57958, "name": "unknown", "code": "it('Checking some(x).each(f) === undefined and f gets x', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => {\n let hack: number | null = null;\n const actual = opt.each((x) => {\n hack = x;\n });\n assert.isUndefined(actual);\n assert.equal(opt.getOrDie(), hack);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57959, "name": "unknown", "code": "it('Given f :: s -> some(b), checking some(x).bind(f) === some(b)', () => {\n fc.assert(fc.property(fc.integer(), fc.func(arbOptionSome(fc.integer())), (i, f) => {\n const actual = Optional.some(i).bind(f);\n assert.deepEqual(actual, f(i));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57960, "name": "unknown", "code": "it('Given f :: s -> none, checking some(x).bind(f) === none', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), fc.func(arbOptionNone()), (opt, f) => {\n const actual = opt.bind(f);\n assertNone(actual);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57961, "name": "unknown", "code": "it('Checking some(x).exists(_ -> false) === false', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => !opt.exists(Fun.never)));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57962, "name": "unknown", "code": "it('Checking some(x).exists(_ -> true) === true', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => opt.exists(Fun.always)));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57963, "name": "unknown", "code": "it('Checking some(x).exists(f) iff. f(x)', () => {\n fc.assert(fc.property(fc.integer(), fc.func(fc.boolean()), (i, f) => {\n const opt = Optional.some(i);\n if (f(i)) {\n assert.isTrue(opt.exists(f));\n } else {\n assert.isFalse(opt.exists(f));\n }\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57964, "name": "unknown", "code": "it('Checking some(x).forall(_ -> false) === false', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => !opt.forall(Fun.never)));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57965, "name": "unknown", "code": "it('Checking some(x).forall(_ -> true) === true', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => opt.forall(Fun.always)));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57966, "name": "unknown", "code": "it('Checking some(x).forall(f) iff. f(x)', () => {\n fc.assert(fc.property(fc.integer(), fc.func(fc.boolean()), (i, f) => {\n const opt = Optional.some(i);\n if (f(i)) {\n assert.isTrue(opt.forall(f));\n } else {\n assert.isFalse(opt.forall(f));\n }\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57967, "name": "unknown", "code": "it('Checking some(x).toArray equals [ x ]', () => {\n fc.assert(fc.property(fc.integer(), (json) => {\n assert.deepEqual(Optional.some(json).toArray(), [ json ]);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57968, "name": "unknown", "code": "it('Checking some(x).toString equals \"some(x)\"', () => {\n fc.assert(fc.property(fc.integer(), (json) => {\n assert.equal(Optional.some(json).toString(), 'some(' + json + ')');\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57969, "name": "unknown", "code": "it('Checking none.fold(_ -> x, die) === x', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n const actual = Optional.none().fold(Fun.constant(i), Fun.die('Should not be called'));\n assert.equal(actual, i);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57970, "name": "unknown", "code": "it('Checking none.is === false', () => {\n fc.assert(fc.property(fc.integer(), (v) => {\n assert.isFalse(Optionals.is(Optional.none(), v));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57971, "name": "unknown", "code": "it('Checking none.getOr(v) === v', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n assert.equal(Optional.none().getOr(i), i);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57972, "name": "unknown", "code": "it('Checking none.getOrThunk(_ -> v) === v', () => {\n fc.assert(fc.property(fc.func(fc.integer()), (thunk) => {\n assert.equal(Optional.none().getOrThunk(thunk), thunk());\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57973, "name": "unknown", "code": "it('Checking none.getOrDie() always throws', () => {\n // Require non empty string of msg falsiness gets in the way.\n fc.assert(fc.property(fc.string(1, 40), (s) => {\n assert.throws(() => {\n Optional.none().getOrDie(s);\n });\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57974, "name": "unknown", "code": "it('Checking none.or(oSomeValue) === oSomeValue', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n const output = Optional.none().or(Optional.some(i));\n assert.isTrue(Optionals.is(output, i));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57975, "name": "unknown", "code": "it('Checking none.orThunk(_ -> v) === v', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n const output = Optional.none().orThunk(() => Optional.some(i));\n assert.isTrue(Optionals.is(output, i));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57976, "name": "unknown", "code": "it('none is not some', () => {\n assert.isFalse(Optional.none().isSome());\n fc.assert(fc.property(fc.anything(), (x) => {\n assert.isTrue(Optional.some(x).isSome());\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalIsSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57977, "name": "unknown", "code": "it('Optional.isNone', () => {\n assert.isTrue(Optional.none().isNone());\n fc.assert(fc.property(fc.anything(), (x) => {\n assert.isFalse(Optional.some(x).isNone());\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalIsNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57978, "name": "unknown", "code": "it('Optional.getOr', () => {\n fc.assert(fc.property(fc.integer(), (x) => {\n assert.equal(Optional.none().getOr(x), x);\n assert.equal(Optional.none().getOrThunk(() => x), x);\n }));\n fc.assert(fc.property(fc.integer(), fc.integer(), (x, y) => {\n assert.equal(Optional.some(x).getOr(y), x);\n assert.equal(Optional.some(x).getOrThunk(Fun.die('boom')), x);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalGetOrTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57979, "name": "unknown", "code": "it('Optional.getOr', () => {\n fc.assert(fc.property(fc.integer(), (x) => {\n assert.equal(Optional.none().getOr(x), x);\n assert.equal(Optional.none().getOrThunk(() => x), x);\n }));\n fc.assert(fc.property(fc.integer(), fc.integer(), (x, y) => {\n assert.equal(Optional.some(x).getOr(y), x);\n assert.equal(Optional.some(x).getOrThunk(Fun.die('boom')), x);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalGetOrTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57980, "name": "unknown", "code": "it('Checking some(x).filter(_ -> false) === none', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => {\n assertNone(opt.filter(Fun.never));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalFilterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57981, "name": "unknown", "code": "it('Checking some(x).filter(_ -> true) === some(x)', () => {\n fc.assert(fc.property(fc.integer(), (x) => {\n assertSome(some(x).filter(Fun.always), x);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalFilterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57982, "name": "unknown", "code": "it('Checking some(x).filter(f) === some(x) iff. f(x)', () => {\n fc.assert(fc.property(fc.integer(), fc.func(fc.boolean()), (i, f) => {\n if (f(i)) {\n assertSome(some(i).filter(f), i);\n } else {\n assertNone(some(i).filter(f));\n }\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/OptionalFilterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57983, "name": "unknown", "code": "it('fails for none vs some', () => {\n fc.assert(fc.property(fc.nat(), (n) => {\n assert.throw(() => {\n assertOptional(Optional.none(), Optional.some(n));\n });\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/AssertOptionalTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57984, "name": "unknown", "code": "it('fails for some vs none', () => {\n fc.assert(fc.property(fc.nat(), (n) => {\n assert.throw(() => {\n assertOptional(Optional.some(n), Optional.none());\n });\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/AssertOptionalTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57985, "name": "unknown", "code": "it('fails when some values are different', () => {\n fc.assert(fc.property(fc.nat(), (n) => {\n assert.throw(() => {\n assertOptional(Optional.some(n), Optional.some(n + 1));\n });\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/AssertOptionalTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57986, "name": "unknown", "code": "it('passes for identical somes', () => {\n fc.assert(fc.property(fc.nat(), (n) => {\n assertOptional(Optional.some(n), Optional.some(n));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/AssertOptionalTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57987, "name": "unknown", "code": "it('passes for identical some arrays', () => {\n fc.assert(fc.property(fc.array(fc.nat()), (n) => {\n assertOptional(Optional.some(n), Optional.some(n));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/optional/AssertOptionalTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57988, "name": "unknown", "code": "it('Checking that creating a namespace (forge) from an obj will enable that value to be retrieved by resolving (path)', () => {\n fc.assert(fc.property(\n // NOTE: This value is being modified, so it cannot be shrunk.\n fc.dictionary(fc.asciiString(),\n // We want to make sure every path in the object is an object\n // also, because that is a limitation of forge.\n fc.dictionary(fc.asciiString(),\n fc.dictionary(fc.asciiString(), fc.constant({}))\n )\n ),\n fc.array(fc.asciiString(1, 30), 1, 40),\n fc.asciiString(1, 30),\n fc.asciiString(1, 30),\n (dict, parts, field, newValue) => {\n const created = Resolve.forge(parts, dict);\n created[field] = newValue;\n const resolved = Resolve.path(parts.concat([ field ]), dict);\n assert.deepEqual(resolved, newValue);\n }\n ), { endOnFailure: true });\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/obj/ResolveTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57989, "name": "unknown", "code": "it('map id obj = obj', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.integer()), (obj) => {\n const actual = Obj.map(obj, Fun.identity);\n assert.deepEqual(actual, obj);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/obj/ObjMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57990, "name": "unknown", "code": "it('map constant obj means that values(obj) are all the constant', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.integer()), fc.integer(), (obj, x) => {\n const output = Obj.map(obj, Fun.constant(x));\n const values = Obj.values(output);\n return Arr.forall(values, (v) => v === x);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/obj/ObjMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57991, "name": "unknown", "code": "it('tupleMap obj (x, i) -> { k: i, v: x }', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.integer()), (obj) => {\n const output = Obj.tupleMap(obj, (x, i) => ({ k: i, v: x }));\n assert.deepEqual(output, obj);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/obj/ObjMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57992, "name": "unknown", "code": "it('mapToArray is symmetric with tupleMap', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.integer()), (obj) => {\n const array = Obj.mapToArray(obj, (x, i) => ({ k: i, v: x }));\n\n const aKeys = Arr.map(array, (x) => x.k);\n const aValues = Arr.map(array, (x) => x.v);\n\n const keys = Obj.keys(obj);\n const values = Obj.values(obj);\n\n assert.deepEqual(Arr.sort(aKeys), Arr.sort(keys));\n assert.deepEqual(Arr.sort(aValues), Arr.sort(values));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/obj/ObjMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57993, "name": "unknown", "code": "it('single key/value', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.json(),\n (k: string, v: any) => {\n const o = { [k]: v };\n assert.isFalse(Obj.isEmpty(o));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/obj/ObjIsEmptyTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57994, "name": "unknown", "code": "it('the value found by find always passes predicate', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(), fc.json()),\n fc.func(fc.boolean()),\n (obj, pred) => {\n // It looks like the way that fc.fun works is it cares about all of its arguments, so therefore\n // we have to only pass in one if we want it to be deterministic. Just an assumption\n const value = Obj.find(obj, (v) => {\n return pred(v);\n });\n return value.fold(() => {\n const values = Obj.values(obj);\n return !Arr.exists(values, (v) => {\n return pred(v);\n });\n }, (v) => {\n return pred(v);\n });\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/obj/ObjFindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57995, "name": "unknown", "code": "it('If predicate is always false, then find is always none', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(), fc.json()),\n (obj) => {\n const value = Obj.find(obj, Fun.never);\n return value.isNone();\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/obj/ObjFindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57996, "name": "unknown", "code": "it('If object is empty, find is always none', () => {\n fc.assert(fc.property(\n fc.func(fc.boolean()),\n (pred) => {\n const value = Obj.find({}, pred);\n return value.isNone();\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/obj/ObjFindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57997, "name": "unknown", "code": "it('If predicate is always true, then value is always the some(first), or none if dict is empty', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(), fc.json()),\n (obj) => {\n const value = Obj.find(obj, Fun.always);\n // No order is specified, so we cannot know what \"first\" is\n return Obj.keys(obj).length === 0 ? value.isNone() : true;\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/obj/ObjFindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57998, "name": "unknown", "code": "it('Each + set should equal the same object', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(), fc.json()),\n (obj) => {\n const values: Record = {};\n const output = Obj.each(obj, (x, i) => {\n values[i] = x;\n });\n assert.deepEqual(values, obj);\n assert.isUndefined(output);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/obj/ObjEachTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 57999, "name": "unknown", "code": "it('Merged with identity on left', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), (obj) => {\n assert.deepEqual(Merger.merge({}, obj), obj);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58000, "name": "unknown", "code": "it('Merged with identity on right', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), (obj) => {\n assert.deepEqual(Merger.merge(obj, {}), obj);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58001, "name": "unknown", "code": "it('Merged with itself is itself', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), (obj) => {\n assert.deepEqual(Merger.merge(obj, obj), obj);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58002, "name": "unknown", "code": "it('Merge(a, Merge(b, c)) === Merge(Merge(a, b), c)', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), fc.dictionary(fc.asciiString(), fc.json()), fc.dictionary(fc.asciiString(), fc.json()), (a, b, c) => {\n const one = Merger.merge(a, Merger.merge(b, c));\n const other = Merger.merge(Merger.merge(a, b), c);\n assert.deepEqual(other, one);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58003, "name": "unknown", "code": "it('Merge(a, b) contains all the keys of b', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), fc.dictionary(fc.asciiString(), fc.json()), (a, b) => {\n const output = Merger.merge(a, b);\n const keys = Obj.keys(b);\n const oKeys = Obj.keys(output);\n return Arr.forall(keys, (k) => {\n return Arr.contains(oKeys, k);\n });\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58004, "name": "unknown", "code": "it('Deep-merged with identity on left', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), (obj) => {\n assert.deepEqual(Merger.deepMerge({}, obj), obj);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58005, "name": "unknown", "code": "it('Deep-merged with identity on right', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), (obj) => {\n assert.deepEqual(Merger.deepMerge(obj, {}), obj);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58006, "name": "unknown", "code": "it('Deep-merged with itself is itself', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), (obj) => {\n assert.deepEqual(Merger.deepMerge(obj, obj), obj);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58007, "name": "unknown", "code": "it('Deep-merge(a, Deep-merge(b, c)) === Deep-merge(Deep-merge(a, b), c)', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), fc.dictionary(fc.asciiString(), fc.json()), fc.dictionary(fc.asciiString(), fc.json()), (a, b, c) => {\n const one = Merger.merge(a, Merger.merge(b, c));\n const other = Merger.merge(Merger.merge(a, b), c);\n assert.deepEqual(other, one);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58008, "name": "unknown", "code": "it('Deep-merge(a, b) contains all the keys of b', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), fc.dictionary(fc.asciiString(), fc.json()), (a, b) => {\n const output = Merger.deepMerge(a, b);\n const keys = Obj.keys(b);\n const oKeys = Obj.keys(output);\n return Arr.forall(keys, (k) => {\n return Arr.contains(oKeys, k);\n });\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58009, "name": "unknown", "code": "it('Check that if the filter always returns false, then everything is in \"f\"', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(), fc.string(1, 40)),\n (obj) => {\n const output = Obj.bifilter(obj, Fun.never);\n assert.lengthOf(Obj.keys(output.f), Obj.keys(obj).length);\n assert.lengthOf(Obj.keys(output.t), 0);\n return true;\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/obj/BiFilterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58010, "name": "unknown", "code": "it('Check that if the filter always returns true, then everything is in \"t\"', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(), fc.string(1, 40)),\n (obj) => {\n const output = Obj.bifilter(obj, Fun.always);\n assert.lengthOf(Obj.keys(output.f), 0);\n assert.lengthOf(Obj.keys(output.t), Obj.keys(obj).length);\n return true;\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/obj/BiFilterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58011, "name": "unknown", "code": "it('Check that everything in f fails predicate and everything in t passes predicate', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(1, 30), fc.integer()),\n (obj) => {\n const predicate = (x: number) => x % 2 === 0;\n const output = Obj.bifilter(obj, predicate);\n\n const matches = (k: string) => predicate(obj[k]);\n\n const falseKeys = Obj.keys(output.f);\n const trueKeys = Obj.keys(output.t);\n\n assert.isFalse(Arr.exists(falseKeys, matches));\n assert.isTrue(Arr.forall(trueKeys, matches));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/obj/BiFilterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58012, "name": "unknown", "code": "it('should have an adjustment of delta, or be the min or max', () => {\n fc.assert(fc.property(\n fc.nat(),\n fc.integer(),\n fc.nat(),\n fc.nat(),\n (value, delta, min, range) => {\n const max = min + range;\n const actual = Num.cycleBy(value, delta, min, max);\n return (actual - value) === delta || actual === min || actual === max;\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/num/NumCycleByTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58013, "name": "unknown", "code": "it('0 has no effect', () => {\n fc.assert(fc.property(fc.nat(), fc.nat(), (value, delta) => {\n const actual = Num.cycleBy(value, 0, value, value + delta);\n assert.equal(actual, value);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/num/NumCycleByTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58014, "name": "unknown", "code": "it('delta is max', () => {\n fc.assert(fc.property(fc.nat(), fc.nat(), (value, delta) => {\n const max = value + delta;\n const actual = Num.cycleBy(value, delta, value, max);\n assert.equal(actual, max);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/num/NumCycleByTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58015, "name": "unknown", "code": "it('Num.clamp', () => {\n fc.assert(fc.property(\n fc.nat(1000),\n fc.nat(1000),\n fc.nat(1000),\n (a, b, c) => {\n const low = a;\n const med = low + b;\n const high = med + c;\n // low <= med <= high\n assert.equal(Num.clamp(med, low, high), med);\n assert.equal(Num.clamp(med, low, high), med);\n assert.equal(Num.clamp(high, low, med), med);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/num/NumClampTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58016, "name": "unknown", "code": "it('mirrors bind', () => {\n const arbInner = fc.tuple(fc.boolean(), fc.string()).map(([ isJust, value ]) => {\n if (isJust) {\n return Maybes.just(value);\n } else {\n return Maybes.nothing();\n }\n });\n const arbNested = fc.tuple(fc.boolean(), arbInner).map(([ isJust, value ]) => {\n if (isJust) {\n return Maybes.just(value);\n } else {\n return Maybes.nothing>();\n }\n });\n fc.assert(fc.property(arbNested, (maybe) => {\n const flattened = Maybes.flatten(maybe);\n const bound = Maybes.bind, string>(Fun.identity)(maybe);\n assert.deepEqual(flattened, bound);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/maybe/MonadTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58017, "name": "unknown", "code": "it('allows creating \"Just\" maybes', () => {\n fc.assert(fc.property(fc.anything(), (thing) => {\n const item = Maybes.just(thing);\n assert.isTrue(Maybes.isJust(item));\n assert.isFalse(Maybes.isNothing(item));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/maybe/IdentityTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58018, "name": "unknown", "code": "it('allows folding on \"Just\" maybes', () => {\n // Simple value, complex assertions\n Fun.pipe(\n Maybes.just('test'),\n Maybes.fold(\n Fun.die('Should call other branch'),\n (test) => {\n assert.equal(test, 'test');\n return 'other-test';\n }\n ),\n (result) => assert.equal(result, 'other-test')\n );\n\n // Complex values, simple assertions\n fc.assert(fc.property(fc.anything(), (thing) => {\n Fun.pipe(\n Maybes.just(thing),\n Maybes.fold(Fun.die('Should call other branch'), Fun.noop)\n );\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/maybe/IdentityTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58019, "name": "unknown", "code": "it('gets the value on \"Just\"', () => {\n fc.assert(fc.property(fc.string(), (s) => {\n const val = Fun.pipe(\n Maybes.just(s),\n Maybes.getOrDie\n );\n assert.equal(val, s);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/maybe/GetterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58020, "name": "unknown", "code": "it('is always false for \"Nothing\"', () => {\n fc.assert(fc.property(fc.anything(), (thing) => {\n const matches = Fun.pipe(\n Maybes.nothing(),\n Maybes.is(thing)\n );\n\n assert.isFalse(matches);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/maybe/ComparatorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58021, "name": "unknown", "code": "it('is always false for \"Nothing\" with explicit comparator', () => {\n fc.assert(fc.property(fc.anything(), (thing) => {\n const matches = Fun.pipe(\n Maybes.nothing(),\n Maybes.is(thing, Fun.die('should not be called'))\n );\n\n assert.isFalse(matches);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/maybe/ComparatorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58022, "name": "unknown", "code": "it('is correct for \"Just\"', () => {\n fc.assert(fc.property(fc.string(), (thing) => {\n const matches = Fun.pipe(\n Maybes.just(thing),\n Maybes.is(thing)\n );\n\n assert.isTrue(matches);\n }));\n\n fc.assert(fc.property(fc.string(), (thing) => {\n const matches = Fun.pipe(\n Maybes.just(thing),\n Maybes.is(thing + 'foo')\n );\n\n assert.isFalse(matches);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/maybe/ComparatorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58023, "name": "unknown", "code": "it('is correct for \"Just\"', () => {\n fc.assert(fc.property(fc.string(), (thing) => {\n const matches = Fun.pipe(\n Maybes.just(thing),\n Maybes.is(thing)\n );\n\n assert.isTrue(matches);\n }));\n\n fc.assert(fc.property(fc.string(), (thing) => {\n const matches = Fun.pipe(\n Maybes.just(thing),\n Maybes.is(thing + 'foo')\n );\n\n assert.isFalse(matches);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/maybe/ComparatorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58024, "name": "unknown", "code": "it('is correct for \"Just\" with an explicit comparator', () => {\n\n // Just an example data type that doesn't have a simple equality\n const thunkEq = (a: () => string, b: () => string): boolean => a() === b();\n\n fc.assert(fc.property(fc.string(), (thing) => {\n const matches = Fun.pipe(\n Maybes.just(Fun.constant(thing)),\n Maybes.is(Fun.constant(thing), thunkEq)\n );\n\n assert.isTrue(matches);\n }));\n\n fc.assert(fc.property(fc.string(), (thing) => {\n const matches = Fun.pipe(\n Maybes.just(Fun.constant(thing)),\n Maybes.is(() => thing + 'foo', thunkEq)\n );\n\n assert.isFalse(matches);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/maybe/ComparatorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58025, "name": "unknown", "code": "it('is correct for \"Just\" with an explicit comparator', () => {\n\n // Just an example data type that doesn't have a simple equality\n const thunkEq = (a: () => string, b: () => string): boolean => a() === b();\n\n fc.assert(fc.property(fc.string(), (thing) => {\n const matches = Fun.pipe(\n Maybes.just(Fun.constant(thing)),\n Maybes.is(Fun.constant(thing), thunkEq)\n );\n\n assert.isTrue(matches);\n }));\n\n fc.assert(fc.property(fc.string(), (thing) => {\n const matches = Fun.pipe(\n Maybes.just(Fun.constant(thing)),\n Maybes.is(() => thing + 'foo', thunkEq)\n );\n\n assert.isFalse(matches);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/maybe/ComparatorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58026, "name": "unknown", "code": "it('is false for one \"Nothing\"', () => {\n fc.assert(fc.property(fc.anything(), (thing) => {\n assert.isFalse(Maybes.equals(Maybes.nothing(), Maybes.just(thing)));\n assert.isFalse(Maybes.equals(Maybes.just(thing), Maybes.nothing()));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/maybe/ComparatorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58027, "name": "unknown", "code": "it('compares normally for two \"Just\"s', () => {\n const different = fc.tuple(fc.anything(), fc.anything()).filter(([ lhs, rhs ]) => lhs !== rhs);\n fc.assert(fc.property(different, ([ lhs, rhs ]) => {\n assert.isFalse(Maybes.equals(Maybes.just(lhs), Maybes.just(rhs)));\n }));\n\n const theSame = fc.string().map((x) => [ x, x ]);\n fc.assert(fc.property(theSame, ([ lhs, rhs ]) => {\n assert.isTrue(Maybes.equals(Maybes.just(lhs), Maybes.just(rhs)));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/maybe/ComparatorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58028, "name": "unknown", "code": "it('compares normally for two \"Just\"s', () => {\n const different = fc.tuple(fc.anything(), fc.anything()).filter(([ lhs, rhs ]) => lhs !== rhs);\n fc.assert(fc.property(different, ([ lhs, rhs ]) => {\n assert.isFalse(Maybes.equals(Maybes.just(lhs), Maybes.just(rhs)));\n }));\n\n const theSame = fc.string().map((x) => [ x, x ]);\n fc.assert(fc.property(theSame, ([ lhs, rhs ]) => {\n assert.isTrue(Maybes.equals(Maybes.just(lhs), Maybes.just(rhs)));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/maybe/ComparatorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58029, "name": "unknown", "code": "it('is false for one \"Nothing\"', () => {\n fc.assert(fc.property(fc.anything(), (thing) => {\n assert.isFalse(Maybes.equals(Maybes.nothing(), Maybes.just(thing), unusedComparator));\n assert.isFalse(Maybes.equals(Maybes.just(thing), Maybes.nothing(), unusedComparator));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/maybe/ComparatorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58030, "name": "unknown", "code": "it('Thunk.cached counter', () => {\n fc.assert(fc.property(fc.json(), fc.func(fc.json()), fc.json(), (a, f, b) => {\n let counter = 0;\n const thunk = Thunk.cached((x) => {\n counter++;\n return {\n counter,\n output: f(x)\n };\n });\n const value = thunk(a);\n const other = thunk(b);\n assert.deepEqual(other, value);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/fun/ThunkTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58031, "name": "unknown", "code": "it('Check compose :: compose(f, g)(x) = f(g(x))', () => {\n fc.assert(fc.property(fc.string(), fc.func(fc.string()), fc.func(fc.string()), (x, f, g) => {\n const h = Fun.compose(f, g);\n assert.deepEqual(h(x), f(g(x)));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58032, "name": "unknown", "code": "it('Check compose1 :: compose1(f, g)(x) = f(g(x))', () => {\n fc.assert(fc.property(fc.string(), fc.func(fc.string()), fc.func(fc.string()), (x, f, g) => {\n const h = Fun.compose1(f, g);\n assert.deepEqual(h(x), f(g(x)));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58033, "name": "unknown", "code": "it('Check constant :: constant(a)() === a', () => {\n fc.assert(fc.property(fc.json(), (json) => {\n assert.deepEqual(Fun.constant(json)(), json);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58034, "name": "unknown", "code": "it('Check identity :: identity(a) === a', () => {\n fc.assert(fc.property(fc.json(), (json) => {\n assert.deepEqual(Fun.identity(json), json);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58035, "name": "unknown", "code": "it('Check always :: f(x) === true', () => {\n fc.assert(fc.property(fc.json(), (json) => {\n assert.isTrue(Fun.always(json));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58036, "name": "unknown", "code": "it('Check never :: f(x) === false', () => {\n fc.assert(fc.property(fc.json(), (json) => {\n assert.isFalse(Fun.never(json));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58037, "name": "unknown", "code": "it('Check curry', () => {\n fc.assert(fc.property(fc.json(), fc.json(), fc.json(), fc.json(), (a, b, c, d) => {\n const f = (a: string, b: string, c: string, d: string) => [ a, b, c, d ];\n\n assert.deepEqual([ a, b, c, d ], Fun.curry(f, a)(b, c, d));\n assert.deepEqual([ a, b, c, d ], Fun.curry(f, a, b)(c, d));\n assert.deepEqual([ a, b, c, d ], Fun.curry(f, a, b, c)(d));\n assert.deepEqual([ a, b, c, d ], Fun.curry(f, a, b, c, d)());\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58038, "name": "unknown", "code": "it('Check not :: not(f(x)) === !f(x)', () => {\n fc.assert(fc.property(fc.json(), fc.func(fc.boolean()), (x, f) => {\n const g = Fun.not(f);\n assert.deepEqual(!g(x), f(x));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58039, "name": "unknown", "code": "it('Check not :: not(not(f(x))) === f(x)', () => {\n fc.assert(fc.property(fc.json(), fc.func(fc.boolean()), (x, f) => {\n const g = Fun.not(Fun.not(f));\n assert.deepEqual(g(x), f(x));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58040, "name": "unknown", "code": "it('Check apply :: apply(constant(a)) === a', () => {\n fc.assert(fc.property(fc.json(), (x) => {\n assert.deepEqual(Fun.apply(Fun.constant(x)), x);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58041, "name": "unknown", "code": "it('Check call :: apply(constant(a)) === undefined', () => {\n fc.assert(fc.property(fc.json(), (x) => {\n let hack: any = null;\n const output = Fun.call(() => {\n hack = x;\n });\n\n assert.isUndefined(output);\n assert.deepEqual(hack, x);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58042, "name": "unknown", "code": "it('Check that values should be empty and errors should be all if we only generate errors', () => {\n fc.assert(fc.property(\n fc.array(arbResultError(fc.integer())),\n (resErrors) => {\n const actual = Results.partition(resErrors);\n if (actual.values.length !== 0) {\n assert.fail('Values length should be 0');\n } else if (resErrors.length !== actual.errors.length) {\n assert.fail('Errors length should be ' + resErrors.length);\n }\n return true;\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58043, "name": "unknown", "code": "it('Check that errors should be empty and values should be all if we only generate values', () => {\n fc.assert(fc.property(\n fc.array(arbResultValue(fc.integer())),\n (resValues) => {\n const actual = Results.partition(resValues);\n if (actual.errors.length !== 0) {\n assert.fail('Errors length should be 0');\n } else if (resValues.length !== actual.values.length) {\n assert.fail('Values length should be ' + resValues.length);\n }\n return true;\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58044, "name": "unknown", "code": "it('Check that the total number of values and errors matches the input size', () => {\n fc.assert(fc.property(\n fc.array(arbResult(fc.integer(), fc.string())),\n (results) => {\n const actual = Results.partition(results);\n assert.equal(actual.errors.length + actual.values.length, results.length);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58045, "name": "unknown", "code": "it('Check that two errors always equal comparison.bothErrors', () => {\n fc.assert(fc.property(\n arbResultError(fc.integer()),\n arbResultError(fc.integer()),\n (r1, r2) => {\n const comparison = Results.compare(r1, r2);\n return comparison.match({\n bothErrors: Fun.always,\n firstError: Fun.never,\n secondError: Fun.never,\n bothValues: Fun.never\n });\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58046, "name": "unknown", "code": "it('Check that error, value always equal comparison.firstError', () => {\n fc.assert(fc.property(\n arbResultError(fc.integer()),\n arbResultValue(fc.string()),\n (r1, r2) => {\n const comparison = Results.compare(r1, r2);\n return comparison.match({\n bothErrors: Fun.never,\n firstError: Fun.always,\n secondError: Fun.never,\n bothValues: Fun.never\n });\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58047, "name": "unknown", "code": "it('Check that value, error always equal comparison.secondError', () => {\n fc.assert(fc.property(\n arbResultValue(fc.integer()),\n arbResultError(fc.string()),\n (r1, r2) => {\n const comparison = Results.compare(r1, r2);\n return comparison.match({\n bothErrors: Fun.never,\n firstError: Fun.never,\n secondError: Fun.always,\n bothValues: Fun.never\n });\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58048, "name": "unknown", "code": "it('Check that value, value always equal comparison.bothValues', () => {\n fc.assert(fc.property(\n arbResultValue(fc.integer()),\n arbResultValue(fc.integer()),\n (r1, r2) => {\n const comparison = Results.compare(r1, r2);\n return comparison.match({\n bothErrors: Fun.never,\n firstError: Fun.never,\n secondError: Fun.never,\n bothValues: Fun.always\n });\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58049, "name": "unknown", "code": "it('Results.unite', () => {\n fc.assert(fc.property(fc.integer(), (a) => {\n assert.equal(Results.unite(Result.error(a)), a);\n assert.equal(Results.unite(Result.value(a)), a);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58050, "name": "unknown", "code": "it('Checking value.is(value.getOrDie()) === true', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), (res) => {\n assert.isTrue(Results.is(res, res.getOrDie()));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58051, "name": "unknown", "code": "it('Checking value.isValue === true', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), (res) => {\n assert.isTrue(res.isValue());\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58052, "name": "unknown", "code": "it('Checking value.isError === false', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), (res) => {\n assert.isFalse(res.isError());\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58053, "name": "unknown", "code": "it('Checking value.getOr(v) === value.value', () => {\n fc.assert(fc.property(fc.integer(), (a) => {\n assert.equal(Result.value(a).getOr(a), a);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58054, "name": "unknown", "code": "it('Checking value.getOrDie() does not throw', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), (res) => {\n res.getOrDie();\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58055, "name": "unknown", "code": "it('Checking value.or(oValue) === value', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), (a, b) => {\n assertResult(Result.value(a).or(Result.value(b)), Result.value(a));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58056, "name": "unknown", "code": "it('Checking error.or(value) === value', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), (a, b) => {\n assertResult(Result.error(a).or(Result.value(b)), Result.value(b));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58057, "name": "unknown", "code": "it('Checking value.orThunk(die) does not throw', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), (res) => {\n res.orThunk(Fun.die('dies'));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58058, "name": "unknown", "code": "it('Checking value.fold(die, id) === value.getOrDie()', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), (res) => {\n const actual = res.getOrDie();\n assert.equal(res.fold(Fun.die('should not get here'), Fun.identity), actual);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58059, "name": "unknown", "code": "it('Checking value.map(f) === f(value.getOrDie())', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), fc.func(fc.json()), (res, f) => {\n assert.equal(f(res.getOrDie()), res.map(f).getOrDie());\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58060, "name": "unknown", "code": "it('Checking value.each(f) === undefined', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), fc.func(fc.json()), (res, f) => {\n const actual = res.each(f);\n assert.isUndefined(actual);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58061, "name": "unknown", "code": "it('Given f :: s -> RV, checking value.bind(f).getOrDie() === f(value.getOrDie()).getOrDie()', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), fc.func(arbResultValue(fc.integer())), (res, f) => {\n assert.equal(f(res.getOrDie()).getOrDie(), res.bind(f).getOrDie());\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58062, "name": "unknown", "code": "it('Given f :: s -> RE, checking value.bind(f).fold(id, die) === f(value.getOrDie()).fold(id, die)', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), fc.func(arbResultError(fc.integer())), (res, f) => {\n const toErrString = (r: Result) => r.fold(Fun.identity, Fun.die('Not a Result.error'));\n assert.equal(toErrString(f(res.getOrDie())), toErrString(res.bind(f)));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58063, "name": "unknown", "code": "it('Checking value.forall is true iff. f(value.getOrDie() === true)', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), fc.func(fc.boolean()), (res, f) => {\n assert.equal(res.forall(f), f(res.getOrDie()));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58064, "name": "unknown", "code": "it('Checking value.exists is true iff. f(value.getOrDie() === true)', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), fc.func(fc.boolean()), (res, f) => {\n assert.equal(res.exists(f), f(res.getOrDie()));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58065, "name": "unknown", "code": "it('Checking value.toOptional is always Optional.some(value.getOrDie())', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), (res) => {\n assert.equal(res.toOptional().getOrDie(), res.getOrDie());\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58066, "name": "unknown", "code": "it('error.is === false', () => {\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n assert.isFalse(Results.is(Result.error(s), i));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58067, "name": "unknown", "code": "it('error.isValue === false', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), (res) => {\n assert.isFalse(res.isValue());\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58068, "name": "unknown", "code": "it('error.isError === true', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), (res) => {\n assert.isTrue(res.isError());\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58069, "name": "unknown", "code": "it('error.getOr(v) === v', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), fc.json(), (res, json) => {\n assert.deepEqual(res.getOr(json), json);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58070, "name": "unknown", "code": "it('error.getOrDie() always throws', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), (res) => {\n assert.throws(() => {\n res.getOrDie();\n });\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58071, "name": "unknown", "code": "it('error.or(oValue) === oValue', () => {\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n assertResult(Result.error(s).or(Result.value(i)), Result.value(i));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58072, "name": "unknown", "code": "it('error.orThunk(_ -> v) === v', () => {\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n assertResult(Result.error(s).orThunk(() => Result.value(i)), Result.value(i));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58073, "name": "unknown", "code": "it('error.fold(_ -> x, die) === x', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), fc.json(), (res, json) => {\n const actual = res.fold(Fun.constant(json), Fun.die('Should not die'));\n assert.deepEqual(actual, json);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58074, "name": "unknown", "code": "it('error.map returns an error', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n assertResult(Result.error(i).map(Fun.die('should not be called')), Result.error(i));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58075, "name": "unknown", "code": "it('error.mapError(f) === f(error)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n const f = (x: number) => x % 3;\n assertResult(Result.error(i).mapError(f), Result.error(f(i)));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58076, "name": "unknown", "code": "it('error.each returns undefined', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), (res) => {\n const actual = res.each(Fun.die('should not be called'));\n assert.isUndefined(actual);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58077, "name": "unknown", "code": "it('Given f :: s -> RV, error.bind(f) === error', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), fc.func(arbResultValue(fc.integer())), (res, f) => {\n const actual = res.bind(f);\n assert.deepEqual(getErrorOrDie(actual), getErrorOrDie(res));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58078, "name": "unknown", "code": "it('Given f :: s -> RE, error.bind(f) === error', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), fc.func(arbResultError(fc.integer())), (res, f) => {\n const actual = res.bind(f);\n assert.deepEqual(getErrorOrDie(actual), getErrorOrDie(res));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58079, "name": "unknown", "code": "it('error.forall === true', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), fc.func(fc.boolean()), (res, f) => {\n assert.isTrue(res.forall(f));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58080, "name": "unknown", "code": "it('error.exists === false', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n assert.isFalse(Result.error(i).exists(Fun.die('should not be called')));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58081, "name": "unknown", "code": "it('error.toOptional is always none', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), (res) => {\n assertNone(res.toOptional());\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58082, "name": "unknown", "code": "it('should not generate identical IDs', () => {\n const arbId = fc.string(1, 30).map(Id.generate);\n fc.assert(fc.property(arbId, arbId, (id1, id2) => id1 !== id2));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/data/IdTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58083, "name": "unknown", "code": "it('pure', () =>\n fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n LazyValue.pure(i).get((v) => {\n eqAsync('LazyValue.pure', i, v, reject);\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/async/LazyValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58084, "name": "unknown", "code": "it('pure, map', () =>\n fc.assert(fc.asyncProperty(fc.integer(), fc.func(fc.string()), (i, f) => new Promise((resolve, reject) => {\n LazyValue.pure(i).map(f).get((v) => {\n eqAsync('LazyValue.map', f(i), v, reject);\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/async/LazyValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58085, "name": "unknown", "code": "it('delayed, map', () =>\n fc.assert(fc.asyncProperty(fc.integer(), fc.func(fc.string()), (i, f) => new Promise((resolve, reject) => {\n LazyValue.nu((c) => {\n setTimeout(() => {\n c(i);\n }, 2);\n }).map(f).get((v) => {\n eqAsync('LazyValue.map', f(i), v, reject);\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/async/LazyValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58086, "name": "unknown", "code": "it('parallel spec', () => fc.assert(fc.asyncProperty(fc.array(fc.integer(), 0, 20), (vals) => new Promise((resolve, reject) => {\n const lazyVals = Arr.map(vals, LazyValue.pure);\n LazyValues.par(lazyVals).get((actual) => {\n eqAsync('pars', vals, actual, reject);\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/async/LazyValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58087, "name": "unknown", "code": "it('pure get', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) =>\n Future.pure(i).get((ii) => {\n eqAsync('pure get', i, ii, reject, tNumber);\n resolve();\n })))))", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/async/FutureTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58088, "name": "unknown", "code": "it('future soon get', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) =>\n Future.nu((cb) => setTimeout(() => cb(i), 3)).get((ii) => {\n eqAsync('get', i, ii, reject, tNumber);\n resolve();\n })))))", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/async/FutureTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58089, "name": "unknown", "code": "it('map', () => fc.assert(fc.asyncProperty(fc.integer(), fc.func(fc.string()), (i, f) => new Promise((resolve, reject) =>\n Future.pure(i).map(f).get((ii) => {\n eqAsync('get', f(i), ii, reject, tString);\n resolve();\n })))))", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/async/FutureTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58090, "name": "unknown", "code": "it('bind', () => fc.assert(fc.asyncProperty(fc.integer(), fc.func(fc.string()), (i, f) => new Promise((resolve, reject) =>\n Future.pure(i).bind(Fun.compose(Future.pure, f)).get((ii) => {\n eqAsync('get', f(i), ii, reject, tString);\n resolve();\n })))))", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/async/FutureTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58091, "name": "unknown", "code": "it('anonBind', () => fc.assert(fc.asyncProperty(fc.integer(), fc.string(), (i, s) => new Promise((resolve, reject) =>\n Future.pure(i).anonBind(Future.pure(s)).get((ii) => {\n eqAsync('get', s, ii, reject, tString);\n resolve();\n })))))", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/async/FutureTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58092, "name": "unknown", "code": "it('parallel spec', () => fc.assert(fc.asyncProperty(fc.array(fc.tuple(fc.integer(1, 10), fc.integer())), (tuples) => new Promise((resolve, reject) =>\n Futures.par(Arr.map(tuples, ([ timeout, value ]) => Future.nu((cb) => setTimeout(() => cb(value), timeout)))).get((ii) => {\n eqAsync('pars', tuples.map(([ _, i ]) => i), ii, reject, tArray(tNumber));\n resolve();\n }))))\n )", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/async/FutureTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58093, "name": "unknown", "code": "it('mapM spec', () =>\n fc.assert(fc.asyncProperty(fc.array(fc.tuple(fc.integer(1, 10), fc.integer())), (tuples) => new Promise((resolve, reject) =>\n Futures.mapM(tuples, ([ timeout, value ]) => Future.nu((cb) => setTimeout(() => cb(value), timeout))).get((ii) => {\n eqAsync('pars', tuples.map(([ _, i ]) => i), ii, reject, tArray(tNumber));\n resolve();\n }))))\n )", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/async/FutureTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58094, "name": "unknown", "code": "it('nu', () => fc.assert(fc.asyncProperty(arbResult(fc.integer(), fc.integer()), (r) => new Promise((resolve, reject) => {\n FutureResult.nu((completer) => {\n completer(r);\n }).get((ii) => {\n eqAsync('eq', r, ii, reject, tResult());\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58095, "name": "unknown", "code": "it('fromFuture', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.fromFuture(Future.pure(i)).get((ii) => {\n eqAsync('eq', Result.value(i), ii, reject, tResult());\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58096, "name": "unknown", "code": "it('wrap get', () => fc.assert(fc.asyncProperty(arbResult(fc.integer(), fc.integer()), (r) => new Promise((resolve, reject) => {\n FutureResult.wrap(Future.pure(r)).get((ii) => {\n eqAsync('eq', r, ii, reject, tResult());\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58097, "name": "unknown", "code": "it('fromResult get', () => fc.assert(fc.asyncProperty(arbResult(fc.integer(), fc.integer()), (r) => new Promise((resolve, reject) => {\n FutureResult.fromResult(r).get((ii) => {\n eqAsync('eq', r, ii, reject, tResult());\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58098, "name": "unknown", "code": "it('pure get', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.pure(i).get((ii) => {\n eqAsync('eq', Result.value(i), ii, reject, tResult());\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58099, "name": "unknown", "code": "it('value get', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.value(i).get((ii) => {\n eqAsync('eq', Result.value(i), ii, reject, tResult());\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58100, "name": "unknown", "code": "it('error get', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.error(i).get((ii) => {\n eqAsync('eq', Result.error(i), ii, reject, tResult());\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58101, "name": "unknown", "code": "it('value mapResult', () => {\n const f = (x: number) => x + 3;\n return fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.value(i).mapResult(f).get((ii) => {\n eqAsync('eq', Result.value(f(i)), ii, reject, tResult());\n resolve();\n });\n })));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58102, "name": "unknown", "code": "it('error mapResult', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.error(i).mapResult(Fun.die('should not be called')).get((ii) => {\n eqAsync('eq', Result.error(i), ii, reject, tResult());\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58103, "name": "unknown", "code": "it('value mapError', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.value(i).mapError(Fun.die('should not be called')).get((ii) => {\n eqAsync('eq', Result.value(i), ii, reject, tResult());\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58104, "name": "unknown", "code": "it('err mapError', () => {\n const f = (x: number) => x + 3;\n return fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.error(i).mapError(f).get((ii) => {\n eqAsync('eq', Result.error(f(i)), ii, reject, tResult());\n resolve();\n });\n })));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58105, "name": "unknown", "code": "it('value bindFuture value', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n const f = (x: number) => x % 4;\n FutureResult.value(i).bindFuture((x) => FutureResult.value(f(x))).get((actual) => {\n eqAsync('bind result', Result.value(f(i)), actual, reject, tResult(tNumber));\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58106, "name": "unknown", "code": "it('bindFuture: value bindFuture error', () => fc.assert(fc.asyncProperty(fc.integer(), fc.string(), (i, s) => new Promise((resolve, reject) => {\n FutureResult.value(i).bindFuture(() => FutureResult.error(s)).get((actual) => {\n eqAsync('bind result', Result.error(s), actual, reject, tResult(tNumber));\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58107, "name": "unknown", "code": "it('error bindFuture', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.error(i).bindFuture(Fun.die('should not be called')).get((actual) => {\n eqAsync('bind result', Result.error(i), actual, reject, tResult(tNumber));\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58108, "name": "unknown", "code": "it('returns matching keys and values', () => {\n fc.assert(fc.property(\n fc.array(fc.asciiString(1, 30)),\n (rawValues: string[]) => {\n const values = Unique.stringArray(rawValues);\n\n const keys = Arr.map(values, (v, i) => i);\n\n const output = Zip.zipToObject(keys, values);\n\n const oKeys = Obj.keys(output);\n assert.deepEqual(values.length, oKeys.length);\n\n assert.deepEqual(Arr.forall(oKeys, (oKey) => {\n const index = parseInt(oKey, 10);\n const expected = values[index];\n return output[oKey] === expected;\n }), true);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/ZipTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58109, "name": "unknown", "code": "it('matches corresponding tuples', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.array(fc.integer()),\n (keys, values) => {\n if (keys.length !== values.length) {\n assert.throws(() => Zip.zipToTuples(keys, values));\n } else {\n const output = Zip.zipToTuples(keys, values);\n assert.equal(output.length, keys.length);\n assert.isTrue(Arr.forall(output, (x, i) => x.k === keys[i] && x.v === values[i]));\n }\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/ZipTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58110, "name": "unknown", "code": "it('Reversing twice is identity', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n assert.deepEqual(Arr.reverse(Arr.reverse(arr)), arr);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/ReverseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58111, "name": "unknown", "code": "it('reversing a one element array is identity', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (a) => {\n assert.deepEqual(Arr.reverse([ a ]), [ a ]);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/ReverseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58112, "name": "unknown", "code": "it('reverses 2 elements', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), (a, b) => {\n assert.deepEqual(Arr.reverse([ a, b ]), [ b, a ]);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/ReverseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58115, "name": "unknown", "code": "it('Check that if the filter always returns false, then everything is in \"fail\"', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n (arr) => {\n const output = Arr.partition(arr, Fun.never);\n assert.deepEqual(output.pass.length, 0);\n assert.deepEqual(output.fail, arr);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/PartitionTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58116, "name": "unknown", "code": "it('Check that if the filter always returns true, then everything is in \"pass\"', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n (arr) => {\n const output = Arr.partition(arr, Fun.always);\n assert.deepEqual(output.fail.length, 0);\n assert.deepEqual(output.pass, arr);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/PartitionTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58117, "name": "unknown", "code": "it('Check that everything in fail fails predicate and everything in pass passes predicate', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n (arr) => {\n const predicate = (x: number) => x % 3 === 0;\n const output = Arr.partition(arr, predicate);\n return Arr.forall(output.fail, (x) => !predicate(x)) && Arr.forall(output.pass, predicate);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/PartitionTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58118, "name": "unknown", "code": "it('inductive case', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(1, 30), fc.integer()),\n fc.asciiString(1, 30),\n fc.integer(),\n (obj, k, v) => {\n const objWithoutK = Obj.filter(obj, (x, i) => i !== k);\n assert.deepEqual(Obj.size({ [k]: v, ...objWithoutK }), Obj.size(objWithoutK) + 1);\n }), {\n numRuns: 5000\n });\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/ObjSizeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58119, "name": "unknown", "code": "it('only returns elements that are in the input', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.integer()), (obj) => {\n const keys = Obj.keys(obj);\n return Arr.forall(keys, (k) => obj.hasOwnProperty(k));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/ObjKeysTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58120, "name": "unknown", "code": "it('filter const true is identity', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.integer()), (obj) => {\n assert.deepEqual(Obj.filter(obj, Fun.always), obj);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/ObjFilterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58121, "name": "unknown", "code": "it('Length of interspersed = len(arr) + len(arr)-1', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.integer(),\n (arr, delimiter) => {\n const actual = Jam.intersperse(arr, delimiter);\n const expected = arr.length === 0 ? 0 : arr.length * 2 - 1;\n assert.deepEqual(actual.length, expected);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/IntersperseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58122, "name": "unknown", "code": "it('Every odd element matches delimiter', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.integer(),\n (arr, delimiter) => {\n const actual = Jam.intersperse(arr, delimiter);\n return Arr.forall(actual, (x, i) => i % 2 === 1 ? x === delimiter : true);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/IntersperseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58123, "name": "unknown", "code": "it('Filtering out delimiters (assuming different type to array to avoid removing original array) should equal original', () => {\n fc.assert(fc.property(\n fc.array(fc.nat()),\n arbNegativeInteger(),\n (arr, delimiter) => {\n const actual = Jam.intersperse(arr, delimiter);\n const filtered = Arr.filter(actual, (a) => a !== delimiter);\n assert.deepEqual(filtered, arr);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/IntersperseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58124, "name": "unknown", "code": "it('finds element in middle of array', () => {\n fc.assert(fc.property(fc.array(fc.nat()), arbNegativeInteger(), fc.array(fc.nat()), (prefix, element, suffix) => {\n const arr = prefix.concat([ element ]).concat(suffix);\n assertSome(Arr.indexOf(arr, element), prefix.length);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/IndexOfTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58125, "name": "unknown", "code": "it('Adjacent groups have different hashes, and everything in a group has the same hash', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.func(fc.asciiString()),\n (xs, f) => {\n const groups = Arr.groupBy(xs, (x) => f(x));\n\n /* Properties about groups\n * 1. No two adjacent groups can have the same g(..) value\n * 2. Each group must have the same g(..) value\n */\n\n const hasEmptyGroups = Arr.exists(groups, (g) => g.length === 0);\n\n if (hasEmptyGroups) {\n assert.fail('Should not have empty groups');\n }\n // No consecutive groups should have the same result of g.\n const values = Arr.map(groups, (group) => {\n const first = f(group[0]);\n const mapped = Arr.map(group, (g) => f(g));\n\n const isSame = Arr.forall(mapped, (m) => m === first);\n if (!isSame) {\n assert.fail('Not everything in a group has the same g(..) value');\n }\n return first;\n });\n\n const hasSameGroup = Arr.exists(values, (v, i) => i > 0 ? values[i - 1] === values[i] : false);\n\n if (hasSameGroup) {\n assert.fail('A group is next to another group with the same g(..) value');\n }\n return true;\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/GroupByTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58126, "name": "unknown", "code": "it('Flattening groups equals the original array', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.func(fc.string()),\n (xs, f) => {\n const groups = Arr.groupBy(xs, (x) => f(x));\n\n const output = Arr.flatten(groups);\n assert.deepEqual(output, xs);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/GroupByTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58127, "name": "unknown", "code": "it('forall of a non-empty array with a predicate that always returns false is false', () => {\n fc.assert(fc.property(\n fc.array(fc.integer(), 1, 30),\n (xs) => {\n assert.isFalse(Arr.forall(xs, Fun.never));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/ForallTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58128, "name": "unknown", "code": "it('forall of a non-empty array with a predicate that always returns true is true', () => {\n fc.assert(fc.property(\n fc.array(fc.integer(), 1, 30),\n (xs) => {\n assert.isTrue(Arr.forall(xs, Fun.always));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/ForallTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58129, "name": "unknown", "code": "it('foldl concat [ ] xs === reverse(xs)', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n (arr) => {\n const output = Arr.foldl(arr, (b: number[], a: number) => [ a ].concat(b), []);\n assert.deepEqual(output, Arr.reverse(arr));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/FoldTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58130, "name": "unknown", "code": "it('foldr concat [ ] xs === xs', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n (arr) => {\n const output = Arr.foldr(arr, (b: number[], a: number) => [ a ].concat(b), []);\n assert.deepEqual(output, arr);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/FoldTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58131, "name": "unknown", "code": "it('foldr concat ys xs === xs ++ ys', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.array(fc.integer()),\n (xs, ys) => {\n const output = Arr.foldr(xs, (b, a) => [ a ].concat(b), ys);\n assert.deepEqual(output, xs.concat(ys));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/FoldTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58132, "name": "unknown", "code": "it('foldl concat ys xs === reverse(xs) ++ ys', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.array(fc.integer()),\n (xs, ys) => {\n const output = Arr.foldl(xs, (b, a) => [ a ].concat(b), ys);\n assert.deepEqual(output, Arr.reverse(xs).concat(ys));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/FoldTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58133, "name": "unknown", "code": "it('is consistent with chunking', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.integer(1, 5),\n (arr, chunkSize) => {\n const chunks = Arr.chunk(arr, chunkSize);\n const bound = Arr.flatten(chunks);\n assert.deepEqual(bound, arr);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/FlattenTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58134, "name": "unknown", "code": "it('wrap then flatten array is identity', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n assert.deepEqual(arr, Arr.flatten(Arr.pure(arr)));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/FlattenTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58135, "name": "unknown", "code": "it('mapping pure then flattening array is identity', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n assert.deepEqual(arr, Arr.flatten(Arr.map(arr, Arr.pure)));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/FlattenTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58136, "name": "unknown", "code": "it('flattening two lists === concat', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.array(fc.integer()), (xs, ys) => {\n assert.deepEqual(xs.concat(ys), Arr.flatten([ xs, ys ]));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/FlattenTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58137, "name": "unknown", "code": "describe('finds element in middle of array', () => {\n fc.assert(fc.property(fc.array(fc.nat()), arbNegativeInteger(), fc.array(fc.nat()), (prefix, element, suffix) => {\n const arr = [ ...prefix, element, ...suffix ];\n assertSome(\n Arr.findIndex(arr, (x) => x === element),\n prefix.length\n );\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/FindIndexTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58138, "name": "unknown", "code": "it('finds elements that pass the predicate', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n const pred = (x: number) => x % 3 === 0;\n assert.isTrue(Arr.findIndex(arr, pred).forall((x) => pred(arr[x])));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/FindIndexTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58139, "name": "unknown", "code": "it('returns none if predicate always returns false', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n assertNone(Arr.findIndex(arr, Fun.never));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/FindIndexTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58140, "name": "unknown", "code": "it('is consistent with find', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n const pred = (x: number) => x % 5 === 0;\n assertOptional(Arr.findIndex(arr, pred).map((x) => arr[x]), Arr.find(arr, pred));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/FindIndexTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58141, "name": "unknown", "code": "it('is consistent with exists', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n const pred = (x: number) => x % 6 === 0;\n assert.equal(Arr.findIndex(arr, pred).isSome(), Arr.exists(arr, pred));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/FindIndexTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58142, "name": "unknown", "code": "it('Element exists in middle of array', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), fc.array(fc.integer()), (prefix, element, suffix) => {\n const arr2 = Arr.flatten([ prefix, [ element ], suffix ]);\n assert.isTrue(Arr.exists(arr2, eqc(element)));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/ExistsTest.ts", "start_line": null, "end_line": null, "dependencies": ["eqc"], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58143, "name": "unknown", "code": "it('Element exists in singleton array of itself', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (i) => {\n assert.isTrue(Arr.exists([ i ], eqc(i)));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/ExistsTest.ts", "start_line": null, "end_line": null, "dependencies": ["eqc"], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58144, "name": "unknown", "code": "it('Element does not exist in empty array', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (i) => {\n assert.isFalse(Arr.exists([], eqc(i)));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/ExistsTest.ts", "start_line": null, "end_line": null, "dependencies": ["eqc"], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58145, "name": "unknown", "code": "it('Element not found when predicate always returns false', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => !Arr.exists(arr, never)));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/ExistsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58146, "name": "unknown", "code": "it('Element exists in non-empty array when predicate always returns true', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), (xs, x) => {\n const arr = Arr.flatten([ xs, [ x ]]);\n assert.isTrue(Arr.exists(arr, always));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/ExistsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58162, "name": "unknown", "code": "it('binding an array of empty arrays with identity equals an empty array', () => {\n fc.assert(fc.property(fc.array(fc.constant([])), (arr) => {\n assert.deepEqual(Arr.bind(arr, Fun.identity), []);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/ArrBindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Binding an array of empty arrays with the identity function results in an empty array.", "mode": "fast-check"} {"id": 58163, "name": "unknown", "code": "it('bind (pure .) is map', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), (arr, j) => {\n const f = (x: number) => x + j;\n assert.deepEqual(Arr.bind(arr, Fun.compose(Arr.pure, f)), Arr.map(arr, f));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/ArrBindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Applying `bind` with `pure` composed is equivalent to `map`.", "mode": "fast-check"} {"id": 58165, "name": "unknown", "code": "it('obeys right identity law', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n assert.deepEqual(Arr.bind(arr, Arr.pure), arr);\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/ArrBindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.bind` followed by `Arr.pure` returns the original array, demonstrating the right identity law.", "mode": "fast-check"} {"id": 58167, "name": "unknown", "code": "it('never turns Just to Nothing (or vice versa)', () => {\n const mapper = Maybes.map(Fun.identity);\n\n const nothing = mapper(Maybes.nothing());\n assert.isTrue(Maybes.isNothing(nothing));\n\n fc.assert(fc.property(fc.anything(), (thing) => {\n const just = mapper(Maybes.just(thing));\n assert.isTrue(Maybes.isJust(just));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/maybe/FunctorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58168, "name": "unknown", "code": "it('executorLzReceiveOption', async () => {\n // sanity check that generated options are the same with value as 0 and not provided.\n expect(Options.newOptions().addExecutorLzReceiveOption(1, 0)).toEqual(\n Options.newOptions().addExecutorLzReceiveOption(1)\n )\n await fc.assert(\n fc.asyncProperty(\n omnicounterIncrementTypeArbitrary,\n gasLimitArbitrary,\n nativeDropArbitrary,\n\n // Test the generation and submission of arbitrary LZ_RECEIVE Options. The transaction should succeed,\n // and the options from the transaction receipt logs should match the generated input.\n async (type, gasLimit, nativeDrop) => {\n const options = Options.newOptions().addExecutorLzReceiveOption(gasLimit, nativeDrop)\n const packetSentEvents = await incrementAndReturnLogs(type, options)\n expect(packetSentEvents).toEqual([\n expect.objectContaining({\n args: expect.objectContaining({\n options: expect.toEqualCaseInsensitive(options.toHex()),\n }),\n }),\n ])\n const rawPacketOptions = packetSentEvents[0]!.args.options\n expect(rawPacketOptions).toEqualCaseInsensitive(options.toHex())\n\n // test decoding\n const packetOptions = Options.fromOptions(rawPacketOptions)\n const decodedExecutorLzReceiveOption = packetOptions.decodeExecutorLzReceiveOption()\n expect(decodedExecutorLzReceiveOption).toEqual({\n gas: gasLimit,\n value: nativeDrop,\n })\n expect(packetOptions.decodeExecutorNativeDropOption()).toEqual([])\n expect(packetOptions.decodeExecutorComposeOption()).toEqual([])\n expect(packetOptions.decodeExecutorOrderedExecutionOption()).toEqual(false)\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/tests/ua-devtools-evm-hardhat-test/test/omnicounter/options.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58169, "name": "unknown", "code": "it('executorComposeOption', async () => {\n await fc.assert(\n fc.asyncProperty(\n omnicounterIncrementTypeArbitrary,\n composedIndexArbitrary,\n gasLimitArbitrary,\n nativeDropArbitrary,\n\n // Test the generation and submission of arbitrary COMPOSE Options. The transaction should succeed, and\n // the options from the transaction receipt logs should match the generated input.\n async (type, index, gasLimit, nativeDrop) => {\n const options = Options.newOptions()\n .addExecutorComposeOption(index, gasLimit, nativeDrop)\n // We also need to add a lzReceive option to avoid Executor_ZeroLzReceiveGasProvided error\n .addExecutorLzReceiveOption(MIN_GAS_LIMIT)\n const packetSentEvents = await incrementAndReturnLogs(type, options)\n expect(packetSentEvents).toEqual([\n expect.objectContaining({\n args: expect.objectContaining({\n options: expect.toEqualCaseInsensitive(options.toHex()),\n }),\n }),\n ])\n const rawPacketOptions = packetSentEvents[0]!.args.options\n expect(rawPacketOptions).toEqualCaseInsensitive(options.toHex())\n\n // test decoding\n const packetOptions = Options.fromOptions(rawPacketOptions)\n const decodedExecutorComposeOptions = packetOptions.decodeExecutorComposeOption()\n expect(decodedExecutorComposeOptions).toEqual([\n {\n index,\n gas: gasLimit,\n value: nativeDrop,\n },\n ])\n expect(packetOptions.decodeExecutorLzReceiveOption()).toEqual({\n gas: MIN_GAS_LIMIT,\n value: BigInt(0),\n })\n expect(packetOptions.decodeExecutorNativeDropOption()).toEqual([])\n expect(packetOptions.decodeExecutorOrderedExecutionOption()).toEqual(false)\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/tests/ua-devtools-evm-hardhat-test/test/omnicounter/options.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58170, "name": "unknown", "code": "it('executorLzNativeDrop', async () => {\n const address = await ethSigner.signer.getAddress()\n await fc.assert(\n fc.asyncProperty(\n omnicounterIncrementTypeArbitrary,\n nativeDropArbitrary,\n\n // Test the generation and submission of arbitrary NATIVE_DROP Options. The transaction should succeed,\n // and the options from the transaction receipt logs should match the generated input.\n async (type, nativeDrop) => {\n const options = Options.newOptions()\n .addExecutorNativeDropOption(nativeDrop, address)\n // We also need to add a lzReceive option to avoid Executor_ZeroLzReceiveGasProvided error\n .addExecutorLzReceiveOption(MIN_GAS_LIMIT)\n const packetSentEvents = await incrementAndReturnLogs(type, options)\n expect(packetSentEvents).toEqual([\n expect.objectContaining({\n args: expect.objectContaining({\n options: expect.toEqualCaseInsensitive(options.toHex()),\n }),\n }),\n ])\n const rawPacketOptions = packetSentEvents[0]!.args.options\n expect(rawPacketOptions).toEqualCaseInsensitive(options.toHex())\n\n // test decoding\n const packetOptions = Options.fromOptions(rawPacketOptions)\n const decodedExecutorNativeDropOptions = packetOptions.decodeExecutorNativeDropOption()\n expect(decodedExecutorNativeDropOptions).toEqual([\n {\n amount: nativeDrop,\n receiver: expect.toEqualCaseInsensitive(makeBytes32(address)),\n },\n ])\n expect(packetOptions.decodeExecutorLzReceiveOption()).toEqual({\n gas: MIN_GAS_LIMIT,\n value: BigInt(0),\n })\n expect(packetOptions.decodeExecutorComposeOption()).toEqual([])\n expect(packetOptions.decodeExecutorOrderedExecutionOption()).toEqual(false)\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/tests/ua-devtools-evm-hardhat-test/test/omnicounter/options.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58171, "name": "unknown", "code": "it('executorOrderedExecutionOption', async () => {\n await fc.assert(\n fc.asyncProperty(\n omnicounterIncrementTypeArbitrary,\n\n // Test the generation and submission of arbitrary ORDERED Options. The transaction should succeed, and the\n // options from the transaction receipt logs should match the generated input.\n async (type) => {\n const options = Options.newOptions()\n .addExecutorOrderedExecutionOption()\n // We also need to add a lzReceive option to avoid Executor_ZeroLzReceiveGasProvided error\n .addExecutorLzReceiveOption(MIN_GAS_LIMIT)\n const packetSentEvents = await incrementAndReturnLogs(type, options)\n expect(packetSentEvents).toHaveLength(1)\n const rawPacketOptions = packetSentEvents[0]!.args.options.toLowerCase()\n expect(rawPacketOptions).toBe(options.toHex().toLowerCase())\n\n // test decoding\n const packetOptions = Options.fromOptions(rawPacketOptions)\n expect(packetOptions.decodeExecutorOrderedExecutionOption()).toBe(true)\n expect(packetOptions.decodeExecutorLzReceiveOption()).toEqual({\n gas: MIN_GAS_LIMIT,\n value: BigInt(0),\n })\n expect(packetOptions.decodeExecutorComposeOption()).toEqual([])\n expect(packetOptions.decodeExecutorNativeDropOption()).toEqual([])\n }\n ),\n { numRuns: 10 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/tests/ua-devtools-evm-hardhat-test/test/omnicounter/options.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58172, "name": "unknown", "code": "it('stacked options', async () => {\n // custom gasLimit arbitrary so \"stacked\" compose options won't have a gasLimit sum that overflows MAX_UINT_128\n const stackedGasLimitArbitrary: fc.Arbitrary = fc.bigInt({\n min: MIN_GAS_LIMIT,\n max: BigInt('0xFFFFFFFFFFFFFFFF'),\n })\n\n // custom nativeDrop arbitrary so \"stacked\" compose options won't have a nativeDrop sum that exceeds DEFAULT_MAX_NATIVE_DROP\n const stackedValueArbitrary: fc.Arbitrary = fc.bigInt({\n min: DEFAULT_MIN_NATIVE_DROP,\n max: DEFAULT_MAX_NATIVE_DROP / BigInt(4),\n })\n\n const address = await ethSigner.signer.getAddress()\n await fc.assert(\n fc.asyncProperty(\n omnicounterIncrementTypeArbitrary,\n composedIndexArbitrary,\n stackedGasLimitArbitrary,\n stackedValueArbitrary,\n\n // Test the generation of multiple Options in a single Packet. The transaction should succeed. Options\n // should be decoded to match inputs. gasLimit and nativeDrop should be summed for Packets that have\n // multiple COMPOSE options for the same index.\n async (type, index, gasLimit, stackedValue) => {\n const options = Options.newOptions()\n .addExecutorComposeOption(index, gasLimit, stackedValue)\n .addExecutorLzReceiveOption(gasLimit, stackedValue)\n .addExecutorNativeDropOption(stackedValue, address)\n .addExecutorComposeOption(index, gasLimit, stackedValue) // Repeat executor compose option to make sure values/gasLimits are summed\n\n const packetSentEvents = await incrementAndReturnLogs(type, options)\n expect(packetSentEvents).toEqual([\n expect.objectContaining({\n args: expect.objectContaining({\n options: expect.toEqualCaseInsensitive(options.toHex()),\n }),\n }),\n ])\n const packetOptions = Options.fromOptions(packetSentEvents[0]!.args.options)\n\n // check executorComposeOption\n const packetComposeOptions = packetOptions.decodeExecutorComposeOption()\n expect(packetComposeOptions).toEqual([\n {\n index,\n gas: gasLimit * BigInt(2),\n // compose options with same index are summed (in this specific case, just multiplied by 2)\n value: stackedValue * BigInt(2),\n },\n ])\n\n // check executorLzReceiveOption\n const packetLzReceiveOption = packetOptions.decodeExecutorLzReceiveOption()\n expect(packetLzReceiveOption).toEqual({\n gas: gasLimit,\n value: stackedValue,\n })\n\n // check executorNativeDropOption\n const packetNativeDropOptions = packetOptions.decodeExecutorNativeDropOption()\n expect(packetNativeDropOptions).toEqual([\n {\n amount: stackedValue,\n receiver: expect.toEqualCaseInsensitive(makeBytes32(address)),\n },\n ])\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/tests/ua-devtools-evm-hardhat-test/test/omnicounter/options.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58173, "name": "unknown", "code": "it('child no arg event', async () => {\n const receipt = await (await child.emitNoArgEvent()).wait()\n expect(parseLogs(receipt, parent)).toMatchSnapshot()\n expect(parseLogsWithName(receipt, parent, 'NoArgEvent')).toEqual([]) // only the child should emit the event\n expect(parseLogsWithName(receipt, child, 'NoArgEvent')).toHaveLength(1)\n expect(parseLogsWithName(receipt, parallel, 'NoArgEvent')).toEqual([]) // parallel logs should be empty\n\n fc.assert(\n fc.property(fc.string(), (name) => {\n fc.pre(name !== 'NoArgEvent')\n expect(parseLogsWithName(receipt, parent, name)).toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/tests/devtools-evm-test/test/events/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58174, "name": "unknown", "code": "it('not parse an event with one arg from a different contract', async () => {\n await fc.assert(\n fc.asyncProperty(fc.integer({ min: 0 }), async (arg) => {\n const receipt = await (await child.emitOneArgEvent(arg)).wait()\n expect(parseLogsWithName(receipt, parent, 'OneArgEvent')).toEqual([])\n }),\n { numRuns: 10 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/tests/devtools-evm-test/test/events/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58175, "name": "unknown", "code": "it('not parse an event with one arg with unknown name', async () => {\n await fc.assert(\n fc.asyncProperty(fc.integer({ min: 0 }), fc.string(), async (arg, name) => {\n fc.pre(name !== 'OneArgEvent')\n\n const receipt = await (await child.emitOneArgEvent(arg)).wait()\n expect(parseLogsWithName(receipt, parent, name)).toEqual([])\n }),\n { numRuns: 10 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/tests/devtools-evm-test/test/events/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58176, "name": "unknown", "code": "it('not parse an event with many args from a different contract', async () => {\n const eventNameArbitrary = fc.constantFrom('NoArgEvent', 'OneArgEvent', 'FourArgEvent')\n\n await fc.assert(\n fc.asyncProperty(fc.integer({ min: 0, max: 10 }), eventNameArbitrary, async (count, name) => {\n const receipt = await (await child.emitMany(count)).wait()\n\n expect(parseLogsWithName(receipt, child, name)).toHaveLength(count)\n expect(parseLogsWithName(receipt, parent, name)).toEqual([])\n }),\n { numRuns: 10 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/tests/devtools-evm-test/test/events/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58177, "name": "unknown", "code": "it('not parse an event with many args with unknown name from a different contract', async () => {\n await fc.assert(\n fc.asyncProperty(fc.integer({ min: 0, max: 10 }), fc.string(), async (count, name) => {\n fc.pre(name !== 'NoArgEvent')\n fc.pre(name !== 'OneArgEvent')\n fc.pre(name !== 'FourArgEvent')\n\n const receipt = await (await child.emitMany(count)).wait()\n\n expect(parseLogsWithName(receipt, parent, name)).toEqual([])\n }),\n { numRuns: 10 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/tests/devtools-evm-test/test/events/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58183, "name": "unknown", "code": "it('should pass an error through if it already is a ContractError', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, async (eid) => {\n const errorParser = await createContractErrorParser({ contract, eid })\n const error = new RevertError('A reason is worth a million bytes')\n const parsedError = await errorParser(error)\n\n expect(parsedError).toBe(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/tests/devtools-evm-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58184, "name": "unknown", "code": "it('should parse assert/panic', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, async (eid) => {\n const errorParser = await createContractErrorParser({ contract, eid })\n const error = await assertFailed(contract.throwWithAssert())\n const parsedError = await errorParser(error)\n\n expect(parsedError).toEqual(new PanicError(BigInt(1)))\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/tests/devtools-evm-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58185, "name": "unknown", "code": "it('should parse assert/panic with code', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, async (eid) => {\n const errorParser = await createContractErrorParser({ contract, eid })\n const error = await assertFailed(contract.throwWithAssertWithCode())\n const parsedError = await errorParser(error)\n\n expect(parsedError).toEqual(new PanicError(BigInt(18)))\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/tests/devtools-evm-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58186, "name": "unknown", "code": "it('should parse revert with arguments', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, async (eid) => {\n const errorParser = await createContractErrorParser({ contract, eid })\n const error = await assertFailed(contract.throwWithRevertAndArgument('my bad'))\n const parsedError = await errorParser(error)\n\n expect(parsedError).toEqual(new RevertError('my bad'))\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/tests/devtools-evm-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58187, "name": "unknown", "code": "it('should parse require with an argument', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, async (eid) => {\n const errorParser = await createContractErrorParser({ contract, eid })\n const error = await assertFailed(contract.throwWithRequireAndArgument('my bad'))\n const parsedError = await errorParser(error)\n\n expect(parsedError).toEqual(new RevertError('my bad'))\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/tests/devtools-evm-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58188, "name": "unknown", "code": "it('should parse require with a custom error with no arguments', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, async (eid) => {\n const errorParser = await createContractErrorParser({ contract, eid })\n const error = await assertFailed(contract.throwWithCustomErrorAndNoArguments())\n const parsedError = await errorParser(error)\n\n expect(parsedError).toEqual(new CustomError('CustomErrorWithNoArguments', []))\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/tests/devtools-evm-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58189, "name": "unknown", "code": "it('should parse require with a custom error with an argument', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, fc.string(), async (eid, arg) => {\n const errorParser = await createContractErrorParser({ contract, eid })\n const error = await assertFailed(contract.throwWithCustomErrorAndArgument(arg))\n const parsedError = await errorParser(error)\n\n expect(parsedError).toEqual(new CustomError('CustomErrorWithAnArgument', [arg]))\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/tests/devtools-evm-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58208, "name": "unknown", "code": "it('should return true if peers() returns a matching bytes32', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n evmEndpointArbitrary,\n evmAddressArbitrary,\n async (omniContract, peerEid, peer) => {\n omniContract.contract.peers.mockResolvedValue(makeBytes32(peer))\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.hasPeer(peerEid, peer)).resolves.toBe(true)\n await expect(sdk.hasPeer(peerEid, makeBytes32(peer))).resolves.toBe(true)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`OApp.hasPeer` returns true if the `peers()` function from the `omniContract` returns a `bytes32` that matches the given peer.", "mode": "fast-check"} {"id": 58209, "name": "unknown", "code": "it('should return true if peers returns a zero address', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n solanaEndpointArbitrary,\n nullishAddressArbitrary,\n async (omniContract, peerEid, peer) => {\n omniContract.contract.peers.mockResolvedValue(peer)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.hasPeer(peerEid, undefined)).resolves.toBe(true)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test verifies that if `peers` returns a zero address, the `hasPeer` function resolves to true.", "mode": "fast-check"} {"id": 58211, "name": "unknown", "code": "it('should return true if peers() returns a matching value', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n solanaEndpointArbitrary,\n solanaAddressArbitrary,\n async (omniContract, peerEid, peer) => {\n const peerHex = makeBytes32(normalizePeer(peer, peerEid))\n\n omniContract.contract.peers.mockResolvedValue(peerHex)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.hasPeer(peerEid, peer)).resolves.toBe(true)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`OApp.hasPeer` returns true when `peers()` of the contract resolves with a value matching the normalized peer data.", "mode": "fast-check"} {"id": 58212, "name": "unknown", "code": "it('should return true if peers returns a zero address', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n aptosEndpointArbitrary,\n nullishAddressArbitrary,\n nullishAddressArbitrary,\n async (omniContract, peerEid, peer, probePeer) => {\n omniContract.contract.peers.mockResolvedValue(peer)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.hasPeer(peerEid, probePeer)).resolves.toBe(true)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that `hasPeer` returns true when `peers` resolves to a zero address.", "mode": "fast-check"} {"id": 58213, "name": "unknown", "code": "it('should return false if peers returns a non-zero address', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n aptosEndpointArbitrary,\n nullishAddressArbitrary,\n aptosAddressArbitrary,\n async (omniContract, peerEid, peer, probePeer) => {\n fc.pre(!isZero(probePeer))\n\n omniContract.contract.peers.mockResolvedValue(peer)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.hasPeer(peerEid, probePeer)).resolves.toBe(false)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that `sdk.hasPeer(peerEid, probePeer)` resolves to `false` when `probePeer` is a non-zero address and the `peers` method is mocked to return a non-zero address.", "mode": "fast-check"} {"id": 58223, "name": "unknown", "code": "it('should return an EndpointV2 if the call to endpoint() resolves with a non-zeroish address', async () => {\n await fc.assert(\n fc.asyncProperty(omniContractArbitrary, evmAddressArbitrary, async (omniContract, endpointAddress) => {\n fc.pre(!isZero(endpointAddress))\n\n omniContract.contract.endpoint.mockResolvedValue(endpointAddress)\n\n const sdk = new OApp(omniContract)\n const endpoint = await sdk.getEndpointSDK()\n\n expect(endpoint).toBeInstanceOf(EndpointV2)\n expect(endpoint.point).toEqual({ eid: sdk.point.eid, address: endpointAddress })\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Returning an `EndpointV2` occurs when the `endpoint()` function resolves with a non-zero address, verifying the correctness of `getEndpointSDK` in handling such cases.", "mode": "fast-check"} {"id": 58224, "name": "unknown", "code": "it('should return the contract name', async () => {\n await fc.assert(\n fc.asyncProperty(omniContractArbitrary, fc.string(), async (omniContract, name) => {\n omniContract.contract.name.mockResolvedValue(name)\n\n const sdk = new ERC20(omniContract)\n\n await expect(sdk.getName()).resolves.toBe(name)\n\n expect(omniContract.contract.name).toHaveBeenCalledTimes(1)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools-evm/test/erc20/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `getName` method of the `ERC20` instance should return the contract name resolved by the mocked `name` method of the `omniContract`.", "mode": "fast-check"} {"id": 58239, "name": "unknown", "code": "it('should return false if the confirmations are different', async () => {\n await fc.assert(\n fc.asyncProperty(\n channelIdArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n evmAddressArbitrary,\n async (channelId, oapp, ulnConfig, executor) => {\n fc.pre(executor !== ulnConfig.executor)\n\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(channelId, oapp, {\n ...ulnConfig,\n executor,\n })\n ).resolves.toBeFalsy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that `ulnSdk.hasAppUlnConfig` returns false when the executor in the configuration does not match the expected executor.", "mode": "fast-check"} {"id": 58271, "name": "unknown", "code": "it('should return an empty array when called with an array of nulls and undefineds', () => {\n fc.assert(\n fc.property(fc.array(nullableArbitrary), (transactions) => {\n expect(flattenTransactions(transactions)).toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/transactions/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`flattenTransactions` returns an empty array when given an array containing only null and undefined values.", "mode": "fast-check"} {"id": 58276, "name": "unknown", "code": "it('should return the first transaction as failed if createSigner fails', async () => {\n await fc.assert(\n fc.asyncProperty(fc.array(transactionArbitrary), async (transactions) => {\n const signerFactory: OmniSignerFactory = jest\n .fn()\n .mockImplementation((eid: EndpointId) => Promise.reject(new Error(`So sorry ${eid}`)))\n const signAndSendTransactions = createSignAndSend(signerFactory)\n\n // Now we send all the transactions to the flow and observe the output\n const [successful, errors, pending] = await signAndSendTransactions(transactions)\n\n const grouped = groupTransactionsByEid(transactions)\n\n // We expect none of the transactions to go through\n expect(successful).toEqual([])\n // We expect the errors to contain the first transaction and the wrapped error from the signer factory\n expect(errors).toEqual(\n Array.from(grouped.entries()).map(([eid, transactions]) => ({\n error: new Error(\n `Failed to create a signer for ${formatEid(eid)}: ${new Error(`So sorry ${eid}`)}`\n ),\n transaction: transactions[0],\n }))\n )\n // And we expect all the transactions to be pending\n expect(pending).toContainAllValues(\n Array.from(grouped.entries()).flatMap(([, transactions]) => transactions)\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58277, "name": "unknown", "code": "it('should return all successful transactions if they all go through', async () => {\n await fc.assert(\n fc.asyncProperty(fc.array(transactionArbitrary), async (transactions) => {\n // We'll prepare some mock objects for this test\n // to mock the transaction responses and receipts\n const receipt = { transactionHash: '0x0' }\n\n // Our successful wait will produce a receipt\n const successfulWait = jest.fn().mockResolvedValue(receipt)\n const successfulResponse: OmniTransactionResponse = {\n transactionHash: '0x0',\n wait: successfulWait,\n }\n\n // Our signAndSend will then use the map to resolve/reject transactions\n const signAndSend = jest.fn().mockResolvedValue(successfulResponse)\n const sign = jest.fn().mockRejectedValue('Oh god no')\n const signerFactory: OmniSignerFactory = jest.fn().mockResolvedValue({ signAndSend, sign })\n const signAndSendTransactions = createSignAndSend(signerFactory)\n\n // Now we send all the transactions to the flow and observe the output\n const [successful, errors, pending] = await signAndSendTransactions(transactions)\n\n // Since we are executing groups of transactions in parallel,\n // in general the order of successful transaction will not match the order of input transactions\n expect(successful).toContainAllValues(\n transactions.map((transaction) => ({ transaction, receipt }))\n )\n expect(errors).toEqual([])\n expect(pending).toEqual([])\n\n // What needs to match though is the order of successful transactions within groups\n //\n // For that we group the successful transactions and make sure those are equal to the grouped original transactions\n const groupedSuccessful = groupTransactionsByEid(\n successful.map(({ transaction }) => transaction)\n )\n expect(groupedSuccessful).toEqual(groupTransactionsByEid(transactions))\n\n // We also check that the signer factory has been called with the eids\n for (const transaction of transactions) {\n expect(signerFactory).toHaveBeenCalledWith(transaction.point.eid)\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58278, "name": "unknown", "code": "it('should bail on the first submission error', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.array(transactionArbitrary),\n transactionArbitrary,\n fc.array(transactionArbitrary),\n async (firstBatch, failedTransaction, secondBatch) => {\n // We'll prepare some mock objects for this test\n // to mock the transaction responses and receipts\n const error = new Error('Failed transaction')\n const receipt = { transactionHash: '0x0' }\n const successfulWait = jest.fn().mockResolvedValue(receipt)\n const successfulResponse: OmniTransactionResponse = {\n transactionHash: '0x0',\n wait: successfulWait,\n }\n\n // In order to resolve the good ones and reject the bad ones\n // we'll prepare a map between a transaction and its response\n //\n // This map relies on the fact that we are passing the transaction object without modifying it\n // so the objects are referentially equal\n const implementations: Map> = new Map([\n ...firstBatch.map((t) => [t, Promise.resolve(successfulResponse)] as const),\n ...secondBatch.map((t) => [t, Promise.resolve(successfulResponse)] as const),\n [failedTransaction, Promise.reject(error)],\n ])\n\n const expectedSuccessful = [\n // The first batch should all go through\n ...firstBatch,\n // The transactions that are not on the chain affected by the failed transaction should also pass\n ...secondBatch.filter(({ point }) => point.eid !== failedTransaction.point.eid),\n ]\n\n const expectedPending = secondBatch.filter(\n ({ point }) => point.eid === failedTransaction.point.eid\n )\n\n // Our signAndSend will then use the map to resolve/reject transactions\n const signAndSend = jest.fn().mockImplementation((t) => implementations.get(t))\n const sign = jest.fn().mockRejectedValue('Oh god no')\n const signerFactory: OmniSignerFactory = jest\n .fn()\n .mockResolvedValue({ signAndSend, sign })\n const signAndSendTransactions = createSignAndSend(signerFactory)\n\n // Now we send all the transactions to the flow and observe the output\n const transactions = [...firstBatch, failedTransaction, ...secondBatch]\n const [successful, errors, pending] = await signAndSendTransactions(transactions)\n\n // Since we are executing groups of transactions in parallel,\n // in general the order of successful transaction will not match the order of input transactions\n expect(successful).toContainAllValues(\n expectedSuccessful.map((transaction) => ({ transaction, receipt }))\n )\n expect(errors).toEqual([{ transaction: failedTransaction, error }])\n expect(pending).toEqual([failedTransaction, ...expectedPending])\n\n // What needs to match though is the order of successful transactions within groups\n //\n // For that we group the successful transactions and make sure those are equal to the grouped original transactions\n const groupedSuccessful = groupTransactionsByEid(\n successful.map(({ transaction }) => transaction)\n )\n expect(groupedSuccessful).toEqual(groupTransactionsByEid(expectedSuccessful))\n\n // We also check that the signer factory has been called with the eids\n expect(signerFactory).toHaveBeenCalledWith(failedTransaction.point.eid)\n for (const transaction of firstBatch) {\n expect(signerFactory).toHaveBeenCalledWith(transaction.point.eid)\n }\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58279, "name": "unknown", "code": "it('should call onProgress for every successful transaction', async () => {\n await fc.assert(\n fc.asyncProperty(fc.array(transactionArbitrary), async (transactions) => {\n // We'll prepare some mock objects for this test\n // to mock the transaction responses and receipts\n const receipt = { transactionHash: '0x0' }\n\n // Our successful wait will produce a receipt\n const successfulWait = jest.fn().mockResolvedValue(receipt)\n const successfulResponse: OmniTransactionResponse = {\n transactionHash: '0x0',\n wait: successfulWait,\n }\n\n // Our signAndSend will then use the map to resolve/reject transactions\n const signAndSend = jest.fn().mockResolvedValue(successfulResponse)\n const sign = jest.fn().mockRejectedValue('Oh god no')\n const signerFactory: OmniSignerFactory = jest.fn().mockResolvedValue({ signAndSend, sign })\n const signAndSendTransactions = createSignAndSend(signerFactory)\n\n const handleProgress = jest.fn()\n const [successful] = await signAndSendTransactions(transactions, handleProgress)\n\n // We check whether onProgress has been called for every transaction\n for (const [index, transaction] of successful.entries()) {\n expect(handleProgress).toHaveBeenNthCalledWith(\n index + 1,\n // We expect the transaction in question to be passed\n transaction,\n // As well as the list of all the successful transactions so far\n successful.slice(0, index + 1)\n )\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58280, "name": "unknown", "code": "it('should bail on the first wait error', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.array(transactionArbitrary),\n transactionArbitrary,\n fc.array(transactionArbitrary),\n async (firstBatch, failedTransaction, secondBatch) => {\n // We'll prepare some mock objects for this test\n // to mock the transaction responses and receipts\n const error = new Error('Failed transaction')\n const receipt = { transactionHash: '0x0' }\n\n // Our successful wait will produce a receipt\n const successfulWait = jest.fn().mockResolvedValue(receipt)\n const successfulResponse: OmniTransactionResponse = {\n transactionHash: '0x0',\n wait: successfulWait,\n }\n\n // Our unsuccessful wait will throw an error\n const unsuccessfulWait = jest.fn().mockRejectedValue(error)\n const unsuccessfulResponse: OmniTransactionResponse = {\n transactionHash: '0x0',\n wait: unsuccessfulWait,\n }\n\n // In order to resolve the good ones and reject the bad ones\n // we'll prepare a map between a transaction and its response\n //\n // This map relies on the fact that we are passing the transaction object without modifying it\n // so the objects are referentially equal\n const implementations: Map> = new Map([\n ...firstBatch.map((t) => [t, Promise.resolve(successfulResponse)] as const),\n ...secondBatch.map((t) => [t, Promise.resolve(successfulResponse)] as const),\n [failedTransaction, Promise.resolve(unsuccessfulResponse)],\n ])\n\n const expectedSuccessful = [\n // The first batch should all go through\n ...firstBatch,\n // The transactions that are not on the chain affected by the failed transaction should also pass\n ...secondBatch.filter(({ point }) => point.eid !== failedTransaction.point.eid),\n ]\n\n const expectedPending = secondBatch.filter(\n ({ point }) => point.eid === failedTransaction.point.eid\n )\n\n // Our signAndSend will then use the map to resolve/reject transactions\n const signAndSend = jest.fn().mockImplementation((t) => implementations.get(t))\n const sign = jest.fn().mockRejectedValue('Oh god no')\n const signerFactory: OmniSignerFactory = jest.fn().mockResolvedValue({ signAndSend, sign })\n const signAndSendTransactions = createSignAndSend(signerFactory)\n\n // Now we send all the transactions to the flow and observe the output\n const transactions = [...firstBatch, failedTransaction, ...secondBatch]\n const [successful, errors, pending] = await signAndSendTransactions(transactions)\n\n // Since we are executing groups of transactions in parallel,\n // in general the order of successful transaction will not match the order of input transactions\n expect(successful).toContainAllValues(\n expectedSuccessful.map((transaction) => ({ transaction, receipt }))\n )\n expect(errors).toEqual([{ transaction: failedTransaction, error }])\n expect(pending).toEqual([failedTransaction, ...expectedPending])\n\n // What needs to match though is the order of successful transactions within groups\n //\n // For that we group the successful transactions and make sure those are equal to the grouped original transactions\n const groupedSuccessful = groupTransactionsByEid(\n successful.map(({ transaction }) => transaction)\n )\n expect(groupedSuccessful).toEqual(groupTransactionsByEid(expectedSuccessful))\n\n // We also check that the signer factory has been called with the eids\n expect(signerFactory).toHaveBeenCalledWith(failedTransaction.point.eid)\n for (const transaction of firstBatch) {\n expect(signerFactory).toHaveBeenCalledWith(transaction.point.eid)\n }\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58281, "name": "unknown", "code": "it('should not bail on the first wait error', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.array(transactionArbitrary),\n transactionArbitrary,\n fc.array(transactionArbitrary),\n async (firstBatch, failedTransaction, secondBatch) => {\n // We'll prepare some mock objects for this test\n // to mock the transaction responses and receipts\n const error = new Error('Failed transaction')\n const receipt = { transactionHash: '0x0' }\n\n // Our successful wait will produce a receipt\n const successfulWait = jest.fn().mockResolvedValue(receipt)\n const successfulResponse: OmniTransactionResponse = {\n transactionHash: '0x0',\n wait: successfulWait,\n }\n\n // Our unsuccessful wait will throw an error\n const unsuccessfulWait = jest.fn().mockRejectedValue(error)\n const unsuccessfulResponse: OmniTransactionResponse = {\n transactionHash: '0x0',\n wait: unsuccessfulWait,\n }\n\n // In order to resolve the good ones and reject the bad ones\n // we'll prepare a map between a transaction and its response\n //\n // This map relies on the fact that we are passing the transaction object without modifying it\n // so the objects are referentially equal\n const implementations: Map> = new Map([\n ...firstBatch.map((t) => [t, Promise.resolve(successfulResponse)] as const),\n ...secondBatch.map((t) => [t, Promise.resolve(successfulResponse)] as const),\n [failedTransaction, Promise.resolve(unsuccessfulResponse)],\n ])\n\n const expectedSuccessful = [\n // The first batch should all go through\n ...firstBatch,\n // The second batch should all go through since they all were submitted and will all be mined\n ...secondBatch,\n ]\n\n // Our signAndSend will then use the map to resolve/reject transactions\n const signAndSend = jest.fn().mockImplementation((t) => implementations.get(t))\n const sign = jest.fn().mockRejectedValue('Oh god no')\n const signerFactory: OmniSignerFactory = jest.fn().mockResolvedValue({ signAndSend, sign })\n const signAndSendTransactions = createSignAndSend(signerFactory)\n\n // Now we send all the transactions to the flow and observe the output\n const transactions = [...firstBatch, failedTransaction, ...secondBatch]\n const [successful, errors, pending] = await signAndSendTransactions(transactions)\n\n // Since we are executing groups of transactions in parallel,\n // in general the order of successful transaction will not match the order of input transactions\n expect(successful).toContainAllValues(\n expectedSuccessful.map((transaction) => ({ transaction, receipt }))\n )\n expect(errors).toEqual([{ transaction: failedTransaction, error }])\n expect(pending).toEqual([failedTransaction])\n\n // What needs to match though is the order of successful transactions within groups\n //\n // For that we group the successful transactions and make sure those are equal to the grouped original transactions\n const groupedSuccessful = groupTransactionsByEid(\n successful.map(({ transaction }) => transaction)\n )\n expect(groupedSuccessful).toEqual(groupTransactionsByEid(expectedSuccessful))\n\n // We also check that the signer factory has been called with the eids\n expect(signerFactory).toHaveBeenCalledWith(failedTransaction.point.eid)\n for (const transaction of firstBatch) {\n expect(signerFactory).toHaveBeenCalledWith(transaction.point.eid)\n }\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58282, "name": "unknown", "code": "it('should only return errors if the submission fails', async () => {\n await fc.assert(\n fc.asyncProperty(fc.array(transactionArbitrary), async (transactions) => {\n // We'll prepare some mock objects for this test\n // to mock the transaction responses and receipts\n const error = new Error('Failed transaction')\n\n // Our signAndSend will then use the map to resolve/reject transactions\n const signAndSendBatch = jest.fn().mockRejectedValue(error)\n const signAndSend = jest.fn().mockRejectedValue('Oh god no')\n const sign = jest.fn().mockRejectedValue('Oh god no')\n const signerFactory: OmniSignerFactory = jest\n .fn()\n .mockResolvedValue({ signAndSend, signAndSendBatch, sign })\n const signAndSendTransactions = createSignAndSend(signerFactory)\n\n // Now we send all the transactions to the flow and observe the output\n const [successful, errors, pending] = await signAndSendTransactions(transactions)\n\n // Since we are executing groups of transactions in parallel,\n // in general the order of successful transaction will not match the order of input transactions\n expect(successful).toEqual([])\n expect(errors).toContainAllValues(\n transactions.map((transaction) => ({ transaction, error }))\n )\n expect(pending).toContainAllValues(transactions)\n\n // We also check that the signer factory has been called with the eids\n for (const transaction of transactions) {\n expect(signerFactory).toHaveBeenCalledWith(transaction.point.eid)\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58283, "name": "unknown", "code": "it('should only return errors if the waiting fails', async () => {\n await fc.assert(\n fc.asyncProperty(fc.array(transactionArbitrary), async (transactions) => {\n // We'll prepare some mock objects for this test\n // to mock the transaction responses and receipts\n const error = new Error('Failed transaction')\n // Our unsuccessful wait will throw an error\n const wait = jest.fn().mockRejectedValue(error)\n const response: OmniTransactionResponse = {\n transactionHash: '0x0',\n wait,\n }\n\n // Our signAndSend will then use the map to resolve/reject transactions\n const signAndSendBatch = jest.fn().mockResolvedValue(response)\n const signAndSend = jest.fn().mockRejectedValue('Oh god no')\n const sign = jest.fn().mockRejectedValue('Oh god no')\n const signerFactory: OmniSignerFactory = jest\n .fn()\n .mockResolvedValue({ signAndSend, signAndSendBatch, sign })\n const signAndSendTransactions = createSignAndSend(signerFactory)\n\n // Now we send all the transactions to the flow and observe the output\n const [successful, errors, pending] = await signAndSendTransactions(transactions)\n\n // Since we are executing groups of transactions in parallel,\n // in general the order of successful transaction will not match the order of input transactions\n expect(successful).toEqual([])\n expect(errors).toContainAllValues(\n transactions.map((transaction) => ({ transaction, error }))\n )\n expect(pending).toContainAllValues(transactions)\n\n // We also check that the signer factory has been called with the eids\n for (const transaction of transactions) {\n expect(signerFactory).toHaveBeenCalledWith(transaction.point.eid)\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58284, "name": "unknown", "code": "it('should only return successes if waiting succeeds', async () => {\n await fc.assert(\n fc.asyncProperty(fc.array(transactionArbitrary), async (transactions) => {\n const receipt = { transactionHash: '0x0' }\n\n // Our successful wait will produce a receipt\n const wait = jest.fn().mockResolvedValue(receipt)\n const response: OmniTransactionResponse = {\n transactionHash: '0x0',\n wait,\n }\n\n // Our signAndSend will then use the map to resolve/reject transactions\n const signAndSendBatch = jest.fn().mockResolvedValue(response)\n const signAndSend = jest.fn().mockRejectedValue('Oh god no')\n const sign = jest.fn().mockRejectedValue('Oh god no')\n const signerFactory: OmniSignerFactory = jest\n .fn()\n .mockResolvedValue({ signAndSend, signAndSendBatch, sign })\n const signAndSendTransactions = createSignAndSend(signerFactory)\n\n // Now we send all the transactions to the flow and observe the output\n const [successful, errors, pending] = await signAndSendTransactions(transactions)\n\n // Since we are executing groups of transactions in parallel,\n // in general the order of successful transaction will not match the order of input transactions\n expect(successful).toContainAllValues(\n transactions.map((transaction) => ({ transaction, receipt }))\n )\n expect(errors).toEqual([])\n expect(pending).toEqual([])\n\n // We also check that the signer factory has been called with the eids\n for (const transaction of transactions) {\n expect(signerFactory).toHaveBeenCalledWith(transaction.point.eid)\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58291, "name": "unknown", "code": "it('should work for non-negative bigint strings', () => {\n fc.assert(\n fc.property(fc.bigInt({ min: BigInt(0) }), (value) => {\n expect(UIntBigIntSchema.parse(String(value))).toBe(value)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58292, "name": "unknown", "code": "it('should not work for negative bigint strings', () => {\n fc.assert(\n fc.property(fc.bigInt({ max: BigInt(-1) }), (value) => {\n expect(() => UIntBigIntSchema.parse(String(value))).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58293, "name": "unknown", "code": "it('should work for non-negative integers', () => {\n fc.assert(\n fc.property(fc.integer({ min: 0 }), (value) => {\n expect(UIntBigIntSchema.parse(value)).toBe(BigInt(value))\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58294, "name": "unknown", "code": "it('should not work for negative integers', () => {\n fc.assert(\n fc.property(fc.integer({ max: -1 }), (value) => {\n expect(() => UIntBigIntSchema.parse(value)).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58295, "name": "unknown", "code": "it('should work for non-negative integer strings', () => {\n fc.assert(\n fc.property(fc.integer({ min: 0 }), (value) => {\n expect(UIntBigIntSchema.parse(String(value))).toBe(BigInt(value))\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58296, "name": "unknown", "code": "it('should not work for negative integer strings', () => {\n fc.assert(\n fc.property(fc.integer({ max: -1 }), (value) => {\n expect(() => UIntBigIntSchema.parse(String(value))).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58297, "name": "unknown", "code": "it('should throw a ZodError for invalid values', () => {\n fc.assert(\n fc.property(fc.anything(), (value) => {\n let isValid = false\n\n try {\n isValid = UIntBigIntSchema.safeParse(value).success\n } catch {\n // This catch block is designed to catch errors caused by messed up standard methods\n // like toString or toValue that fast check throws at us\n }\n\n fc.pre(!isValid)\n\n // Here we expect that whatever we got, we'll not receive a SyntaxError\n // (coming from a BigInt() constructor) but a ZodError\n expect(() => UIntBigIntSchema.parse(value)).toThrow(ZodError)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58298, "name": "unknown", "code": "it('should work for non-negative integers', () => {\n fc.assert(\n fc.property(fc.integer({ min: 0 }), (value) => {\n expect(UIntNumberSchema.parse(value)).toBe(value)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58299, "name": "unknown", "code": "it('should not work for negative integers', () => {\n fc.assert(\n fc.property(fc.integer({ max: -1 }), (value) => {\n expect(() => UIntNumberSchema.parse(value)).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58300, "name": "unknown", "code": "it('should work for non-negative integer strings', () => {\n fc.assert(\n fc.property(fc.integer({ min: 0 }), (value) => {\n expect(UIntNumberSchema.parse(String(value))).toBe(value)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58301, "name": "unknown", "code": "it('should not work for negative integer strings', () => {\n fc.assert(\n fc.property(fc.integer({ max: -1 }), (value) => {\n expect(() => UIntNumberSchema.parse(String(value))).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58302, "name": "unknown", "code": "it('should throw a ZodError for invalid values', () => {\n fc.assert(\n fc.property(fc.anything(), (value) => {\n let isValid = false\n\n try {\n isValid = UIntNumberSchema.safeParse(value).success\n } catch {\n // This catch block is designed to catch errors caused by messed up standard methods\n // like toString or toValue that fast check throws at us\n }\n\n fc.pre(!isValid)\n\n // Here we expect that whatever we got, we'll not receive a SyntaxError\n // (coming from a BigInt() constructor) but a ZodError\n expect(() => UIntNumberSchema.parse(value)).toThrow(ZodError)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58303, "name": "unknown", "code": "it('should work without contract name innit', () => {\n fc.assert(\n fc.property(pointArbitrary, (point) => {\n fc.pre(!point.contractName)\n\n expect(formatOmniPoint(point)).toBe(`[${point.address} @ ${formatEid(point.eid)}]`)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/format.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58304, "name": "unknown", "code": "it('should work with contract name innit', () => {\n fc.assert(\n fc.property(pointArbitrary, (point) => {\n fc.pre(!!point.contractName)\n\n expect(formatOmniPoint(point)).toBe(\n `[${point.address} (${point.contractName}) @ ${formatEid(point.eid)}]`\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/format.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58305, "name": "unknown", "code": "it('should just work innit', () => {\n fc.assert(\n fc.property(vectorArbitrary, (vector) => {\n expect(formatOmniVector(vector)).toBe(\n `${formatOmniPoint(vector.from)} \u2192 ${formatOmniPoint(vector.to)}`\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/format.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58306, "name": "unknown", "code": "it('should be true for referentially equal vector', () => {\n fc.assert(\n fc.property(pointArbitrary, (point) => {\n expect(arePointsEqual(point, point)).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58307, "name": "unknown", "code": "it('should be true for value equal vector', () => {\n fc.assert(\n fc.property(pointArbitrary, (point) => {\n expect(arePointsEqual(point, { ...point })).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58308, "name": "unknown", "code": "it(\"should be false when addresses don't match\", () => {\n fc.assert(\n fc.property(pointArbitrary, addressArbitrary, (point, address) => {\n fc.pre(point.address !== address)\n\n expect(arePointsEqual(point, { ...point, address })).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58309, "name": "unknown", "code": "it(\"should be false when endpoint IDs don't match\", () => {\n fc.assert(\n fc.property(pointArbitrary, endpointArbitrary, (point, eid) => {\n fc.pre(point.eid !== eid)\n\n expect(arePointsEqual(point, { ...point, eid })).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58310, "name": "unknown", "code": "it(\"should be false when contract names don't match\", () => {\n fc.assert(\n fc.property(pointArbitrary, nullableArbitrary(fc.string()), (point, contractName) => {\n fc.pre(point.contractName !== contractName)\n\n expect(arePointsEqual(point, { ...point, contractName })).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58311, "name": "unknown", "code": "it('should be true for referentially equal vector', () => {\n fc.assert(\n fc.property(vectorArbitrary, (vector) => {\n expect(areVectorsEqual(vector, vector)).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58312, "name": "unknown", "code": "it('should be true for value equal vector', () => {\n fc.assert(\n fc.property(vectorArbitrary, (vector) => {\n expect(areVectorsEqual(vector, { ...vector })).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58313, "name": "unknown", "code": "it(\"should be false when from point doesn't match\", () => {\n fc.assert(\n fc.property(vectorArbitrary, pointArbitrary, (vector, from) => {\n fc.pre(!arePointsEqual(vector.from, from))\n\n expect(areVectorsEqual(vector, { ...vector, from })).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58314, "name": "unknown", "code": "it(\"should be false when to point doesn't match\", () => {\n fc.assert(\n fc.property(vectorArbitrary, pointArbitrary, (vector, to) => {\n fc.pre(!arePointsEqual(vector.from, to))\n\n expect(areVectorsEqual(vector, { ...vector, to })).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58315, "name": "unknown", "code": "it('should return true if the eids match', () => {\n fc.assert(\n fc.property(pointArbitrary, pointArbitrary, (pointA, pointB) => {\n expect(areSameEndpoint(pointA, { ...pointB, eid: pointA.eid })).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58316, "name": "unknown", "code": "it('should return false if the eids differ', () => {\n fc.assert(\n fc.property(pointArbitrary, pointArbitrary, (pointA, pointB) => {\n fc.pre(pointA.eid !== pointB.eid)\n\n expect(areSameEndpoint(pointA, pointB)).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58317, "name": "unknown", "code": "it('should produce identical serialized values if the vector match', () => {\n fc.assert(\n fc.property(pointArbitrary, (point) => {\n expect(serializePoint(point)).toBe(serializePoint({ ...point }))\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58318, "name": "unknown", "code": "it(\"should produce different serialized values if the vector don't match\", () => {\n fc.assert(\n fc.property(pointArbitrary, pointArbitrary, (pointA, pointB) => {\n fc.pre(!arePointsEqual(pointA, pointB))\n\n expect(serializePoint(pointA)).not.toBe(serializePoint(pointB))\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58319, "name": "unknown", "code": "it('should produce identical serialized values if the vector match', () => {\n fc.assert(\n fc.property(vectorArbitrary, (vector) => {\n expect(serializeVector(vector)).toBe(serializeVector({ ...vector }))\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58320, "name": "unknown", "code": "it(\"should produce different serialized values if the vector don't match\", () => {\n fc.assert(\n fc.property(vectorArbitrary, vectorArbitrary, (lineA, lineB) => {\n fc.pre(!areVectorsEqual(lineA, lineB))\n\n expect(serializeVector(lineA)).not.toBe(serializeVector(lineB))\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58321, "name": "unknown", "code": "it('should return true if two points are on the same stage', () => {\n fc.assert(\n fc.property(endpointArbitrary, endpointArbitrary, addressArbitrary, (eid1, eid2, address) => {\n fc.pre(endpointIdToStage(eid1) === endpointIdToStage(eid2))\n\n expect(\n isVectorPossible({ from: { eid: eid1, address }, to: { eid: eid2, address } })\n ).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58322, "name": "unknown", "code": "it('should return false if two points are not on the same stage', () => {\n fc.assert(\n fc.property(endpointArbitrary, endpointArbitrary, addressArbitrary, (eid1, eid2, address) => {\n fc.pre(endpointIdToStage(eid1) !== endpointIdToStage(eid2))\n\n expect(\n isVectorPossible({ from: { eid: eid1, address }, to: { eid: eid2, address } })\n ).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58323, "name": "unknown", "code": "it('should append eid to a value', () => {\n fc.assert(\n fc.property(endpointArbitrary, fc.dictionary(fc.string(), fc.anything()), (eid, value) => {\n expect(withEid(eid)(value)).toEqual({ ...value, eid })\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58324, "name": "unknown", "code": "it('should return an empty array if configuration function returns null, undefined or an empty array', async () => {\n const createSdk = jest.fn()\n const configureNode = jest.fn()\n const configureNodes = createConfigureNodes(configureNode)\n\n await fc.assert(\n fc.asyncProperty(nodesArbitrary, async (contracts) => {\n createSdk.mockClear()\n configureNode.mockClear()\n\n // We mock the node configurator to only return empty values\n configureNode.mockResolvedValueOnce(null).mockResolvedValueOnce(undefined).mockResolvedValue([])\n\n const graph = { contracts, connections: [] }\n await expect(configureNodes(graph, createSdk)).resolves.toEqual([])\n\n expect(createSdk).toHaveBeenCalledTimes(contracts.length)\n expect(configureNode).toHaveBeenCalledTimes(contracts.length)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/config.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58325, "name": "unknown", "code": "it('should create an SDK and execute configurator for every node', async () => {\n // Just some random SDK factory\n const createSdk = jest.fn().mockImplementation((point: OmniPoint) => ({ sdkFor: point }))\n // And a configuration function that returns something that we can identify in the result\n const configureNode = jest\n .fn()\n .mockImplementation((node: OmniNode, sdk: unknown) => ({ point: node.point, sdk }))\n const configureNodes = createConfigureNodes(configureNode)\n\n await fc.assert(\n fc.asyncProperty(nodesArbitrary, async (contracts) => {\n createSdk.mockClear()\n configureNode.mockClear()\n\n const graph = { contracts, connections: [] }\n const transactions = await configureNodes(graph, createSdk)\n\n // First we check that the transactions match what our configuration function would return\n expect(transactions).toHaveLength(contracts.length)\n expect(transactions).toEqual(\n contracts.map(({ point }) => ({\n point,\n sdk: {\n sdkFor: point,\n },\n }))\n )\n\n // Then we check that the configurations have been called properly\n expect(createSdk).toHaveBeenCalledTimes(contracts.length)\n expect(configureNode).toHaveBeenCalledTimes(contracts.length)\n\n for (const contract of contracts) {\n expect(createSdk).toHaveBeenCalledWith(contract.point)\n expect(configureNode).toHaveBeenCalledWith(\n contract,\n expect.objectContaining({ sdkFor: contract.point }),\n graph,\n createSdk\n )\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/config.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58326, "name": "unknown", "code": "it('should return an empty array if configuration function returns null, undefined or an empty array', async () => {\n const createSdk = jest.fn()\n const configureEdge = jest.fn()\n const configureEdges = createConfigureEdges(configureEdge)\n\n await fc.assert(\n fc.asyncProperty(edgesArbitrary, async (connections) => {\n createSdk.mockClear()\n configureEdge.mockClear()\n\n // We mock the node configurator to only return empty values\n configureEdge.mockResolvedValueOnce(null).mockResolvedValueOnce(undefined).mockResolvedValue([])\n\n const graph = { contracts: [], connections }\n await expect(configureEdges(graph, createSdk)).resolves.toEqual([])\n\n expect(createSdk).toHaveBeenCalledTimes(connections.length)\n expect(configureEdge).toHaveBeenCalledTimes(connections.length)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/config.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58327, "name": "unknown", "code": "it('should create an SDK and execute configurator for every connection', async () => {\n // Just some random SDK factory\n const createSdk = jest.fn().mockImplementation((point: OmniPoint) => ({ sdkFor: point }))\n // And a configuration function that returns something that we can identify in the result\n const configureEdge = jest\n .fn()\n .mockImplementation((edge: OmniEdge, sdk: unknown) => ({ vector: edge.vector, sdk }))\n const configureEdges = createConfigureEdges(configureEdge)\n\n await fc.assert(\n fc.asyncProperty(edgesArbitrary, async (connections) => {\n createSdk.mockClear()\n configureEdge.mockClear()\n\n const graph = { contracts: [], connections }\n const transactions = await configureEdges(graph, createSdk)\n\n // First we check that the transactions match what our configuration function would return\n expect(transactions).toHaveLength(connections.length)\n expect(transactions).toEqual(\n connections.map(({ vector }) => ({\n vector,\n sdk: {\n sdkFor: vector.from,\n },\n }))\n )\n\n // Then we check that the configurations have been called properly\n expect(createSdk).toHaveBeenCalledTimes(connections.length)\n expect(configureEdge).toHaveBeenCalledTimes(connections.length)\n\n for (const contract of connections) {\n expect(createSdk).toHaveBeenCalledWith(contract.vector.from)\n expect(configureEdge).toHaveBeenCalledWith(\n contract,\n expect.objectContaining({ sdkFor: contract.vector.from }),\n graph,\n createSdk\n )\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/config.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58328, "name": "unknown", "code": "it('should return a configurator that does nothing with no configurators', async () => {\n const createSdk = jest.fn()\n const emptyConfigurator = createConfigureMultiple()\n\n await fc.assert(\n fc.asyncProperty(graphArbitrary, async (graph) => {\n expect(createSdk).not.toHaveBeenCalled()\n\n await expect(emptyConfigurator(graph, createSdk)).resolves.toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/config.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58329, "name": "unknown", "code": "it('should call all configurators', async () => {\n const createSdk = jest.fn()\n\n await fc.assert(\n fc.asyncProperty(\n graphArbitrary,\n fc.array(transactionArbitrary),\n async (graph, transactionGroups) => {\n createSdk.mockClear()\n\n // We create a configurator for every group of transactions\n const configurators = transactionGroups.map((transactions) =>\n jest.fn().mockResolvedValue(transactions)\n )\n\n // Now we execute these configurators\n const multiConfigurator = createConfigureMultiple(...configurators)\n\n // And expect to get all the transactions back\n await expect(multiConfigurator(graph, createSdk)).resolves.toEqual(transactionGroups.flat())\n\n // We also check that every configurator has been called\n for (const configurator of configurators) {\n expect(configurator).toHaveBeenCalledOnce()\n }\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/config.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58330, "name": "unknown", "code": "it('should add a single node', () => {\n fc.assert(\n fc.property(nodeArbitrary, (node) => {\n const builder = new OmniGraphBuilder()\n\n builder.addNodes(node)\n expect(builder.nodes).toEqual([node])\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58331, "name": "unknown", "code": "it('should not add a duplicate node', () => {\n fc.assert(\n fc.property(nodeArbitrary, (node) => {\n const builder = new OmniGraphBuilder()\n\n builder.addNodes(node, node)\n expect(builder.nodes).toEqual([node])\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58332, "name": "unknown", "code": "it('should overwrite a node if the points are equal', () => {\n fc.assert(\n fc.property(pointArbitrary, nodeConfigArbitrary, nodeConfigArbitrary, (point, configA, configB) => {\n const builder = new OmniGraphBuilder()\n\n const nodeA = { point, config: configA }\n const nodeB = { point, config: configB }\n\n builder.addNodes(nodeA, nodeB)\n expect(builder.nodes).toEqual([nodeB])\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58333, "name": "unknown", "code": "it('should not do anything when there are no nodes', () => {\n fc.assert(\n fc.property(nodeArbitrary, (node) => {\n const builder = new OmniGraphBuilder()\n\n builder.removeNodeAt(node.point)\n expect(builder.nodes).toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58334, "name": "unknown", "code": "it('should return self', () => {\n fc.assert(\n fc.property(nodeArbitrary, (node) => {\n const builder = new OmniGraphBuilder()\n\n expect(builder.removeNodeAt(node.point)).toBe(builder)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58335, "name": "unknown", "code": "it('should remove a node at a specified point', () => {\n fc.assert(\n fc.property(nodeArbitrary, (node) => {\n const builder = new OmniGraphBuilder()\n\n builder.addNodes(node)\n builder.removeNodeAt(node.point)\n expect(builder.nodes).toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58336, "name": "unknown", "code": "it('should not remove nodes at different points', () => {\n fc.assert(\n fc.property(nodeArbitrary, nodeArbitrary, (nodeA, nodeB) => {\n fc.pre(!arePointsEqual(nodeA.point, nodeB.point))\n\n const builder = new OmniGraphBuilder()\n\n builder.addNodes(nodeA, nodeB)\n builder.removeNodeAt(nodeA.point)\n expect(builder.nodes).toEqual([nodeB])\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58337, "name": "unknown", "code": "it('should remove all edges starting at the node', () => {\n fc.assert(\n fc.property(\n nodeArbitrary,\n nodeArbitrary,\n nodeArbitrary,\n edgeConfigArbitrary,\n (nodeA, nodeB, nodeC, edgeConfig) => {\n fc.pre(!arePointsEqual(nodeA.point, nodeB.point))\n fc.pre(!arePointsEqual(nodeA.point, nodeC.point))\n fc.pre(!arePointsEqual(nodeB.point, nodeC.point))\n\n const edgeAB = { vector: { from: nodeA.point, to: nodeB.point }, config: edgeConfig }\n const edgeAC = { vector: { from: nodeA.point, to: nodeC.point }, config: edgeConfig }\n const edgeBA = { vector: { from: nodeB.point, to: nodeA.point }, config: edgeConfig }\n const edgeBC = { vector: { from: nodeB.point, to: nodeC.point }, config: edgeConfig }\n const edgeCA = { vector: { from: nodeC.point, to: nodeA.point }, config: edgeConfig }\n const edgeCB = { vector: { from: nodeC.point, to: nodeB.point }, config: edgeConfig }\n\n fc.pre(isVectorPossible(edgeAB.vector))\n fc.pre(isVectorPossible(edgeAC.vector))\n fc.pre(isVectorPossible(edgeBA.vector))\n fc.pre(isVectorPossible(edgeBC.vector))\n fc.pre(isVectorPossible(edgeCA.vector))\n fc.pre(isVectorPossible(edgeCB.vector))\n\n const builder = new OmniGraphBuilder()\n\n builder\n .addNodes(nodeA, nodeB, nodeC)\n .addEdges(edgeAB, edgeAC, edgeBA, edgeBC, edgeCA, edgeCB)\n .removeNodeAt(nodeA.point)\n expect(builder.edges).toEqual([edgeBA, edgeBC, edgeCA, edgeCB])\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58338, "name": "unknown", "code": "it('should fail if from is not in the graph', () => {\n fc.assert(\n fc.property(edgeArbitrary, nodeConfigArbitrary, (edge, nodeConfig) => {\n fc.pre(isVectorPossible(edge.vector))\n\n const builder = new OmniGraphBuilder()\n\n builder\n .addNodes(\n { point: edge.vector.from, config: nodeConfig },\n { point: edge.vector.to, config: nodeConfig }\n )\n .removeNodeAt(edge.vector.from)\n\n expect(() => builder.addEdges(edge)).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58339, "name": "unknown", "code": "it('should fail if vector is not possible', () => {\n fc.assert(\n fc.property(edgeArbitrary, nodeConfigArbitrary, (edge, nodeConfig) => {\n fc.pre(!isVectorPossible(edge.vector))\n\n const builder = new OmniGraphBuilder()\n\n builder\n .addNodes(\n { point: edge.vector.from, config: nodeConfig },\n { point: edge.vector.to, config: nodeConfig }\n )\n .removeNodeAt(edge.vector.from)\n\n expect(() => builder.addEdges(edge)).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58340, "name": "unknown", "code": "it('should not fail if to is not in the graph', () => {\n fc.assert(\n fc.property(edgeArbitrary, nodeConfigArbitrary, (edge, nodeConfig) => {\n fc.pre(isVectorPossible(edge.vector))\n\n const builder = new OmniGraphBuilder()\n\n builder\n .addNodes(\n { point: edge.vector.from, config: nodeConfig },\n { point: edge.vector.to, config: nodeConfig }\n )\n .removeNodeAt(edge.vector.to)\n .addEdges(edge)\n\n expect(builder.edges).toEqual([edge])\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58341, "name": "unknown", "code": "it('should add a single edge', () => {\n fc.assert(\n fc.property(edgeArbitrary, nodeConfigArbitrary, (edge, nodeConfig) => {\n fc.pre(isVectorPossible(edge.vector))\n\n const builder = new OmniGraphBuilder()\n\n builder\n .addNodes({ point: edge.vector.from, config: nodeConfig })\n .addNodes({ point: edge.vector.to, config: nodeConfig })\n .addEdges(edge)\n expect(builder.edges).toEqual([edge])\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58342, "name": "unknown", "code": "it('should not add a duplicate edge', () => {\n fc.assert(\n fc.property(edgeArbitrary, nodeConfigArbitrary, (edge, nodeConfig) => {\n fc.pre(isVectorPossible(edge.vector))\n\n const builder = new OmniGraphBuilder()\n\n builder\n .addNodes({ point: edge.vector.from, config: nodeConfig })\n .addNodes({ point: edge.vector.to, config: nodeConfig })\n .addEdges(edge, edge)\n expect(builder.edges).toEqual([edge])\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58343, "name": "unknown", "code": "it('should overwrite an edge if the points are equal', () => {\n fc.assert(\n fc.property(\n vectorArbitrary,\n edgeConfigArbitrary,\n edgeConfigArbitrary,\n nodeConfigArbitrary,\n (vector, configA, configB, nodeConfig) => {\n fc.pre(isVectorPossible(vector))\n\n const builder = new OmniGraphBuilder()\n\n const edgeA = { vector, config: configA }\n const edgeB = { vector, config: configB }\n\n builder\n .addNodes({ point: vector.from, config: nodeConfig })\n .addNodes({ point: vector.to, config: nodeConfig })\n .addEdges(edgeA, edgeB)\n expect(builder.edges).toEqual([edgeB])\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58344, "name": "unknown", "code": "it('should not do anything when there are no edges', () => {\n fc.assert(\n fc.property(edgeArbitrary, (edge) => {\n fc.pre(isVectorPossible(edge.vector))\n\n const builder = new OmniGraphBuilder()\n\n builder.removeEdgeAt(edge.vector)\n expect(builder.edges).toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58345, "name": "unknown", "code": "it('should return self', () => {\n fc.assert(\n fc.property(edgeArbitrary, (edge) => {\n fc.pre(isVectorPossible(edge.vector))\n\n const builder = new OmniGraphBuilder()\n\n expect(builder.removeEdgeAt(edge.vector)).toBe(builder)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58346, "name": "unknown", "code": "it('should remove a edge at a specified vector', () => {\n fc.assert(\n fc.property(edgeArbitrary, nodeConfigArbitrary, (edge, nodeConfig) => {\n fc.pre(isVectorPossible(edge.vector))\n\n const builder = new OmniGraphBuilder()\n\n builder\n .addNodes({ point: edge.vector.from, config: nodeConfig })\n .addNodes({ point: edge.vector.to, config: nodeConfig })\n .addEdges(edge)\n\n builder.removeEdgeAt(edge.vector)\n expect(builder.edges).toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58347, "name": "unknown", "code": "it('should not remove edges at different vectors', () => {\n fc.assert(\n fc.property(edgeArbitrary, edgeArbitrary, nodeConfigArbitrary, (edgeA, edgeB, nodeConfig) => {\n fc.pre(isVectorPossible(edgeA.vector))\n fc.pre(isVectorPossible(edgeB.vector))\n fc.pre(!areVectorsEqual(edgeA.vector, edgeB.vector))\n\n const builder = new OmniGraphBuilder()\n\n builder\n .addNodes({ point: edgeA.vector.from, config: nodeConfig })\n .addNodes({ point: edgeA.vector.to, config: nodeConfig })\n .addNodes({ point: edgeB.vector.from, config: nodeConfig })\n .addNodes({ point: edgeB.vector.to, config: nodeConfig })\n .addEdges(edgeA, edgeB)\n builder.removeEdgeAt(edgeA.vector)\n expect(builder.edges).toEqual([edgeB])\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58348, "name": "unknown", "code": "it('should return undefined when there are no nodes', () => {\n const builder = new OmniGraphBuilder()\n\n fc.assert(\n fc.property(pointArbitrary, (point) => {\n expect(builder.getNodeAt(point)).toBeUndefined()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58349, "name": "unknown", "code": "it('should return undefined when there are no nodes at a specified point', () => {\n fc.assert(\n fc.property(nodesArbitrary, (nodes) => {\n const node = nodes.at(-1)\n fc.pre(node != null)\n\n const builder = new OmniGraphBuilder()\n\n builder.addNodes(...nodes)\n builder.removeNodeAt(node!.point)\n expect(builder.getNodeAt(node!.point)).toBeUndefined()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58350, "name": "unknown", "code": "it('should return node when there is a node at a specified point', () => {\n fc.assert(\n fc.property(nodesArbitrary, (nodes) => {\n const node = nodes.at(-1)\n fc.pre(node != null)\n\n const builder = new OmniGraphBuilder()\n\n builder.addNodes(...nodes)\n expect(builder.getNodeAt(node!.point)).toBe(node)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58351, "name": "unknown", "code": "it('should return undefined when there are no edges', () => {\n const builder = new OmniGraphBuilder()\n\n fc.assert(\n fc.property(vectorArbitrary, (vector) => {\n expect(builder.getEdgeAt(vector)).toBeUndefined()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58352, "name": "unknown", "code": "it('should return undefined when there are no edges at a specified vector', () => {\n fc.assert(\n fc.property(edgesArbitrary, nodeConfigArbitrary, (edges, nodeConfig) => {\n const edge = edges.at(-1)\n fc.pre(edge != null)\n fc.pre(edges.map((e) => e.vector).every(isVectorPossible))\n\n const builder = new OmniGraphBuilder()\n const nodes = edges.flatMap(({ vector: { from, to } }) => [\n { point: from, config: nodeConfig },\n { point: to, config: nodeConfig },\n ])\n\n builder\n .addNodes(...nodes)\n .addEdges(...edges)\n .removeEdgeAt(edge!.vector)\n expect(builder.getEdgeAt(edge!.vector)).toBeUndefined()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58353, "name": "unknown", "code": "it('should return edge when there is a edge at a specified vector', () => {\n fc.assert(\n fc.property(edgesArbitrary, nodeConfigArbitrary, (edges, nodeConfig) => {\n const edge = edges.at(-1)\n fc.pre(edge != null)\n fc.pre(edges.map((e) => e.vector).every(isVectorPossible))\n\n const builder = new OmniGraphBuilder()\n const nodes = edges.flatMap(({ vector: { from, to } }) => [\n { point: from, config: nodeConfig },\n { point: to, config: nodeConfig },\n ])\n\n builder.addNodes(...nodes).addEdges(...edges)\n expect(builder.getEdgeAt(edge!.vector)).toBe(edge)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58354, "name": "unknown", "code": "it('should return an empty array when there are no edges', () => {\n const builder = new OmniGraphBuilder()\n\n fc.assert(\n fc.property(pointArbitrary, (point) => {\n expect(builder.getEdgesFrom(point)).toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58355, "name": "unknown", "code": "it('should return all edges that originate at a specific point', () => {\n fc.assert(\n fc.property(edgesArbitrary, nodeConfigArbitrary, (edges, nodeConfig) => {\n const edge = edges.at(-1)\n fc.pre(edge != null)\n fc.pre(edges.map((e) => e.vector).every(isVectorPossible))\n\n const builder = new OmniGraphBuilder()\n const nodes = edges.flatMap(({ vector: { from, to } }) => [\n { point: from, config: nodeConfig },\n { point: to, config: nodeConfig },\n ])\n\n builder.addNodes(...nodes).addEdges(...edges)\n\n const edgesFrom = builder.edges.filter(({ vector }) =>\n arePointsEqual(vector.from, edge!.vector.from)\n )\n expect(builder.getEdgesFrom(edge!.vector.from)).toEqual(edgesFrom)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58356, "name": "unknown", "code": "it('should return an empty array when there are no edges', () => {\n const builder = new OmniGraphBuilder()\n\n fc.assert(\n fc.property(pointArbitrary, (point) => {\n expect(builder.getEdgesTo(point)).toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58357, "name": "unknown", "code": "it('should return all edges that end at a specific point', () => {\n fc.assert(\n fc.property(edgesArbitrary, nodeConfigArbitrary, (edges, nodeConfig) => {\n const edge = edges.at(-1)\n fc.pre(edge != null)\n fc.pre(edges.map((e) => e.vector).every(isVectorPossible))\n\n const builder = new OmniGraphBuilder()\n const nodes = edges.flatMap(({ vector: { from, to } }) => [\n { point: from, config: nodeConfig },\n { point: to, config: nodeConfig },\n ])\n\n builder.addNodes(...nodes).addEdges(...edges)\n\n const edgesTo = builder.edges.filter(({ vector }) => arePointsEqual(vector.to, edge!.vector.to))\n expect(builder.getEdgesTo(edge!.vector.to)).toEqual(edgesTo)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58358, "name": "unknown", "code": "it('should return padded values for address', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, (address) => {\n const bytes = makeBytes32(address)\n\n expect(bytes.length).toBe(66)\n expect(BigInt(bytes)).toBe(BigInt(address))\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58359, "name": "unknown", "code": "it('should return identity for bytes32', () => {\n fc.assert(\n fc.property(evmBytes32Arbitrary, (bytes) => {\n expect(makeBytes32(bytes)).toBe(bytes)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58360, "name": "unknown", "code": "it('should return true for two nullish values', () => {\n fc.assert(\n fc.property(zeroishBytes32Arbitrary, zeroishBytes32Arbitrary, (a, b) => {\n expect(areBytes32Equal(a, b)).toBe(true)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58361, "name": "unknown", "code": "it('should return true for two identical values', () => {\n fc.assert(\n fc.property(evmBytes32Arbitrary, (a) => {\n expect(areBytes32Equal(a, a)).toBe(true)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58362, "name": "unknown", "code": "it('should return true for an address and bytes', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, (address) => {\n expect(areBytes32Equal(address, makeBytes32(address))).toBe(true)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58363, "name": "unknown", "code": "it('should return false for a zeroish value and a non-zeroish address', () => {\n fc.assert(\n fc.property(zeroishBytes32Arbitrary, evmAddressArbitrary, (bytes, address) => {\n fc.pre(!isZero(address))\n\n expect(areBytes32Equal(bytes, address)).toBe(false)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58364, "name": "unknown", "code": "it('should return false for a zeroish value and a non-zeroish bytes', () => {\n fc.assert(\n fc.property(zeroishBytes32Arbitrary, evmBytes32Arbitrary, (a, b) => {\n fc.pre(!isZero(b))\n\n expect(areBytes32Equal(a, b)).toBe(false)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58365, "name": "unknown", "code": "it('should return true for identical UInt8Arrays', () => {\n fc.assert(\n fc.property(fc.uint8Array({ minLength: 1 }), (bytes) => {\n expect(areBytes32Equal(bytes, bytes)).toBe(true)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58366, "name": "unknown", "code": "it('should return true for a UInt8Array & its hex representation', () => {\n fc.assert(\n fc.property(fc.uint8Array({ minLength: 1, maxLength: 32 }), (bytes) => {\n expect(areBytes32Equal(bytes, makeBytes32(bytes))).toBe(true)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58369, "name": "unknown", "code": "it('should return false with non-zero address', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, (address) => {\n fc.pre(address !== AddressZero)\n\n expect(isZero(address)).toBe(false)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58370, "name": "unknown", "code": "it('should return false with non-zero bytes32', () => {\n fc.assert(\n fc.property(evmBytes32Arbitrary, (address) => {\n fc.pre(address !== ZERO_BYTES)\n\n expect(isZero(address)).toBe(false)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58371, "name": "unknown", "code": "it('should return true with a zero-only UInt8Array', () => {\n fc.assert(\n fc.property(fc.uint8Array({ min: 0, max: 0 }), (bytes) => {\n expect(isZero(bytes)).toBe(true)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58372, "name": "unknown", "code": "it('should return false with a non-zero UInt8Array', () => {\n fc.assert(\n fc.property(fc.uint8Array({ minLength: 1 }), (bytes) => {\n fc.pre(bytes.some((byte) => byte !== 0))\n\n expect(isZero(bytes)).toBe(false)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58373, "name": "unknown", "code": "it('should return address with non-zero address', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, (address) => {\n fc.pre(address !== AddressZero)\n\n expect(ignoreZero(address)).toBe(address)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58374, "name": "unknown", "code": "it('should return 0 for two identical addresses', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, (address) => {\n expect(compareBytes32Ascending(address, address)).toBe(0)\n expect(compareBytes32Ascending(address, makeBytes32(address))).toBe(0)\n expect(compareBytes32Ascending(makeBytes32(address), makeBytes32(address))).toBe(0)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58375, "name": "unknown", "code": "it('should return a negative value for zero address and any other address', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, (address) => {\n fc.pre(!isZero(address))\n\n expect(compareBytes32Ascending(AddressZero, address)).toBeLessThan(0)\n expect(compareBytes32Ascending(AddressZero, makeBytes32(address))).toBeLessThan(0)\n expect(compareBytes32Ascending(makeBytes32(AddressZero), address)).toBeLessThan(0)\n expect(compareBytes32Ascending(makeBytes32(AddressZero), makeBytes32(address))).toBeLessThan(0)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58376, "name": "unknown", "code": "it('should return a positive value for zero address and any other address', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, (address) => {\n fc.pre(!isZero(address))\n\n expect(compareBytes32Ascending(address, AddressZero)).toBeGreaterThan(0)\n expect(compareBytes32Ascending(makeBytes32(address), AddressZero)).toBeGreaterThan(0)\n expect(compareBytes32Ascending(address, makeBytes32(AddressZero))).toBeGreaterThan(0)\n expect(compareBytes32Ascending(makeBytes32(address), makeBytes32(AddressZero))).toBeGreaterThan(0)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58377, "name": "unknown", "code": "it('should return a negative if address comes before the other address', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, evmAddressArbitrary, (addressA, addressB) => {\n fc.pre(addressA.toLowerCase() < addressB.toLowerCase())\n\n expect(compareBytes32Ascending(addressA, addressB)).toBeLessThan(0)\n expect(compareBytes32Ascending(addressA, makeBytes32(addressB))).toBeLessThan(0)\n expect(compareBytes32Ascending(makeBytes32(addressA), addressB)).toBeLessThan(0)\n expect(compareBytes32Ascending(makeBytes32(addressA), makeBytes32(addressB))).toBeLessThan(0)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58378, "name": "unknown", "code": "it('should return a negative if address comes after the other address', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, evmAddressArbitrary, (addressA, addressB) => {\n fc.pre(addressA.toLowerCase() > addressB.toLowerCase())\n\n expect(compareBytes32Ascending(addressA, addressB)).toBeGreaterThan(0)\n expect(compareBytes32Ascending(makeBytes32(addressA), addressB)).toBeGreaterThan(0)\n expect(compareBytes32Ascending(addressA, makeBytes32(addressB))).toBeGreaterThan(0)\n expect(compareBytes32Ascending(makeBytes32(addressA), makeBytes32(addressB))).toBeGreaterThan(0)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58379, "name": "unknown", "code": "it('should have addition, update and deletion working correctly', () => {\n fc.assert(\n fc.property(keyArbitrary, valueArbitrary, valueArbitrary, (key, value1, value2) => {\n const map = new TestMap()\n\n // Sanity check first\n expect(map.has(key)).toBeFalsy()\n\n // Set a value first\n map.set(key, value1)\n\n // Check whether the insertion worked\n expect(map.has(key)).toBeTruthy()\n expect(map.size).toBe(1)\n expect(map.get(key)).toBe(value1)\n expect(Array.from(map.keys())).toEqual([key])\n expect(Array.from(map.values())).toEqual([value1])\n expect(Array.from(map.entries())).toEqual([[key, value1]])\n\n // Now overwrite the value\n map.set(key, value2)\n\n // Check whether the insertion worked\n expect(map.has(key)).toBeTruthy()\n expect(map.size).toBe(1)\n expect(map.get(key)).toBe(value2)\n expect(Array.from(map.keys())).toEqual([key])\n expect(Array.from(map.values())).toEqual([value2])\n expect(Array.from(map.entries())).toEqual([[key, value2]])\n\n // Now delete the value\n map.delete(key)\n\n // And check that the deletion worked\n expect(map.has(key)).toBeFalsy()\n expect(map.size).toBe(0)\n expect(map.get(key)).toBeUndefined()\n expect(Array.from(map.keys())).toEqual([])\n expect(Array.from(map.values())).toEqual([])\n expect(Array.from(map.entries())).toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/map.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58380, "name": "unknown", "code": "it('should instantiate from entries', () => {\n fc.assert(\n fc.property(fc.array(fc.tuple(keyArbitrary, valueArbitrary)), (entries) => {\n const map = new TestMap(entries)\n\n // This looks like the simplest way of deduplicating the entries\n //\n // For the test below we want to make sure that we check that the map\n // contains the last value belonging to a key - entries can contain\n // duplicate keys so we need this helper data structure to store the last value set for a key\n const valuesByHash = Object.fromEntries(entries.map(([key, value]) => [hash(key), value]))\n\n for (const [key] of entries) {\n const hashedKey = hash(key)\n expect(hashedKey in valuesByHash).toBeTruthy()\n\n const value = valuesByHash[hashedKey]\n\n expect(map.has(key)).toBeTruthy()\n expect(map.get(key)).toBe(value)\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/map.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58381, "name": "unknown", "code": "it('should clear correctly', () => {\n fc.assert(\n fc.property(fc.array(fc.tuple(keyArbitrary, valueArbitrary)), (entries) => {\n const map = new TestMap(entries)\n\n map.clear()\n\n expect(map.size).toBe(0)\n expect(Array.from(map.keys())).toEqual([])\n expect(Array.from(map.values())).toEqual([])\n expect(Array.from(map.entries())).toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/map.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58390, "name": "unknown", "code": "it('should return true for identical values', () => {\n fc.assert(\n fc.property(fc.anything(), (value) => {\n expect(isDeepEqual(value, value)).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/assertion.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`isDeepEqual` returns true when comparing identical values.", "mode": "fast-check"} {"id": 58408, "name": "unknown", "code": "it('should parse a BN instance', () => {\n fc.assert(\n fc.property(bnArbitrary, (bn) => {\n expect(BNBigIntSchema.parse(bn)).toBe(BigInt(bn.toString()))\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-solana/test/common/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`BNBigIntSchema.parse` converts a BN instance to its equivalent BigInt representation.", "mode": "fast-check"} {"id": 58410, "name": "unknown", "code": "it('should parse a PublicKey instance', () => {\n fc.assert(\n fc.property(\n keypairArbitrary.map((keypair) => keypair.publicKey),\n (publicKey) => {\n expect(PublicKeySchema.parse(publicKey)).toBe(publicKey)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-solana/test/common/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`PublicKeySchema` correctly parses a `PublicKey` instance to itself without alteration.", "mode": "fast-check"} {"id": 58430, "name": "unknown", "code": "it('should resolve with JsonRpcProvider if urlFactory resolves with a URL', async () => {\n await fc.assert(\n fc.asyncProperty(urlArbitrary, endpointArbitrary, async (url, eid) => {\n const urlFactory = jest.fn().mockResolvedValue(url)\n const providerFactory = createProviderFactory(urlFactory)\n const provider = await providerFactory(eid)\n\n expect(provider).toBeInstanceOf(JsonRpcProvider)\n expect(provider.connection.url).toBe(url)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm/test/provider/factory.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "When `urlFactory` resolves with a URL, `providerFactory` should create a `JsonRpcProvider` with the correct connection URL.", "mode": "fast-check"} {"id": 58432, "name": "unknown", "code": "it('should serialize correctly with a message', () => {\n fc.assert(\n fc.property(messageArbitrary, (message) => {\n fc.pre(message !== '')\n\n expect(String(new UnknownError(message))).toBe(`UnknownError: ${message}`)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm/test/errors/errors.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`UnknownError` should serialize to a string format prefixed with \"UnknownError: \" followed by the message, as long as the message is not empty.", "mode": "fast-check"} {"id": 58433, "name": "unknown", "code": "it('should serialize correctly when message is not passed', () => {\n fc.assert(\n fc.property(reasonArbitrary, (reason) => {\n expect(String(new PanicError(reason))).toBe(\n `PanicError: Contract panicked (assert() has been called). Error code ${reason}`\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm/test/errors/errors.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Creating a `PanicError` without a message should serialize to a default panic message including the error code.", "mode": "fast-check"} {"id": 58434, "name": "unknown", "code": "it('should serialize correctly when message is empty', () => {\n fc.assert(\n fc.property(reasonArbitrary, (reason) => {\n expect(String(new PanicError(reason, ''))).toBe(`PanicError. Error code ${reason}`)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm/test/errors/errors.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`PanicError` serialization results in the format \"PanicError. Error code {reason}\" when the message is empty.", "mode": "fast-check"} {"id": 58443, "name": "unknown", "code": "it('should return address with non-zero address', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, (address) => {\n fc.pre(address !== AddressZero)\n\n expect(makeZeroAddress(address)).toBe(address)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm/test/address.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `makeZeroAddress` function returns the input address unchanged if the address is non-zero.", "mode": "fast-check"} {"id": 58446, "name": "unknown", "code": "it('should resolve if all resolve', async () => {\n await fc.assert(\n fc.asyncProperty(valuesArbitrary, async (values) => {\n const tasks = values.map((value) => jest.fn().mockResolvedValue(value))\n\n expect(await sequence(tasks)).toEqual(values)\n\n // Make sure all the tasks got called\n for (const task of tasks) {\n expect(task).toHaveBeenCalledTimes(1)\n expect(task).toHaveBeenCalledWith()\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58447, "name": "unknown", "code": "it('should reject with the first rejection', async () => {\n await fc.assert(\n fc.asyncProperty(valuesArbitrary, valueArbitrary, valuesArbitrary, async (values1, error, values2) => {\n const tasks1 = values1.map((value) => jest.fn().mockResolvedValue(value))\n const failingTask = jest.fn().mockRejectedValue(error)\n const tasks2 = values2.map((value) => jest.fn().mockResolvedValue(value))\n const tasks = [...tasks1, failingTask, ...tasks2]\n\n await expect(sequence(tasks)).rejects.toBe(error)\n\n // Make sure the first batch got called\n for (const task of tasks1) {\n expect(task).toHaveBeenCalledTimes(1)\n expect(task).toHaveBeenCalledWith()\n }\n\n // Make sure the failing task got called\n expect(failingTask).toHaveBeenCalledTimes(1)\n expect(failingTask).toHaveBeenCalledWith()\n\n // Make sure the second batch didn't get called\n for (const task of tasks2) {\n expect(task).not.toHaveBeenCalled()\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58448, "name": "unknown", "code": "it('should execute one by one', async () => {\n await fc.assert(\n fc.asyncProperty(valuesArbitrary, async (values) => {\n fc.pre(values.length > 0)\n\n const tasks = values.map((value) => jest.fn().mockResolvedValue(value))\n\n await sequence(tasks)\n\n tasks.reduce((task1, task2) => {\n return expect(task1).toHaveBeenCalledBefore(task2), task2\n })\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58455, "name": "unknown", "code": "it('should resolve with the return value of a synchronous task', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, async (value) => {\n const task = jest.fn().mockReturnValue(value)\n const handleError = jest.fn()\n\n await expect(mapError(task, handleError)).resolves.toBe(value)\n expect(handleError).not.toHaveBeenCalled()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`mapError` resolves with the return value of a synchronous task without invoking the error handler.", "mode": "fast-check"} {"id": 58459, "name": "unknown", "code": "it('should resolve with the return value of a synchronous task', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, async (value) => {\n const task = jest.fn().mockReturnValue(value)\n const handleError = jest.fn()\n\n await expect(tapError(task, handleError)).resolves.toBe(value)\n expect(handleError).not.toHaveBeenCalled()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`tapError` resolves with the return value of a synchronous task and does not call `handleError`.", "mode": "fast-check"} {"id": 58465, "name": "unknown", "code": "it('should throw', () => {\n fc.assert(\n fc.property(numAttemptsArbitrary, (numAttempts) => {\n expect(() => createSimpleRetryStrategy(numAttempts)).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`createSimpleRetryStrategy` should throw an exception when invoked with various values of `numAttempts`.", "mode": "fast-check"} {"id": 58466, "name": "unknown", "code": "it('should return a function that returns true until numAttempts is reached', () => {\n fc.assert(\n fc.property(numAttemptsArbitrary, (numAttempts) => {\n const strategy = createSimpleRetryStrategy(numAttempts)\n\n // The first N attempts should return true since we want to retry them\n for (let attempt = 1; attempt <= numAttempts; attempt++) {\n expect(strategy(attempt, 'error', [], [])).toBeTruthy()\n }\n\n // The N+1th attempt should return false\n expect(strategy(numAttempts + 1, 'error', [], [])).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "A function created by `createSimpleRetryStrategy` should return true for attempts up to `numAttempts` and false for the `numAttempts + 1` attempt.", "mode": "fast-check"} {"id": 58468, "name": "unknown", "code": "it('should not throw if called with an array of networks defined in hardhat config', () => {\n fc.assert(\n fc.property(definedNetworksArrayArbitrary, (networks) => {\n expect(assertDefinedNetworks(networks)).toBe(networks)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/internal/assertions.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58469, "name": "unknown", "code": "it('should not throw if called with a Set of networks defined in hardhat config', () => {\n fc.assert(\n fc.property(definedNetworksSetArbitrary, (networks) => {\n expect(assertDefinedNetworks(networks)).toBe(networks)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/internal/assertions.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58470, "name": "unknown", "code": "it('should throw if called if a network has not been defined in an array', () => {\n fc.assert(\n fc.property(definedNetworksArrayArbitrary, fc.string(), (networks, network) => {\n fc.pre(!definedNetworks.includes(network))\n\n expect(() => assertDefinedNetworks([...networks, network])).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/internal/assertions.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58471, "name": "unknown", "code": "it('should throw if called if a network has not been defined in a Set', () => {\n fc.assert(\n fc.property(definedNetworksSetArbitrary, fc.string(), (networks, network) => {\n fc.pre(!definedNetworks.includes(network))\n\n expect(() => assertDefinedNetworks(networks.add(network))).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/internal/assertions.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58475, "name": "unknown", "code": "it('should work goddammit', async () => {\n await fc.assert(\n fc.asyncProperty(portArbitrary, anvilOptionsRecordArbitrary, async (port, anvilOptions) => {\n const simulationConfig = resolveSimulationConfig({ port }, hre.config)\n const spec = serializeDockerComposeSpec(createSimulationComposeSpec(simulationConfig, anvilOptions))\n\n await writeFile(SPEC_FILE_PATH, spec)\n\n const result = validateSpec()\n\n expect(result.stderr.toString('utf8')).toBe('')\n expect(result.status).toBe(0)\n }),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/simulation/compose.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58476, "name": "unknown", "code": "it('should pass the original value if contract is already an OmniPoint', async () => {\n await fc.assert(\n fc.asyncProperty(pointArbitrary, async (point) => {\n const contractFactory = jest.fn().mockRejectedValue('Oh no')\n const transformer = createOmniPointHardhatTransformer(contractFactory)\n\n const transformed = await transformer(point)\n\n expect(transformed).toBe(point)\n expect(contractFactory).not.toHaveBeenCalled()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/transformations.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58477, "name": "unknown", "code": "it('should call the contractFactory if contract is not an OmniPoint', async () => {\n await fc.assert(\n fc.asyncProperty(pointHardhatArbitrary, evmAddressArbitrary, async (point, address) => {\n fc.pre(!isOmniPoint(point))\n\n const contract = new Contract(address, [])\n const contractFactory = jest\n .fn()\n .mockImplementation(async (point: OmniPointHardhat) => ({ eid: point.eid, contract }))\n const transformer = createOmniPointHardhatTransformer(contractFactory)\n\n const transformed = await transformer(point)\n\n expect(transformed).toEqual({ ...point, address })\n expect(contractFactory).toHaveBeenCalledTimes(1)\n expect(contractFactory).toHaveBeenCalledWith(point)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/transformations.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58478, "name": "unknown", "code": "it('should add the contractName if point is not an OmniPoint', async () => {\n await fc.assert(\n fc.asyncProperty(pointHardhatArbitrary, evmAddressArbitrary, async (point, address) => {\n fc.pre(!isOmniPoint(point))\n\n const contract = new Contract(address, [])\n const contractFactory = jest\n .fn()\n .mockImplementation(async (point: OmniPointHardhat) => ({ eid: point.eid, contract }))\n const transformer = createOmniPointHardhatTransformer(contractFactory)\n\n const transformed = await transformer(point)\n\n expect(transformed).toEqual({ eid: point.eid, address, contractName: point.contractName })\n expect(contractFactory).toHaveBeenCalledTimes(1)\n expect(contractFactory).toHaveBeenCalledWith(point)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/transformations.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58479, "name": "unknown", "code": "it('should call the pointTransformer on the point', async () => {\n await fc.assert(\n fc.asyncProperty(\n pointHardhatArbitrary,\n evmAddressArbitrary,\n fc.anything(),\n async (point, address, config) => {\n fc.pre(!isOmniPoint(point))\n\n const pointTransformer = jest.fn().mockImplementation(async (point: OmniPointHardhat) => ({\n eid: point.eid,\n address: address,\n }))\n const transformer = createOmniNodeHardhatTransformer(pointTransformer)\n\n const node = await transformer({ contract: point, config })\n\n expect(node).toEqual({ point: { eid: point.eid, address }, config })\n expect(pointTransformer).toHaveBeenCalledTimes(1)\n expect(pointTransformer).toHaveBeenCalledWith(point)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/transformations.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58480, "name": "unknown", "code": "it('should call the pointTransformer on from and to', async () => {\n await fc.assert(\n fc.asyncProperty(\n pointHardhatArbitrary,\n pointHardhatArbitrary,\n evmAddressArbitrary,\n fc.anything(),\n async (from, to, address, config) => {\n const pointTransformer = jest.fn().mockImplementation(async (point: OmniPointHardhat) => ({\n eid: point.eid,\n address,\n }))\n const transformer = createOmniEdgeHardhatTransformer(pointTransformer)\n\n const edge = await transformer({ from, to, config })\n\n expect(edge).toEqual({\n vector: { from: { eid: from.eid, address }, to: { eid: to.eid, address } },\n config,\n })\n expect(pointTransformer).toHaveBeenCalledTimes(2)\n expect(pointTransformer).toHaveBeenCalledWith(from)\n expect(pointTransformer).toHaveBeenCalledWith(to)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/transformations.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58481, "name": "unknown", "code": "it('should call the nodeTransformer and edgeTransformer for every node and edge and return the result', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.array(nodeHardhatArbitrary),\n fc.array(edgeHardhatArbitrary),\n async (contracts, connections) => {\n const nodeTransformer = jest.fn().mockImplementation(async (node) => ({ node }))\n const edgeTransformer = jest.fn().mockImplementation(async (edge) => ({ edge }))\n const transformer = createOmniGraphHardhatTransformer(nodeTransformer, edgeTransformer)\n\n const graph = await transformer({ contracts, connections })\n\n expect(graph.contracts).toEqual(contracts.map((node) => ({ node })))\n expect(graph.connections).toEqual(connections.map((edge) => ({ edge })))\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/transformations.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58482, "name": "unknown", "code": "it('should support sequential applicative', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.array(nodeHardhatArbitrary),\n fc.array(edgeHardhatArbitrary),\n async (contracts, connections) => {\n const nodeTransformer = jest.fn().mockImplementation(async (node) => ({ node }))\n const edgeTransformer = jest.fn().mockImplementation(async (edge) => ({ edge }))\n const transformerSequential = createOmniGraphHardhatTransformer(\n nodeTransformer,\n edgeTransformer,\n sequence\n )\n const transformerParallel = createOmniGraphHardhatTransformer(\n nodeTransformer,\n edgeTransformer,\n parallel\n )\n\n const graphSequential = await transformerSequential({ contracts, connections })\n const graphParallel = await transformerParallel({ contracts, connections })\n\n expect(graphSequential).toEqual(graphParallel)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/transformations.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58483, "name": "unknown", "code": "it('should just work', () => {\n fc.assert(\n fc.property(endpointArbitrary, evmAddressArbitrary, (eid, address) => {\n const omniDeployment: OmniDeployment = { eid, deployment: { address } as Deployment }\n\n expect(omniDeploymentToPoint(omniDeployment)).toEqual({ eid, address })\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58484, "name": "unknown", "code": "it('should just work', () => {\n fc.assert(\n fc.property(endpointArbitrary, evmAddressArbitrary, (eid, address) => {\n const omniDeployment: OmniDeployment = { eid, deployment: { address, abi: [] } as Deployment }\n const omniContract = omniDeploymentToContract(omniDeployment)\n\n // chai is not great with deep equality on class instances so we need to compare the result property by property\n expect(omniContract.eid).toBe(eid)\n expect(omniContract.contract.address).toBe(address)\n expect(omniContract.contract.interface.fragments).toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58485, "name": "unknown", "code": "it('should fall back on getting the artifact based on the deployments if artifact not found', async () => {\n await fc.assert(\n fc.asyncProperty(evmAddressArbitrary, async (address) => {\n const environmentFactory = createGetHreByEid(hre)\n const contractFactory = createContractFactory(environmentFactory)\n\n const env = await environmentFactory(EndpointId.ETHEREUM_V2_MAINNET)\n jest.spyOn(env.deployments, 'getArtifact').mockRejectedValue(new Error(`oh no`))\n jest.spyOn(env.deployments, 'getDeploymentsFromAddress').mockResolvedValue([\n {\n address,\n abi: [],\n },\n ])\n\n // Then check whether the factory will get it for us\n const deployment = await contractFactory({\n eid: EndpointId.ETHEREUM_V2_MAINNET,\n address,\n contractName: 'MyContract',\n })\n\n expect(deployment).toEqual({\n eid: EndpointId.ETHEREUM_V2_MAINNET,\n contract: expect.any(Contract),\n })\n expect(env.deployments.getArtifact).toHaveBeenCalledWith('MyContract')\n expect(env.deployments.getDeploymentsFromAddress).toHaveBeenCalledWith(address)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58486, "name": "unknown", "code": "it('should reject when eid does not exist', async () => {\n await fc.assert(\n fc.asyncProperty(evmAddressArbitrary, async (address) => {\n const contractFactory = createContractFactory()\n\n await expect(() =>\n contractFactory({ eid: EndpointId.CANTO_TESTNET, address })\n ).rejects.toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58487, "name": "unknown", "code": "it('should reject when contract has not been deployed', async () => {\n await fc.assert(\n fc.asyncProperty(evmAddressArbitrary, async (address) => {\n const contractFactory = createContractFactory()\n\n await expect(() =>\n contractFactory({ eid: EndpointId.ETHEREUM_V2_MAINNET, address })\n ).rejects.toThrow(/Could not find a deployment for address/)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58488, "name": "unknown", "code": "it('should resolve when there is only one deployment for the contract', async () => {\n await fc.assert(\n fc.asyncProperty(evmAddressArbitrary, async (address) => {\n const environmentFactory = createGetHreByEid(hre)\n const contractFactory = createContractFactory(environmentFactory)\n\n const env = await environmentFactory(EndpointId.ETHEREUM_V2_MAINNET)\n jest.spyOn(env.deployments, 'getDeploymentsFromAddress').mockResolvedValue([\n {\n address,\n abi: [],\n },\n ])\n\n // Then check whether the factory will get it for us\n const deployment = await contractFactory({\n eid: EndpointId.ETHEREUM_V2_MAINNET,\n address,\n })\n\n expect(deployment).toEqual({\n eid: EndpointId.ETHEREUM_V2_MAINNET,\n contract: expect.any(Contract),\n })\n expect(env.deployments.getDeploymentsFromAddress).toHaveBeenCalledWith(address)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58489, "name": "unknown", "code": "it('should merge ABIs when there are multiple deployments with the same address (proxy deployments)', async () => {\n await fc.assert(\n fc.asyncProperty(evmAddressArbitrary, async (address) => {\n const environmentFactory = createGetHreByEid(hre)\n const contractFactory = createContractFactory(environmentFactory)\n\n const env = await environmentFactory(EndpointId.ETHEREUM_V2_MAINNET)\n jest.spyOn(env.deployments, 'getDeploymentsFromAddress').mockResolvedValue([\n {\n address,\n abi: [\n { name: 'implementation', outputs: [], stateMutability: 'view', type: 'function' },\n ],\n },\n {\n address,\n abi: [\n { name: 'contractMethod', outputs: [], stateMutability: 'view', type: 'function' },\n ],\n },\n ])\n\n // Then check whether the factory will get it for us\n const omniContract = await contractFactory({\n eid: EndpointId.ETHEREUM_V2_MAINNET,\n address,\n })\n\n expect(omniContract).toEqual({\n eid: EndpointId.ETHEREUM_V2_MAINNET,\n contract: expect.any(Contract),\n })\n expect(omniContract.contract.implementation).toBeInstanceOf(Function)\n expect(omniContract.contract.contractMethod).toBeInstanceOf(Function)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58490, "name": "unknown", "code": "it('should reject if contractFactory rejects', async () => {\n await fc.assert(\n fc.asyncProperty(pointArbitrary, async (point) => {\n const error = new Error()\n const contractFactory = jest.fn().mockRejectedValue(error)\n const connectedContractFactory = createConnectedContractFactory(contractFactory)\n\n await expect(connectedContractFactory(point)).rejects.toBe(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/contracts.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58491, "name": "unknown", "code": "it('should reject if providerFactory rejects', async () => {\n await fc.assert(\n fc.asyncProperty(pointArbitrary, async (point) => {\n const error = new Error()\n const contractFactory = jest.fn().mockResolvedValue(new Contract(makeZeroAddress(undefined), []))\n const providerFactory = jest.fn().mockRejectedValue(error)\n const connectedContractFactory = createConnectedContractFactory(contractFactory, providerFactory)\n\n await expect(connectedContractFactory(point)).rejects.toBe(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/contracts.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58492, "name": "unknown", "code": "it('should return a connected contract', async () => {\n await fc.assert(\n fc.asyncProperty(pointArbitrary, async (point) => {\n const contract = new Contract(makeZeroAddress(undefined), [])\n const provider = new JsonRpcProvider()\n const contractFactory = jest.fn().mockResolvedValue({ eid: point.eid, contract })\n const providerFactory = jest.fn().mockResolvedValue(provider)\n const connectedContractFactory = createConnectedContractFactory(contractFactory, providerFactory)\n\n const connectedOmniContract = await connectedContractFactory(point)\n\n expect(connectedOmniContract.eid).toBe(point.eid)\n expect(connectedOmniContract.contract).not.toBe(contract)\n expect(connectedOmniContract.contract).toBeInstanceOf(Contract)\n expect(connectedOmniContract.contract.provider).toBe(provider)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/contracts.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58493, "name": "unknown", "code": "it('should throw if negative index is passed', () => {\n fc.assert(\n fc.property(fc.integer({ max: -1 }), (index) => {\n expect(() => signer.parse('signer', String(index))).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/cli.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58494, "name": "unknown", "code": "it('should return the address if valid address is passed', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, (address) => {\n expect(signer.parse('signer', address)).toEqual({ type: 'address', address })\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/cli.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58495, "name": "unknown", "code": "it('should return the index if non-negative index is passed', () => {\n fc.assert(\n fc.property(fc.integer({ min: 0 }), (index) => {\n expect(signer.parse('signer', String(index))).toEqual({ type: 'index', index })\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/cli.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58496, "name": "unknown", "code": "it('should parse all valid endpoint IDs', () => {\n fc.assert(\n fc.property(endpointArbitrary, (eid) => {\n expect(types.eid.parse('eid', String(eid))).toEqual(eid)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/cli.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58497, "name": "unknown", "code": "it('should parse all valid endpoint labels', () => {\n fc.assert(\n fc.property(endpointArbitrary, (eid) => {\n expect(types.eid.parse('eid', EndpointId[eid]!)).toEqual(eid)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/cli.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58498, "name": "unknown", "code": "it('should not parse invalid strings', () => {\n fc.assert(\n fc.property(fc.string(), (eid) => {\n // We filter out the values that by any slim chance could be valid endpoint IDs\n fc.pre(EndpointId[eid] == null)\n fc.pre(EndpointId[parseInt(eid)] == null)\n\n expect(() => types.eid.parse('eid', eid)).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/cli.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58499, "name": "unknown", "code": "it('should not parse invalid numbers', () => {\n fc.assert(\n fc.property(fc.integer(), (eid) => {\n fc.pre(EndpointId[eid] == null)\n\n expect(() => types.eid.parse('eid', String(eid))).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/cli.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58500, "name": "unknown", "code": "it('should return undefined if called with undefined definition', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, async (eid) => {\n await expect(createSignerAddressOrIndexFactory()(eid)).resolves.toBeUndefined()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58501, "name": "unknown", "code": "it('should return address if called with address definition', async () => {\n await fc.assert(\n fc.asyncProperty(evmAddressArbitrary, endpointArbitrary, async (address, eid) => {\n await expect(createSignerAddressOrIndexFactory({ type: 'address', address })(eid)).resolves.toBe(\n address\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58502, "name": "unknown", "code": "it('should return index if called with index definition', async () => {\n await fc.assert(\n fc.asyncProperty(fc.integer(), endpointArbitrary, async (index, eid) => {\n await expect(createSignerAddressOrIndexFactory({ type: 'index', index })(eid)).resolves.toBe(index)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58503, "name": "unknown", "code": "it('should reject if called with a missing named definition', async () => {\n const mockGetNamedAccounts = jest.fn().mockResolvedValue({ wombat: '0xwombat' })\n const mockHre = {\n getNamedAccounts: mockGetNamedAccounts,\n }\n const hreFactory = jest.fn().mockResolvedValue(mockHre)\n\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, async (eid) => {\n await expect(\n createSignerAddressOrIndexFactory({ type: 'named', name: 'no-wombat' }, hreFactory)(eid)\n ).rejects.toThrow(`Missing named account 'no-wombat' for eid ${formatEid(eid)}`)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58504, "name": "unknown", "code": "it('should resolve with an address if called with a defined named definition', async () => {\n const mockGetNamedAccounts = jest.fn().mockResolvedValue({ wombat: '0xwombat' })\n const mockHre = {\n getNamedAccounts: mockGetNamedAccounts,\n }\n const hreFactory = jest.fn().mockResolvedValue(mockHre)\n\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, async (eid) => {\n await expect(\n createSignerAddressOrIndexFactory({ type: 'named', name: 'wombat' }, hreFactory)(eid)\n ).resolves.toBe('0xwombat')\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm-hardhat/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58505, "name": "unknown", "code": "it('should not run tsc', async () => {\n await fc.assert(\n fc.asyncProperty(fc.oneof(fc.string(), fc.constantFrom(undefined)), async (env) => {\n fc.pre(env !== 'production')\n\n const plugin = createDeclarationBuild({ enabled: undefined })\n\n await plugin.buildEnd.call(pluginContext)\n\n expect(spawnSyncMock).not.toHaveBeenCalled()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/build-devtools/test/tsup/declarations.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58506, "name": "unknown", "code": "it('executorLzReceiveOption', async () => {\n // sanity check that generated options are the same with value as 0 and not provided.\n expect(Options.newOptions().addExecutorLzReceiveOption(1, 0)).toEqual(\n Options.newOptions().addExecutorLzReceiveOption(1)\n )\n await fc.assert(\n fc.asyncProperty(\n omnicounterIncrementTypeArbitrary,\n gasLimitArbitrary,\n nativeDropArbitrary,\n\n // Test the generation and submission of arbitrary LZ_RECEIVE Options. The transaction should succeed,\n // and the options from the transaction receipt logs should match the generated input.\n async (type, gasLimit, nativeDrop) => {\n const options = Options.newOptions().addExecutorLzReceiveOption(gasLimit, nativeDrop)\n const packetSentEvents = await incrementAndReturnLogs(type, options)\n expect(packetSentEvents).toEqual([\n expect.objectContaining({\n args: expect.objectContaining({\n options: expect.toEqualCaseInsensitive(options.toHex()),\n }),\n }),\n ])\n const rawPacketOptions = packetSentEvents[0]!.args.options\n expect(rawPacketOptions).toEqualCaseInsensitive(options.toHex())\n\n // test decoding\n const packetOptions = Options.fromOptions(rawPacketOptions)\n const decodedExecutorLzReceiveOption = packetOptions.decodeExecutorLzReceiveOption()\n expect(decodedExecutorLzReceiveOption).toEqual({\n gas: gasLimit,\n value: nativeDrop,\n })\n expect(packetOptions.decodeExecutorNativeDropOption()).toEqual([])\n expect(packetOptions.decodeExecutorComposeOption()).toEqual([])\n expect(packetOptions.decodeExecutorOrderedExecutionOption()).toEqual(false)\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/tests/ua-devtools-evm-hardhat-test/test/omnicounter/options.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58507, "name": "unknown", "code": "it('executorComposeOption', async () => {\n await fc.assert(\n fc.asyncProperty(\n omnicounterIncrementTypeArbitrary,\n composedIndexArbitrary,\n gasLimitArbitrary,\n nativeDropArbitrary,\n\n // Test the generation and submission of arbitrary COMPOSE Options. The transaction should succeed, and\n // the options from the transaction receipt logs should match the generated input.\n async (type, index, gasLimit, nativeDrop) => {\n const options = Options.newOptions()\n .addExecutorComposeOption(index, gasLimit, nativeDrop)\n // We also need to add a lzReceive option to avoid Executor_ZeroLzReceiveGasProvided error\n .addExecutorLzReceiveOption(MIN_GAS_LIMIT)\n const packetSentEvents = await incrementAndReturnLogs(type, options)\n expect(packetSentEvents).toEqual([\n expect.objectContaining({\n args: expect.objectContaining({\n options: expect.toEqualCaseInsensitive(options.toHex()),\n }),\n }),\n ])\n const rawPacketOptions = packetSentEvents[0]!.args.options\n expect(rawPacketOptions).toEqualCaseInsensitive(options.toHex())\n\n // test decoding\n const packetOptions = Options.fromOptions(rawPacketOptions)\n const decodedExecutorComposeOptions = packetOptions.decodeExecutorComposeOption()\n expect(decodedExecutorComposeOptions).toEqual([\n {\n index,\n gas: gasLimit,\n value: nativeDrop,\n },\n ])\n expect(packetOptions.decodeExecutorLzReceiveOption()).toEqual({\n gas: MIN_GAS_LIMIT,\n value: BigInt(0),\n })\n expect(packetOptions.decodeExecutorNativeDropOption()).toEqual([])\n expect(packetOptions.decodeExecutorOrderedExecutionOption()).toEqual(false)\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/tests/ua-devtools-evm-hardhat-test/test/omnicounter/options.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58508, "name": "unknown", "code": "it('executorLzNativeDrop', async () => {\n const address = await ethSigner.signer.getAddress()\n await fc.assert(\n fc.asyncProperty(\n omnicounterIncrementTypeArbitrary,\n nativeDropArbitrary,\n\n // Test the generation and submission of arbitrary NATIVE_DROP Options. The transaction should succeed,\n // and the options from the transaction receipt logs should match the generated input.\n async (type, nativeDrop) => {\n const options = Options.newOptions()\n .addExecutorNativeDropOption(nativeDrop, address)\n // We also need to add a lzReceive option to avoid Executor_ZeroLzReceiveGasProvided error\n .addExecutorLzReceiveOption(MIN_GAS_LIMIT)\n const packetSentEvents = await incrementAndReturnLogs(type, options)\n expect(packetSentEvents).toEqual([\n expect.objectContaining({\n args: expect.objectContaining({\n options: expect.toEqualCaseInsensitive(options.toHex()),\n }),\n }),\n ])\n const rawPacketOptions = packetSentEvents[0]!.args.options\n expect(rawPacketOptions).toEqualCaseInsensitive(options.toHex())\n\n // test decoding\n const packetOptions = Options.fromOptions(rawPacketOptions)\n const decodedExecutorNativeDropOptions = packetOptions.decodeExecutorNativeDropOption()\n expect(decodedExecutorNativeDropOptions).toEqual([\n {\n amount: nativeDrop,\n receiver: expect.toEqualCaseInsensitive(makeBytes32(address)),\n },\n ])\n expect(packetOptions.decodeExecutorLzReceiveOption()).toEqual({\n gas: MIN_GAS_LIMIT,\n value: BigInt(0),\n })\n expect(packetOptions.decodeExecutorComposeOption()).toEqual([])\n expect(packetOptions.decodeExecutorOrderedExecutionOption()).toEqual(false)\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/tests/ua-devtools-evm-hardhat-test/test/omnicounter/options.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58509, "name": "unknown", "code": "it('executorOrderedExecutionOption', async () => {\n await fc.assert(\n fc.asyncProperty(\n omnicounterIncrementTypeArbitrary,\n\n // Test the generation and submission of arbitrary ORDERED Options. The transaction should succeed, and the\n // options from the transaction receipt logs should match the generated input.\n async (type) => {\n const options = Options.newOptions()\n .addExecutorOrderedExecutionOption()\n // We also need to add a lzReceive option to avoid Executor_ZeroLzReceiveGasProvided error\n .addExecutorLzReceiveOption(MIN_GAS_LIMIT)\n const packetSentEvents = await incrementAndReturnLogs(type, options)\n expect(packetSentEvents).toHaveLength(1)\n const rawPacketOptions = packetSentEvents[0]!.args.options.toLowerCase()\n expect(rawPacketOptions).toBe(options.toHex().toLowerCase())\n\n // test decoding\n const packetOptions = Options.fromOptions(rawPacketOptions)\n expect(packetOptions.decodeExecutorOrderedExecutionOption()).toBe(true)\n expect(packetOptions.decodeExecutorLzReceiveOption()).toEqual({\n gas: MIN_GAS_LIMIT,\n value: BigInt(0),\n })\n expect(packetOptions.decodeExecutorComposeOption()).toEqual([])\n expect(packetOptions.decodeExecutorNativeDropOption()).toEqual([])\n }\n ),\n { numRuns: 10 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/tests/ua-devtools-evm-hardhat-test/test/omnicounter/options.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58510, "name": "unknown", "code": "it('stacked options', async () => {\n // custom gasLimit arbitrary so \"stacked\" compose options won't have a gasLimit sum that overflows MAX_UINT_128\n const stackedGasLimitArbitrary: fc.Arbitrary = fc.bigInt({\n min: MIN_GAS_LIMIT,\n max: BigInt('0xFFFFFFFFFFFFFFFF'),\n })\n\n // custom nativeDrop arbitrary so \"stacked\" compose options won't have a nativeDrop sum that exceeds DEFAULT_MAX_NATIVE_DROP\n const stackedValueArbitrary: fc.Arbitrary = fc.bigInt({\n min: DEFAULT_MIN_NATIVE_DROP,\n max: DEFAULT_MAX_NATIVE_DROP / BigInt(4),\n })\n\n const address = await ethSigner.signer.getAddress()\n await fc.assert(\n fc.asyncProperty(\n omnicounterIncrementTypeArbitrary,\n composedIndexArbitrary,\n stackedGasLimitArbitrary,\n stackedValueArbitrary,\n\n // Test the generation of multiple Options in a single Packet. The transaction should succeed. Options\n // should be decoded to match inputs. gasLimit and nativeDrop should be summed for Packets that have\n // multiple COMPOSE options for the same index.\n async (type, index, gasLimit, stackedValue) => {\n const options = Options.newOptions()\n .addExecutorComposeOption(index, gasLimit, stackedValue)\n .addExecutorLzReceiveOption(gasLimit, stackedValue)\n .addExecutorNativeDropOption(stackedValue, address)\n .addExecutorComposeOption(index, gasLimit, stackedValue) // Repeat executor compose option to make sure values/gasLimits are summed\n\n const packetSentEvents = await incrementAndReturnLogs(type, options)\n expect(packetSentEvents).toEqual([\n expect.objectContaining({\n args: expect.objectContaining({\n options: expect.toEqualCaseInsensitive(options.toHex()),\n }),\n }),\n ])\n const packetOptions = Options.fromOptions(packetSentEvents[0]!.args.options)\n\n // check executorComposeOption\n const packetComposeOptions = packetOptions.decodeExecutorComposeOption()\n expect(packetComposeOptions).toEqual([\n {\n index,\n gas: gasLimit * BigInt(2),\n // compose options with same index are summed (in this specific case, just multiplied by 2)\n value: stackedValue * BigInt(2),\n },\n ])\n\n // check executorLzReceiveOption\n const packetLzReceiveOption = packetOptions.decodeExecutorLzReceiveOption()\n expect(packetLzReceiveOption).toEqual({\n gas: gasLimit,\n value: stackedValue,\n })\n\n // check executorNativeDropOption\n const packetNativeDropOptions = packetOptions.decodeExecutorNativeDropOption()\n expect(packetNativeDropOptions).toEqual([\n {\n amount: stackedValue,\n receiver: expect.toEqualCaseInsensitive(makeBytes32(address)),\n },\n ])\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/tests/ua-devtools-evm-hardhat-test/test/omnicounter/options.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58511, "name": "unknown", "code": "it('should pass an error through if it already is a ContractError', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, async (eid) => {\n const errorParser = await createContractErrorParser({ contract, eid })\n const error = new RevertError('A reason is worth a million bytes')\n const parsedError = await errorParser(error)\n\n expect(parsedError).toBe(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/tests/devtools-evm-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58512, "name": "unknown", "code": "it('should parse assert/panic', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, async (eid) => {\n const errorParser = await createContractErrorParser({ contract, eid })\n const error = await assertFailed(contract.throwWithAssert())\n const parsedError = await errorParser(error)\n\n expect(parsedError).toEqual(new PanicError(BigInt(1)))\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/tests/devtools-evm-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58513, "name": "unknown", "code": "it('should parse assert/panic with code', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, async (eid) => {\n const errorParser = await createContractErrorParser({ contract, eid })\n const error = await assertFailed(contract.throwWithAssertWithCode())\n const parsedError = await errorParser(error)\n\n expect(parsedError).toEqual(new PanicError(BigInt(18)))\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/tests/devtools-evm-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58514, "name": "unknown", "code": "it('should parse revert with arguments', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, async (eid) => {\n const errorParser = await createContractErrorParser({ contract, eid })\n const error = await assertFailed(contract.throwWithRevertAndArgument('my bad'))\n const parsedError = await errorParser(error)\n\n expect(parsedError).toEqual(new RevertError('my bad'))\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/tests/devtools-evm-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58515, "name": "unknown", "code": "it('should parse require with an argument', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, async (eid) => {\n const errorParser = await createContractErrorParser({ contract, eid })\n const error = await assertFailed(contract.throwWithRequireAndArgument('my bad'))\n const parsedError = await errorParser(error)\n\n expect(parsedError).toEqual(new RevertError('my bad'))\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/tests/devtools-evm-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58516, "name": "unknown", "code": "it('should parse require with a custom error with no arguments', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, async (eid) => {\n const errorParser = await createContractErrorParser({ contract, eid })\n const error = await assertFailed(contract.throwWithCustomErrorAndNoArguments())\n const parsedError = await errorParser(error)\n\n expect(parsedError).toEqual(new CustomError('CustomErrorWithNoArguments', []))\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/tests/devtools-evm-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58517, "name": "unknown", "code": "it('should parse require with a custom error with an argument', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, fc.string(), async (eid, arg) => {\n const errorParser = await createContractErrorParser({ contract, eid })\n const error = await assertFailed(contract.throwWithCustomErrorAndArgument(arg))\n const parsedError = await errorParser(error)\n\n expect(parsedError).toEqual(new CustomError('CustomErrorWithAnArgument', [arg]))\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/tests/devtools-evm-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58518, "name": "unknown", "code": "it('should parse string', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, fc.string(), async (eid, message) => {\n const errorParser = await createContractErrorParser({ contract, eid })\n const parsedError = await errorParser(message)\n\n expect(parsedError).toEqual(new UnknownError(`Unknown error: ${message}`))\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/tests/devtools-evm-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58519, "name": "unknown", "code": "it('should parse an Error', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, fc.string(), async (eid, message) => {\n const errorParser = await createContractErrorParser({ contract, eid })\n const error = new Error(message)\n const parsedError = await errorParser(error)\n\n expect(parsedError).toEqual(new UnknownError(`Unknown error: ${error}`))\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/tests/devtools-evm-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58520, "name": "unknown", "code": "it('should never reject', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, fc.anything(), async (eid, error) => {\n const errorParser = await createContractErrorParser({ contract, eid })\n const parsedError = await errorParser(error)\n\n expect(parsedError).toBeInstanceOf(UnknownError)\n expect(parsedError.reason).toBeUndefined()\n expect(parsedError.message).toMatch(/Unknown error: /)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/tests/devtools-evm-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58521, "name": "unknown", "code": "it('child no arg event', async () => {\n const receipt = await (await child.emitNoArgEvent()).wait()\n expect(parseLogs(receipt, parent)).toMatchSnapshot()\n expect(parseLogsWithName(receipt, parent, 'NoArgEvent')).toEqual([]) // only the child should emit the event\n expect(parseLogsWithName(receipt, child, 'NoArgEvent')).toHaveLength(1)\n expect(parseLogsWithName(receipt, parallel, 'NoArgEvent')).toEqual([]) // parallel logs should be empty\n\n fc.assert(\n fc.property(fc.string(), (name) => {\n fc.pre(name !== 'NoArgEvent')\n expect(parseLogsWithName(receipt, parent, name)).toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/tests/devtools-evm-test/test/events/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58522, "name": "unknown", "code": "it('not parse an event with one arg from a different contract', async () => {\n await fc.assert(\n fc.asyncProperty(fc.integer({ min: 0 }), async (arg) => {\n const receipt = await (await child.emitOneArgEvent(arg)).wait()\n expect(parseLogsWithName(receipt, parent, 'OneArgEvent')).toEqual([])\n }),\n { numRuns: 10 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/tests/devtools-evm-test/test/events/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58523, "name": "unknown", "code": "it('not parse an event with one arg with unknown name', async () => {\n await fc.assert(\n fc.asyncProperty(fc.integer({ min: 0 }), fc.string(), async (arg, name) => {\n fc.pre(name !== 'OneArgEvent')\n\n const receipt = await (await child.emitOneArgEvent(arg)).wait()\n expect(parseLogsWithName(receipt, parent, name)).toEqual([])\n }),\n { numRuns: 10 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/tests/devtools-evm-test/test/events/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58524, "name": "unknown", "code": "it('not parse an event with many args from a different contract', async () => {\n const eventNameArbitrary = fc.constantFrom('NoArgEvent', 'OneArgEvent', 'FourArgEvent')\n\n await fc.assert(\n fc.asyncProperty(fc.integer({ min: 0, max: 10 }), eventNameArbitrary, async (count, name) => {\n const receipt = await (await child.emitMany(count)).wait()\n\n expect(parseLogsWithName(receipt, child, name)).toHaveLength(count)\n expect(parseLogsWithName(receipt, parent, name)).toEqual([])\n }),\n { numRuns: 10 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/tests/devtools-evm-test/test/events/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58525, "name": "unknown", "code": "it('not parse an event with many args with unknown name from a different contract', async () => {\n await fc.assert(\n fc.asyncProperty(fc.integer({ min: 0, max: 10 }), fc.string(), async (count, name) => {\n fc.pre(name !== 'NoArgEvent')\n fc.pre(name !== 'OneArgEvent')\n fc.pre(name !== 'FourArgEvent')\n\n const receipt = await (await child.emitMany(count)).wait()\n\n expect(parseLogsWithName(receipt, parent, name)).toEqual([])\n }),\n { numRuns: 10 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/tests/devtools-evm-test/test/events/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58526, "name": "unknown", "code": "it('should parse a custom an error with an argument coming from the contract itself', async () => {\n const errorParser = await createErrorParser()\n\n await fc.assert(\n fc.asyncProperty(fc.string(), async (arg) => {\n const error = await assertFailed(contract.throwWithCustomErrorAndArgument(arg))\n const parsedError = await errorParser(error)\n\n expect(parsedError).toEqual(new CustomError('CustomErrorWithAnArgument', [arg]))\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/tests/devtools-evm-hardhat-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58527, "name": "unknown", "code": "it('should parse a custom an error with an argument coming from a nested contract', async () => {\n const errorParser = await createErrorParser()\n\n await fc.assert(\n fc.asyncProperty(fc.string(), async (arg) => {\n const error = await assertFailed(contract.throwNestedWithCustomErrorAndArgument(arg))\n const parsedError = await errorParser(error)\n\n expect(parsedError).toEqual(new CustomError('NestedCustomErrorWithAnArgument', [arg]))\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/tests/devtools-evm-hardhat-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58528, "name": "unknown", "code": "it('should parse a custom an error with an different arguments defined in more contracts coming from the contract itself', async () => {\n const errorParser = await createErrorParser()\n\n await fc.assert(\n fc.asyncProperty(fc.string(), async (arg) => {\n const error = await assertFailed(contract.throwWithCommonErrorAndArgument(arg))\n const parsedError = await errorParser(error)\n\n expect(parsedError).toEqual(new CustomError('CommonErrorWithAnArgument', [arg]))\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/tests/devtools-evm-hardhat-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58529, "name": "unknown", "code": "it('should parse a custom an error with different arguments defined in more contracts coming from a nested contract', async () => {\n const errorParser = await createErrorParser()\n\n await fc.assert(\n fc.asyncProperty(fc.integer({ min: 0 }), async (arg) => {\n const error = await assertFailed(contract.throwNestedWithCommonErrorAndArgument(arg))\n const parsedError = await errorParser(error)\n\n expect(parsedError).toEqual(new CustomError('CommonErrorWithAnArgument', [BigNumber.from(arg)]))\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/tests/devtools-evm-hardhat-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58530, "name": "unknown", "code": "it('should never reject', async () => {\n const errorParser = await createErrorParser()\n\n await fc.assert(\n fc.asyncProperty(fc.anything(), async (error) => {\n const parsedError = await errorParser(error)\n\n expect(parsedError).toBeInstanceOf(UnknownError)\n expect(parsedError.reason).toBeUndefined()\n expect(parsedError.message).toMatch(/Unknown error: /)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/tests/devtools-evm-hardhat-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58531, "name": "unknown", "code": "it('should succeed with a valid config', () => {\n fc.assert(\n fc.property(oappNodeConfigArbitrary, (config) => {\n expect(OAppNodeConfigSchema.parse(config)).toEqual(config)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools/test/oapp/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58532, "name": "unknown", "code": "it('should pass any additional properties through', () => {\n fc.assert(\n fc.property(\n oappNodeConfigArbitrary,\n fc.dictionary(fc.string(), fc.anything()),\n (config, extraProperties) => {\n const combined = Object.assign({}, extraProperties, config)\n\n expect(combined).toMatchObject(OAppNodeConfigSchema.parse(combined))\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools/test/oapp/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58533, "name": "unknown", "code": "it('should call owner on the contract', async () => {\n await fc.assert(\n fc.asyncProperty(omniContractArbitrary, evmAddressArbitrary, async (omniContract, owner) => {\n omniContract.contract.owner.mockResolvedValue(owner)\n\n const sdk = new OApp(omniContract)\n const ownable = Object.assign(sdk, OwnableMixin)\n\n expect(await ownable.getOwner()).toBe(owner)\n expect(omniContract.contract.owner).toHaveBeenCalledTimes(1)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools-evm/test/ownable/mixin.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58534, "name": "unknown", "code": "it('should return true if the owner addresses match', async () => {\n await fc.assert(\n fc.asyncProperty(omniContractArbitrary, evmAddressArbitrary, async (omniContract, owner) => {\n omniContract.contract.owner.mockResolvedValue(owner)\n\n const sdk = new OApp(omniContract)\n const ownable = Object.assign(sdk, OwnableMixin)\n\n expect(await ownable.hasOwner(owner)).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools-evm/test/ownable/mixin.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58535, "name": "unknown", "code": "it('should return false if the owner addresses do not match', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n evmAddressArbitrary,\n evmAddressArbitrary,\n async (omniContract, owner, user) => {\n fc.pre(!areBytes32Equal(owner, user))\n\n omniContract.contract.owner.mockResolvedValue(owner)\n\n const sdk = new OApp(omniContract)\n const ownable = Object.assign(sdk, OwnableMixin)\n\n expect(await ownable.hasOwner(user)).toBeFalsy()\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools-evm/test/ownable/mixin.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58536, "name": "unknown", "code": "it('should encode data for a transferOwnership call', async () => {\n await fc.assert(\n fc.asyncProperty(omniContractArbitrary, evmAddressArbitrary, async (omniContract, owner) => {\n const sdk = new OApp(omniContract)\n const ownable = Object.assign(sdk, OwnableMixin)\n const encodeFunctionData = omniContract.contract.interface.encodeFunctionData as jest.Mock\n\n encodeFunctionData.mockClear()\n\n await ownable.setOwner(owner)\n\n expect(encodeFunctionData).toHaveBeenCalledTimes(1)\n expect(encodeFunctionData).toHaveBeenCalledWith('transferOwnership', [owner])\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools-evm/test/ownable/mixin.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58537, "name": "unknown", "code": "it('should call peers on the contract', async () => {\n await fc.assert(\n fc.asyncProperty(omniContractArbitrary, endpointArbitrary, async (omniContract, peerEid) => {\n const sdk = new OApp(omniContract)\n\n await sdk.getPeer(peerEid)\n\n expect(omniContract.contract.peers).toHaveBeenCalledTimes(1)\n expect(omniContract.contract.peers).toHaveBeenCalledWith(peerEid)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58538, "name": "unknown", "code": "it('should return undefined if peers() returns a zero address, null or undefined', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n evmEndpointArbitrary,\n nullishAddressArbitrary,\n async (omniContract, peerEid, peer) => {\n omniContract.contract.peers.mockResolvedValue(peer)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.getPeer(peerEid)).resolves.toBeUndefined()\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58539, "name": "unknown", "code": "it('should return an address if peers() returns a non-null bytes', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n evmEndpointArbitrary,\n evmAddressArbitrary,\n async (omniContract, peerEid, peer) => {\n fc.pre(!isZero(peer))\n\n omniContract.contract.peers.mockResolvedValue(peer)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.getPeer(peerEid)).resolves.toBe(peer)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58540, "name": "unknown", "code": "it('should return undefined if peers() returns a zero address, null or undefined', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n solanaEndpointArbitrary,\n nullishAddressArbitrary,\n async (omniContract, peerEid, peer) => {\n omniContract.contract.peers.mockResolvedValue(peer)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.getPeer(peerEid)).resolves.toBeUndefined()\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58541, "name": "unknown", "code": "it('should return an address if peers() returns a non-null bytes', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n evmEndpointArbitrary,\n solanaEndpointArbitrary,\n solanaAddressArbitrary,\n async (omniContract, eid, peerEid, peer) => {\n // For Solana we need to take the native address format and turn it into EVM bytes32\n //\n // We do this by normalizing the value into a UInt8Array,\n // then denormalizing it using an EVM eid\n const peerBytes = normalizePeer(peer, peerEid)\n const peerHex = makeBytes32(peerBytes)\n\n fc.pre(!isZero(peerHex))\n\n omniContract.contract.peers.mockResolvedValue(peerHex)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.getPeer(peerEid)).resolves.toBe(peer)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58542, "name": "unknown", "code": "it('should return undefined if peers() returns a zero address, null or undefined', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n aptosEndpointArbitrary,\n nullishAddressArbitrary,\n async (omniContract, peerEid, peer) => {\n omniContract.contract.peers.mockResolvedValue(peer)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.getPeer(peerEid)).resolves.toBeUndefined()\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58543, "name": "unknown", "code": "it('should return an address if peers() returns a non-null bytes', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n aptosEndpointArbitrary,\n aptosAddressArbitrary,\n async (omniContract, peerEid, peer) => {\n fc.pre(!isZero(peer))\n\n omniContract.contract.peers.mockResolvedValue(peer)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.getPeer(peerEid)).resolves.toBe(peer)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58544, "name": "unknown", "code": "it('should return true if peers returns a zero address', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n evmEndpointArbitrary,\n nullishAddressArbitrary,\n nullishAddressArbitrary,\n async (omniContract, peerEid, peer, probePeer) => {\n omniContract.contract.peers.mockResolvedValue(peer)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.hasPeer(peerEid, probePeer)).resolves.toBe(true)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58545, "name": "unknown", "code": "it('should return false if peers returns a non-zero address', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n evmEndpointArbitrary,\n nullishAddressArbitrary,\n evmAddressArbitrary,\n async (omniContract, peerEid, peer, probePeer) => {\n fc.pre(!isZero(probePeer))\n\n omniContract.contract.peers.mockResolvedValue(peer)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.hasPeer(peerEid, probePeer)).resolves.toBe(false)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58546, "name": "unknown", "code": "it('should return true if peers() returns a matching bytes32', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n evmEndpointArbitrary,\n evmAddressArbitrary,\n async (omniContract, peerEid, peer) => {\n omniContract.contract.peers.mockResolvedValue(makeBytes32(peer))\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.hasPeer(peerEid, peer)).resolves.toBe(true)\n await expect(sdk.hasPeer(peerEid, makeBytes32(peer))).resolves.toBe(true)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58547, "name": "unknown", "code": "it('should return true if peers returns a zero address', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n solanaEndpointArbitrary,\n nullishAddressArbitrary,\n async (omniContract, peerEid, peer) => {\n omniContract.contract.peers.mockResolvedValue(peer)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.hasPeer(peerEid, undefined)).resolves.toBe(true)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58548, "name": "unknown", "code": "it('should return false if peers returns a different value', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n solanaEndpointArbitrary,\n solanaAddressArbitrary,\n solanaAddressArbitrary,\n async (omniContract, peerEid, peer, probePeer) => {\n fc.pre(\n !areBytes32Equal(normalizePeer(peer, peerEid), normalizePeer(probePeer, peerEid))\n )\n\n const peerHex = makeBytes32(normalizePeer(peer, peerEid))\n\n omniContract.contract.peers.mockResolvedValue(peerHex)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.hasPeer(peerEid, probePeer)).resolves.toBe(false)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58549, "name": "unknown", "code": "it('should return true if peers() returns a matching value', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n solanaEndpointArbitrary,\n solanaAddressArbitrary,\n async (omniContract, peerEid, peer) => {\n const peerHex = makeBytes32(normalizePeer(peer, peerEid))\n\n omniContract.contract.peers.mockResolvedValue(peerHex)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.hasPeer(peerEid, peer)).resolves.toBe(true)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58550, "name": "unknown", "code": "it('should return true if peers returns a zero address', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n aptosEndpointArbitrary,\n nullishAddressArbitrary,\n nullishAddressArbitrary,\n async (omniContract, peerEid, peer, probePeer) => {\n omniContract.contract.peers.mockResolvedValue(peer)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.hasPeer(peerEid, probePeer)).resolves.toBe(true)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58551, "name": "unknown", "code": "it('should return false if peers returns a non-zero address', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n aptosEndpointArbitrary,\n nullishAddressArbitrary,\n aptosAddressArbitrary,\n async (omniContract, peerEid, peer, probePeer) => {\n fc.pre(!isZero(probePeer))\n\n omniContract.contract.peers.mockResolvedValue(peer)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.hasPeer(peerEid, probePeer)).resolves.toBe(false)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58552, "name": "unknown", "code": "it('should return true if peers() returns a matching bytes32', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n aptosEndpointArbitrary,\n aptosAddressArbitrary,\n async (omniContract, peerEid, peer) => {\n omniContract.contract.peers.mockResolvedValue(makeBytes32(peer))\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.hasPeer(peerEid, peer)).resolves.toBe(true)\n await expect(sdk.hasPeer(peerEid, makeBytes32(peer))).resolves.toBe(true)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58553, "name": "unknown", "code": "it('should encode data for a setPeer call', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n evmEndpointArbitrary,\n evmAddressArbitrary,\n async (omniContract, peerEid, peerAddress) => {\n const sdk = new OApp(omniContract)\n const encodeFunctionData = omniContract.contract.interface.encodeFunctionData\n\n ;(encodeFunctionData as jest.Mock).mockClear()\n\n await sdk.setPeer(peerEid, peerAddress)\n\n expect(encodeFunctionData).toHaveBeenCalledTimes(1)\n expect(encodeFunctionData).toHaveBeenCalledWith('setPeer', [\n peerEid,\n makeBytes32(peerAddress),\n ])\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58554, "name": "unknown", "code": "it('should return an OmniTransaction', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n evmEndpointArbitrary,\n evmAddressArbitrary,\n fc.string(),\n async (omniContract, peerEid, peerAddress, data) => {\n const encodeFunctionData = omniContract.contract.interface.encodeFunctionData as jest.Mock\n encodeFunctionData.mockReturnValue(data)\n\n const sdk = new OApp(omniContract)\n const transaction = await sdk.setPeer(peerEid, peerAddress)\n\n expect(transaction).toEqual({\n data,\n description: `Setting peer for eid ${peerEid} (${formatEid(peerEid)}) to address ${makeBytes32(peerAddress)}`,\n point: {\n eid: omniContract.eid,\n address: omniContract.contract.address,\n },\n })\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58555, "name": "unknown", "code": "it('should encode data for a setPeer call', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n solanaEndpointArbitrary,\n solanaAddressArbitrary,\n async (omniContract, peerEid, peerAddress) => {\n const sdk = new OApp(omniContract)\n const encodeFunctionData = omniContract.contract.interface.encodeFunctionData\n\n ;(encodeFunctionData as jest.Mock).mockClear()\n\n await sdk.setPeer(peerEid, peerAddress)\n\n expect(encodeFunctionData).toHaveBeenCalledTimes(1)\n expect(encodeFunctionData).toHaveBeenCalledWith('setPeer', [\n peerEid,\n makeBytes32(normalizePeer(peerAddress, peerEid)),\n ])\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58556, "name": "unknown", "code": "it('should return an OmniTransaction', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n solanaEndpointArbitrary,\n solanaAddressArbitrary,\n fc.string(),\n async (omniContract, peerEid, peerAddress, data) => {\n const encodeFunctionData = omniContract.contract.interface.encodeFunctionData as jest.Mock\n encodeFunctionData.mockReturnValue(data)\n\n const sdk = new OApp(omniContract)\n const transaction = await sdk.setPeer(peerEid, peerAddress)\n\n expect(transaction).toEqual({\n data,\n description: `Setting peer for eid ${peerEid} (${formatEid(peerEid)}) to address ${makeBytes32(normalizePeer(peerAddress, peerEid))}`,\n point: {\n eid: omniContract.eid,\n address: omniContract.contract.address,\n },\n })\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58557, "name": "unknown", "code": "it('should encode data for a setPeer call', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n aptosEndpointArbitrary,\n aptosAddressArbitrary,\n async (omniContract, peerEid, peerAddress) => {\n const sdk = new OApp(omniContract)\n const encodeFunctionData = omniContract.contract.interface.encodeFunctionData\n\n ;(encodeFunctionData as jest.Mock).mockClear()\n\n await sdk.setPeer(peerEid, peerAddress)\n\n expect(encodeFunctionData).toHaveBeenCalledTimes(1)\n expect(encodeFunctionData).toHaveBeenCalledWith('setPeer', [\n peerEid,\n makeBytes32(peerAddress),\n ])\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58558, "name": "unknown", "code": "it('should return an OmniTransaction', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n aptosEndpointArbitrary,\n aptosAddressArbitrary,\n fc.string(),\n async (omniContract, peerEid, peerAddress, data) => {\n const encodeFunctionData = omniContract.contract.interface.encodeFunctionData as jest.Mock\n encodeFunctionData.mockReturnValue(data)\n\n const sdk = new OApp(omniContract)\n const transaction = await sdk.setPeer(peerEid, peerAddress)\n\n expect(transaction).toEqual({\n data,\n description: `Setting peer for eid ${peerEid} (${formatEid(peerEid)}) to address ${makeBytes32(peerAddress)}`,\n point: {\n eid: omniContract.eid,\n address: omniContract.contract.address,\n },\n })\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58559, "name": "unknown", "code": "it('should reject if the call to endpoint() rejects', async () => {\n await fc.assert(\n fc.asyncProperty(omniContractArbitrary, async (omniContract) => {\n omniContract.contract.endpoint.mockRejectedValue('No you did not')\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.getEndpointSDK()).rejects.toThrow(/Failed to get EndpointV2 address for OApp/)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58560, "name": "unknown", "code": "it('should reject if the call to endpoint() resolves with a zeroish address', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n nullishAddressArbitrary,\n async (omniContract, endpointAddress) => {\n omniContract.contract.endpoint.mockResolvedValue(endpointAddress)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.getEndpointSDK()).rejects.toThrow(\n /EndpointV2 cannot be instantiated: EndpointV2 address has been set to a zero value for OApp/\n )\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58561, "name": "unknown", "code": "it('should return an EndpointV2 if the call to endpoint() resolves with a non-zeroish address', async () => {\n await fc.assert(\n fc.asyncProperty(omniContractArbitrary, evmAddressArbitrary, async (omniContract, endpointAddress) => {\n fc.pre(!isZero(endpointAddress))\n\n omniContract.contract.endpoint.mockResolvedValue(endpointAddress)\n\n const sdk = new OApp(omniContract)\n const endpoint = await sdk.getEndpointSDK()\n\n expect(endpoint).toBeInstanceOf(EndpointV2)\n expect(endpoint.point).toEqual({ eid: sdk.point.eid, address: endpointAddress })\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58562, "name": "unknown", "code": "it('should return the contract name', async () => {\n await fc.assert(\n fc.asyncProperty(omniContractArbitrary, fc.string(), async (omniContract, name) => {\n omniContract.contract.name.mockResolvedValue(name)\n\n const sdk = new ERC20(omniContract)\n\n await expect(sdk.getName()).resolves.toBe(name)\n\n expect(omniContract.contract.name).toHaveBeenCalledTimes(1)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools-evm/test/erc20/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58563, "name": "unknown", "code": "it('should return the contract symbol', async () => {\n await fc.assert(\n fc.asyncProperty(omniContractArbitrary, fc.string(), async (omniContract, symbol) => {\n omniContract.contract.symbol.mockResolvedValue(symbol)\n\n const sdk = new ERC20(omniContract)\n\n await expect(sdk.getSymbol()).resolves.toBe(symbol)\n\n expect(omniContract.contract.symbol).toHaveBeenCalledTimes(1)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools-evm/test/erc20/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58564, "name": "unknown", "code": "it('should return the contract decimals', async () => {\n await fc.assert(\n fc.asyncProperty(omniContractArbitrary, fc.integer({ min: 1 }), async (omniContract, decimals) => {\n omniContract.contract.decimals.mockResolvedValue(decimals)\n\n const sdk = new ERC20(omniContract)\n\n await expect(sdk.getDecimals()).resolves.toBe(decimals)\n\n expect(omniContract.contract.decimals).toHaveBeenCalledTimes(1)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools-evm/test/erc20/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58565, "name": "unknown", "code": "it('should return the user balance', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n evmAddressArbitrary,\n fc.bigInt({ min: BigInt(0) }),\n async (omniContract, user, balance) => {\n omniContract.contract.balanceOf.mockResolvedValue(BigNumber.from(balance))\n\n const sdk = new ERC20(omniContract)\n\n await expect(sdk.getBalanceOf(user)).resolves.toBe(balance)\n\n expect(omniContract.contract.balanceOf).toHaveBeenCalledTimes(1)\n expect(omniContract.contract.balanceOf).toHaveBeenCalledWith(user)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools-evm/test/erc20/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58566, "name": "unknown", "code": "it('should return the user balance', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n evmAddressArbitrary,\n evmAddressArbitrary,\n fc.bigInt({ min: BigInt(0) }),\n async (omniContract, owner, spender, allowance) => {\n omniContract.contract.allowance.mockResolvedValue(BigNumber.from(allowance))\n\n const sdk = new ERC20(omniContract)\n\n await expect(sdk.getAllowance(owner, spender)).resolves.toBe(allowance)\n\n expect(omniContract.contract.allowance).toHaveBeenCalledTimes(1)\n expect(omniContract.contract.allowance).toHaveBeenCalledWith(owner, spender)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/ua-devtools-evm/test/erc20/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58567, "name": "unknown", "code": "it('should not attempt to register libraries multiple times', async () => {\n await fc.assert(\n fc.asyncProperty(\n pointArbitrary,\n pointArbitrary,\n pointArbitrary,\n addressArbitrary,\n async (pointA, pointB, pointC, libraryAddress) => {\n fc.pre(!arePointsEqual(pointA, pointB))\n fc.pre(!arePointsEqual(pointB, pointC))\n fc.pre(!arePointsEqual(pointC, pointA))\n\n const config: EndpointV2EdgeConfig = {\n defaultReceiveLibrary: libraryAddress,\n defaultSendLibrary: libraryAddress,\n }\n\n const graph: EndpointV2OmniGraph = {\n contracts: [],\n connections: [\n {\n vector: { from: pointA, to: pointB },\n config,\n },\n {\n vector: { from: pointA, to: pointC },\n config,\n },\n {\n vector: { from: pointB, to: pointA },\n config,\n },\n {\n vector: { from: pointB, to: pointC },\n config,\n },\n {\n vector: { from: pointC, to: pointA },\n config,\n },\n {\n vector: { from: pointC, to: pointB },\n config,\n },\n ],\n }\n\n const createSdk = jest.fn((point: OmniPoint) => new MockSDK(point) as unknown as IEndpointV2)\n const result = await configureEndpointV2RegisterLibraries(graph, createSdk)\n\n // The result should not contain any duplicate library registrations\n expect(result).toEqual([\n { point: pointA, data: `0xREGISTERLIBRARY ${libraryAddress}` },\n { point: pointB, data: `0xREGISTERLIBRARY ${libraryAddress}` },\n { point: pointC, data: `0xREGISTERLIBRARY ${libraryAddress}` },\n ])\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools/test/endpointv2/config.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58568, "name": "unknown", "code": "it('should sort requiredDVNs and optionalDVNs before encoding', async () => {\n fc.assert(\n fc.property(dvnsArbitrary, (dvns) => {\n const sortedDvns = [...dvns].sort((a, b) => a.localeCompare(b))\n const ulnConfigUnsorted: UlnReadUlnConfig = {\n executor: AddressZero,\n optionalDVNThreshold: 0,\n optionalDVNs: dvns,\n requiredDVNs: dvns,\n }\n\n const ulnConfigSorted: UlnReadUlnConfig = {\n ...ulnConfigUnsorted,\n optionalDVNs: sortedDvns,\n requiredDVNs: sortedDvns,\n }\n\n const ulnConfigEncodedUnsorted = ulnSdk.encodeUlnConfig(ulnConfigUnsorted)\n const ulnConfigEncodedSorted = ulnSdk.encodeUlnConfig(ulnConfigSorted)\n expect(ulnConfigEncodedSorted).toBe(ulnConfigEncodedUnsorted)\n }),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58569, "name": "unknown", "code": "it('should sort requiredDVNs and optionalDVNs', async () => {\n await fc.assert(\n fc.asyncProperty(channelIdArbitrary, dvnsArbitrary, async (eid, dvns) => {\n const sortedDvns = [...dvns].sort((a, b) => a.localeCompare(b))\n const ulnConfigUnsorted: UlnReadUlnConfig = {\n executor: AddressZero,\n optionalDVNThreshold: 0,\n optionalDVNs: dvns,\n requiredDVNs: dvns,\n }\n\n const ulnConfigSorted: UlnReadUlnConfig = {\n ...ulnConfigUnsorted,\n optionalDVNs: sortedDvns,\n requiredDVNs: sortedDvns,\n }\n\n // Let's check that both the sorted and the unsorted config produce the same transaction\n const transactionUnsorted = await ulnSdk.setDefaultUlnConfig(eid, ulnConfigUnsorted)\n const transactionsSorted = await ulnSdk.setDefaultUlnConfig(eid, ulnConfigSorted)\n expect(transactionUnsorted).toEqual(transactionsSorted)\n\n // And let's check that the encoding call is correct and the DVNs are sorted\n expect(transactionsSorted.data).toBe(\n ulnSdk.contract.contract.interface.encodeFunctionData('setDefaultReadLibConfigs', [\n [\n {\n eid,\n config: {\n executor: AddressZero,\n optionalDVNThreshold: 0,\n optionalDVNs: sortedDvns.map(addChecksum),\n requiredDVNs: sortedDvns.map(addChecksum),\n requiredDVNCount: sortedDvns.length,\n optionalDVNCount: sortedDvns.length,\n },\n },\n ],\n ])\n )\n }),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58570, "name": "unknown", "code": "it('should default the missing attributes', async () => {\n await fc.assert(\n fc.asyncProperty(channelIdArbitrary, dvnsArbitrary, async (eid, dvns) => {\n const sortedDvns = [...dvns].sort((a, b) => a.localeCompare(b))\n const ulnUserConfig: UlnReadUlnUserConfig = {\n requiredDVNs: dvns,\n }\n const ulnConfig: UlnReadUlnConfig = {\n requiredDVNs: dvns,\n executor: AddressZero,\n optionalDVNThreshold: 0,\n optionalDVNs: [],\n }\n\n // Let's check that both the sorted and the unsorted config produce the same transaction\n const transactionsWithDefaults = await ulnSdk.setDefaultUlnConfig(eid, ulnUserConfig)\n const transactionsWithFullConfig = await ulnSdk.setDefaultUlnConfig(eid, ulnConfig)\n expect(transactionsWithDefaults).toEqual(transactionsWithFullConfig)\n\n // And let's check that the encoding call is correct and the DVNs are sorted\n expect(transactionsWithDefaults.data).toBe(\n ulnSdk.contract.contract.interface.encodeFunctionData('setDefaultReadLibConfigs', [\n [\n {\n eid,\n config: {\n executor: ulnConfig.executor,\n optionalDVNThreshold: ulnConfig.optionalDVNThreshold,\n optionalDVNs: ulnConfig.optionalDVNs,\n requiredDVNs: sortedDvns.map(addChecksum),\n requiredDVNCount: ulnConfig.requiredDVNs.length,\n optionalDVNCount: ulnConfig.optionalDVNs.length,\n },\n },\n ],\n ])\n )\n }),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58571, "name": "unknown", "code": "it('should return true if the configs are identical', async () => {\n await fc.assert(\n fc.asyncProperty(\n channelIdArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n async (channelId, oapp, ulnConfig) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(ulnSdk.hasAppUlnConfig(channelId, oapp, ulnConfig)).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58572, "name": "unknown", "code": "it('should return true if config has extra properties', async () => {\n await fc.assert(\n fc.asyncProperty(\n channelIdArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n fc.object(),\n async (channelId, oapp, ulnConfig, extra) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(channelId, oapp, {\n ...extra,\n ...ulnConfig,\n })\n ).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58573, "name": "unknown", "code": "it('should return true if configs with defaults are identical', async () => {\n await fc.assert(\n fc.asyncProperty(\n channelIdArbitrary,\n evmAddressArbitrary,\n dvnsArbitrary,\n async (channelId, oapp, dvns) => {\n const ulnUserConfig: UlnReadUlnUserConfig = {\n requiredDVNs: dvns,\n }\n const ulnConfig: UlnReadUlnConfig = {\n requiredDVNs: dvns,\n optionalDVNs: [],\n optionalDVNThreshold: 0,\n executor: AddressZero,\n }\n\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(ulnSdk.hasAppUlnConfig(channelId, oapp, ulnUserConfig)).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58574, "name": "unknown", "code": "it('should return false if configs with defaults are not identical', async () => {\n await fc.assert(\n fc.asyncProperty(\n channelIdArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n async (channelId, oapp, ulnConfig) => {\n // We only want to test againsts configs that are not\n // equal to the default config\n fc.pre(\n ulnConfig.executor !== AddressZero ||\n ulnConfig.optionalDVNThreshold !== 0 ||\n ulnConfig.optionalDVNs.length !== 0\n )\n\n const ulnUserConfig: UlnReadUlnUserConfig = {\n requiredDVNs: ulnConfig.requiredDVNs,\n }\n\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(ulnSdk.hasAppUlnConfig(channelId, oapp, ulnUserConfig)).resolves.toBeFalsy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58575, "name": "unknown", "code": "it('should return true if the configs are identical except for the dvn casing', async () => {\n await fc.assert(\n fc.asyncProperty(\n channelIdArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n async (channelId, oapp, ulnConfig) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(channelId, oapp, {\n ...ulnConfig,\n requiredDVNs: ulnConfig.requiredDVNs.map(addChecksum),\n optionalDVNs: ulnConfig.optionalDVNs.map(addChecksum),\n })\n ).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58576, "name": "unknown", "code": "it('should return true if the configs are identical except for the dvn sorting and casing', async () => {\n await fc.assert(\n fc.asyncProperty(\n channelIdArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n async (channelId, oapp, ulnConfig) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(channelId, oapp, {\n ...ulnConfig,\n requiredDVNs: ulnConfig.requiredDVNs.map(addChecksum).sort(compareBytes32Ascending),\n optionalDVNs: ulnConfig.optionalDVNs.map(addChecksum).sort(compareBytes32Ascending),\n })\n ).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58577, "name": "unknown", "code": "it('should return false if the confirmations are different', async () => {\n await fc.assert(\n fc.asyncProperty(\n channelIdArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n evmAddressArbitrary,\n async (channelId, oapp, ulnConfig, executor) => {\n fc.pre(executor !== ulnConfig.executor)\n\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(channelId, oapp, {\n ...ulnConfig,\n executor,\n })\n ).resolves.toBeFalsy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58578, "name": "unknown", "code": "it('should return false if the optionalDVNThresholds are different', async () => {\n await fc.assert(\n fc.asyncProperty(\n channelIdArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n fc.integer(),\n async (channelId, oapp, ulnConfig, optionalDVNThreshold) => {\n fc.pre(optionalDVNThreshold !== ulnConfig.optionalDVNThreshold)\n\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(channelId, oapp, {\n ...ulnConfig,\n optionalDVNThreshold,\n })\n ).resolves.toBeFalsy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58579, "name": "unknown", "code": "it('should return false if the requiredDVNs are different', async () => {\n await fc.assert(\n fc.asyncProperty(\n channelIdArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n dvnsArbitrary,\n async (channelId, oapp, ulnConfig, extraRequiredDVNs) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(channelId, oapp, {\n ...ulnConfig,\n requiredDVNs: [...ulnConfig.requiredDVNs, ...extraRequiredDVNs],\n })\n ).resolves.toBeFalsy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58580, "name": "unknown", "code": "it('should return false if the optionalDVNs are different', async () => {\n await fc.assert(\n fc.asyncProperty(\n channelIdArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n dvnsArbitrary,\n async (channelId, oapp, ulnConfig, extraOptionalDVNs) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(channelId, oapp, {\n ...ulnConfig,\n optionalDVNs: [...ulnConfig.optionalDVNs, ...extraOptionalDVNs],\n })\n ).resolves.toBeFalsy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58581, "name": "unknown", "code": "it('should sort requiredDVNs and optionalDVNs before encoding', async () => {\n fc.assert(\n fc.property(dvnsArbitrary, (dvns) => {\n const sortedDvns = [...dvns].sort((a, b) => a.localeCompare(b))\n const ulnConfigUnsorted: Uln302UlnConfig = {\n confirmations: BigInt(100),\n optionalDVNThreshold: 0,\n optionalDVNs: dvns,\n requiredDVNs: dvns,\n }\n\n const ulnConfigSorted: Uln302UlnConfig = {\n ...ulnConfigUnsorted,\n optionalDVNs: sortedDvns,\n requiredDVNs: sortedDvns,\n }\n\n const ulnConfigEncodedUnsorted = ulnSdk.encodeUlnConfig(ulnConfigUnsorted)\n const ulnConfigEncodedSorted = ulnSdk.encodeUlnConfig(ulnConfigSorted)\n expect(ulnConfigEncodedSorted).toBe(ulnConfigEncodedUnsorted)\n }),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58582, "name": "unknown", "code": "it('should sort requiredDVNs and optionalDVNs', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, dvnsArbitrary, async (eid, dvns) => {\n const sortedDvns = [...dvns].sort((a, b) => a.localeCompare(b))\n const ulnConfigUnsorted: Uln302UlnConfig = {\n confirmations: BigInt(100),\n optionalDVNThreshold: 0,\n optionalDVNs: dvns,\n requiredDVNs: dvns,\n }\n\n const ulnConfigSorted: Uln302UlnConfig = {\n ...ulnConfigUnsorted,\n optionalDVNs: sortedDvns,\n requiredDVNs: sortedDvns,\n }\n\n // Let's check that both the sorted and the unsorted config produce the same transaction\n const transactionUnsorted = await ulnSdk.setDefaultUlnConfig(eid, ulnConfigUnsorted)\n const transactionsSorted = await ulnSdk.setDefaultUlnConfig(eid, ulnConfigSorted)\n expect(transactionUnsorted).toEqual(transactionsSorted)\n\n // And let's check that the encoding call is correct and the DVNs are sorted\n expect(transactionsSorted.data).toBe(\n ulnSdk.contract.contract.interface.encodeFunctionData('setDefaultUlnConfigs', [\n [\n {\n eid,\n config: {\n confirmations: BigInt(100),\n optionalDVNThreshold: 0,\n optionalDVNs: sortedDvns.map(addChecksum),\n requiredDVNs: sortedDvns.map(addChecksum),\n requiredDVNCount: sortedDvns.length,\n optionalDVNCount: sortedDvns.length,\n },\n },\n ],\n ])\n )\n }),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58583, "name": "unknown", "code": "it('should default the missing attributes', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, dvnsArbitrary, async (eid, dvns) => {\n const sortedDvns = [...dvns].sort((a, b) => a.localeCompare(b))\n const ulnUserConfig: Uln302UlnUserConfig = {\n requiredDVNs: dvns,\n }\n const ulnConfig: Uln302UlnConfig = {\n requiredDVNs: dvns,\n confirmations: BigInt(0),\n optionalDVNThreshold: 0,\n optionalDVNs: [],\n }\n\n // Let's check that both the sorted and the unsorted config produce the same transaction\n const transactionsWithDefaults = await ulnSdk.setDefaultUlnConfig(eid, ulnUserConfig)\n const transactionsWithFullConfig = await ulnSdk.setDefaultUlnConfig(eid, ulnConfig)\n expect(transactionsWithDefaults).toEqual(transactionsWithFullConfig)\n\n // And let's check that the encoding call is correct and the DVNs are sorted\n expect(transactionsWithDefaults.data).toBe(\n ulnSdk.contract.contract.interface.encodeFunctionData('setDefaultUlnConfigs', [\n [\n {\n eid,\n config: {\n confirmations: ulnConfig.confirmations,\n optionalDVNThreshold: ulnConfig.optionalDVNThreshold,\n optionalDVNs: ulnConfig.optionalDVNs,\n requiredDVNs: sortedDvns.map(addChecksum),\n requiredDVNCount: ulnConfig.requiredDVNs.length,\n optionalDVNCount: ulnConfig.optionalDVNs.length,\n },\n },\n ],\n ])\n )\n }),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58584, "name": "unknown", "code": "it('should return true if the configs are identical', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n async (eid, oapp, ulnConfig) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(eid, oapp, ulnConfig, Uln302ConfigType.Receive)\n ).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58585, "name": "unknown", "code": "it('should return true if config has extra properties', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n fc.object(),\n async (eid, oapp, ulnConfig, extra) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(\n eid,\n oapp,\n {\n ...extra,\n ...ulnConfig,\n },\n Uln302ConfigType.Receive\n )\n ).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58586, "name": "unknown", "code": "it('should return true if configs with defaults are identical', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, evmAddressArbitrary, dvnsArbitrary, async (eid, oapp, dvns) => {\n const ulnUserConfig: Uln302UlnUserConfig = {\n requiredDVNs: dvns,\n }\n const ulnConfig: Uln302UlnConfig = {\n requiredDVNs: dvns,\n optionalDVNs: [],\n optionalDVNThreshold: 0,\n confirmations: BigInt(0),\n }\n\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(eid, oapp, ulnUserConfig, Uln302ConfigType.Receive)\n ).resolves.toBeTruthy()\n }),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58587, "name": "unknown", "code": "it('should return false if configs with defaults are not identical', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n async (eid, oapp, ulnConfig) => {\n // We only want to test againsts configs that are not\n // equal to the default config\n fc.pre(\n ulnConfig.confirmations !== BigInt(0) ||\n ulnConfig.optionalDVNThreshold !== 0 ||\n ulnConfig.optionalDVNs.length !== 0\n )\n\n const ulnUserConfig: Uln302UlnUserConfig = {\n requiredDVNs: ulnConfig.requiredDVNs,\n }\n\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(eid, oapp, ulnUserConfig, Uln302ConfigType.Receive)\n ).resolves.toBeFalsy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58588, "name": "unknown", "code": "it('should return true if the configs are identical except for the dvn casing', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n async (eid, oapp, ulnConfig) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(\n eid,\n oapp,\n {\n ...ulnConfig,\n requiredDVNs: ulnConfig.requiredDVNs.map(addChecksum),\n optionalDVNs: ulnConfig.optionalDVNs.map(addChecksum),\n },\n Uln302ConfigType.Receive\n )\n ).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58589, "name": "unknown", "code": "it('should return true if the configs are identical except for the dvn sorting and casing', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n async (eid, oapp, ulnConfig) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(\n eid,\n oapp,\n {\n ...ulnConfig,\n requiredDVNs: ulnConfig.requiredDVNs.map(addChecksum).sort(compareBytes32Ascending),\n optionalDVNs: ulnConfig.optionalDVNs.map(addChecksum).sort(compareBytes32Ascending),\n },\n Uln302ConfigType.Receive\n )\n ).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58590, "name": "unknown", "code": "it('should return false if the confirmations are different', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n fc.bigInt(),\n async (eid, oapp, ulnConfig, confirmations) => {\n fc.pre(confirmations !== ulnConfig.confirmations)\n\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(\n eid,\n oapp,\n {\n ...ulnConfig,\n confirmations,\n },\n Uln302ConfigType.Receive\n )\n ).resolves.toBeFalsy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58591, "name": "unknown", "code": "it('should return false if the optionalDVNThresholds are different', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n fc.integer(),\n async (eid, oapp, ulnConfig, optionalDVNThreshold) => {\n fc.pre(optionalDVNThreshold !== ulnConfig.optionalDVNThreshold)\n\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(\n eid,\n oapp,\n {\n ...ulnConfig,\n optionalDVNThreshold,\n },\n Uln302ConfigType.Receive\n )\n ).resolves.toBeFalsy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58592, "name": "unknown", "code": "it('should return false if the requiredDVNs are different', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n dvnsArbitrary,\n async (eid, oapp, ulnConfig, extraRequiredDVNs) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(\n eid,\n oapp,\n {\n ...ulnConfig,\n requiredDVNs: [...ulnConfig.requiredDVNs, ...extraRequiredDVNs],\n },\n Uln302ConfigType.Receive\n )\n ).resolves.toBeFalsy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58593, "name": "unknown", "code": "it('should return false if the optionalDVNs are different', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n dvnsArbitrary,\n async (eid, oapp, ulnConfig, extraOptionalDVNs) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(\n eid,\n oapp,\n {\n ...ulnConfig,\n optionalDVNs: [...ulnConfig.optionalDVNs, ...extraOptionalDVNs],\n },\n Uln302ConfigType.Receive\n )\n ).resolves.toBeFalsy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58594, "name": "unknown", "code": "it('should return true if the configs are identical', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n executorConfigArbitrary,\n async (eid, oapp, executorConfig) => {\n getAppExecutorConfigSpy.mockReset()\n getAppExecutorConfigSpy.mockResolvedValue(executorConfig)\n\n await expect(ulnSdk.hasAppExecutorConfig(eid, oapp, executorConfig)).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58595, "name": "unknown", "code": "it('should return true if the configs are identical except for the executor casing', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n executorConfigArbitrary,\n async (eid, oapp, executorConfig) => {\n getAppExecutorConfigSpy.mockReset()\n getAppExecutorConfigSpy.mockResolvedValue(executorConfig)\n\n await expect(\n ulnSdk.hasAppExecutorConfig(eid, oapp, {\n ...executorConfig,\n executor: addChecksum(executorConfig.executor),\n })\n ).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58596, "name": "unknown", "code": "it('should return true if config has extra properties', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n executorConfigArbitrary,\n fc.object(),\n async (eid, oapp, executorConfig, extra) => {\n getAppExecutorConfigSpy.mockReset()\n getAppExecutorConfigSpy.mockResolvedValue(executorConfig)\n\n await expect(\n ulnSdk.hasAppExecutorConfig(eid, oapp, {\n ...extra,\n ...executorConfig,\n })\n ).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58597, "name": "unknown", "code": "it('should reject if the address is a zeroish address', async () => {\n await fc.assert(\n fc.asyncProperty(pointArbitrary, zeroishAddressArbitrary, async (point, address) => {\n const provider = new JsonRpcProvider()\n const sdk = new EndpointV2(provider, point)\n\n await expect(sdk.getUln302SDK(address)).rejects.toThrow(\n /Uln302 cannot be instantiated: Uln302 address cannot be a zero value for Endpoint/\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/endpoint/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58598, "name": "unknown", "code": "it('should return a ULN302 if the address is a non-zeroish address', async () => {\n await fc.assert(\n fc.asyncProperty(pointArbitrary, evmAddressArbitrary, async (point, address) => {\n fc.pre(!isZero(address))\n\n const provider = new JsonRpcProvider()\n\n const sdk = new EndpointV2(provider, point)\n const uln302 = await sdk.getUln302SDK(address)\n\n expect(uln302).toBeInstanceOf(Uln302)\n expect(uln302.point).toEqual({ eid: point.eid, address })\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/endpoint/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58599, "name": "unknown", "code": "it('should return a tuple if the call succeeds', async () => {\n await fc.assert(\n fc.asyncProperty(\n pointArbitrary,\n endpointArbitrary,\n evmAddressArbitrary,\n evmAddressArbitrary,\n fc.boolean(),\n async (point, eid, oappAddress, libraryAddress, isDefault) => {\n const provider = new JsonRpcProvider()\n const sdk = new EndpointV2(provider, point)\n\n jest.spyOn(provider, 'call').mockResolvedValue(\n sdk.contract.contract.interface.encodeFunctionResult('getReceiveLibrary', [\n libraryAddress,\n isDefault,\n ])\n )\n\n await expect(sdk.getReceiveLibrary(oappAddress, eid)).resolves.toEqual([\n addChecksum(libraryAddress),\n isDefault,\n ])\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/endpoint/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58600, "name": "unknown", "code": "it('should return undefined as the default lib if the call fails with LZ_DefaultReceiveLibUnavailable', async () => {\n await fc.assert(\n fc.asyncProperty(\n pointArbitrary,\n endpointArbitrary,\n evmAddressArbitrary,\n async (point, eid, oappAddress) => {\n const provider = new JsonRpcProvider()\n const sdk = new EndpointV2(provider, point)\n // The LZ_DefaultReceiveLibUnavailable error\n const error = { data: '0x78e84d06' }\n\n jest.spyOn(provider, 'call').mockRejectedValue(error)\n\n await expect(sdk.getReceiveLibrary(oappAddress, eid)).resolves.toEqual([undefined, true])\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/endpoint/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58601, "name": "unknown", "code": "it('should reject if call fails but not with LZ_DefaultReceiveLibUnavailable', async () => {\n await fc.assert(\n fc.asyncProperty(\n pointArbitrary,\n endpointArbitrary,\n evmAddressArbitrary,\n async (point, eid, oappAddress) => {\n const provider = new JsonRpcProvider()\n const sdk = new EndpointV2(provider, point)\n const error = { data: '0x86957466' }\n\n jest.spyOn(provider, 'call').mockRejectedValue(error)\n\n await expect(sdk.getReceiveLibrary(oappAddress, eid)).rejects.toEqual(error)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/endpoint/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58602, "name": "unknown", "code": "it('should return an address if the call succeeds', async () => {\n await fc.assert(\n fc.asyncProperty(\n pointArbitrary,\n endpointArbitrary,\n evmAddressArbitrary,\n evmAddressArbitrary,\n async (point, eid, oappAddress, libraryAddress) => {\n const provider = new JsonRpcProvider()\n const sdk = new EndpointV2(provider, point)\n\n jest.spyOn(provider, 'call').mockResolvedValue(\n sdk.contract.contract.interface.encodeFunctionResult('getSendLibrary', [libraryAddress])\n )\n\n await expect(sdk.getSendLibrary(oappAddress, eid)).resolves.toEqual(addChecksum(libraryAddress))\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/endpoint/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58603, "name": "unknown", "code": "it('should return undefined if the call fails with LZ_DefaultSendLibUnavailable', async () => {\n await fc.assert(\n fc.asyncProperty(\n pointArbitrary,\n endpointArbitrary,\n evmAddressArbitrary,\n async (point, eid, oappAddress) => {\n const provider = new JsonRpcProvider()\n const sdk = new EndpointV2(provider, point)\n // The LZ_DefaultReceiveLibUnavailable error\n const error = { data: '0x6c1ccdb5' }\n\n jest.spyOn(provider, 'call').mockRejectedValue(error)\n\n await expect(sdk.getSendLibrary(oappAddress, eid)).resolves.toEqual(undefined)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/endpoint/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58604, "name": "unknown", "code": "it('should reject if call fails but not with LZ_DefaultSendLibUnavailable', async () => {\n await fc.assert(\n fc.asyncProperty(\n pointArbitrary,\n endpointArbitrary,\n evmAddressArbitrary,\n async (point, eid, oappAddress) => {\n const provider = new JsonRpcProvider()\n const sdk = new EndpointV2(provider, point)\n const error = { data: '0x86957466' }\n\n jest.spyOn(provider, 'call').mockRejectedValue(error)\n\n await expect(sdk.getSendLibrary(oappAddress, eid)).rejects.toEqual(error)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/protocol-devtools-evm/test/endpoint/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58605, "name": "unknown", "code": "it('should call onStart & onSuccess when the callback resolves', async () => {\n await fc.assert(\n fc.asyncProperty(fc.array(fc.anything()), fc.anything(), async (args, returnValue) => {\n const fn = jest.fn().mockResolvedValue(returnValue)\n const onStart = jest.fn().mockImplementation((logger: Logger) => logger.debug(`onStart`))\n const onSuccess = jest.fn().mockImplementation((logger: Logger) => logger.debug(`onSuccess`))\n\n await expect(withAsyncLogger(fn, { onStart, onSuccess })(...args)).resolves.toBe(returnValue)\n\n expect(onStart).toHaveBeenCalledWith(expect.anything(), args)\n expect(onSuccess).toHaveBeenCalledWith(expect.anything(), args, returnValue)\n expect(onStart).toHaveBeenCalledBefore(onSuccess)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/io-devtools/test/stdio/logger.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58606, "name": "unknown", "code": "it('should call onStart & onFailure when callback rejects', async () => {\n await fc.assert(\n fc.asyncProperty(fc.array(fc.anything()), fc.anything(), async (args, error) => {\n const fn = jest.fn().mockRejectedValue(error)\n const onStart = jest.fn().mockImplementation((logger: Logger) => logger.debug(`onStart`))\n const onError = jest.fn().mockImplementation((logger: Logger) => logger.debug(`onSuccess`))\n\n await expect(withAsyncLogger(fn, { onStart, onError })(...args)).rejects.toBe(error)\n\n expect(onStart).toHaveBeenCalledWith(expect.anything(), args)\n expect(onError).toHaveBeenCalledWith(expect.anything(), args, error)\n expect(onStart).toHaveBeenCalledBefore(onError)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/io-devtools/test/stdio/logger.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58607, "name": "unknown", "code": "it('should resolve if onSuccess call throws', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.array(fc.anything()),\n fc.anything(),\n fc.anything(),\n async (args, returnValue, loggerError) => {\n const fn = jest.fn().mockResolvedValue(returnValue)\n const onStart = jest.fn().mockImplementation((logger: Logger) => logger.debug(`onStart`))\n const onSuccess = jest.fn().mockImplementation(() => {\n throw loggerError\n })\n\n await expect(withAsyncLogger(fn, { onStart, onSuccess })(...args)).resolves.toBe(\n returnValue\n )\n\n expect(onStart).toHaveBeenCalledWith(expect.anything(), args)\n expect(onSuccess).toHaveBeenCalledWith(expect.anything(), args, returnValue)\n expect(onStart).toHaveBeenCalledBefore(onSuccess)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/io-devtools/test/stdio/logger.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58608, "name": "unknown", "code": "it('should reject with the original error if onError callback throws', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.array(fc.anything()),\n fc.anything(),\n fc.anything(),\n async (args, error, loggerError) => {\n const fn = jest.fn().mockRejectedValue(error)\n const onStart = jest.fn().mockImplementation((logger: Logger) => logger.debug(`onStart`))\n const onError = jest.fn().mockImplementation(() => {\n throw loggerError\n })\n\n await expect(withAsyncLogger(fn, { onStart, onError })(...args)).rejects.toBe(error)\n\n expect(onStart).toHaveBeenCalledWith(expect.anything(), args)\n expect(onError).toHaveBeenCalledWith(expect.anything(), args, error)\n expect(onStart).toHaveBeenCalledBefore(onError)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/io-devtools/test/stdio/logger.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58609, "name": "unknown", "code": "it('should return an empty array when called with an array of nulls and undefineds', () => {\n fc.assert(\n fc.property(fc.array(nullableArbitrary), (transactions) => {\n expect(flattenTransactions(transactions)).toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/transactions/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58610, "name": "unknown", "code": "it('should remove any nulls or undefineds', () => {\n fc.assert(\n fc.property(fc.array(fc.oneof(transactionArbitrary, nullableArbitrary)), (transactions) => {\n const flattened = flattenTransactions(transactions)\n\n for (const transaction of flattened) {\n expect(transaction).not.toBeNull()\n expect(transaction).not.toBeUndefined()\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/transactions/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58611, "name": "unknown", "code": "it('should flatten any arrays', () => {\n fc.assert(\n fc.property(\n fc.array(fc.oneof(transactionArbitrary, nullableArbitrary, fc.array(transactionArbitrary))),\n (transactions) => {\n const flattened = flattenTransactions(transactions)\n\n for (const transaction of flattened) {\n expect(transaction).not.toBeInstanceOf(Array)\n }\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/transactions/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58612, "name": "unknown", "code": "it('should return a map with containing all the transactions passed in', () => {\n fc.assert(\n fc.property(fc.array(transactionArbitrary), (transactions) => {\n const grouped = groupTransactionsByEid(transactions)\n\n for (const transaction of transactions) {\n expect(grouped.get(transaction.point.eid)).toContain(transaction)\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/transactions/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58613, "name": "unknown", "code": "it('should preserve the order of transaction per group', () => {\n fc.assert(\n fc.property(fc.array(transactionArbitrary), (transactions) => {\n const grouped = groupTransactionsByEid(transactions)\n\n for (const transactionsForEid of grouped.values()) {\n // Here we want to make sure that within a group of transactions,\n // no transactions have changed order\n //\n // The logic here goes something like this:\n // - We look for the indices of transactions from the grouped array in the original array\n // - If two transactions swapped places, this array would then contain an inversion\n // (transaction at an earlier index in the grouped array would appear after a transaction\n // at a later index). So what we do is remove the inversions by sorting the array of indices\n // and make sure this sorted array matches the original one\n const transactionIndices = transactionsForEid.map((t) => transactions.indexOf(t))\n const sortedTransactionIndices = transactionIndices.slice().sort()\n\n expect(transactionIndices).toEqual(sortedTransactionIndices)\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/transactions/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58614, "name": "unknown", "code": "it('should return the first transaction as failed if createSigner fails', async () => {\n await fc.assert(\n fc.asyncProperty(fc.array(transactionArbitrary), async (transactions) => {\n const signerFactory: OmniSignerFactory = jest\n .fn()\n .mockImplementation((eid: EndpointId) => Promise.reject(new Error(`So sorry ${eid}`)))\n const signAndSendTransactions = createSignAndSend(signerFactory)\n\n // Now we send all the transactions to the flow and observe the output\n const [successful, errors, pending] = await signAndSendTransactions(transactions)\n\n const grouped = groupTransactionsByEid(transactions)\n\n // We expect none of the transactions to go through\n expect(successful).toEqual([])\n // We expect the errors to contain the first transaction and the wrapped error from the signer factory\n expect(errors).toEqual(\n Array.from(grouped.entries()).map(([eid, transactions]) => ({\n error: new Error(\n `Failed to create a signer for ${formatEid(eid)}: ${new Error(`So sorry ${eid}`)}`\n ),\n transaction: transactions[0],\n }))\n )\n // And we expect all the transactions to be pending\n expect(pending).toContainAllValues(\n Array.from(grouped.entries()).flatMap(([, transactions]) => transactions)\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58615, "name": "unknown", "code": "it('should return all successful transactions if they all go through', async () => {\n await fc.assert(\n fc.asyncProperty(fc.array(transactionArbitrary), async (transactions) => {\n // We'll prepare some mock objects for this test\n // to mock the transaction responses and receipts\n const receipt = { transactionHash: '0x0' }\n\n // Our successful wait will produce a receipt\n const successfulWait = jest.fn().mockResolvedValue(receipt)\n const successfulResponse: OmniTransactionResponse = {\n transactionHash: '0x0',\n wait: successfulWait,\n }\n\n // Our signAndSend will then use the map to resolve/reject transactions\n const signAndSend = jest.fn().mockResolvedValue(successfulResponse)\n const sign = jest.fn().mockRejectedValue('Oh god no')\n const signerFactory: OmniSignerFactory = jest.fn().mockResolvedValue({ signAndSend, sign })\n const signAndSendTransactions = createSignAndSend(signerFactory)\n\n // Now we send all the transactions to the flow and observe the output\n const [successful, errors, pending] = await signAndSendTransactions(transactions)\n\n // Since we are executing groups of transactions in parallel,\n // in general the order of successful transaction will not match the order of input transactions\n expect(successful).toContainAllValues(\n transactions.map((transaction) => ({ transaction, receipt }))\n )\n expect(errors).toEqual([])\n expect(pending).toEqual([])\n\n // What needs to match though is the order of successful transactions within groups\n //\n // For that we group the successful transactions and make sure those are equal to the grouped original transactions\n const groupedSuccessful = groupTransactionsByEid(\n successful.map(({ transaction }) => transaction)\n )\n expect(groupedSuccessful).toEqual(groupTransactionsByEid(transactions))\n\n // We also check that the signer factory has been called with the eids\n for (const transaction of transactions) {\n expect(signerFactory).toHaveBeenCalledWith(transaction.point.eid)\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58616, "name": "unknown", "code": "it('should bail on the first submission error', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.array(transactionArbitrary),\n transactionArbitrary,\n fc.array(transactionArbitrary),\n async (firstBatch, failedTransaction, secondBatch) => {\n // We'll prepare some mock objects for this test\n // to mock the transaction responses and receipts\n const error = new Error('Failed transaction')\n const receipt = { transactionHash: '0x0' }\n const successfulWait = jest.fn().mockResolvedValue(receipt)\n const successfulResponse: OmniTransactionResponse = {\n transactionHash: '0x0',\n wait: successfulWait,\n }\n\n // In order to resolve the good ones and reject the bad ones\n // we'll prepare a map between a transaction and its response\n //\n // This map relies on the fact that we are passing the transaction object without modifying it\n // so the objects are referentially equal\n const implementations: Map> = new Map([\n ...firstBatch.map((t) => [t, Promise.resolve(successfulResponse)] as const),\n ...secondBatch.map((t) => [t, Promise.resolve(successfulResponse)] as const),\n [failedTransaction, Promise.reject(error)],\n ])\n\n const expectedSuccessful = [\n // The first batch should all go through\n ...firstBatch,\n // The transactions that are not on the chain affected by the failed transaction should also pass\n ...secondBatch.filter(({ point }) => point.eid !== failedTransaction.point.eid),\n ]\n\n const expectedPending = secondBatch.filter(\n ({ point }) => point.eid === failedTransaction.point.eid\n )\n\n // Our signAndSend will then use the map to resolve/reject transactions\n const signAndSend = jest.fn().mockImplementation((t) => implementations.get(t))\n const sign = jest.fn().mockRejectedValue('Oh god no')\n const signerFactory: OmniSignerFactory = jest\n .fn()\n .mockResolvedValue({ signAndSend, sign })\n const signAndSendTransactions = createSignAndSend(signerFactory)\n\n // Now we send all the transactions to the flow and observe the output\n const transactions = [...firstBatch, failedTransaction, ...secondBatch]\n const [successful, errors, pending] = await signAndSendTransactions(transactions)\n\n // Since we are executing groups of transactions in parallel,\n // in general the order of successful transaction will not match the order of input transactions\n expect(successful).toContainAllValues(\n expectedSuccessful.map((transaction) => ({ transaction, receipt }))\n )\n expect(errors).toEqual([{ transaction: failedTransaction, error }])\n expect(pending).toEqual([failedTransaction, ...expectedPending])\n\n // What needs to match though is the order of successful transactions within groups\n //\n // For that we group the successful transactions and make sure those are equal to the grouped original transactions\n const groupedSuccessful = groupTransactionsByEid(\n successful.map(({ transaction }) => transaction)\n )\n expect(groupedSuccessful).toEqual(groupTransactionsByEid(expectedSuccessful))\n\n // We also check that the signer factory has been called with the eids\n expect(signerFactory).toHaveBeenCalledWith(failedTransaction.point.eid)\n for (const transaction of firstBatch) {\n expect(signerFactory).toHaveBeenCalledWith(transaction.point.eid)\n }\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58617, "name": "unknown", "code": "it('should call onProgress for every successful transaction', async () => {\n await fc.assert(\n fc.asyncProperty(fc.array(transactionArbitrary), async (transactions) => {\n // We'll prepare some mock objects for this test\n // to mock the transaction responses and receipts\n const receipt = { transactionHash: '0x0' }\n\n // Our successful wait will produce a receipt\n const successfulWait = jest.fn().mockResolvedValue(receipt)\n const successfulResponse: OmniTransactionResponse = {\n transactionHash: '0x0',\n wait: successfulWait,\n }\n\n // Our signAndSend will then use the map to resolve/reject transactions\n const signAndSend = jest.fn().mockResolvedValue(successfulResponse)\n const sign = jest.fn().mockRejectedValue('Oh god no')\n const signerFactory: OmniSignerFactory = jest.fn().mockResolvedValue({ signAndSend, sign })\n const signAndSendTransactions = createSignAndSend(signerFactory)\n\n const handleProgress = jest.fn()\n const [successful] = await signAndSendTransactions(transactions, handleProgress)\n\n // We check whether onProgress has been called for every transaction\n for (const [index, transaction] of successful.entries()) {\n expect(handleProgress).toHaveBeenNthCalledWith(\n index + 1,\n // We expect the transaction in question to be passed\n transaction,\n // As well as the list of all the successful transactions so far\n successful.slice(0, index + 1)\n )\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58618, "name": "unknown", "code": "it('should bail on the first wait error', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.array(transactionArbitrary),\n transactionArbitrary,\n fc.array(transactionArbitrary),\n async (firstBatch, failedTransaction, secondBatch) => {\n // We'll prepare some mock objects for this test\n // to mock the transaction responses and receipts\n const error = new Error('Failed transaction')\n const receipt = { transactionHash: '0x0' }\n\n // Our successful wait will produce a receipt\n const successfulWait = jest.fn().mockResolvedValue(receipt)\n const successfulResponse: OmniTransactionResponse = {\n transactionHash: '0x0',\n wait: successfulWait,\n }\n\n // Our unsuccessful wait will throw an error\n const unsuccessfulWait = jest.fn().mockRejectedValue(error)\n const unsuccessfulResponse: OmniTransactionResponse = {\n transactionHash: '0x0',\n wait: unsuccessfulWait,\n }\n\n // In order to resolve the good ones and reject the bad ones\n // we'll prepare a map between a transaction and its response\n //\n // This map relies on the fact that we are passing the transaction object without modifying it\n // so the objects are referentially equal\n const implementations: Map> = new Map([\n ...firstBatch.map((t) => [t, Promise.resolve(successfulResponse)] as const),\n ...secondBatch.map((t) => [t, Promise.resolve(successfulResponse)] as const),\n [failedTransaction, Promise.resolve(unsuccessfulResponse)],\n ])\n\n const expectedSuccessful = [\n // The first batch should all go through\n ...firstBatch,\n // The transactions that are not on the chain affected by the failed transaction should also pass\n ...secondBatch.filter(({ point }) => point.eid !== failedTransaction.point.eid),\n ]\n\n const expectedPending = secondBatch.filter(\n ({ point }) => point.eid === failedTransaction.point.eid\n )\n\n // Our signAndSend will then use the map to resolve/reject transactions\n const signAndSend = jest.fn().mockImplementation((t) => implementations.get(t))\n const sign = jest.fn().mockRejectedValue('Oh god no')\n const signerFactory: OmniSignerFactory = jest.fn().mockResolvedValue({ signAndSend, sign })\n const signAndSendTransactions = createSignAndSend(signerFactory)\n\n // Now we send all the transactions to the flow and observe the output\n const transactions = [...firstBatch, failedTransaction, ...secondBatch]\n const [successful, errors, pending] = await signAndSendTransactions(transactions)\n\n // Since we are executing groups of transactions in parallel,\n // in general the order of successful transaction will not match the order of input transactions\n expect(successful).toContainAllValues(\n expectedSuccessful.map((transaction) => ({ transaction, receipt }))\n )\n expect(errors).toEqual([{ transaction: failedTransaction, error }])\n expect(pending).toEqual([failedTransaction, ...expectedPending])\n\n // What needs to match though is the order of successful transactions within groups\n //\n // For that we group the successful transactions and make sure those are equal to the grouped original transactions\n const groupedSuccessful = groupTransactionsByEid(\n successful.map(({ transaction }) => transaction)\n )\n expect(groupedSuccessful).toEqual(groupTransactionsByEid(expectedSuccessful))\n\n // We also check that the signer factory has been called with the eids\n expect(signerFactory).toHaveBeenCalledWith(failedTransaction.point.eid)\n for (const transaction of firstBatch) {\n expect(signerFactory).toHaveBeenCalledWith(transaction.point.eid)\n }\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58619, "name": "unknown", "code": "it('should not bail on the first wait error', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.array(transactionArbitrary),\n transactionArbitrary,\n fc.array(transactionArbitrary),\n async (firstBatch, failedTransaction, secondBatch) => {\n // We'll prepare some mock objects for this test\n // to mock the transaction responses and receipts\n const error = new Error('Failed transaction')\n const receipt = { transactionHash: '0x0' }\n\n // Our successful wait will produce a receipt\n const successfulWait = jest.fn().mockResolvedValue(receipt)\n const successfulResponse: OmniTransactionResponse = {\n transactionHash: '0x0',\n wait: successfulWait,\n }\n\n // Our unsuccessful wait will throw an error\n const unsuccessfulWait = jest.fn().mockRejectedValue(error)\n const unsuccessfulResponse: OmniTransactionResponse = {\n transactionHash: '0x0',\n wait: unsuccessfulWait,\n }\n\n // In order to resolve the good ones and reject the bad ones\n // we'll prepare a map between a transaction and its response\n //\n // This map relies on the fact that we are passing the transaction object without modifying it\n // so the objects are referentially equal\n const implementations: Map> = new Map([\n ...firstBatch.map((t) => [t, Promise.resolve(successfulResponse)] as const),\n ...secondBatch.map((t) => [t, Promise.resolve(successfulResponse)] as const),\n [failedTransaction, Promise.resolve(unsuccessfulResponse)],\n ])\n\n const expectedSuccessful = [\n // The first batch should all go through\n ...firstBatch,\n // The second batch should all go through since they all were submitted and will all be mined\n ...secondBatch,\n ]\n\n // Our signAndSend will then use the map to resolve/reject transactions\n const signAndSend = jest.fn().mockImplementation((t) => implementations.get(t))\n const sign = jest.fn().mockRejectedValue('Oh god no')\n const signerFactory: OmniSignerFactory = jest.fn().mockResolvedValue({ signAndSend, sign })\n const signAndSendTransactions = createSignAndSend(signerFactory)\n\n // Now we send all the transactions to the flow and observe the output\n const transactions = [...firstBatch, failedTransaction, ...secondBatch]\n const [successful, errors, pending] = await signAndSendTransactions(transactions)\n\n // Since we are executing groups of transactions in parallel,\n // in general the order of successful transaction will not match the order of input transactions\n expect(successful).toContainAllValues(\n expectedSuccessful.map((transaction) => ({ transaction, receipt }))\n )\n expect(errors).toEqual([{ transaction: failedTransaction, error }])\n expect(pending).toEqual([failedTransaction])\n\n // What needs to match though is the order of successful transactions within groups\n //\n // For that we group the successful transactions and make sure those are equal to the grouped original transactions\n const groupedSuccessful = groupTransactionsByEid(\n successful.map(({ transaction }) => transaction)\n )\n expect(groupedSuccessful).toEqual(groupTransactionsByEid(expectedSuccessful))\n\n // We also check that the signer factory has been called with the eids\n expect(signerFactory).toHaveBeenCalledWith(failedTransaction.point.eid)\n for (const transaction of firstBatch) {\n expect(signerFactory).toHaveBeenCalledWith(transaction.point.eid)\n }\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58620, "name": "unknown", "code": "it('should only return errors if the submission fails', async () => {\n await fc.assert(\n fc.asyncProperty(fc.array(transactionArbitrary), async (transactions) => {\n // We'll prepare some mock objects for this test\n // to mock the transaction responses and receipts\n const error = new Error('Failed transaction')\n\n // Our signAndSend will then use the map to resolve/reject transactions\n const signAndSendBatch = jest.fn().mockRejectedValue(error)\n const signAndSend = jest.fn().mockRejectedValue('Oh god no')\n const sign = jest.fn().mockRejectedValue('Oh god no')\n const signerFactory: OmniSignerFactory = jest\n .fn()\n .mockResolvedValue({ signAndSend, signAndSendBatch, sign })\n const signAndSendTransactions = createSignAndSend(signerFactory)\n\n // Now we send all the transactions to the flow and observe the output\n const [successful, errors, pending] = await signAndSendTransactions(transactions)\n\n // Since we are executing groups of transactions in parallel,\n // in general the order of successful transaction will not match the order of input transactions\n expect(successful).toEqual([])\n expect(errors).toContainAllValues(\n transactions.map((transaction) => ({ transaction, error }))\n )\n expect(pending).toContainAllValues(transactions)\n\n // We also check that the signer factory has been called with the eids\n for (const transaction of transactions) {\n expect(signerFactory).toHaveBeenCalledWith(transaction.point.eid)\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58621, "name": "unknown", "code": "it('should only return errors if the waiting fails', async () => {\n await fc.assert(\n fc.asyncProperty(fc.array(transactionArbitrary), async (transactions) => {\n // We'll prepare some mock objects for this test\n // to mock the transaction responses and receipts\n const error = new Error('Failed transaction')\n // Our unsuccessful wait will throw an error\n const wait = jest.fn().mockRejectedValue(error)\n const response: OmniTransactionResponse = {\n transactionHash: '0x0',\n wait,\n }\n\n // Our signAndSend will then use the map to resolve/reject transactions\n const signAndSendBatch = jest.fn().mockResolvedValue(response)\n const signAndSend = jest.fn().mockRejectedValue('Oh god no')\n const sign = jest.fn().mockRejectedValue('Oh god no')\n const signerFactory: OmniSignerFactory = jest\n .fn()\n .mockResolvedValue({ signAndSend, signAndSendBatch, sign })\n const signAndSendTransactions = createSignAndSend(signerFactory)\n\n // Now we send all the transactions to the flow and observe the output\n const [successful, errors, pending] = await signAndSendTransactions(transactions)\n\n // Since we are executing groups of transactions in parallel,\n // in general the order of successful transaction will not match the order of input transactions\n expect(successful).toEqual([])\n expect(errors).toContainAllValues(\n transactions.map((transaction) => ({ transaction, error }))\n )\n expect(pending).toContainAllValues(transactions)\n\n // We also check that the signer factory has been called with the eids\n for (const transaction of transactions) {\n expect(signerFactory).toHaveBeenCalledWith(transaction.point.eid)\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58622, "name": "unknown", "code": "it('should only return successes if waiting succeeds', async () => {\n await fc.assert(\n fc.asyncProperty(fc.array(transactionArbitrary), async (transactions) => {\n const receipt = { transactionHash: '0x0' }\n\n // Our successful wait will produce a receipt\n const wait = jest.fn().mockResolvedValue(receipt)\n const response: OmniTransactionResponse = {\n transactionHash: '0x0',\n wait,\n }\n\n // Our signAndSend will then use the map to resolve/reject transactions\n const signAndSendBatch = jest.fn().mockResolvedValue(response)\n const signAndSend = jest.fn().mockRejectedValue('Oh god no')\n const sign = jest.fn().mockRejectedValue('Oh god no')\n const signerFactory: OmniSignerFactory = jest\n .fn()\n .mockResolvedValue({ signAndSend, signAndSendBatch, sign })\n const signAndSendTransactions = createSignAndSend(signerFactory)\n\n // Now we send all the transactions to the flow and observe the output\n const [successful, errors, pending] = await signAndSendTransactions(transactions)\n\n // Since we are executing groups of transactions in parallel,\n // in general the order of successful transaction will not match the order of input transactions\n expect(successful).toContainAllValues(\n transactions.map((transaction) => ({ transaction, receipt }))\n )\n expect(errors).toEqual([])\n expect(pending).toEqual([])\n\n // We also check that the signer factory has been called with the eids\n for (const transaction of transactions) {\n expect(signerFactory).toHaveBeenCalledWith(transaction.point.eid)\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58623, "name": "unknown", "code": "it('should parse successfully', () => {\n fc.assert(\n fc.property(pointArbitrary, good, (point, config) => {\n expect(schema.safeParse({ point, config }).success).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58624, "name": "unknown", "code": "it('should not parse', () => {\n fc.assert(\n fc.property(pointArbitrary, bad, (point, config) => {\n expect(schema.safeParse({ point, config }).success).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58625, "name": "unknown", "code": "it('should parse successfully', () => {\n fc.assert(\n fc.property(vectorArbitrary, good, (vector, config) => {\n expect(schema.safeParse({ vector, config }).success).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58626, "name": "unknown", "code": "it('should not parse', () => {\n fc.assert(\n fc.property(vectorArbitrary, bad, (vector, config) => {\n expect(schema.safeParse({ vector, config }).success).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58627, "name": "unknown", "code": "it('should work for non-negative bigints', () => {\n fc.assert(\n fc.property(fc.bigInt({ min: BigInt(0) }), (value) => {\n expect(UIntBigIntSchema.parse(value)).toBe(value)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58628, "name": "unknown", "code": "it('should not work for negative bigints', () => {\n fc.assert(\n fc.property(fc.bigInt({ max: BigInt(-1) }), (value) => {\n expect(() => UIntBigIntSchema.parse(value)).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58629, "name": "unknown", "code": "it('should work for non-negative bigint strings', () => {\n fc.assert(\n fc.property(fc.bigInt({ min: BigInt(0) }), (value) => {\n expect(UIntBigIntSchema.parse(String(value))).toBe(value)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58630, "name": "unknown", "code": "it('should not work for negative bigint strings', () => {\n fc.assert(\n fc.property(fc.bigInt({ max: BigInt(-1) }), (value) => {\n expect(() => UIntBigIntSchema.parse(String(value))).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58631, "name": "unknown", "code": "it('should work for non-negative integers', () => {\n fc.assert(\n fc.property(fc.integer({ min: 0 }), (value) => {\n expect(UIntBigIntSchema.parse(value)).toBe(BigInt(value))\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58632, "name": "unknown", "code": "it('should not work for negative integers', () => {\n fc.assert(\n fc.property(fc.integer({ max: -1 }), (value) => {\n expect(() => UIntBigIntSchema.parse(value)).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58633, "name": "unknown", "code": "it('should work for non-negative integer strings', () => {\n fc.assert(\n fc.property(fc.integer({ min: 0 }), (value) => {\n expect(UIntBigIntSchema.parse(String(value))).toBe(BigInt(value))\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58634, "name": "unknown", "code": "it('should not work for negative integer strings', () => {\n fc.assert(\n fc.property(fc.integer({ max: -1 }), (value) => {\n expect(() => UIntBigIntSchema.parse(String(value))).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58635, "name": "unknown", "code": "it('should throw a ZodError for invalid values', () => {\n fc.assert(\n fc.property(fc.anything(), (value) => {\n let isValid = false\n\n try {\n isValid = UIntBigIntSchema.safeParse(value).success\n } catch {\n // This catch block is designed to catch errors caused by messed up standard methods\n // like toString or toValue that fast check throws at us\n }\n\n fc.pre(!isValid)\n\n // Here we expect that whatever we got, we'll not receive a SyntaxError\n // (coming from a BigInt() constructor) but a ZodError\n expect(() => UIntBigIntSchema.parse(value)).toThrow(ZodError)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58636, "name": "unknown", "code": "it('should work for non-negative integers', () => {\n fc.assert(\n fc.property(fc.integer({ min: 0 }), (value) => {\n expect(UIntNumberSchema.parse(value)).toBe(value)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58637, "name": "unknown", "code": "it('should not work for negative integers', () => {\n fc.assert(\n fc.property(fc.integer({ max: -1 }), (value) => {\n expect(() => UIntNumberSchema.parse(value)).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58638, "name": "unknown", "code": "it('should work for non-negative integer strings', () => {\n fc.assert(\n fc.property(fc.integer({ min: 0 }), (value) => {\n expect(UIntNumberSchema.parse(String(value))).toBe(value)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58639, "name": "unknown", "code": "it('should not work for negative integer strings', () => {\n fc.assert(\n fc.property(fc.integer({ max: -1 }), (value) => {\n expect(() => UIntNumberSchema.parse(String(value))).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58640, "name": "unknown", "code": "it('should throw a ZodError for invalid values', () => {\n fc.assert(\n fc.property(fc.anything(), (value) => {\n let isValid = false\n\n try {\n isValid = UIntNumberSchema.safeParse(value).success\n } catch {\n // This catch block is designed to catch errors caused by messed up standard methods\n // like toString or toValue that fast check throws at us\n }\n\n fc.pre(!isValid)\n\n // Here we expect that whatever we got, we'll not receive a SyntaxError\n // (coming from a BigInt() constructor) but a ZodError\n expect(() => UIntNumberSchema.parse(value)).toThrow(ZodError)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58641, "name": "unknown", "code": "it('should be true for referentially equal vector', () => {\n fc.assert(\n fc.property(pointArbitrary, (point) => {\n expect(arePointsEqual(point, point)).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58642, "name": "unknown", "code": "it('should be true for value equal vector', () => {\n fc.assert(\n fc.property(pointArbitrary, (point) => {\n expect(arePointsEqual(point, { ...point })).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58643, "name": "unknown", "code": "it(\"should be false when addresses don't match\", () => {\n fc.assert(\n fc.property(pointArbitrary, addressArbitrary, (point, address) => {\n fc.pre(point.address !== address)\n\n expect(arePointsEqual(point, { ...point, address })).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58644, "name": "unknown", "code": "it(\"should be false when endpoint IDs don't match\", () => {\n fc.assert(\n fc.property(pointArbitrary, endpointArbitrary, (point, eid) => {\n fc.pre(point.eid !== eid)\n\n expect(arePointsEqual(point, { ...point, eid })).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58645, "name": "unknown", "code": "it(\"should be false when contract names don't match\", () => {\n fc.assert(\n fc.property(pointArbitrary, nullableArbitrary(fc.string()), (point, contractName) => {\n fc.pre(point.contractName !== contractName)\n\n expect(arePointsEqual(point, { ...point, contractName })).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58646, "name": "unknown", "code": "it('should be true for referentially equal vector', () => {\n fc.assert(\n fc.property(vectorArbitrary, (vector) => {\n expect(areVectorsEqual(vector, vector)).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58647, "name": "unknown", "code": "it('should be true for value equal vector', () => {\n fc.assert(\n fc.property(vectorArbitrary, (vector) => {\n expect(areVectorsEqual(vector, { ...vector })).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58648, "name": "unknown", "code": "it(\"should be false when from point doesn't match\", () => {\n fc.assert(\n fc.property(vectorArbitrary, pointArbitrary, (vector, from) => {\n fc.pre(!arePointsEqual(vector.from, from))\n\n expect(areVectorsEqual(vector, { ...vector, from })).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58649, "name": "unknown", "code": "it(\"should be false when to point doesn't match\", () => {\n fc.assert(\n fc.property(vectorArbitrary, pointArbitrary, (vector, to) => {\n fc.pre(!arePointsEqual(vector.from, to))\n\n expect(areVectorsEqual(vector, { ...vector, to })).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58650, "name": "unknown", "code": "it('should return true if the eids match', () => {\n fc.assert(\n fc.property(pointArbitrary, pointArbitrary, (pointA, pointB) => {\n expect(areSameEndpoint(pointA, { ...pointB, eid: pointA.eid })).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58651, "name": "unknown", "code": "it('should return false if the eids differ', () => {\n fc.assert(\n fc.property(pointArbitrary, pointArbitrary, (pointA, pointB) => {\n fc.pre(pointA.eid !== pointB.eid)\n\n expect(areSameEndpoint(pointA, pointB)).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58652, "name": "unknown", "code": "it('should produce identical serialized values if the vector match', () => {\n fc.assert(\n fc.property(pointArbitrary, (point) => {\n expect(serializePoint(point)).toBe(serializePoint({ ...point }))\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58653, "name": "unknown", "code": "it(\"should produce different serialized values if the vector don't match\", () => {\n fc.assert(\n fc.property(pointArbitrary, pointArbitrary, (pointA, pointB) => {\n fc.pre(!arePointsEqual(pointA, pointB))\n\n expect(serializePoint(pointA)).not.toBe(serializePoint(pointB))\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58654, "name": "unknown", "code": "it('should produce identical serialized values if the vector match', () => {\n fc.assert(\n fc.property(vectorArbitrary, (vector) => {\n expect(serializeVector(vector)).toBe(serializeVector({ ...vector }))\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58655, "name": "unknown", "code": "it(\"should produce different serialized values if the vector don't match\", () => {\n fc.assert(\n fc.property(vectorArbitrary, vectorArbitrary, (lineA, lineB) => {\n fc.pre(!areVectorsEqual(lineA, lineB))\n\n expect(serializeVector(lineA)).not.toBe(serializeVector(lineB))\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58656, "name": "unknown", "code": "it('should return true if two points are on the same stage', () => {\n fc.assert(\n fc.property(endpointArbitrary, endpointArbitrary, addressArbitrary, (eid1, eid2, address) => {\n fc.pre(endpointIdToStage(eid1) === endpointIdToStage(eid2))\n\n expect(\n isVectorPossible({ from: { eid: eid1, address }, to: { eid: eid2, address } })\n ).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58657, "name": "unknown", "code": "it('should return false if two points are not on the same stage', () => {\n fc.assert(\n fc.property(endpointArbitrary, endpointArbitrary, addressArbitrary, (eid1, eid2, address) => {\n fc.pre(endpointIdToStage(eid1) !== endpointIdToStage(eid2))\n\n expect(\n isVectorPossible({ from: { eid: eid1, address }, to: { eid: eid2, address } })\n ).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58658, "name": "unknown", "code": "it('should append eid to a value', () => {\n fc.assert(\n fc.property(endpointArbitrary, fc.dictionary(fc.string(), fc.anything()), (eid, value) => {\n expect(withEid(eid)(value)).toEqual({ ...value, eid })\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58659, "name": "unknown", "code": "it('should return an empty array if configuration function returns null, undefined or an empty array', async () => {\n const createSdk = jest.fn()\n const configureNode = jest.fn()\n const configureNodes = createConfigureNodes(configureNode)\n\n await fc.assert(\n fc.asyncProperty(nodesArbitrary, async (contracts) => {\n createSdk.mockClear()\n configureNode.mockClear()\n\n // We mock the node configurator to only return empty values\n configureNode.mockResolvedValueOnce(null).mockResolvedValueOnce(undefined).mockResolvedValue([])\n\n const graph = { contracts, connections: [] }\n await expect(configureNodes(graph, createSdk)).resolves.toEqual([])\n\n expect(createSdk).toHaveBeenCalledTimes(contracts.length)\n expect(configureNode).toHaveBeenCalledTimes(contracts.length)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/config.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58660, "name": "unknown", "code": "it('should create an SDK and execute configurator for every node', async () => {\n // Just some random SDK factory\n const createSdk = jest.fn().mockImplementation((point: OmniPoint) => ({ sdkFor: point }))\n // And a configuration function that returns something that we can identify in the result\n const configureNode = jest\n .fn()\n .mockImplementation((node: OmniNode, sdk: unknown) => ({ point: node.point, sdk }))\n const configureNodes = createConfigureNodes(configureNode)\n\n await fc.assert(\n fc.asyncProperty(nodesArbitrary, async (contracts) => {\n createSdk.mockClear()\n configureNode.mockClear()\n\n const graph = { contracts, connections: [] }\n const transactions = await configureNodes(graph, createSdk)\n\n // First we check that the transactions match what our configuration function would return\n expect(transactions).toHaveLength(contracts.length)\n expect(transactions).toEqual(\n contracts.map(({ point }) => ({\n point,\n sdk: {\n sdkFor: point,\n },\n }))\n )\n\n // Then we check that the configurations have been called properly\n expect(createSdk).toHaveBeenCalledTimes(contracts.length)\n expect(configureNode).toHaveBeenCalledTimes(contracts.length)\n\n for (const contract of contracts) {\n expect(createSdk).toHaveBeenCalledWith(contract.point)\n expect(configureNode).toHaveBeenCalledWith(\n contract,\n expect.objectContaining({ sdkFor: contract.point }),\n graph,\n createSdk\n )\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/config.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58661, "name": "unknown", "code": "it('should return an empty array if configuration function returns null, undefined or an empty array', async () => {\n const createSdk = jest.fn()\n const configureEdge = jest.fn()\n const configureEdges = createConfigureEdges(configureEdge)\n\n await fc.assert(\n fc.asyncProperty(edgesArbitrary, async (connections) => {\n createSdk.mockClear()\n configureEdge.mockClear()\n\n // We mock the node configurator to only return empty values\n configureEdge.mockResolvedValueOnce(null).mockResolvedValueOnce(undefined).mockResolvedValue([])\n\n const graph = { contracts: [], connections }\n await expect(configureEdges(graph, createSdk)).resolves.toEqual([])\n\n expect(createSdk).toHaveBeenCalledTimes(connections.length)\n expect(configureEdge).toHaveBeenCalledTimes(connections.length)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/config.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58662, "name": "unknown", "code": "it('should create an SDK and execute configurator for every connection', async () => {\n // Just some random SDK factory\n const createSdk = jest.fn().mockImplementation((point: OmniPoint) => ({ sdkFor: point }))\n // And a configuration function that returns something that we can identify in the result\n const configureEdge = jest\n .fn()\n .mockImplementation((edge: OmniEdge, sdk: unknown) => ({ vector: edge.vector, sdk }))\n const configureEdges = createConfigureEdges(configureEdge)\n\n await fc.assert(\n fc.asyncProperty(edgesArbitrary, async (connections) => {\n createSdk.mockClear()\n configureEdge.mockClear()\n\n const graph = { contracts: [], connections }\n const transactions = await configureEdges(graph, createSdk)\n\n // First we check that the transactions match what our configuration function would return\n expect(transactions).toHaveLength(connections.length)\n expect(transactions).toEqual(\n connections.map(({ vector }) => ({\n vector,\n sdk: {\n sdkFor: vector.from,\n },\n }))\n )\n\n // Then we check that the configurations have been called properly\n expect(createSdk).toHaveBeenCalledTimes(connections.length)\n expect(configureEdge).toHaveBeenCalledTimes(connections.length)\n\n for (const contract of connections) {\n expect(createSdk).toHaveBeenCalledWith(contract.vector.from)\n expect(configureEdge).toHaveBeenCalledWith(\n contract,\n expect.objectContaining({ sdkFor: contract.vector.from }),\n graph,\n createSdk\n )\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/config.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58663, "name": "unknown", "code": "it('should return a configurator that does nothing with no configurators', async () => {\n const createSdk = jest.fn()\n const emptyConfigurator = createConfigureMultiple()\n\n await fc.assert(\n fc.asyncProperty(graphArbitrary, async (graph) => {\n expect(createSdk).not.toHaveBeenCalled()\n\n await expect(emptyConfigurator(graph, createSdk)).resolves.toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/config.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58664, "name": "unknown", "code": "it('should call all configurators', async () => {\n const createSdk = jest.fn()\n\n await fc.assert(\n fc.asyncProperty(\n graphArbitrary,\n fc.array(transactionArbitrary),\n async (graph, transactionGroups) => {\n createSdk.mockClear()\n\n // We create a configurator for every group of transactions\n const configurators = transactionGroups.map((transactions) =>\n jest.fn().mockResolvedValue(transactions)\n )\n\n // Now we execute these configurators\n const multiConfigurator = createConfigureMultiple(...configurators)\n\n // And expect to get all the transactions back\n await expect(multiConfigurator(graph, createSdk)).resolves.toEqual(transactionGroups.flat())\n\n // We also check that every configurator has been called\n for (const configurator of configurators) {\n expect(configurator).toHaveBeenCalledOnce()\n }\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/config.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58665, "name": "unknown", "code": "it('should work without contract name innit', () => {\n fc.assert(\n fc.property(pointArbitrary, (point) => {\n fc.pre(!point.contractName)\n\n expect(formatOmniPoint(point)).toBe(`[${point.address} @ ${formatEid(point.eid)}]`)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/format.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58666, "name": "unknown", "code": "it('should work with contract name innit', () => {\n fc.assert(\n fc.property(pointArbitrary, (point) => {\n fc.pre(!!point.contractName)\n\n expect(formatOmniPoint(point)).toBe(\n `[${point.address} (${point.contractName}) @ ${formatEid(point.eid)}]`\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/format.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58667, "name": "unknown", "code": "it('should just work innit', () => {\n fc.assert(\n fc.property(vectorArbitrary, (vector) => {\n expect(formatOmniVector(vector)).toBe(\n `${formatOmniPoint(vector.from)} \u2192 ${formatOmniPoint(vector.to)}`\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/format.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58668, "name": "unknown", "code": "it('should add a single node', () => {\n fc.assert(\n fc.property(nodeArbitrary, (node) => {\n const builder = new OmniGraphBuilder()\n\n builder.addNodes(node)\n expect(builder.nodes).toEqual([node])\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58669, "name": "unknown", "code": "it('should not add a duplicate node', () => {\n fc.assert(\n fc.property(nodeArbitrary, (node) => {\n const builder = new OmniGraphBuilder()\n\n builder.addNodes(node, node)\n expect(builder.nodes).toEqual([node])\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58670, "name": "unknown", "code": "it('should overwrite a node if the points are equal', () => {\n fc.assert(\n fc.property(pointArbitrary, nodeConfigArbitrary, nodeConfigArbitrary, (point, configA, configB) => {\n const builder = new OmniGraphBuilder()\n\n const nodeA = { point, config: configA }\n const nodeB = { point, config: configB }\n\n builder.addNodes(nodeA, nodeB)\n expect(builder.nodes).toEqual([nodeB])\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58671, "name": "unknown", "code": "it('should not do anything when there are no nodes', () => {\n fc.assert(\n fc.property(nodeArbitrary, (node) => {\n const builder = new OmniGraphBuilder()\n\n builder.removeNodeAt(node.point)\n expect(builder.nodes).toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58672, "name": "unknown", "code": "it('should return self', () => {\n fc.assert(\n fc.property(nodeArbitrary, (node) => {\n const builder = new OmniGraphBuilder()\n\n expect(builder.removeNodeAt(node.point)).toBe(builder)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58673, "name": "unknown", "code": "it('should remove a node at a specified point', () => {\n fc.assert(\n fc.property(nodeArbitrary, (node) => {\n const builder = new OmniGraphBuilder()\n\n builder.addNodes(node)\n builder.removeNodeAt(node.point)\n expect(builder.nodes).toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58674, "name": "unknown", "code": "it('should not remove nodes at different points', () => {\n fc.assert(\n fc.property(nodeArbitrary, nodeArbitrary, (nodeA, nodeB) => {\n fc.pre(!arePointsEqual(nodeA.point, nodeB.point))\n\n const builder = new OmniGraphBuilder()\n\n builder.addNodes(nodeA, nodeB)\n builder.removeNodeAt(nodeA.point)\n expect(builder.nodes).toEqual([nodeB])\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58675, "name": "unknown", "code": "it('should remove all edges starting at the node', () => {\n fc.assert(\n fc.property(\n nodeArbitrary,\n nodeArbitrary,\n nodeArbitrary,\n edgeConfigArbitrary,\n (nodeA, nodeB, nodeC, edgeConfig) => {\n fc.pre(!arePointsEqual(nodeA.point, nodeB.point))\n fc.pre(!arePointsEqual(nodeA.point, nodeC.point))\n fc.pre(!arePointsEqual(nodeB.point, nodeC.point))\n\n const edgeAB = { vector: { from: nodeA.point, to: nodeB.point }, config: edgeConfig }\n const edgeAC = { vector: { from: nodeA.point, to: nodeC.point }, config: edgeConfig }\n const edgeBA = { vector: { from: nodeB.point, to: nodeA.point }, config: edgeConfig }\n const edgeBC = { vector: { from: nodeB.point, to: nodeC.point }, config: edgeConfig }\n const edgeCA = { vector: { from: nodeC.point, to: nodeA.point }, config: edgeConfig }\n const edgeCB = { vector: { from: nodeC.point, to: nodeB.point }, config: edgeConfig }\n\n fc.pre(isVectorPossible(edgeAB.vector))\n fc.pre(isVectorPossible(edgeAC.vector))\n fc.pre(isVectorPossible(edgeBA.vector))\n fc.pre(isVectorPossible(edgeBC.vector))\n fc.pre(isVectorPossible(edgeCA.vector))\n fc.pre(isVectorPossible(edgeCB.vector))\n\n const builder = new OmniGraphBuilder()\n\n builder\n .addNodes(nodeA, nodeB, nodeC)\n .addEdges(edgeAB, edgeAC, edgeBA, edgeBC, edgeCA, edgeCB)\n .removeNodeAt(nodeA.point)\n expect(builder.edges).toEqual([edgeBA, edgeBC, edgeCA, edgeCB])\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58676, "name": "unknown", "code": "it('should fail if from is not in the graph', () => {\n fc.assert(\n fc.property(edgeArbitrary, nodeConfigArbitrary, (edge, nodeConfig) => {\n fc.pre(isVectorPossible(edge.vector))\n\n const builder = new OmniGraphBuilder()\n\n builder\n .addNodes(\n { point: edge.vector.from, config: nodeConfig },\n { point: edge.vector.to, config: nodeConfig }\n )\n .removeNodeAt(edge.vector.from)\n\n expect(() => builder.addEdges(edge)).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58677, "name": "unknown", "code": "it('should fail if vector is not possible', () => {\n fc.assert(\n fc.property(edgeArbitrary, nodeConfigArbitrary, (edge, nodeConfig) => {\n fc.pre(!isVectorPossible(edge.vector))\n\n const builder = new OmniGraphBuilder()\n\n builder\n .addNodes(\n { point: edge.vector.from, config: nodeConfig },\n { point: edge.vector.to, config: nodeConfig }\n )\n .removeNodeAt(edge.vector.from)\n\n expect(() => builder.addEdges(edge)).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58678, "name": "unknown", "code": "it('should not fail if to is not in the graph', () => {\n fc.assert(\n fc.property(edgeArbitrary, nodeConfigArbitrary, (edge, nodeConfig) => {\n fc.pre(isVectorPossible(edge.vector))\n\n const builder = new OmniGraphBuilder()\n\n builder\n .addNodes(\n { point: edge.vector.from, config: nodeConfig },\n { point: edge.vector.to, config: nodeConfig }\n )\n .removeNodeAt(edge.vector.to)\n .addEdges(edge)\n\n expect(builder.edges).toEqual([edge])\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58679, "name": "unknown", "code": "it('should add a single edge', () => {\n fc.assert(\n fc.property(edgeArbitrary, nodeConfigArbitrary, (edge, nodeConfig) => {\n fc.pre(isVectorPossible(edge.vector))\n\n const builder = new OmniGraphBuilder()\n\n builder\n .addNodes({ point: edge.vector.from, config: nodeConfig })\n .addNodes({ point: edge.vector.to, config: nodeConfig })\n .addEdges(edge)\n expect(builder.edges).toEqual([edge])\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58680, "name": "unknown", "code": "it('should not add a duplicate edge', () => {\n fc.assert(\n fc.property(edgeArbitrary, nodeConfigArbitrary, (edge, nodeConfig) => {\n fc.pre(isVectorPossible(edge.vector))\n\n const builder = new OmniGraphBuilder()\n\n builder\n .addNodes({ point: edge.vector.from, config: nodeConfig })\n .addNodes({ point: edge.vector.to, config: nodeConfig })\n .addEdges(edge, edge)\n expect(builder.edges).toEqual([edge])\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58681, "name": "unknown", "code": "it('should overwrite an edge if the points are equal', () => {\n fc.assert(\n fc.property(\n vectorArbitrary,\n edgeConfigArbitrary,\n edgeConfigArbitrary,\n nodeConfigArbitrary,\n (vector, configA, configB, nodeConfig) => {\n fc.pre(isVectorPossible(vector))\n\n const builder = new OmniGraphBuilder()\n\n const edgeA = { vector, config: configA }\n const edgeB = { vector, config: configB }\n\n builder\n .addNodes({ point: vector.from, config: nodeConfig })\n .addNodes({ point: vector.to, config: nodeConfig })\n .addEdges(edgeA, edgeB)\n expect(builder.edges).toEqual([edgeB])\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58682, "name": "unknown", "code": "it('should not do anything when there are no edges', () => {\n fc.assert(\n fc.property(edgeArbitrary, (edge) => {\n fc.pre(isVectorPossible(edge.vector))\n\n const builder = new OmniGraphBuilder()\n\n builder.removeEdgeAt(edge.vector)\n expect(builder.edges).toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58683, "name": "unknown", "code": "it('should return self', () => {\n fc.assert(\n fc.property(edgeArbitrary, (edge) => {\n fc.pre(isVectorPossible(edge.vector))\n\n const builder = new OmniGraphBuilder()\n\n expect(builder.removeEdgeAt(edge.vector)).toBe(builder)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58684, "name": "unknown", "code": "it('should remove a edge at a specified vector', () => {\n fc.assert(\n fc.property(edgeArbitrary, nodeConfigArbitrary, (edge, nodeConfig) => {\n fc.pre(isVectorPossible(edge.vector))\n\n const builder = new OmniGraphBuilder()\n\n builder\n .addNodes({ point: edge.vector.from, config: nodeConfig })\n .addNodes({ point: edge.vector.to, config: nodeConfig })\n .addEdges(edge)\n\n builder.removeEdgeAt(edge.vector)\n expect(builder.edges).toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58685, "name": "unknown", "code": "it('should not remove edges at different vectors', () => {\n fc.assert(\n fc.property(edgeArbitrary, edgeArbitrary, nodeConfigArbitrary, (edgeA, edgeB, nodeConfig) => {\n fc.pre(isVectorPossible(edgeA.vector))\n fc.pre(isVectorPossible(edgeB.vector))\n fc.pre(!areVectorsEqual(edgeA.vector, edgeB.vector))\n\n const builder = new OmniGraphBuilder()\n\n builder\n .addNodes({ point: edgeA.vector.from, config: nodeConfig })\n .addNodes({ point: edgeA.vector.to, config: nodeConfig })\n .addNodes({ point: edgeB.vector.from, config: nodeConfig })\n .addNodes({ point: edgeB.vector.to, config: nodeConfig })\n .addEdges(edgeA, edgeB)\n builder.removeEdgeAt(edgeA.vector)\n expect(builder.edges).toEqual([edgeB])\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58686, "name": "unknown", "code": "it('should return undefined when there are no nodes', () => {\n const builder = new OmniGraphBuilder()\n\n fc.assert(\n fc.property(pointArbitrary, (point) => {\n expect(builder.getNodeAt(point)).toBeUndefined()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58687, "name": "unknown", "code": "it('should return undefined when there are no nodes at a specified point', () => {\n fc.assert(\n fc.property(nodesArbitrary, (nodes) => {\n const node = nodes.at(-1)\n fc.pre(node != null)\n\n const builder = new OmniGraphBuilder()\n\n builder.addNodes(...nodes)\n builder.removeNodeAt(node!.point)\n expect(builder.getNodeAt(node!.point)).toBeUndefined()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58688, "name": "unknown", "code": "it('should return node when there is a node at a specified point', () => {\n fc.assert(\n fc.property(nodesArbitrary, (nodes) => {\n const node = nodes.at(-1)\n fc.pre(node != null)\n\n const builder = new OmniGraphBuilder()\n\n builder.addNodes(...nodes)\n expect(builder.getNodeAt(node!.point)).toBe(node)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58689, "name": "unknown", "code": "it('should return undefined when there are no edges', () => {\n const builder = new OmniGraphBuilder()\n\n fc.assert(\n fc.property(vectorArbitrary, (vector) => {\n expect(builder.getEdgeAt(vector)).toBeUndefined()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58690, "name": "unknown", "code": "it('should return undefined when there are no edges at a specified vector', () => {\n fc.assert(\n fc.property(edgesArbitrary, nodeConfigArbitrary, (edges, nodeConfig) => {\n const edge = edges.at(-1)\n fc.pre(edge != null)\n fc.pre(edges.map((e) => e.vector).every(isVectorPossible))\n\n const builder = new OmniGraphBuilder()\n const nodes = edges.flatMap(({ vector: { from, to } }) => [\n { point: from, config: nodeConfig },\n { point: to, config: nodeConfig },\n ])\n\n builder\n .addNodes(...nodes)\n .addEdges(...edges)\n .removeEdgeAt(edge!.vector)\n expect(builder.getEdgeAt(edge!.vector)).toBeUndefined()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58691, "name": "unknown", "code": "it('should return edge when there is a edge at a specified vector', () => {\n fc.assert(\n fc.property(edgesArbitrary, nodeConfigArbitrary, (edges, nodeConfig) => {\n const edge = edges.at(-1)\n fc.pre(edge != null)\n fc.pre(edges.map((e) => e.vector).every(isVectorPossible))\n\n const builder = new OmniGraphBuilder()\n const nodes = edges.flatMap(({ vector: { from, to } }) => [\n { point: from, config: nodeConfig },\n { point: to, config: nodeConfig },\n ])\n\n builder.addNodes(...nodes).addEdges(...edges)\n expect(builder.getEdgeAt(edge!.vector)).toBe(edge)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58692, "name": "unknown", "code": "it('should return an empty array when there are no edges', () => {\n const builder = new OmniGraphBuilder()\n\n fc.assert(\n fc.property(pointArbitrary, (point) => {\n expect(builder.getEdgesFrom(point)).toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58693, "name": "unknown", "code": "it('should return all edges that originate at a specific point', () => {\n fc.assert(\n fc.property(edgesArbitrary, nodeConfigArbitrary, (edges, nodeConfig) => {\n const edge = edges.at(-1)\n fc.pre(edge != null)\n fc.pre(edges.map((e) => e.vector).every(isVectorPossible))\n\n const builder = new OmniGraphBuilder()\n const nodes = edges.flatMap(({ vector: { from, to } }) => [\n { point: from, config: nodeConfig },\n { point: to, config: nodeConfig },\n ])\n\n builder.addNodes(...nodes).addEdges(...edges)\n\n const edgesFrom = builder.edges.filter(({ vector }) =>\n arePointsEqual(vector.from, edge!.vector.from)\n )\n expect(builder.getEdgesFrom(edge!.vector.from)).toEqual(edgesFrom)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58694, "name": "unknown", "code": "it('should return an empty array when there are no edges', () => {\n const builder = new OmniGraphBuilder()\n\n fc.assert(\n fc.property(pointArbitrary, (point) => {\n expect(builder.getEdgesTo(point)).toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58695, "name": "unknown", "code": "it('should return all edges that end at a specific point', () => {\n fc.assert(\n fc.property(edgesArbitrary, nodeConfigArbitrary, (edges, nodeConfig) => {\n const edge = edges.at(-1)\n fc.pre(edge != null)\n fc.pre(edges.map((e) => e.vector).every(isVectorPossible))\n\n const builder = new OmniGraphBuilder()\n const nodes = edges.flatMap(({ vector: { from, to } }) => [\n { point: from, config: nodeConfig },\n { point: to, config: nodeConfig },\n ])\n\n builder.addNodes(...nodes).addEdges(...edges)\n\n const edgesTo = builder.edges.filter(({ vector }) => arePointsEqual(vector.to, edge!.vector.to))\n expect(builder.getEdgesTo(edge!.vector.to)).toEqual(edgesTo)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/omnigraph/builder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58696, "name": "unknown", "code": "it('should return padded values for address', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, (address) => {\n const bytes = makeBytes32(address)\n\n expect(bytes.length).toBe(66)\n expect(BigInt(bytes)).toBe(BigInt(address))\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58697, "name": "unknown", "code": "it('should return identity for bytes32', () => {\n fc.assert(\n fc.property(evmBytes32Arbitrary, (bytes) => {\n expect(makeBytes32(bytes)).toBe(bytes)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58698, "name": "unknown", "code": "it('should return true for two nullish values', () => {\n fc.assert(\n fc.property(zeroishBytes32Arbitrary, zeroishBytes32Arbitrary, (a, b) => {\n expect(areBytes32Equal(a, b)).toBe(true)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58699, "name": "unknown", "code": "it('should return true for two identical values', () => {\n fc.assert(\n fc.property(evmBytes32Arbitrary, (a) => {\n expect(areBytes32Equal(a, a)).toBe(true)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58700, "name": "unknown", "code": "it('should return true for an address and bytes', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, (address) => {\n expect(areBytes32Equal(address, makeBytes32(address))).toBe(true)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58701, "name": "unknown", "code": "it('should return false for a zeroish value and a non-zeroish address', () => {\n fc.assert(\n fc.property(zeroishBytes32Arbitrary, evmAddressArbitrary, (bytes, address) => {\n fc.pre(!isZero(address))\n\n expect(areBytes32Equal(bytes, address)).toBe(false)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58702, "name": "unknown", "code": "it('should return false for a zeroish value and a non-zeroish bytes', () => {\n fc.assert(\n fc.property(zeroishBytes32Arbitrary, evmBytes32Arbitrary, (a, b) => {\n fc.pre(!isZero(b))\n\n expect(areBytes32Equal(a, b)).toBe(false)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58703, "name": "unknown", "code": "it('should return true for identical UInt8Arrays', () => {\n fc.assert(\n fc.property(fc.uint8Array({ minLength: 1 }), (bytes) => {\n expect(areBytes32Equal(bytes, bytes)).toBe(true)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58704, "name": "unknown", "code": "it('should return true for a UInt8Array & its hex representation', () => {\n fc.assert(\n fc.property(fc.uint8Array({ minLength: 1, maxLength: 32 }), (bytes) => {\n expect(areBytes32Equal(bytes, makeBytes32(bytes))).toBe(true)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58705, "name": "unknown", "code": "it('should return false two non-matching UInt8Array instances', () => {\n fc.assert(\n fc.property(\n fc.uint8Array({ minLength: 1, maxLength: 32 }),\n fc.uint8Array({ minLength: 1, maxLength: 32 }),\n (a, b) => {\n // We need to filter out matching arrays\n fc.pre(\n // We walk over the first array and check that there is at least one non-matching element\n //\n // We default any missing (undefined) values in the second array to 0\n // since any leading zeros are equal to undefined\n a.some((v, i) => v !== b[i] || 0) ||\n // And we do the same for the second array (since we don't know which one lis longer)\n b.some((v, i) => v !== a[i] || 0)\n )\n\n expect(areBytes32Equal(a, b)).toBe(false)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58706, "name": "unknown", "code": "it('should return false two a UInt8Array & non-matching hex string', () => {\n fc.assert(\n fc.property(\n fc.uint8Array({ minLength: 1, maxLength: 32 }),\n fc.uint8Array({ minLength: 1, maxLength: 32 }),\n (a, b) => {\n fc.pre(\n // We walk over the first array and check that there is at least one non-matching element\n //\n // We default any missing (undefined) values in the second array to 0\n // since any leading zeros are equal to undefined\n a.some((v, i) => v !== b[i]) ||\n // And we do the same for the second array (since we don't know which one lis longer)\n b.some((v, i) => v !== a[i])\n )\n\n expect(areBytes32Equal(a, makeBytes32(b))).toBe(false)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58707, "name": "unknown", "code": "it('should return false with non-zero address', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, (address) => {\n fc.pre(address !== AddressZero)\n\n expect(isZero(address)).toBe(false)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58708, "name": "unknown", "code": "it('should return false with non-zero bytes32', () => {\n fc.assert(\n fc.property(evmBytes32Arbitrary, (address) => {\n fc.pre(address !== ZERO_BYTES)\n\n expect(isZero(address)).toBe(false)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58709, "name": "unknown", "code": "it('should return true with a zero-only UInt8Array', () => {\n fc.assert(\n fc.property(fc.uint8Array({ min: 0, max: 0 }), (bytes) => {\n expect(isZero(bytes)).toBe(true)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58710, "name": "unknown", "code": "it('should return false with a non-zero UInt8Array', () => {\n fc.assert(\n fc.property(fc.uint8Array({ minLength: 1 }), (bytes) => {\n fc.pre(bytes.some((byte) => byte !== 0))\n\n expect(isZero(bytes)).toBe(false)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58711, "name": "unknown", "code": "it('should return address with non-zero address', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, (address) => {\n fc.pre(address !== AddressZero)\n\n expect(ignoreZero(address)).toBe(address)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58712, "name": "unknown", "code": "it('should return 0 for two identical addresses', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, (address) => {\n expect(compareBytes32Ascending(address, address)).toBe(0)\n expect(compareBytes32Ascending(address, makeBytes32(address))).toBe(0)\n expect(compareBytes32Ascending(makeBytes32(address), makeBytes32(address))).toBe(0)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58713, "name": "unknown", "code": "it('should return a negative value for zero address and any other address', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, (address) => {\n fc.pre(!isZero(address))\n\n expect(compareBytes32Ascending(AddressZero, address)).toBeLessThan(0)\n expect(compareBytes32Ascending(AddressZero, makeBytes32(address))).toBeLessThan(0)\n expect(compareBytes32Ascending(makeBytes32(AddressZero), address)).toBeLessThan(0)\n expect(compareBytes32Ascending(makeBytes32(AddressZero), makeBytes32(address))).toBeLessThan(0)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58714, "name": "unknown", "code": "it('should return a positive value for zero address and any other address', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, (address) => {\n fc.pre(!isZero(address))\n\n expect(compareBytes32Ascending(address, AddressZero)).toBeGreaterThan(0)\n expect(compareBytes32Ascending(makeBytes32(address), AddressZero)).toBeGreaterThan(0)\n expect(compareBytes32Ascending(address, makeBytes32(AddressZero))).toBeGreaterThan(0)\n expect(compareBytes32Ascending(makeBytes32(address), makeBytes32(AddressZero))).toBeGreaterThan(0)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58715, "name": "unknown", "code": "it('should return a negative if address comes before the other address', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, evmAddressArbitrary, (addressA, addressB) => {\n fc.pre(addressA.toLowerCase() < addressB.toLowerCase())\n\n expect(compareBytes32Ascending(addressA, addressB)).toBeLessThan(0)\n expect(compareBytes32Ascending(addressA, makeBytes32(addressB))).toBeLessThan(0)\n expect(compareBytes32Ascending(makeBytes32(addressA), addressB)).toBeLessThan(0)\n expect(compareBytes32Ascending(makeBytes32(addressA), makeBytes32(addressB))).toBeLessThan(0)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58716, "name": "unknown", "code": "it('should return a negative if address comes after the other address', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, evmAddressArbitrary, (addressA, addressB) => {\n fc.pre(addressA.toLowerCase() > addressB.toLowerCase())\n\n expect(compareBytes32Ascending(addressA, addressB)).toBeGreaterThan(0)\n expect(compareBytes32Ascending(makeBytes32(addressA), addressB)).toBeGreaterThan(0)\n expect(compareBytes32Ascending(addressA, makeBytes32(addressB))).toBeGreaterThan(0)\n expect(compareBytes32Ascending(makeBytes32(addressA), makeBytes32(addressB))).toBeGreaterThan(0)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58717, "name": "unknown", "code": "it('should resolve if all resolve', async () => {\n await fc.assert(\n fc.asyncProperty(valuesArbitrary, async (values) => {\n const tasks = values.map((value) => jest.fn().mockResolvedValue(value))\n\n expect(await sequence(tasks)).toEqual(values)\n\n // Make sure all the tasks got called\n for (const task of tasks) {\n expect(task).toHaveBeenCalledTimes(1)\n expect(task).toHaveBeenCalledWith()\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58718, "name": "unknown", "code": "it('should reject with the first rejection', async () => {\n await fc.assert(\n fc.asyncProperty(valuesArbitrary, valueArbitrary, valuesArbitrary, async (values1, error, values2) => {\n const tasks1 = values1.map((value) => jest.fn().mockResolvedValue(value))\n const failingTask = jest.fn().mockRejectedValue(error)\n const tasks2 = values2.map((value) => jest.fn().mockResolvedValue(value))\n const tasks = [...tasks1, failingTask, ...tasks2]\n\n await expect(sequence(tasks)).rejects.toBe(error)\n\n // Make sure the first batch got called\n for (const task of tasks1) {\n expect(task).toHaveBeenCalledTimes(1)\n expect(task).toHaveBeenCalledWith()\n }\n\n // Make sure the failing task got called\n expect(failingTask).toHaveBeenCalledTimes(1)\n expect(failingTask).toHaveBeenCalledWith()\n\n // Make sure the second batch didn't get called\n for (const task of tasks2) {\n expect(task).not.toHaveBeenCalled()\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58719, "name": "unknown", "code": "it('should execute one by one', async () => {\n await fc.assert(\n fc.asyncProperty(valuesArbitrary, async (values) => {\n fc.pre(values.length > 0)\n\n const tasks = values.map((value) => jest.fn().mockResolvedValue(value))\n\n await sequence(tasks)\n\n tasks.reduce((task1, task2) => {\n return expect(task1).toHaveBeenCalledBefore(task2), task2\n })\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58720, "name": "unknown", "code": "it('should resolve if the first task resolves', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, valuesArbitrary, async (value, errors) => {\n const task = jest.fn().mockResolvedValue(value)\n const tasks = errors.map((error) => jest.fn().mockRejectedValue(error))\n\n expect(await first([task, ...tasks])).toBe(value)\n\n // Make sure none of the other factories got called\n for (const factory of tasks) {\n expect(factory).not.toHaveBeenCalled()\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58721, "name": "unknown", "code": "it('should resolve with the first successful task', async () => {\n await fc.assert(\n fc.asyncProperty(valuesArbitrary, valueArbitrary, async (errors, value) => {\n const tasks = errors.map((error) => jest.fn().mockRejectedValue(error))\n const task = jest.fn().mockResolvedValue(value)\n\n expect(await first([...tasks, task])).toBe(value)\n\n // Make sure all the tasks got called\n for (const factory of tasks) {\n expect(factory).toHaveBeenCalledTimes(1)\n }\n\n expect(task).toHaveBeenCalledTimes(1)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58722, "name": "unknown", "code": "it('should reject with the last rejected task error', async () => {\n await fc.assert(\n fc.asyncProperty(valuesArbitrary, valueArbitrary, async (errors, error) => {\n const tasks = errors.map((error) => jest.fn().mockRejectedValue(error))\n const task = jest.fn().mockRejectedValue(error)\n\n await expect(first([...tasks, task])).rejects.toBe(error)\n\n // Make sure all the tasks got called\n for (const factory of tasks) {\n expect(factory).toHaveBeenCalledTimes(1)\n }\n\n expect(task).toHaveBeenCalledTimes(1)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58723, "name": "unknown", "code": "it('should resolve if the first factory resolves', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, valuesArbitrary, async (value, values) => {\n const successful = jest.fn().mockResolvedValue(value)\n const successfulOther = values.map((value) => jest.fn().mockResolvedValue(value))\n const factory = firstFactory(successful, ...successfulOther)\n\n expect(await factory()).toBe(value)\n\n // Make sure none of the other factories got called\n for (const factory of successfulOther) {\n expect(factory).not.toHaveBeenCalled()\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58724, "name": "unknown", "code": "it('should resolve with the first successful factory', async () => {\n await fc.assert(\n fc.asyncProperty(valuesArbitrary, valueArbitrary, async (errors, value) => {\n const failing = errors.map((error) => jest.fn().mockRejectedValue(error))\n const successful = jest.fn().mockResolvedValue(value)\n const factory = firstFactory(...failing, successful)\n\n expect(await factory()).toBe(value)\n\n // Make sure all the tasks got called\n for (const factory of failing) {\n expect(factory).toHaveBeenCalledTimes(1)\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58725, "name": "unknown", "code": "it('should pass the input to factories', async () => {\n await fc.assert(\n fc.asyncProperty(valuesArbitrary, valueArbitrary, valuesArbitrary, async (errors, value, args) => {\n const failing = errors.map((error) => jest.fn().mockRejectedValue(error))\n const successful = jest.fn().mockResolvedValue(value)\n const factory = firstFactory(...failing, successful)\n\n expect(await factory(...args)).toBe(value)\n\n // Make sure all the tasks got called with the correct arguments\n for (const factory of failing) {\n expect(factory).toHaveBeenCalledTimes(1)\n expect(factory).toHaveBeenCalledWith(...args)\n }\n\n expect(successful).toHaveBeenCalledTimes(1)\n expect(successful).toHaveBeenCalledWith(...args)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58726, "name": "unknown", "code": "it('should resolve with the return value of a synchronous task', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, async (value) => {\n const task = jest.fn().mockReturnValue(value)\n const handleError = jest.fn()\n\n await expect(mapError(task, handleError)).resolves.toBe(value)\n expect(handleError).not.toHaveBeenCalled()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58727, "name": "unknown", "code": "it('should resolve with the resolution value of an asynchronous task', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, async (value) => {\n const task = jest.fn().mockResolvedValue(value)\n const handleError = jest.fn()\n\n await expect(mapError(task, handleError)).resolves.toBe(value)\n expect(handleError).not.toHaveBeenCalled()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58728, "name": "unknown", "code": "it('should reject and call the toError callback if a synchronous task throws', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, valueArbitrary, async (error, mappedError) => {\n const task = jest.fn().mockImplementation(() => {\n throw error\n })\n const handleError = jest.fn().mockReturnValue(mappedError)\n\n await expect(mapError(task, handleError)).rejects.toBe(mappedError)\n expect(handleError).toHaveBeenCalledOnce()\n expect(handleError).toHaveBeenCalledExactlyOnceWith(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58729, "name": "unknown", "code": "it('should reject and call the toError callback if an asynchronous task rejects', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, valueArbitrary, async (error, mappedError) => {\n const task = jest.fn().mockRejectedValue(error)\n const handleError = jest.fn().mockReturnValue(mappedError)\n\n await expect(mapError(task, handleError)).rejects.toBe(mappedError)\n expect(handleError).toHaveBeenCalledOnce()\n expect(handleError).toHaveBeenCalledExactlyOnceWith(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58730, "name": "unknown", "code": "it('should resolve with the return value of a synchronous task', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, async (value) => {\n const task = jest.fn().mockReturnValue(value)\n const handleError = jest.fn()\n\n await expect(tapError(task, handleError)).resolves.toBe(value)\n expect(handleError).not.toHaveBeenCalled()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58731, "name": "unknown", "code": "it('should resolve with the resolution value of an asynchronous task', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, async (value) => {\n const task = jest.fn().mockResolvedValue(value)\n const handleError = jest.fn()\n\n await expect(tapError(task, handleError)).resolves.toBe(value)\n expect(handleError).not.toHaveBeenCalled()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58732, "name": "unknown", "code": "it('should reject and call the onError callback if a synchronous task throws', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, async (error) => {\n const task = jest.fn().mockImplementation(() => {\n throw error\n })\n const handleError = jest.fn()\n\n await expect(tapError(task, handleError)).rejects.toBe(error)\n expect(handleError).toHaveBeenCalledOnce()\n expect(handleError).toHaveBeenCalledExactlyOnceWith(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58733, "name": "unknown", "code": "it('should reject and call the onError callback if an asynchronous task rejects', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, async (error) => {\n const task = jest.fn().mockRejectedValue(error)\n const handleError = jest.fn()\n\n await expect(tapError(task, handleError)).rejects.toBe(error)\n expect(handleError).toHaveBeenCalledOnce()\n expect(handleError).toHaveBeenCalledExactlyOnceWith(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58734, "name": "unknown", "code": "it('should reject with the original error if the onError callback throws', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, valueArbitrary, async (error, anotherError) => {\n const task = jest.fn().mockRejectedValue(error)\n const handleError = jest.fn().mockImplementation(() => {\n throw anotherError\n })\n\n await expect(tapError(task, handleError)).rejects.toBe(error)\n expect(handleError).toHaveBeenCalledOnce()\n expect(handleError).toHaveBeenCalledExactlyOnceWith(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58735, "name": "unknown", "code": "it('should reject with the original error if the onError callback rejects', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, valueArbitrary, async (error, anotherError) => {\n const task = jest.fn().mockRejectedValue(error)\n const handleError = jest.fn().mockRejectedValue(anotherError)\n\n await expect(tapError(task, handleError)).rejects.toBe(error)\n expect(handleError).toHaveBeenCalledOnce()\n expect(handleError).toHaveBeenCalledExactlyOnceWith(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58736, "name": "unknown", "code": "it('should throw', () => {\n fc.assert(\n fc.property(numAttemptsArbitrary, (numAttempts) => {\n expect(() => createSimpleRetryStrategy(numAttempts)).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58737, "name": "unknown", "code": "it('should return a function that returns true until numAttempts is reached', () => {\n fc.assert(\n fc.property(numAttemptsArbitrary, (numAttempts) => {\n const strategy = createSimpleRetryStrategy(numAttempts)\n\n // The first N attempts should return true since we want to retry them\n for (let attempt = 1; attempt <= numAttempts; attempt++) {\n expect(strategy(attempt, 'error', [], [])).toBeTruthy()\n }\n\n // The N+1th attempt should return false\n expect(strategy(numAttempts + 1, 'error', [], [])).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58738, "name": "unknown", "code": "it('should return false if the amount of attempts has been reached, the wrapped strategy value otherwise', () => {\n fc.assert(\n fc.property(numAttemptsArbitrary, (numAttempts) => {\n // We'll create a simple wrapped strategy\n const wrappedStrategy = (attempt: number) => [attempt]\n const strategy = createSimpleRetryStrategy(numAttempts, wrappedStrategy)\n\n // The first N attempts should return the return value of the wrapped strategy\n for (let attempt = 1; attempt <= numAttempts; attempt++) {\n expect(strategy(attempt, 'error', [0], [0])).toEqual(wrappedStrategy(attempt))\n }\n\n // The N+1th attempt should return false\n expect(strategy(numAttempts + 1, 'error', [0], [0])).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58742, "name": "unknown", "code": "it('should call forEach correctly', () => {\n fc.assert(\n fc.property(fc.array(fc.tuple(keyArbitrary, valueArbitrary)), (entries) => {\n const map = new TestMap(entries)\n const callback = jest.fn()\n\n map.forEach(callback)\n\n // We'll get the entries from the map since the original entries\n // might contain duplicates\n const mapEntries = Array.from(map.entries())\n expect(callback).toHaveBeenCalledTimes(mapEntries.length)\n\n for (const [key, value] of mapEntries) {\n expect(callback).toHaveBeenCalledWith(value, key, map)\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/map.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58743, "name": "unknown", "code": "it('should use orElse if a key is not defined', () => {\n fc.assert(\n fc.property(keyArbitrary, valueArbitrary, valueArbitrary, (key, value, orElseValue) => {\n const map = new TestMap()\n const orElse = jest.fn().mockReturnValue(orElseValue)\n\n // Sanity check first\n expect(map.has(key)).toBeFalsy()\n\n // If the key has not been set, the map should use orElse\n expect(map.getOrElse(key, orElse)).toBe(orElseValue)\n\n // Set a value first\n map.set(key, value)\n\n // And check that orElse is not being used\n expect(map.getOrElse(key, orElse)).toBe(value)\n\n // Now delete the value\n map.delete(key)\n\n // And check that orElse is being used again\n expect(map.getOrElse(key, orElse)).toBe(orElseValue)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/map.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58744, "name": "unknown", "code": "it('should normalize a nullish value to empty bytes', () => {\n fc.assert(\n fc.property(evmEndpointArbitrary, nullishArbitrary, (eid, address) => {\n const normalized = normalizePeer(address, eid)\n const denormalized = denormalizePeer(normalized, eid)\n\n expect(normalized).toEqual(new Uint8Array(32))\n expect(isZero(normalized)).toBe(true)\n expect(isZero(denormalized)).toBe(true)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58745, "name": "unknown", "code": "it('should normalize a peer correctly', () => {\n fc.assert(\n fc.property(evmEndpointArbitrary, evmAddressArbitrary, (eid, address) => {\n const normalized = normalizePeer(address, eid)\n const denormalized = denormalizePeer(normalized, eid)\n\n expect(denormalized).toBe(address)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58746, "name": "unknown", "code": "it('should normalize a nullish value to empty bytes', () => {\n fc.assert(\n fc.property(aptosEndpointArbitrary, nullishArbitrary, (eid, address) => {\n const normalized = normalizePeer(address, eid)\n const denormalized = denormalizePeer(normalized, eid)\n\n expect(normalized).toEqual(new Uint8Array(32))\n expect(isZero(normalized)).toBe(true)\n expect(isZero(denormalized)).toBe(true)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58747, "name": "unknown", "code": "it('should normalize a peer correctly', () => {\n fc.assert(\n fc.property(aptosEndpointArbitrary, aptosAddressArbitrary, (eid, address) => {\n const normalized = normalizePeer(address, eid)\n const denormalized = denormalizePeer(normalized, eid)\n\n expect(denormalized).toBe(address)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58748, "name": "unknown", "code": "it('should normalize a nullish value to empty bytes', () => {\n fc.assert(\n fc.property(solanaEndpointArbitrary, nullishArbitrary, (eid, address) => {\n const normalized = normalizePeer(address, eid)\n const denormalized = denormalizePeer(normalized, eid)\n\n expect(normalized).toEqual(new Uint8Array(32))\n expect(isZero(normalized)).toBe(true)\n expect(isZero(denormalized)).toBe(true)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58749, "name": "unknown", "code": "it('should normalize a peer correctly', () => {\n fc.assert(\n fc.property(solanaEndpointArbitrary, solanaAddressArbitrary, (eid, address) => {\n const normalized = normalizePeer(address, eid)\n const denormalized = denormalizePeer(normalized, eid)\n\n expect(denormalized).toBe(address)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58750, "name": "unknown", "code": "it('should return true for identical values', () => {\n fc.assert(\n fc.property(fc.anything(), (value) => {\n expect(isDeepEqual(value, value)).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/assertion.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58751, "name": "unknown", "code": "it('should return true for arrays containing the same values', () => {\n fc.assert(\n fc.property(arrayArbitrary, (array) => {\n expect(isDeepEqual(array, [...array])).toBeTruthy()\n expect(isDeepEqual([...array], array)).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/assertion.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58752, "name": "unknown", "code": "it('should return false for arrays containing different values', () => {\n fc.assert(\n fc.property(arrayArbitrary, arrayArbitrary, (arrayA, arrayB) => {\n // We'll do a very simplified precondition - we'll only run tests when the first elements are different\n fc.pre(!isDeepEqual(arrayA[0], arrayB[0]))\n\n expect(isDeepEqual(arrayA, arrayB)).toBeFalsy()\n expect(isDeepEqual(arrayB, arrayA)).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/assertion.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58753, "name": "unknown", "code": "it('should return false for arrays containing more values', () => {\n fc.assert(\n fc.property(arrayArbitrary, fc.anything(), (array, extraValue) => {\n expect(isDeepEqual(array, [...array, extraValue])).toBeFalsy()\n expect(isDeepEqual([...array, extraValue], array)).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/assertion.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58754, "name": "unknown", "code": "it('should return true for sets containing the same values', () => {\n fc.assert(\n fc.property(arrayArbitrary, (array) => {\n const setA = new Set(array)\n const setB = new Set(array)\n\n expect(isDeepEqual(setA, setB)).toBeTruthy()\n expect(isDeepEqual(setB, setA)).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/assertion.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58755, "name": "unknown", "code": "it('should return true for maps containing the same values', () => {\n fc.assert(\n fc.property(entriesArbitrary, (entries) => {\n const mapA = new Map(entries)\n const mapB = new Map(entries)\n\n expect(isDeepEqual(mapA, mapB)).toBeTruthy()\n expect(isDeepEqual(mapB, mapA)).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/assertion.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58756, "name": "unknown", "code": "it('should return true for objects containing the same values', () => {\n fc.assert(\n fc.property(\n fc.record({\n value: fc.anything(),\n }),\n (object) => {\n expect(isDeepEqual(object, { ...object })).toBeTruthy()\n expect(isDeepEqual({ ...object }, object)).toBeTruthy()\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/assertion.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58757, "name": "unknown", "code": "it('should return false for objects containing different values', () => {\n fc.assert(\n fc.property(\n fc.record({\n value: fc.anything(),\n }),\n fc.anything(),\n (object, value) => {\n fc.pre(!isDeepEqual(object.value, value))\n\n expect(isDeepEqual(object, { value })).toBeFalsy()\n expect(isDeepEqual({ value }, object)).toBeFalsy()\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/assertion.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58758, "name": "unknown", "code": "it('should sign a transaction', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n solanaAddressArbitrary,\n keypairArbitrary,\n keypairArbitrary,\n async (eid, address, sender, recipient) => {\n const transfer = SystemProgram.transfer({\n fromPubkey: sender.publicKey,\n toPubkey: recipient.publicKey,\n lamports: 49,\n })\n\n const connection = new Connection('http://soyllama.com')\n const omniSigner = new OmniSignerSolana(eid, connection, sender)\n\n const transaction = new Transaction().add(transfer)\n transaction.recentBlockhash = 'EETubP5AKHgjPAhzPAFcb8BAY1hMH639CWCFTqi3hq1k'\n transaction.feePayer = sender.publicKey\n\n const omniTransaction: OmniTransaction = {\n point: { eid, address },\n data: serializeTransactionMessage(transaction),\n }\n\n const signature = await omniSigner.sign(omniTransaction)\n const serializedTransaction = (transaction.sign(sender), transaction.serialize())\n\n expect(deserializeTransactionBuffer(signature)).toEqual(serializedTransaction)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-solana/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58759, "name": "unknown", "code": "it('should sign and send a transaction', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n solanaAddressArbitrary,\n keypairArbitrary,\n keypairArbitrary,\n fc.string(),\n async (eid, address, sender, recipient, transactionHash) => {\n sendAndConfirmTransactionMock.mockResolvedValue(transactionHash)\n\n const transfer = SystemProgram.transfer({\n fromPubkey: sender.publicKey,\n toPubkey: recipient.publicKey,\n lamports: 49,\n })\n\n const connection = new Connection('http://soyllama.com')\n const omniSigner = new OmniSignerSolana(eid, connection, sender)\n\n const transaction = new Transaction().add(transfer)\n transaction.recentBlockhash = 'EETubP5AKHgjPAhzPAFcb8BAY1hMH639CWCFTqi3hq1k'\n transaction.feePayer = sender.publicKey\n\n const omniTransaction: OmniTransaction = {\n point: { eid, address },\n data: serializeTransactionMessage(transaction),\n }\n\n const response = await omniSigner.signAndSend(omniTransaction)\n expect(response).toEqual({\n transactionHash,\n wait: expect.any(Function),\n })\n\n expect(await response.wait()).toEqual({ transactionHash })\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-solana/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58760, "name": "unknown", "code": "it('should throw an error', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n solanaAddressArbitrary,\n keypairArbitrary,\n keypairArbitrary,\n async (eid, address, sender, recipient) => {\n const transfer = SystemProgram.transfer({\n fromPubkey: sender.publicKey,\n toPubkey: recipient.publicKey,\n lamports: 49,\n })\n\n const connection = new Connection('http://soyllama.com')\n const multiSigAddress = PublicKey.default\n const wallet = Keypair.generate()\n const omniSigner: OmniSigner = new OmniSignerSolanaSquads(\n eid,\n connection,\n multiSigAddress,\n wallet\n )\n\n const transaction = new Transaction().add(transfer)\n transaction.recentBlockhash = 'EETubP5AKHgjPAhzPAFcb8BAY1hMH639CWCFTqi3hq1k'\n transaction.feePayer = sender.publicKey\n\n const omniTransaction: OmniTransaction = {\n point: { eid, address },\n data: serializeTransactionMessage(transaction),\n }\n\n await expect(omniSigner.sign(omniTransaction)).rejects.toThrow(\n 'OmniSignerSolanaSquads does not support the sign() method. Please use signAndSend().'\n )\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-solana/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58761, "name": "unknown", "code": "it('should work', async () => {\n await fc.assert(\n fc.asyncProperty(keypairArbitrary, keypairArbitrary, async (sender, recipient) => {\n const transfer = SystemProgram.transfer({\n fromPubkey: sender.publicKey,\n toPubkey: recipient.publicKey,\n lamports: 49,\n })\n\n const transaction = new Transaction().add(transfer)\n\n // Transaction in Solana require a recent block hash to be set in order for them to be serialized\n transaction.recentBlockhash = 'EETubP5AKHgjPAhzPAFcb8BAY1hMH639CWCFTqi3hq1k'\n\n // Transactions in Solana require a fee payer to be set in order for them to be serialized\n transaction.feePayer = sender.publicKey\n\n // First we serialize the transaction\n const serializedTransaction = serializeTransactionMessage(transaction)\n // Then we deserialize it\n const deserializedTransaction = deserializeTransactionMessage(serializedTransaction)\n // And check that the fields match the original transaction\n //\n // The reason why we don't compare the transactions directly is that the signers will not match\n // after deserialization (the signers get stripped out of the original transaction)\n expect(deserializedTransaction.instructions).toEqual(transaction.instructions)\n expect(deserializedTransaction.recentBlockhash).toEqual(transaction.recentBlockhash)\n expect(deserializedTransaction.feePayer).toEqual(transaction.feePayer)\n\n // Now we serialize the deserialized transaction again and check that it fully matches the serialized transaction\n const reserializedTransaction = serializeTransactionMessage(deserializedTransaction)\n expect(reserializedTransaction).toEqual(serializedTransaction)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-solana/test/transactions/serde.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58762, "name": "unknown", "code": "it('should reject if urlFactory throws', async () => {\n await fc.assert(\n fc.asyncProperty(errorArbitrary, endpointArbitrary, async (error, eid) => {\n const urlFactory = jest.fn().mockImplementation(() => {\n throw error\n })\n const providerFactory = createConnectionFactory(urlFactory)\n\n await expect(providerFactory(eid)).rejects.toBe(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-solana/test/connection/factory.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58763, "name": "unknown", "code": "it('should reject if urlFactory rejects', async () => {\n await fc.assert(\n fc.asyncProperty(errorArbitrary, endpointArbitrary, async (error, eid) => {\n const urlFactory = jest.fn().mockRejectedValue(error)\n const providerFactory = createConnectionFactory(urlFactory)\n\n await expect(providerFactory(eid)).rejects.toBe(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-solana/test/connection/factory.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58764, "name": "unknown", "code": "it('should resolve with Connection if urlFactory returns a URL', async () => {\n await fc.assert(\n fc.asyncProperty(urlArbitrary, endpointArbitrary, async (url, eid) => {\n const urlFactory = jest.fn().mockReturnValue(url)\n const connectionFactory = createConnectionFactory(urlFactory)\n const connection = await connectionFactory(eid)\n\n expect(connection).toBeInstanceOf(Connection)\n expect(connection.rpcEndpoint).toBe(url)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-solana/test/connection/factory.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58765, "name": "unknown", "code": "it('should resolve with JsonRpcProvider if urlFactory resolves with a URL', async () => {\n await fc.assert(\n fc.asyncProperty(urlArbitrary, endpointArbitrary, async (url, eid) => {\n const urlFactory = jest.fn().mockResolvedValue(url)\n const connectionFactory = createConnectionFactory(urlFactory)\n const connection = await connectionFactory(eid)\n\n expect(connection).toBeInstanceOf(Connection)\n expect(connection.rpcEndpoint).toBe(url)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-solana/test/connection/factory.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58766, "name": "unknown", "code": "it('should throw an error for other endpoints', () => {\n fc.assert(\n fc.property(endpointArbitrary, (eid) => {\n fc.pre(eid !== EndpointId.SOLANA_V2_MAINNET)\n fc.pre(eid !== EndpointId.SOLANA_V2_TESTNET)\n fc.pre(eid !== EndpointId.SOLANA_MAINNET)\n fc.pre(eid !== EndpointId.SOLANA_TESTNET)\n\n expect(() => defaultRpcUrlFactory(eid)).toThrow(\n `Could not find a default Solana RPC URL for eid ${eid} (${formatEid(eid)})`\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-solana/test/connection/factory.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58767, "name": "unknown", "code": "it('should parse a BN instance', () => {\n fc.assert(\n fc.property(bnArbitrary, (bn) => {\n expect(BNBigIntSchema.parse(bn)).toBe(BigInt(bn.toString()))\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-solana/test/common/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58768, "name": "unknown", "code": "it('should not parse anything else', () => {\n fc.assert(\n fc.property(fc.anything(), (value) => {\n expect(() => BNBigIntSchema.parse(value)).toThrow(/Input not instance of BN/)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-solana/test/common/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58769, "name": "unknown", "code": "it('should parse a PublicKey instance', () => {\n fc.assert(\n fc.property(\n keypairArbitrary.map((keypair) => keypair.publicKey),\n (publicKey) => {\n expect(PublicKeySchema.parse(publicKey)).toBe(publicKey)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-solana/test/common/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58770, "name": "unknown", "code": "it('should not parse anything else', () => {\n fc.assert(\n fc.property(fc.anything(), (value) => {\n expect(() => PublicKeySchema.parse(value)).toThrow(/Input not instance of PublicKey/)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-solana/test/common/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58771, "name": "unknown", "code": "it('should return undefined if the account has not been initialized', async () => {\n getAccountInfoMock.mockResolvedValue(null)\n\n await fc.assert(\n fc.asyncProperty(solanaEndpointArbitrary, keypairArbitrary, async (eid, keypair) => {\n fc.pre(eid !== EndpointId.SOLANA_V2_SANDBOX)\n\n const address = keypair.publicKey.toBase58()\n\n const connection = await connectionFactory(oftConfig.eid)\n const getAccountInfo = createGetAccountInfo(connection)\n\n expect(await getAccountInfo(address)).toBeUndefined()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-solana/test/common/accounts.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58773, "name": "unknown", "code": "it('should serialize an external message', () => {\n fc.assert(\n fc.property(cellArbitrary, (body) => {\n const message = external({\n to: wallet.address,\n body,\n })\n\n const serialized = serializeMessage(message)\n const deserialized = deserializeMessage(serialized)\n\n // FIXME Jest comparison operators don't work well with message objects\n // so a workaround expectation is used\n //\n // See https://github.com/ton-core/ton-core/blob/e0ed819973daf0484dfbacd0c30a0dcfe4714f8d/src/types/MessageRelaxed.spec.ts\n expect(Cell.fromBase64(serialized).equals(messageToCell(message))).toBeTruthy()\n\n const reserialized = serializeMessage(deserialized)\n expect(reserialized).toEqual(serialized)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-ton/test/transactions/serde.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "An external message, when serialized and then deserialized, should produce an identical serialized output.", "mode": "fast-check"} {"id": 58777, "name": "unknown", "code": "it('should add a feePayer and the latest block hash to the transaction', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n solanaAddressArbitrary,\n keypairArbitrary,\n keypairArbitrary,\n solanaBlockhashArbitrary,\n async (eid, address, sender, recipient, blockhash) => {\n class TestOmniSDK extends OmniSDK {\n test() {\n const transfer = SystemProgram.transfer({\n fromPubkey: sender.publicKey,\n toPubkey: recipient.publicKey,\n lamports: 49,\n })\n const transaction = new Transaction().add(transfer)\n\n return this.createTransaction(transaction)\n }\n }\n\n const connection = new Connection('http://soyllama.com')\n jest.spyOn(connection, 'getLatestBlockhash').mockResolvedValue({\n blockhash,\n lastValidBlockHeight: NaN,\n })\n\n const sdk = new TestOmniSDK(connection, { eid, address }, sender.publicKey)\n const omniTransaction = await sdk.test()\n\n expect(omniTransaction).toEqual({\n data: expect.any(String),\n point: { eid, address },\n })\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-solana/test/omnigraph/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58778, "name": "unknown", "code": "it('should parse BigNumberish', () => {\n fc.assert(\n fc.property(bigNumberishArbitrary, (bigNumberish) => {\n expect(BigNumberishSchema.parse(bigNumberish)).toBe(bigNumberish)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm/test/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58779, "name": "unknown", "code": "it('should parse BigNumberish into a bigint', () => {\n fc.assert(\n fc.property(bigNumberishArbitrary, (bigNumberish) => {\n const parsed = BigNumberishBigIntSchema.parse(bigNumberish)\n\n expect(typeof parsed).toBe('bigint')\n expect(BigNumber.from(parsed)).toEqual(BigNumber.from(bigNumberish))\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm/test/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58780, "name": "unknown", "code": "it('should parse BigNumberish into a number if within bounds', () => {\n fc.assert(\n fc.property(bigNumberishArbitrary, (bigNumberish) => {\n fc.pre(BigNumber.from(bigNumberish).abs().lte(BigInt(Number.MAX_SAFE_INTEGER)))\n\n const parsed = BigNumberishNumberSchema.parse(bigNumberish)\n\n expect(typeof parsed).toBe('number')\n expect(BigNumber.from(parsed)).toEqual(BigNumber.from(bigNumberish))\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm/test/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58781, "name": "unknown", "code": "it('should throw an error if there is an overflow', () => {\n fc.assert(\n fc.property(bigNumberishArbitrary, (bigNumberish) => {\n fc.pre(BigNumber.from(bigNumberish).abs().gt(BigInt(Number.MAX_SAFE_INTEGER)))\n\n expect(() => BigNumberishNumberSchema.parse(bigNumberish)).toThrow('overflow')\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm/test/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58782, "name": "unknown", "code": "it('should reject if urlFactory throws', async () => {\n await fc.assert(\n fc.asyncProperty(errorArbitrary, endpointArbitrary, async (error, eid) => {\n const urlFactory = jest.fn().mockImplementation(() => {\n throw error\n })\n const providerFactory = createProviderFactory(urlFactory)\n\n await expect(providerFactory(eid)).rejects.toBe(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm/test/provider/factory.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58783, "name": "unknown", "code": "it('should reject if urlFactory rejects', async () => {\n await fc.assert(\n fc.asyncProperty(errorArbitrary, endpointArbitrary, async (error, eid) => {\n const urlFactory = jest.fn().mockRejectedValue(error)\n const providerFactory = createProviderFactory(urlFactory)\n\n await expect(providerFactory(eid)).rejects.toBe(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm/test/provider/factory.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58784, "name": "unknown", "code": "it('should resolve with JsonRpcProvider if urlFactory returns a URL', async () => {\n await fc.assert(\n fc.asyncProperty(urlArbitrary, endpointArbitrary, async (url, eid) => {\n const urlFactory = jest.fn().mockReturnValue(url)\n const providerFactory = createProviderFactory(urlFactory)\n const provider = await providerFactory(eid)\n\n expect(provider).toBeInstanceOf(JsonRpcProvider)\n expect(provider.connection.url).toBe(url)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm/test/provider/factory.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58785, "name": "unknown", "code": "it('should resolve with JsonRpcProvider if urlFactory resolves with a URL', async () => {\n await fc.assert(\n fc.asyncProperty(urlArbitrary, endpointArbitrary, async (url, eid) => {\n const urlFactory = jest.fn().mockResolvedValue(url)\n const providerFactory = createProviderFactory(urlFactory)\n const provider = await providerFactory(eid)\n\n expect(provider).toBeInstanceOf(JsonRpcProvider)\n expect(provider.connection.url).toBe(url)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm/test/provider/factory.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58786, "name": "unknown", "code": "it('should create an OmniPoint with the address of the contract', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, endpointArbitrary, (address, eid) => {\n const contract = new Contract(address, [])\n const omniContract: OmniContract = { eid, contract }\n\n expect(omniContractToPoint(omniContract)).toEqual({ eid, address })\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58787, "name": "unknown", "code": "it('should serialize correctly with a message', () => {\n fc.assert(\n fc.property(messageArbitrary, (message) => {\n fc.pre(message !== '')\n\n expect(String(new UnknownError(message))).toBe(`UnknownError: ${message}`)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm/test/errors/errors.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58788, "name": "unknown", "code": "it('should serialize correctly when message is not passed', () => {\n fc.assert(\n fc.property(reasonArbitrary, (reason) => {\n expect(String(new PanicError(reason))).toBe(\n `PanicError: Contract panicked (assert() has been called). Error code ${reason}`\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm/test/errors/errors.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58789, "name": "unknown", "code": "it('should serialize correctly when message is empty', () => {\n fc.assert(\n fc.property(reasonArbitrary, (reason) => {\n expect(String(new PanicError(reason, ''))).toBe(`PanicError. Error code ${reason}`)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm/test/errors/errors.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58790, "name": "unknown", "code": "it('should serialize correctly with a message', () => {\n fc.assert(\n fc.property(reasonArbitrary, messageArbitrary, (reason, message) => {\n fc.pre(message !== '')\n\n expect(String(new PanicError(reason, message))).toBe(`PanicError: ${message}. Error code ${reason}`)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm/test/errors/errors.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58791, "name": "unknown", "code": "it('should serialize correctly when message is not passed', () => {\n fc.assert(\n fc.property(reasonArbitrary, (reason) => {\n expect(String(new RevertError(reason))).toBe(\n `RevertError: Contract reverted. Error reason '${reason}'`\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm/test/errors/errors.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58792, "name": "unknown", "code": "it('should serialize correctly when message is empty', () => {\n fc.assert(\n fc.property(reasonArbitrary, (reason) => {\n expect(String(new RevertError(reason, ''))).toBe(`RevertError. Error reason '${reason}'`)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm/test/errors/errors.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58793, "name": "unknown", "code": "it('should serialize correctly with a message', () => {\n fc.assert(\n fc.property(reasonArbitrary, messageArbitrary, (reason, message) => {\n fc.pre(message !== '')\n\n expect(String(new RevertError(reason, message))).toBe(\n `RevertError: ${message}. Error reason '${reason}'`\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm/test/errors/errors.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58794, "name": "unknown", "code": "it('should serialize correctly when args are empty', () => {\n fc.assert(\n fc.property(reasonArbitrary, (reason) => {\n expect(String(new CustomError(reason, []))).toBe(\n `CustomError: Contract reverted with custom error. Error ${reason}()`\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm/test/errors/errors.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58795, "name": "unknown", "code": "it('should serialize correctly when message is not passed', () => {\n fc.assert(\n fc.property(reasonArbitrary, argsArbitrary, (reason, args) => {\n const formattedArgs = args.map((arg) => printJson(arg, false))\n\n expect(String(new CustomError(reason, args))).toBe(\n `CustomError: Contract reverted with custom error. Error ${reason}(${formattedArgs})`\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm/test/errors/errors.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58796, "name": "unknown", "code": "it('should serialize correctly when message is empty', () => {\n fc.assert(\n fc.property(reasonArbitrary, argsArbitrary, (reason, args) => {\n const formattedArgs = args.map((arg) => printJson(arg, false))\n\n expect(String(new CustomError(reason, args, ''))).toBe(\n `CustomError. Error ${reason}(${formattedArgs})`\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm/test/errors/errors.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58797, "name": "unknown", "code": "it('should serialize correctly with a message', () => {\n fc.assert(\n fc.property(reasonArbitrary, argsArbitrary, messageArbitrary, (reason, args, message) => {\n fc.pre(message !== '')\n\n const formattedArgs = args.map((arg) => printJson(arg, false))\n\n expect(String(new CustomError(reason, args, message))).toBe(\n `CustomError: ${message}. Error ${reason}(${formattedArgs})`\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm/test/errors/errors.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58798, "name": "unknown", "code": "it('should return address with non-zero address', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, (address) => {\n fc.pre(address !== AddressZero)\n\n expect(makeZeroAddress(address)).toBe(address)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm/test/address.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58799, "name": "unknown", "code": "it('should return the same address, just checksumed', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, (address) => {\n expect(addChecksum(address)).toEqualCaseInsensitive(address)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm/test/address.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58800, "name": "unknown", "code": "it('should return a valid EVM address', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, (address) => {\n expect(isAddress(addChecksum(address))).toBe(true)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm/test/address.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58806, "name": "unknown", "code": "it('should not override user values if provided', () => {\n fc.assert(\n fc.property(\n fc.integer(),\n fc.string(),\n mnemonicArbitrary,\n fc.boolean(),\n (port, directory, mnemonic, overwriteAccounts) => {\n expect(\n resolveSimulationConfig(\n { port, directory, overwriteAccounts, anvil: { mnemonic } },\n hre.config\n )\n ).toEqual({\n port,\n directory: resolve(hre.config.paths.root, directory),\n overwriteAccounts,\n anvil: {\n host: '0.0.0.0',\n port: 8545,\n mnemonic,\n },\n })\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/simulation/config.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58807, "name": "unknown", "code": "it('should work with anvil options', async () => {\n await fc.assert(\n fc.asyncProperty(anvilOptionsArbitrary, async (anvilOptions) => {\n const spec = serializeDockerComposeSpec({\n version: '3.9',\n services: {\n anvil: createEvmNodeServiceSpec(anvilOptions),\n },\n })\n\n await writeFile(SPEC_FILE_PATH, spec)\n\n const result = validateSpec()\n\n expect(result.stderr.toString('utf8')).toBe('')\n expect(result.status).toBe(0)\n }),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/simulation/compose.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58808, "name": "unknown", "code": "it('should work with anvil services', async () => {\n await fc.assert(\n fc.asyncProperty(portArbitrary, servicesArbitrary, async (port, services) => {\n const spec = serializeDockerComposeSpec({\n version: '3.9',\n services: {\n ...services,\n rpc: createEvmNodeProxyServiceSpec(port, services),\n },\n })\n\n await writeFile(SPEC_FILE_PATH, spec)\n\n const result = validateSpec()\n\n expect(result.stderr.toString('utf8')).toBe('')\n expect(result.status).toBe(0)\n }),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/simulation/compose.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58809, "name": "unknown", "code": "it('should work goddammit', async () => {\n await fc.assert(\n fc.asyncProperty(portArbitrary, anvilOptionsRecordArbitrary, async (port, anvilOptions) => {\n const simulationConfig = resolveSimulationConfig({ port }, hre.config)\n const spec = serializeDockerComposeSpec(createSimulationComposeSpec(simulationConfig, anvilOptions))\n\n await writeFile(SPEC_FILE_PATH, spec)\n\n const result = validateSpec()\n\n expect(result.stderr.toString('utf8')).toBe('')\n expect(result.status).toBe(0)\n }),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/simulation/compose.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58810, "name": "unknown", "code": "it('should pass the original value if contract is already an OmniPoint', async () => {\n await fc.assert(\n fc.asyncProperty(pointArbitrary, async (point) => {\n const contractFactory = jest.fn().mockRejectedValue('Oh no')\n const transformer = createOmniPointHardhatTransformer(contractFactory)\n\n const transformed = await transformer(point)\n\n expect(transformed).toBe(point)\n expect(contractFactory).not.toHaveBeenCalled()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/transformations.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58811, "name": "unknown", "code": "it('should call the contractFactory if contract is not an OmniPoint', async () => {\n await fc.assert(\n fc.asyncProperty(pointHardhatArbitrary, evmAddressArbitrary, async (point, address) => {\n fc.pre(!isOmniPoint(point))\n\n const contract = new Contract(address, [])\n const contractFactory = jest\n .fn()\n .mockImplementation(async (point: OmniPointHardhat) => ({ eid: point.eid, contract }))\n const transformer = createOmniPointHardhatTransformer(contractFactory)\n\n const transformed = await transformer(point)\n\n expect(transformed).toEqual({ ...point, address })\n expect(contractFactory).toHaveBeenCalledTimes(1)\n expect(contractFactory).toHaveBeenCalledWith(point)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/transformations.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58812, "name": "unknown", "code": "it('should add the contractName if point is not an OmniPoint', async () => {\n await fc.assert(\n fc.asyncProperty(pointHardhatArbitrary, evmAddressArbitrary, async (point, address) => {\n fc.pre(!isOmniPoint(point))\n\n const contract = new Contract(address, [])\n const contractFactory = jest\n .fn()\n .mockImplementation(async (point: OmniPointHardhat) => ({ eid: point.eid, contract }))\n const transformer = createOmniPointHardhatTransformer(contractFactory)\n\n const transformed = await transformer(point)\n\n expect(transformed).toEqual({ eid: point.eid, address, contractName: point.contractName })\n expect(contractFactory).toHaveBeenCalledTimes(1)\n expect(contractFactory).toHaveBeenCalledWith(point)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/transformations.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58813, "name": "unknown", "code": "it('should call the pointTransformer on the point', async () => {\n await fc.assert(\n fc.asyncProperty(\n pointHardhatArbitrary,\n evmAddressArbitrary,\n fc.anything(),\n async (point, address, config) => {\n fc.pre(!isOmniPoint(point))\n\n const pointTransformer = jest.fn().mockImplementation(async (point: OmniPointHardhat) => ({\n eid: point.eid,\n address: address,\n }))\n const transformer = createOmniNodeHardhatTransformer(pointTransformer)\n\n const node = await transformer({ contract: point, config })\n\n expect(node).toEqual({ point: { eid: point.eid, address }, config })\n expect(pointTransformer).toHaveBeenCalledTimes(1)\n expect(pointTransformer).toHaveBeenCalledWith(point)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/transformations.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58814, "name": "unknown", "code": "it('should call the pointTransformer on from and to', async () => {\n await fc.assert(\n fc.asyncProperty(\n pointHardhatArbitrary,\n pointHardhatArbitrary,\n evmAddressArbitrary,\n fc.anything(),\n async (from, to, address, config) => {\n const pointTransformer = jest.fn().mockImplementation(async (point: OmniPointHardhat) => ({\n eid: point.eid,\n address,\n }))\n const transformer = createOmniEdgeHardhatTransformer(pointTransformer)\n\n const edge = await transformer({ from, to, config })\n\n expect(edge).toEqual({\n vector: { from: { eid: from.eid, address }, to: { eid: to.eid, address } },\n config,\n })\n expect(pointTransformer).toHaveBeenCalledTimes(2)\n expect(pointTransformer).toHaveBeenCalledWith(from)\n expect(pointTransformer).toHaveBeenCalledWith(to)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/transformations.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58815, "name": "unknown", "code": "it('should call the nodeTransformer and edgeTransformer for every node and edge and return the result', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.array(nodeHardhatArbitrary),\n fc.array(edgeHardhatArbitrary),\n async (contracts, connections) => {\n const nodeTransformer = jest.fn().mockImplementation(async (node) => ({ node }))\n const edgeTransformer = jest.fn().mockImplementation(async (edge) => ({ edge }))\n const transformer = createOmniGraphHardhatTransformer(nodeTransformer, edgeTransformer)\n\n const graph = await transformer({ contracts, connections })\n\n expect(graph.contracts).toEqual(contracts.map((node) => ({ node })))\n expect(graph.connections).toEqual(connections.map((edge) => ({ edge })))\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/transformations.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58816, "name": "unknown", "code": "it('should support sequential applicative', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.array(nodeHardhatArbitrary),\n fc.array(edgeHardhatArbitrary),\n async (contracts, connections) => {\n const nodeTransformer = jest.fn().mockImplementation(async (node) => ({ node }))\n const edgeTransformer = jest.fn().mockImplementation(async (edge) => ({ edge }))\n const transformerSequential = createOmniGraphHardhatTransformer(\n nodeTransformer,\n edgeTransformer,\n sequence\n )\n const transformerParallel = createOmniGraphHardhatTransformer(\n nodeTransformer,\n edgeTransformer,\n parallel\n )\n\n const graphSequential = await transformerSequential({ contracts, connections })\n const graphParallel = await transformerParallel({ contracts, connections })\n\n expect(graphSequential).toEqual(graphParallel)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/transformations.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58817, "name": "unknown", "code": "it('should just work', () => {\n fc.assert(\n fc.property(endpointArbitrary, evmAddressArbitrary, (eid, address) => {\n const omniDeployment: OmniDeployment = { eid, deployment: { address } as Deployment }\n\n expect(omniDeploymentToPoint(omniDeployment)).toEqual({ eid, address })\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58818, "name": "unknown", "code": "it('should just work', () => {\n fc.assert(\n fc.property(endpointArbitrary, evmAddressArbitrary, (eid, address) => {\n const omniDeployment: OmniDeployment = { eid, deployment: { address, abi: [] } as Deployment }\n const omniContract = omniDeploymentToContract(omniDeployment)\n\n // chai is not great with deep equality on class instances so we need to compare the result property by property\n expect(omniContract.eid).toBe(eid)\n expect(omniContract.contract.address).toBe(address)\n expect(omniContract.contract.interface.fragments).toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58819, "name": "unknown", "code": "it('should fall back on getting the artifact based on the deployments if artifact not found', async () => {\n await fc.assert(\n fc.asyncProperty(evmAddressArbitrary, async (address) => {\n const environmentFactory = createGetHreByEid(hre)\n const contractFactory = createContractFactory(environmentFactory)\n\n const env = await environmentFactory(EndpointId.ETHEREUM_V2_MAINNET)\n jest.spyOn(env.deployments, 'getArtifact').mockRejectedValue(new Error(`oh no`))\n jest.spyOn(env.deployments, 'getDeploymentsFromAddress').mockResolvedValue([\n {\n address,\n abi: [],\n },\n ])\n\n // Then check whether the factory will get it for us\n const deployment = await contractFactory({\n eid: EndpointId.ETHEREUM_V2_MAINNET,\n address,\n contractName: 'MyContract',\n })\n\n expect(deployment).toEqual({\n eid: EndpointId.ETHEREUM_V2_MAINNET,\n contract: expect.any(Contract),\n })\n expect(env.deployments.getArtifact).toHaveBeenCalledWith('MyContract')\n expect(env.deployments.getDeploymentsFromAddress).toHaveBeenCalledWith(address)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58820, "name": "unknown", "code": "it('should reject when eid does not exist', async () => {\n await fc.assert(\n fc.asyncProperty(evmAddressArbitrary, async (address) => {\n const contractFactory = createContractFactory()\n\n await expect(() =>\n contractFactory({ eid: EndpointId.CANTO_TESTNET, address })\n ).rejects.toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58821, "name": "unknown", "code": "it('should reject when contract has not been deployed', async () => {\n await fc.assert(\n fc.asyncProperty(evmAddressArbitrary, async (address) => {\n const contractFactory = createContractFactory()\n\n await expect(() =>\n contractFactory({ eid: EndpointId.ETHEREUM_V2_MAINNET, address })\n ).rejects.toThrow(/Could not find a deployment for address/)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58822, "name": "unknown", "code": "it('should resolve when there is only one deployment for the contract', async () => {\n await fc.assert(\n fc.asyncProperty(evmAddressArbitrary, async (address) => {\n const environmentFactory = createGetHreByEid(hre)\n const contractFactory = createContractFactory(environmentFactory)\n\n const env = await environmentFactory(EndpointId.ETHEREUM_V2_MAINNET)\n jest.spyOn(env.deployments, 'getDeploymentsFromAddress').mockResolvedValue([\n {\n address,\n abi: [],\n },\n ])\n\n // Then check whether the factory will get it for us\n const deployment = await contractFactory({\n eid: EndpointId.ETHEREUM_V2_MAINNET,\n address,\n })\n\n expect(deployment).toEqual({\n eid: EndpointId.ETHEREUM_V2_MAINNET,\n contract: expect.any(Contract),\n })\n expect(env.deployments.getDeploymentsFromAddress).toHaveBeenCalledWith(address)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58823, "name": "unknown", "code": "it('should merge ABIs when there are multiple deployments with the same address (proxy deployments)', async () => {\n await fc.assert(\n fc.asyncProperty(evmAddressArbitrary, async (address) => {\n const environmentFactory = createGetHreByEid(hre)\n const contractFactory = createContractFactory(environmentFactory)\n\n const env = await environmentFactory(EndpointId.ETHEREUM_V2_MAINNET)\n jest.spyOn(env.deployments, 'getDeploymentsFromAddress').mockResolvedValue([\n {\n address,\n abi: [\n { name: 'implementation', outputs: [], stateMutability: 'view', type: 'function' },\n ],\n },\n {\n address,\n abi: [\n { name: 'contractMethod', outputs: [], stateMutability: 'view', type: 'function' },\n ],\n },\n ])\n\n // Then check whether the factory will get it for us\n const omniContract = await contractFactory({\n eid: EndpointId.ETHEREUM_V2_MAINNET,\n address,\n })\n\n expect(omniContract).toEqual({\n eid: EndpointId.ETHEREUM_V2_MAINNET,\n contract: expect.any(Contract),\n })\n expect(omniContract.contract.implementation).toBeInstanceOf(Function)\n expect(omniContract.contract.contractMethod).toBeInstanceOf(Function)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58824, "name": "unknown", "code": "it('should reject if contractFactory rejects', async () => {\n await fc.assert(\n fc.asyncProperty(pointArbitrary, async (point) => {\n const error = new Error()\n const contractFactory = jest.fn().mockRejectedValue(error)\n const connectedContractFactory = createConnectedContractFactory(contractFactory)\n\n await expect(connectedContractFactory(point)).rejects.toBe(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/contracts.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58825, "name": "unknown", "code": "it('should reject if providerFactory rejects', async () => {\n await fc.assert(\n fc.asyncProperty(pointArbitrary, async (point) => {\n const error = new Error()\n const contractFactory = jest.fn().mockResolvedValue(new Contract(makeZeroAddress(undefined), []))\n const providerFactory = jest.fn().mockRejectedValue(error)\n const connectedContractFactory = createConnectedContractFactory(contractFactory, providerFactory)\n\n await expect(connectedContractFactory(point)).rejects.toBe(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/contracts.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58826, "name": "unknown", "code": "it('should return a connected contract', async () => {\n await fc.assert(\n fc.asyncProperty(pointArbitrary, async (point) => {\n const contract = new Contract(makeZeroAddress(undefined), [])\n const provider = new JsonRpcProvider()\n const contractFactory = jest.fn().mockResolvedValue({ eid: point.eid, contract })\n const providerFactory = jest.fn().mockResolvedValue(provider)\n const connectedContractFactory = createConnectedContractFactory(contractFactory, providerFactory)\n\n const connectedOmniContract = await connectedContractFactory(point)\n\n expect(connectedOmniContract.eid).toBe(point.eid)\n expect(connectedOmniContract.contract).not.toBe(contract)\n expect(connectedOmniContract.contract).toBeInstanceOf(Contract)\n expect(connectedOmniContract.contract.provider).toBe(provider)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/contracts.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58827, "name": "unknown", "code": "it('should not throw if called with an array of networks defined in hardhat config', () => {\n fc.assert(\n fc.property(definedNetworksArrayArbitrary, (networks) => {\n expect(assertDefinedNetworks(networks)).toBe(networks)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/internal/assertions.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58828, "name": "unknown", "code": "it('should not throw if called with a Set of networks defined in hardhat config', () => {\n fc.assert(\n fc.property(definedNetworksSetArbitrary, (networks) => {\n expect(assertDefinedNetworks(networks)).toBe(networks)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/internal/assertions.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58829, "name": "unknown", "code": "it('should throw if called if a network has not been defined in an array', () => {\n fc.assert(\n fc.property(definedNetworksArrayArbitrary, fc.string(), (networks, network) => {\n fc.pre(!definedNetworks.includes(network))\n\n expect(() => assertDefinedNetworks([...networks, network])).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/internal/assertions.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58830, "name": "unknown", "code": "it('should throw if called if a network has not been defined in a Set', () => {\n fc.assert(\n fc.property(definedNetworksSetArbitrary, fc.string(), (networks, network) => {\n fc.pre(!definedNetworks.includes(network))\n\n expect(() => assertDefinedNetworks(networks.add(network))).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/internal/assertions.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58831, "name": "unknown", "code": "it('should throw if negative index is passed', () => {\n fc.assert(\n fc.property(fc.integer({ max: -1 }), (index) => {\n expect(() => signer.parse('signer', String(index))).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/cli.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58832, "name": "unknown", "code": "it('should return the address if valid address is passed', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, (address) => {\n expect(signer.parse('signer', address)).toEqual({ type: 'address', address })\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/cli.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58833, "name": "unknown", "code": "it('should return the index if non-negative index is passed', () => {\n fc.assert(\n fc.property(fc.integer({ min: 0 }), (index) => {\n expect(signer.parse('signer', String(index))).toEqual({ type: 'index', index })\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/cli.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58834, "name": "unknown", "code": "it('should parse all valid endpoint IDs', () => {\n fc.assert(\n fc.property(endpointArbitrary, (eid) => {\n expect(types.eid.parse('eid', String(eid))).toEqual(eid)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/cli.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58835, "name": "unknown", "code": "it('should parse all valid endpoint labels', () => {\n fc.assert(\n fc.property(endpointArbitrary, (eid) => {\n expect(types.eid.parse('eid', EndpointId[eid]!)).toEqual(eid)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/cli.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58836, "name": "unknown", "code": "it('should not parse invalid strings', () => {\n fc.assert(\n fc.property(fc.string(), (eid) => {\n // We filter out the values that by any slim chance could be valid endpoint IDs\n fc.pre(EndpointId[eid] == null)\n fc.pre(EndpointId[parseInt(eid)] == null)\n\n expect(() => types.eid.parse('eid', eid)).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/cli.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58837, "name": "unknown", "code": "it('should not parse invalid numbers', () => {\n fc.assert(\n fc.property(fc.integer(), (eid) => {\n fc.pre(EndpointId[eid] == null)\n\n expect(() => types.eid.parse('eid', String(eid))).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm-hardhat/test/cli.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58838, "name": "unknown", "code": "it('should reject if the eid of the transaction does not match the eid of the signer', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, transactionArbitrary, async (eid, transaction) => {\n fc.pre(eid !== transaction.point.eid)\n\n const signer = {} as Signer\n const omniSigner = new OmniSignerEVM(eid, signer)\n\n await expect(() => omniSigner.sign(transaction)).rejects.toThrow(/Could not use signer/)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm/test/signer/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58839, "name": "unknown", "code": "it('should sign the transaction using the signer if the eids match', async () => {\n await fc.assert(\n fc.asyncProperty(\n transactionArbitrary,\n signedTransactionArbitrary,\n async (transaction, signedTransaction) => {\n const signTransaction = jest.fn().mockResolvedValue(signedTransaction)\n const signer = { signTransaction } as unknown as Signer\n const omniSigner = new OmniSignerEVM(transaction.point.eid, signer)\n\n expect(await omniSigner.sign(transaction)).toBe(signedTransaction)\n expect(signTransaction).toHaveBeenCalledWith({\n to: transaction.point.address,\n data: transaction.data,\n value: transaction.value,\n })\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm/test/signer/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58840, "name": "unknown", "code": "it('should reject if the eid of the transaction does not match the eid of the signer', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, transactionArbitrary, async (eid, transaction) => {\n fc.pre(eid !== transaction.point.eid)\n\n const signer = {} as Signer\n const omniSigner = new OmniSignerEVM(eid, signer)\n\n await expect(() => omniSigner.signAndSend(transaction)).rejects.toThrow(/Could not use signer/)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm/test/signer/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58841, "name": "unknown", "code": "it('should send the transaction using the signer if the eids match', async () => {\n await fc.assert(\n fc.asyncProperty(transactionArbitrary, transactionHashArbitrary, async (transaction, hash) => {\n const sendTransaction = jest.fn().mockResolvedValue({ hash })\n const signer = { sendTransaction } as unknown as Signer\n const omniSigner = new OmniSignerEVM(transaction.point.eid, signer)\n\n expect(await omniSigner.signAndSend(transaction)).toEqual({ transactionHash: hash })\n expect(sendTransaction).toHaveBeenCalledWith({\n to: transaction.point.address,\n data: transaction.data,\n value: transaction.value,\n })\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm/test/signer/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58842, "name": "unknown", "code": "it('should not be supported', async () => {\n await fc.assert(\n fc.asyncProperty(\n evmAddressArbitrary,\n endpointArbitrary,\n transactionArbitrary,\n async (safeAddress, eid, transaction) => {\n const signer = {} as Signer\n\n const apiKit = {\n getNextNonce: jest.fn(),\n } as unknown as SafeApiKit\n\n const safe = {\n createTransaction: jest.fn().mockResolvedValue({ data: 'transaction' }),\n getAddress: jest.fn().mockResolvedValue(safeAddress),\n signTransaction: jest.fn().mockResolvedValue({ data: { data: '0xsigned' } }),\n } as unknown as Safe\n\n const omniSigner = new GnosisOmniSignerEVM(eid, signer, '', {}, undefined, apiKit, safe)\n\n await expect(omniSigner.sign(transaction)).rejects.toThrow(\n /Signing transactions with safe is currently not supported, use signAndSend instead/\n )\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm/test/signer/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58843, "name": "unknown", "code": "it('should reject if the eid of the transaction does not match the eid of the signer', async () => {\n await fc.assert(\n fc.asyncProperty(\n evmAddressArbitrary,\n endpointArbitrary,\n transactionArbitrary,\n async (safeAddress, eid, transaction) => {\n fc.pre(eid !== transaction.point.eid)\n\n const signer = {} as Signer\n const safe = {\n createTransaction: jest.fn().mockResolvedValue({ data: 'transaction' }),\n getAddress: jest.fn().mockResolvedValue(safeAddress),\n signTransactionHash: jest.fn().mockResolvedValue({ data: 'signature' }),\n } as unknown as Safe\n const omniSigner = new GnosisOmniSignerEVM(eid, signer, '', {}, undefined, undefined, safe)\n\n await expect(() => omniSigner.signAndSend(transaction)).rejects.toThrow(\n /Could not use signer/\n )\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm/test/signer/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58844, "name": "unknown", "code": "it('should send the transaction using the signer if the eids match', async () => {\n await fc.assert(\n fc.asyncProperty(\n evmAddressArbitrary,\n transactionArbitrary,\n transactionHashArbitrary,\n async (safeAddress, transaction, transactionHash) => {\n const signer = { getAddress: jest.fn(), sendTransaction: jest.fn() } as unknown as Signer\n const apiKit = {\n proposeTransaction: jest.fn(),\n getNextNonce: jest.fn(),\n } as unknown as SafeApiKit\n const safe = {\n createTransaction: jest.fn().mockResolvedValue({ data: 'transaction' }),\n getTransactionHash: jest.fn().mockResolvedValue(transactionHash),\n getAddress: jest.fn().mockResolvedValue(safeAddress),\n signTransactionHash: jest.fn().mockResolvedValue({ data: 'signature' }),\n } as unknown as Safe\n\n const omniSigner = new GnosisOmniSignerEVM(\n transaction.point.eid,\n signer,\n '',\n {\n safeAddress,\n },\n undefined,\n apiKit,\n safe\n )\n\n const result = await omniSigner.signAndSend(transaction)\n expect(result.transactionHash).toEqual(transactionHash)\n\n expect(await result.wait()).toEqual({ transactionHash })\n\n expect(apiKit.getNextNonce).toHaveBeenCalledWith(safeAddress)\n expect(apiKit.proposeTransaction).toHaveBeenCalledWith({\n safeAddress,\n safeTransactionData: 'transaction',\n safeTxHash: transactionHash,\n senderAddress: undefined,\n senderSignature: 'signature',\n })\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm/test/signer/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58845, "name": "unknown", "code": "it('should reject with no transactions', async () => {\n await fc.assert(\n fc.asyncProperty(evmAddressArbitrary, endpointArbitrary, async (safeAddress, eid) => {\n const signer = {} as Signer\n const safe = {} as unknown as Safe\n const omniSigner = new GnosisOmniSignerEVM(eid, signer, '', {}, undefined, undefined, safe)\n\n await expect(() => omniSigner.signAndSendBatch([])).rejects.toThrow(\n /signAndSendBatch received 0 transactions/\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm/test/signer/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58846, "name": "unknown", "code": "it('should reject if at least one of the transaction eids do not match the signer eid', async () => {\n await fc.assert(\n fc.asyncProperty(\n evmAddressArbitrary,\n endpointArbitrary,\n fc.array(transactionArbitrary, { minLength: 1 }),\n async (safeAddress, eid, transactions) => {\n fc.pre(transactions.some((transaction) => eid !== transaction.point.eid))\n\n const signer = {} as Signer\n const safe = {\n createTransaction: jest.fn().mockResolvedValue({ data: 'transaction' }),\n getAddress: jest.fn().mockResolvedValue(safeAddress),\n signTransactionHash: jest.fn().mockResolvedValue({ data: 'signature' }),\n } as unknown as Safe\n const omniSigner = new GnosisOmniSignerEVM(eid, signer, '', {}, undefined, undefined, safe)\n\n await expect(() => omniSigner.signAndSendBatch(transactions)).rejects.toThrow(\n /Could not use signer/\n )\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm/test/signer/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58847, "name": "unknown", "code": "it('should send the transaction using the signer if the eids match', async () => {\n await fc.assert(\n fc.asyncProperty(\n evmAddressArbitrary,\n endpointArbitrary,\n fc.array(transactionArbitrary, { minLength: 1 }),\n transactionHashArbitrary,\n async (safeAddress, eid, transactions, transactionHash) => {\n const nonce = 17\n const signer = { getAddress: jest.fn(), sendTransaction: jest.fn() } as unknown as Signer\n const apiKit = {\n proposeTransaction: jest.fn(),\n getNextNonce: jest.fn().mockResolvedValue(nonce),\n } as unknown as SafeApiKit\n const safe = {\n createTransaction: jest.fn().mockResolvedValue({ data: 'transaction' }),\n getTransactionHash: jest.fn().mockResolvedValue(transactionHash),\n getAddress: jest.fn().mockResolvedValue(safeAddress),\n signTransactionHash: jest.fn().mockResolvedValue({ data: 'signature' }),\n } as unknown as Safe\n\n const omniSigner = new GnosisOmniSignerEVM(\n eid,\n signer,\n '',\n {\n safeAddress,\n },\n undefined,\n apiKit,\n safe\n )\n\n const transactionsWithMatchingEids = transactions.map((t) => ({\n ...t,\n point: { ...t.point, eid },\n }))\n\n const result = await omniSigner.signAndSendBatch(transactionsWithMatchingEids)\n expect(result.transactionHash).toEqual(transactionHash)\n\n expect(await result.wait()).toEqual({ transactionHash })\n\n expect(safe.createTransaction).toHaveBeenCalledWith({\n safeTransactionData: transactions.map((t) => ({\n to: t.point.address,\n data: t.data,\n value: String(t.value ?? 0),\n operation: OperationType.Call,\n })),\n options: { nonce },\n })\n\n expect(apiKit.getNextNonce).toHaveBeenCalledWith(safeAddress)\n expect(apiKit.proposeTransaction).toHaveBeenCalledWith({\n safeAddress,\n safeTransactionData: 'transaction',\n safeTxHash: transactionHash,\n senderAddress: undefined,\n senderSignature: 'signature',\n })\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-evm/test/signer/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58848, "name": "unknown", "code": "it('should not run tsc', async () => {\n await fc.assert(\n fc.asyncProperty(fc.oneof(fc.string(), fc.constantFrom(undefined)), async (env) => {\n fc.pre(env !== 'production')\n\n const plugin = createDeclarationBuild({ enabled: undefined })\n\n await plugin.buildEnd.call(pluginContext)\n\n expect(spawnSyncMock).not.toHaveBeenCalled()\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/build-devtools/test/tsup/declarations.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58851, "name": "unknown", "code": "test('TINY-4773: AutoLink: multiple @ characters', (editor) => {\n fc.assert(fc.property(fc.hexaString(0, 30), fc.hexaString(0, 30), fc.hexaString(0, 30), (s1, s2, s3) => {\n assertNoLink(editor, `${s1}@@${s2}@.@${s3}`, `${s1}@@${s2}@.@${s3}`);\n }));\n })", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/tinymce/src/plugins/autolink/test/ts/browser/AutoLinkPluginTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Multiple '@' characters in a string should not trigger the creation of a link.", "mode": "fast-check"} {"id": 58852, "name": "unknown", "code": "test('TINY-4773: AutoLink: ending in @ character', (editor) => {\n fc.assert(fc.property(fc.hexaString(0, 100), (s1) => {\n assertNoLink(editor, `${s1}@`, `${s1}@`);\n }));\n })", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/tinymce/src/plugins/autolink/test/ts/browser/AutoLinkPluginTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should ensure that a string ending with the \"@\" character does not trigger link creation in the editor.", "mode": "fast-check"} {"id": 58856, "name": "unknown", "code": "UnitTest.test('KAssert.eqError: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('should throw if numbers differ #1', () => {\n KAssert.eqError('eq', a, Result.error(b));\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqError('eq', a, Result.error(b), tBoom());\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqError('eq', a, Result.error(b), tBoom(), tNumber);\n });\n }));\n\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.throws('should throw if value #1', () => {\n KAssert.eqError('eq', i, Result.value(s));\n });\n Assert.throws('should throw if value #2', () => {\n KAssert.eqError('eq', i, Result.value(s), tBoom());\n });\n Assert.throws('should throw if value #3', () => {\n KAssert.eqError('eq', i, Result.value(s), tBoom(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`KAssert.eqError` throws an error when comparing differing numbers or when comparing an integer with a string wrapped in `Result.value`.", "mode": "fast-check"} {"id": 58857, "name": "unknown", "code": "UnitTest.test('KAssert.eqValue: success', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n KAssert.eqValue('eq', i, Result.value(i));\n KAssert.eqValue('eq', i, Result.value(i), tNumber);\n KAssert.eqValue('eq', i, Result.value(i), tNumber, tBoom());\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`KAssert.eqValue` confirms equality between an integer and a `Result.value` containing the same integer, optionally using `tNumber` and `tBoom` for additional type checking.", "mode": "fast-check"} {"id": 58866, "name": "unknown", "code": "UnitTest.test('KAssert.eqSome: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #1', () => {\n KAssert.eqSome('eq', a, Option.some(b));\n });\n }));\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #2', () => {\n KAssert.eqSome('eq', a, Option.some(b), tNumber);\n });\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`KAssert.eqSome` throws an error when checking equality between a value and a different non-empty option.", "mode": "fast-check"} {"id": 58867, "name": "unknown", "code": "UnitTest.test('KAssert.eqNone: failure', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('some(i) != none', () => {\n KAssert.eqNone('eq', Option.some(i));\n });\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`KAssert.eqNone` throws an error when comparing an `Option.some` value to `none`.", "mode": "fast-check"} {"id": 58871, "name": "unknown", "code": "UnitTest.test('KAssert.eqOption: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #1', () => {\n KAssert.eqOption('eq', Option.some(a), Option.some(b));\n });\n }));\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #2', () => {\n KAssert.eqOption('eq', Option.some(a), Option.some(b), tNumber);\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('none != some(i) #1', () => {\n KAssert.eqOption('eq', Option.none(), Option.some(i));\n });\n Assert.throws('none != some(i) #2', () => {\n KAssert.eqOption('eq', Option.none(), Option.some(i), tBoom());\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('some(i) != none #1', () => {\n KAssert.eqOption('eq', Option.some(i), Option.none());\n });\n Assert.throws('some(i) != none #2', () => {\n KAssert.eqOption('eq', Option.some(i), Option.none(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58872, "name": "unknown", "code": "UnitTest.test('KAssert.eqOption: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #1', () => {\n KAssert.eqOption('eq', Option.some(a), Option.some(b));\n });\n }));\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #2', () => {\n KAssert.eqOption('eq', Option.some(a), Option.some(b), tNumber);\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('none != some(i) #1', () => {\n KAssert.eqOption('eq', Option.none(), Option.some(i));\n });\n Assert.throws('none != some(i) #2', () => {\n KAssert.eqOption('eq', Option.none(), Option.some(i), tBoom());\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('some(i) != none #1', () => {\n KAssert.eqOption('eq', Option.some(i), Option.none());\n });\n Assert.throws('some(i) != none #2', () => {\n KAssert.eqOption('eq', Option.some(i), Option.none(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58873, "name": "unknown", "code": "UnitTest.test('leftTrim(whitespace + s) === leftTrim(s)', () => {\n fc.assert(fc.property(\n fc.string(),\n (s) => {\n Assert.eq('leftTrim', Strings.lTrim(' ' + s), Strings.lTrim(s), tString);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/str/TrimTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58874, "name": "unknown", "code": "UnitTest.test('rightTrim(s + whitespace) === rightTrim(s)', () => {\n fc.assert(fc.property(\n fc.string(),\n (s) => {\n Assert.eq('rightTrim', Strings.rTrim(s + ' '), Strings.rTrim(s), tString);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/str/TrimTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58875, "name": "unknown", "code": "UnitTest.test('trim(whitespace + s) === trim(s)', () => {\n fc.assert(fc.property(\n fc.string(),\n (s) => {\n Assert.eq('trim', Strings.trim(' ' + s), Strings.trim(s), tString);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/str/TrimTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58876, "name": "unknown", "code": "UnitTest.test('trim(s + whitespace) === trim(s)', () => {\n fc.assert(fc.property(\n fc.string(),\n (s) => {\n Assert.eq('trim', Strings.trim(s + ' '), Strings.trim(s), tString);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/str/TrimTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58877, "name": "unknown", "code": "UnitTest.test('trim(whitespace + s + whitespace) === trim(s)', () => {\n fc.assert(fc.property(\n fc.string(),\n (s) => {\n Assert.eq('trim', Strings.trim(' ' + s + ' '), Strings.trim(s), tString);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/str/TrimTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58878, "name": "unknown", "code": "UnitTest.test('StringMatch.matches(StringMatch.starts(s1), s1 + s) === true', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(),\n (s, s1) => {\n Assert.eq('eq', true, StringMatch.matches(\n StringMatch.starts(s1, StringMatch.caseInsensitive),\n s1 + s\n ));\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58879, "name": "unknown", "code": "UnitTest.test('StringMatch.matches(StringMatch.contains(s1), s1 + s) === true', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(),\n (s, s1) => {\n Assert.eq('eq', true, StringMatch.matches(\n StringMatch.contains(s1, StringMatch.caseInsensitive),\n s1 + s\n ));\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58880, "name": "unknown", "code": "UnitTest.test('StringMatch.matches(StringMatch.contains(s1), s + s1) === true', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(),\n (s, s1) => {\n Assert.eq('eq', true, StringMatch.matches(\n StringMatch.contains(s1, StringMatch.caseInsensitive),\n s + s1\n ));\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58881, "name": "unknown", "code": "UnitTest.test('StringMatch.matches(StringMatch.contains(s1), s) === s.indexOf(s1)', () => {\n fc.assert(fc.property(\n fc.asciiString(),\n fc.asciiString(1, 40),\n (s, s1) => {\n Assert.eq('eq', s.toLowerCase().indexOf(s1.toLowerCase()) > -1, StringMatch.matches(\n StringMatch.contains(s1, StringMatch.caseInsensitive),\n s\n ));\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58882, "name": "unknown", "code": "UnitTest.test('StringMatch.matches(StringMatch.contains(s), s) === true', () => {\n fc.assert(fc.property(\n fc.string(),\n (s) => {\n Assert.eq('eq', true, StringMatch.matches(\n StringMatch.contains(s, StringMatch.caseInsensitive),\n s\n ));\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58883, "name": "unknown", "code": "UnitTest.test('StringMatch.matches(StringMatch.exact(s), s + s1) === false', () => {\n fc.assert(fc.property(\n fc.string(1, 40),\n fc.string(1, 40),\n (s, s1) => {\n Assert.eq('eq', false, StringMatch.matches(\n StringMatch.exact(s, StringMatch.caseInsensitive),\n s + s1\n ));\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58884, "name": "unknown", "code": "UnitTest.test('StringMatch.matches(StringMatch.exact(s), s1 + s) === false', () => {\n fc.assert(fc.property(\n fc.string(1, 40),\n fc.string(1, 40),\n (s, s1) => {\n Assert.eq('eq', false, StringMatch.matches(\n StringMatch.exact(s, StringMatch.caseInsensitive),\n s1 + s\n ));\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58885, "name": "unknown", "code": "UnitTest.test('StringMatch.matches(StringMatch.exact(s), s) === true', () => {\n fc.assert(fc.property(\n fc.string(1, 40),\n (s) => {\n Assert.eq('eq', true, StringMatch.matches(\n StringMatch.exact(s, StringMatch.caseInsensitive),\n s\n ));\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58886, "name": "unknown", "code": "UnitTest.test('StringMatch.matches(StringMatch.exact(s), s) === false when different case and case-insensitive', () => {\n fc.assert(fc.property(\n fc.asciiString(1, 40),\n (s) => s.toUpperCase() === s.toLowerCase() || StringMatch.matches(\n StringMatch.exact(s.toLowerCase(), StringMatch.caseInsensitive),\n s.toUpperCase()\n )\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58887, "name": "unknown", "code": "UnitTest.test('StringMatch.matches(StringMatch.exact(s), s) === false when different case and case-sensitive', () => {\n fc.assert(fc.property(\n fc.asciiString(1, 40),\n (s) => s.toUpperCase() === s.toLowerCase() || !StringMatch.matches(\n StringMatch.exact(s.toLowerCase(), StringMatch.caseSensitive),\n s.toUpperCase()\n )\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58888, "name": "unknown", "code": "UnitTest.test('StringMatch.matches(StringMatch.all(s1), *) === true', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(),\n (s) => {\n Assert.eq('eq', true, StringMatch.matches(\n StringMatch.all(),\n s\n ));\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58889, "name": "unknown", "code": "UnitTest.test('Strings.repeat: positive range', () => {\n fc.assert(fc.property(fc.char(), fc.integer(1, 100), (c, count) => {\n const actual = Strings.repeat(c, count);\n Assert.eq('length should be the same as count', count, actual.length);\n Assert.eq('first char should be the same', c, actual.charAt(0));\n Assert.eq('last char should be the same', c, actual.charAt(actual.length - 1));\n }));\n\n fc.assert(fc.property(fc.asciiString(5), fc.integer(1, 100), (s, count) => {\n const actual = Strings.repeat(s, count);\n Assert.eq('length should be count * original length', count * s.length, actual.length);\n Assert.eq('should start with string', 0, actual.indexOf(s));\n Assert.eq('should end with string', actual.length - s.length, actual.lastIndexOf(s));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/str/RepeatTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58890, "name": "unknown", "code": "UnitTest.test('Strings.repeat: positive range', () => {\n fc.assert(fc.property(fc.char(), fc.integer(1, 100), (c, count) => {\n const actual = Strings.repeat(c, count);\n Assert.eq('length should be the same as count', count, actual.length);\n Assert.eq('first char should be the same', c, actual.charAt(0));\n Assert.eq('last char should be the same', c, actual.charAt(actual.length - 1));\n }));\n\n fc.assert(fc.property(fc.asciiString(5), fc.integer(1, 100), (s, count) => {\n const actual = Strings.repeat(s, count);\n Assert.eq('length should be count * original length', count * s.length, actual.length);\n Assert.eq('should start with string', 0, actual.indexOf(s));\n Assert.eq('should end with string', actual.length - s.length, actual.lastIndexOf(s));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/str/RepeatTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58891, "name": "unknown", "code": "UnitTest.test('Strings.repeat: negative range', () => {\n fc.assert(fc.property(fc.char(), fc.integer(-100, 0), (c, count) => {\n const actual = Strings.repeat(c, count);\n Assert.eq('length should be 0', 0, actual.length);\n Assert.eq('should be an empty string', '', actual);\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/str/RepeatTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58892, "name": "unknown", "code": "UnitTest.test('removeTrailing property', () => {\n fc.assert(fc.property(\n fc.asciiString(),\n fc.asciiString(),\n (prefix, suffix) => {\n Assert.eq('removeTrailing', prefix, Strings.removeTrailing(prefix + suffix, suffix));\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/str/RemoveTrailingTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58893, "name": "unknown", "code": "UnitTest.test('removeLeading removes prefix', () => {\n fc.assert(fc.property(\n fc.asciiString(),\n fc.asciiString(),\n (prefix, suffix) => {\n Assert.eq('removeLeading', suffix, Strings.removeLeading(prefix + suffix, prefix));\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/str/RemoveLeadingTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58894, "name": "unknown", "code": "UnitTest.test('ensureTrailing is identity if string already ends with suffix', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(),\n function (prefix, suffix) {\n const s = prefix + suffix;\n Assert.eq('id', s, Strings.ensureTrailing(s, suffix));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/str/EnsureTrailingTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58895, "name": "unknown", "code": "UnitTest.test('ensureTrailing endsWith', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(),\n (s, suffix) => Strings.endsWith(Strings.ensureTrailing(s, suffix), suffix)\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/str/EnsureTrailingTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58896, "name": "unknown", "code": "UnitTest.test('startsWith a prefix', () => {\n fc.assert(fc.property(fc.string(), fc.string(),\n (prefix, suffix) => Strings.startsWith(prefix + suffix, prefix)\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/str/EnsureLeadingTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58897, "name": "unknown", "code": "UnitTest.test('endsWith: A string added to a string (at the end) must have endsWith as true', () => {\n fc.assert(fc.property(\n fc.asciiString(),\n fc.asciiString(),\n (str, contents) => Strings.endsWith(str + contents, contents)\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/str/EndsWithTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58898, "name": "unknown", "code": "UnitTest.test('A string with length 1 or larger should never be empty', () => {\n fc.assert(fc.property(fc.string(1, 40), (str) => {\n Assert.eq('isEmpty', false, Strings.isEmpty(str));\n Assert.eq('isNotEmpty', true, Strings.isNotEmpty(str));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/str/EmptyTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58899, "name": "unknown", "code": "UnitTest.test('A string added to a string (at the end) must be contained within it', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(1, 40),\n (str, contents) => {\n const r = str + contents;\n Assert.eq('eq', true, Strings.contains(r, contents));\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/str/ContainsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58900, "name": "unknown", "code": "UnitTest.test('A string added to a string (at the start) must be contained within it', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(1, 40),\n (str, contents) => {\n const r = contents = str;\n Assert.eq('eq', true, Strings.contains(r, contents));\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/str/ContainsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58901, "name": "unknown", "code": "UnitTest.test('An empty string should contain nothing', () => {\n fc.assert(fc.property(\n fc.string(1, 40),\n (value) => !Strings.contains('', value)\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/str/ContainsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58902, "name": "unknown", "code": "UnitTest.test('capitalize: tail of the string is unchanged', () => {\n fc.assert(fc.property(fc.ascii(), fc.asciiString(30), (h, t) => {\n Assert.eq('tail', t, Strings.capitalize(h + t).substring(1), tString);\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/str/CapitalizeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 58909, "name": "unknown", "code": "UnitTest.test('ResultInstances.pprint', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.eq('pprint value',\n `Result.value(\n ${i}\n)`,\n Pprint.render(Result.value(i), tResult(tNumber, tString))\n );\n\n Assert.eq('pprint error',\n `Result.error(\n ${i}\n)`,\n Pprint.render(Result.error(i), tResult(tString, tNumber))\n );\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/ResultInstancesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Verifies that `Pprint.render` correctly formats both `Result.value` and `Result.error` instances with integers, producing an expected multi-line string with the integer inserted.", "mode": "fast-check"} {"id": 58911, "name": "unknown", "code": "UnitTest.test('Options.cat of only somes should have the same length', () => {\n fc.assert(fc.property(\n fc.array(ArbDataTypes.arbOptionSome(fc.integer())),\n (options) => {\n const output = Options.cat(options);\n Assert.eq('eq', options.length, output.length);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Options.cat` retains the same length as the input array of `Some` options.", "mode": "fast-check"} {"id": 58920, "name": "unknown", "code": "UnitTest.test('Options.sequence: Some then none', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (n) => {\n const someNumbers = Arr.map(n, (x) => Option.some(x));\n Assert.eq('eq', Option.none(), Options.sequence([ ...someNumbers, Option.none() ]), tOption());\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionsSequenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that when an array of `Option.some` values is combined with an `Option.none`, the result of `Options.sequence` is `Option.none`.", "mode": "fast-check"} {"id": 58923, "name": "unknown", "code": "UnitTest.test('Options.flatten: some(some(x))', () => {\n fc.assert(fc.property(fc.integer(), function (n) {\n Assert.eq('eq', Option.some(n), Options.flatten(Option.some(Option.some(n))), tOption());\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionsFlattenTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Options.flatten` should return a single `Option.some` with the value `n` when applied to `Option.some(Option.some(n))`.", "mode": "fast-check"} {"id": 58924, "name": "unknown", "code": "UnitTest.test('Option.none() !== Option.some(x)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.eq('eq', false, Option.none().equals(Option.some(i)));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Option.none()` should not be equal to `Option.some(x)` for any integer `x`.", "mode": "fast-check"} {"id": 58925, "name": "unknown", "code": "UnitTest.test('Option.some(x) !== Option.none()', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.eq('eq', false, (Option.some(i).equals(Option.none())));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Option.some(x)` should not be equal to `Option.none()`.", "mode": "fast-check"} {"id": 58926, "name": "unknown", "code": "UnitTest.test('Option.some(x) === Option.some(x)', () => {\n fc.assert(fc.property(fc.integer(), (i) => Assert.eq('eq', true, Option.some(i).equals(Option.some(i)))));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Option.some(x)` should be equal to `Option.some(x)` for any integer `x`.", "mode": "fast-check"} {"id": 58927, "name": "unknown", "code": "UnitTest.test('Option.some(x) === Option.some(x) (same ref)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n const ob = Option.some(i);\n Assert.eq('eq', true, ob.equals(ob));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Option.some(x)` should be equal to itself when using the `equals` method.", "mode": "fast-check"} {"id": 58928, "name": "unknown", "code": "UnitTest.test('Option.some(x) !== Option.some(x + y) where y is not identity', () => {\n fc.assert(fc.property(fc.string(), fc.string(1, 40), (a, b) => {\n Assert.eq('eq', false, Option.some(a).equals(Option.some(a + b)));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Option.some(x)` should not be equal to `Option.some(x + y)` when `y` is not an identity value.", "mode": "fast-check"} {"id": 58938, "name": "unknown", "code": "UnitTest.test('Checking some(x).getOr(v) === x', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), arbOptionSome(fc.integer()), (a, b) => {\n Assert.eq('eq', a, Option.some(a).getOr(b));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Option.some(x).getOr(v)` should always return `x`.", "mode": "fast-check"} {"id": 58939, "name": "unknown", "code": "UnitTest.test('Checking some(x).getOrThunk(_ -> v) === x', () => {\n fc.assert(fc.property(fc.integer(), fc.func(fc.integer()), (a, thunk) => {\n Assert.eq('eq', a, Option.some(a).getOrThunk(thunk));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Option.some(x).getOrThunk(thunk)` should return `x`, regardless of the thunk provided.", "mode": "fast-check"} {"id": 58940, "name": "unknown", "code": "UnitTest.test('Checking some.getOrDie() never throws', () => {\n fc.assert(fc.property(fc.integer(), fc.string(1, 40), (i, s) => {\n const opt = Option.some(i);\n opt.getOrDie(s);\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Option.some(i).getOrDie(s)` should never throw an error for any integer `i` and string `s` within the specified length.", "mode": "fast-check"} {"id": 58941, "name": "unknown", "code": "UnitTest.test('Checking some(x).or(oSomeValue) === some(x)', () => {\n fc.assert(fc.property(fc.integer(), arbOptionSome(fc.integer()), (json, other) => {\n const output = Option.some(json).or(other);\n Assert.eq('eq', true, output.is(json));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Option.some(x).or(oSomeValue)` should produce `some(x)`, verifying that `or` returns the original `some(x)` instead of an alternative value.", "mode": "fast-check"} {"id": 58942, "name": "unknown", "code": "UnitTest.test('Checking some(x).orThunk(_ -> oSomeValue) === some(x)', () => {\n fc.assert(fc.property(fc.integer(), arbOptionSome(fc.integer()), (i, other) => {\n const output = Option.some(i).orThunk(() => other);\n Assert.eq('eq', true, output.is(i));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Option.some(x).orThunk` called with any integer and another optional integer value should return `Option.some(x)`.", "mode": "fast-check"} {"id": 58951, "name": "unknown", "code": "UnitTest.test('Checking some(x).forall(_ -> true) === true', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => opt.forall(Fun.constant(true))));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The result of `forall` on `some(x)` with a function always returning `true` should be `true`.", "mode": "fast-check"} {"id": 58952, "name": "unknown", "code": "UnitTest.test('Checking some(x).forall(f) iff. f(x)', () => {\n fc.assert(fc.property(fc.integer(), fc.func(fc.boolean()), (i, f) => {\n const opt = Option.some(i);\n if (f(i)) {\n Assert.eq('eq', true, opt.forall(f));\n } else {\n Assert.eq('eq', false, opt.forall(f));\n }\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Option.some(x).forall(f)` should return true if and only if the function `f` applied to `x` returns true.", "mode": "fast-check"} {"id": 58953, "name": "unknown", "code": "UnitTest.test('Checking some(x).toArray equals [ x ]', () => {\n fc.assert(fc.property(fc.integer(), (json) => {\n Assert.eq('eq', [ json ], Option.some(json).toArray());\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Option.some(x).toArray()` results in an array containing just the element `x`.", "mode": "fast-check"} {"id": 58954, "name": "unknown", "code": "UnitTest.test('Checking some(x).toString equals \"some(x)\"', () => {\n fc.assert(fc.property(fc.integer(), (json) => {\n Assert.eq('toString', 'some(' + json + ')', Option.some(json).toString());\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Option.some(x).toString` produces the string \"some(x)\" for any integer x.", "mode": "fast-check"} {"id": 58957, "name": "unknown", "code": "UnitTest.test('Checking none.getOr(v) === v', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.eq('eq', i, Option.none().getOr(i));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Option.none().getOr(i)` should return the value `i`.", "mode": "fast-check"} {"id": 58958, "name": "unknown", "code": "UnitTest.test('Checking none.getOrThunk(_ -> v) === v', () => {\n fc.assert(fc.property(fc.func(fc.integer()), (thunk) => {\n Assert.eq('eq', thunk(), Option.none().getOrThunk(thunk));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Option.none().getOrThunk(thunk)` returns the result of the `thunk` function.", "mode": "fast-check"} {"id": 58967, "name": "unknown", "code": "UnitTest.test('Checking some(x).filter(_ -> true) === some(x)', () => {\n fc.assert(fc.property(fc.integer(), (x) => {\n Assert.eq('eq', true, tOption().eq(\n some(x),\n some(x).filter(Fun.constant(true))\n ));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionFilterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Filtering a `some(x)` with a condition that always returns true should result in `some(x)` unchanged.", "mode": "fast-check"} {"id": 58969, "name": "unknown", "code": "UnitTest.test('Checking that creating a namespace (forge) from an obj will enable that value to be retrieved by resolving (path)', () => {\n fc.assert(fc.property(\n // NOTE: This value is being modified, so it cannot be shrunk.\n fc.dictionary(fc.asciiString(),\n // We want to make sure every path in the object is an object\n // also, because that is a limitation of forge.\n fc.dictionary(fc.asciiString(),\n fc.dictionary(fc.asciiString(), fc.constant({}))\n )\n ),\n fc.array(fc.asciiString(1, 30), 1, 40),\n fc.asciiString(1, 30),\n fc.asciiString(1, 30),\n function (dict, parts, field, newValue) {\n const created = Resolve.forge(parts, dict);\n created[field] = newValue;\n const resolved = Resolve.path(parts.concat([ field ]), dict);\n Assert.eq(\n 'Checking that namespace works with resolve',\n newValue,\n resolved\n );\n }\n ), { endOnFailure: true });\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/obj/ResolveTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Creating a namespace using `forge` allows a value to be set and then accurately retrieved using `path`.", "mode": "fast-check"} {"id": 58972, "name": "unknown", "code": "UnitTest.test('tupleMap obj (x, i) -> { k: i, v: x }', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.integer()), (obj) => {\n const output = Obj.tupleMap(obj, (x, i) => ({ k: i, v: x }));\n Assert.eq('tupleMap', obj, output);\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/obj/ObjMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Obj.tupleMap` should transform a dictionary into an array of objects with keys `k` and `v`, using entries where `k` is the key and `v` is the value, resulting in the same structure as the input.", "mode": "fast-check"} {"id": 58981, "name": "unknown", "code": "UnitTest.test('Merged with identity on right', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), function (obj) {\n Assert.eq('eq', obj, Merger.merge(obj, {}));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Merging an object with an empty object on the right should result in the original object.", "mode": "fast-check"} {"id": 58982, "name": "unknown", "code": "UnitTest.test('Merged with itself is itself', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), function (obj) {\n Assert.eq('eq', obj, Merger.merge(obj, obj));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Merging an object with itself should result in the original object being unchanged.", "mode": "fast-check"} {"id": 58983, "name": "unknown", "code": "UnitTest.test('Merge(a, Merge(b, c)) === Merge(Merge(a, b), c)', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), fc.dictionary(fc.asciiString(), fc.json()), fc.dictionary(fc.asciiString(), fc.json()), function (a, b, c) {\n const one = Merger.merge(a, Merger.merge(b, c));\n const other = Merger.merge(Merger.merge(a, b), c);\n Assert.eq('eq', one, other);\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The merge operation is associative, meaning `Merge(a, Merge(b, c))` should equal `Merge(Merge(a, b), c)`.", "mode": "fast-check"} {"id": 58985, "name": "unknown", "code": "UnitTest.test('Deep-merged with identity on left', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), function (obj) {\n Assert.eq('eq', obj, Merger.deepMerge({}, obj));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Verifies that deeply merging an empty object with any given dictionary results in the original dictionary remaining unchanged.", "mode": "fast-check"} {"id": 58991, "name": "unknown", "code": "UnitTest.test('Check that if the filter always returns true, then everything is in \"t\"', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(), fc.string(1, 40)),\n (obj) => {\n const output = Obj.bifilter(obj, Fun.constant(true));\n Assert.eq('eq', 0, Obj.keys(output.f).length);\n Assert.eq('eq', Obj.keys(obj).length, Obj.keys(output.t).length);\n return true;\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/obj/BiFilterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "If the filter function always returns true, all elements from the input object should appear in the output object's \"t\" section, while the \"f\" section remains empty.", "mode": "fast-check"} {"id": 58994, "name": "unknown", "code": "UnitTest.test('Checking struct with one fewer argument', () => {\n fc.assert(fc.property(\n fc.array(fc.string(), 1, 40),\n (rawValues: string[]) => {\n // Remove duplications.\n const values = toUnique(rawValues);\n\n const struct = Struct.immutable.apply(undefined, values);\n try {\n struct.apply(undefined, values.slice(1));\n return false;\n } catch (err) {\n return err.message.indexOf('Wrong number') > -1;\n }\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/struct/ImmutableTest.ts", "start_line": null, "end_line": null, "dependencies": ["toUnique"], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Struct.immutable` should throw an error with the message containing 'Wrong number' if it is applied with one fewer argument than the number of unique strings used to create the struct.", "mode": "fast-check"} {"id": 59000, "name": "unknown", "code": "UnitTest.test('adt.unknown.match should pass 1 parameter: [ guesses ]', () => {\n fc.assert(fc.property(arbUnknown, (subject) => {\n const contents = subject.match({\n nothing: Fun.die('should not be nothing'),\n unknown: record,\n exact: Fun.die('should not be exact')\n });\n Assert.eq('eq', 1, contents.length);\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `adt.unknown.match` should return an array with exactly one element when the `unknown` case is matched.", "mode": "fast-check"} {"id": 59003, "name": "unknown", "code": "UnitTest.test('adt.exact.match should be same as fold', () => {\n fc.assert(fc.property(arbExact, (subject) => {\n const matched = subject.match({\n nothing: Fun.die('should not be nothing'),\n unknown: Fun.die('should not be unknown'),\n exact: record\n });\n\n const folded = subject.fold(Fun.die('should not be nothing'), Fun.die('should not be unknown'), record);\n Assert.eq('eq', matched, folded);\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property asserts that using `match` on a subject with the `exact` case produces the same result as using `fold` with the same parameters.", "mode": "fast-check"} {"id": 59004, "name": "unknown", "code": "UnitTest.test('adt.match must have the right arguments, not just the right number', () => {\n fc.assert(fc.property(arbAdt, (subject) => {\n try {\n subject.match({\n not: Fun.identity,\n the: Fun.identity,\n right: Fun.identity\n });\n return false;\n } catch (err) {\n return err.message.indexOf('nothing') > -1;\n }\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`adt.match` should throw an error if the argument keys do not match the expected pattern, not just if the number of keys is correct.", "mode": "fast-check"} {"id": 59009, "name": "unknown", "code": "UnitTest.test('Thunk.cached counter', () => {\n fc.assert(fc.property(fc.json(), fc.func(fc.json()), fc.json(), (a, f, b) => {\n let counter = 0;\n const thunk = Thunk.cached((x) => {\n counter++;\n return {\n counter,\n output: f(x)\n };\n });\n const value = thunk(a);\n const other = thunk(b);\n Assert.eq('eq', value, other);\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/fun/ThunkTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59010, "name": "unknown", "code": "UnitTest.test('Check compose :: compose(f, g)(x) = f(g(x))', () => {\n fc.assert(fc.property(fc.string(), fc.func(fc.string()), fc.func(fc.string()), (x, f, g) => {\n const h = Fun.compose(f, g);\n Assert.eq('eq', f(g(x)), h(x));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59011, "name": "unknown", "code": "UnitTest.test('Check compose1 :: compose1(f, g)(x) = f(g(x))', () => {\n fc.assert(fc.property(fc.string(), fc.func(fc.string()), fc.func(fc.string()), (x, f, g) => {\n const h = Fun.compose1(f, g);\n Assert.eq('eq', f(g(x)), h(x));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59012, "name": "unknown", "code": "UnitTest.test('Check constant :: constant(a)() === a', () => {\n fc.assert(fc.property(fc.json(), (json) => {\n Assert.eq('eq', json, Fun.constant(json)());\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59013, "name": "unknown", "code": "UnitTest.test('Check identity :: identity(a) === a', () => {\n fc.assert(fc.property(fc.json(), (json) => {\n Assert.eq('eq', json, Fun.identity(json));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59014, "name": "unknown", "code": "UnitTest.test('Check always :: f(x) === true', () => {\n fc.assert(fc.property(fc.json(), (json) => {\n Assert.eq('eq', true, Fun.always(json));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59015, "name": "unknown", "code": "UnitTest.test('Check never :: f(x) === false', () => {\n fc.assert(fc.property(fc.json(), (json) => {\n Assert.eq('eq', false, Fun.never(json));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59016, "name": "unknown", "code": "UnitTest.test('Check curry', () => {\n fc.assert(fc.property(fc.json(), fc.json(), fc.json(), fc.json(), (a, b, c, d) => {\n const f = (a, b, c, d) => [ a, b, c, d ];\n\n Assert.eq('curry 1', Fun.curry(f, a)(b, c, d), [ a, b, c, d ]);\n Assert.eq('curry 2', Fun.curry(f, a, b)(c, d), [ a, b, c, d ]);\n Assert.eq('curry 3', Fun.curry(f, a, b, c)(d), [ a, b, c, d ]);\n Assert.eq('curry 4', Fun.curry(f, a, b, c, d)(), [ a, b, c, d ]);\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59017, "name": "unknown", "code": "UnitTest.test('Check not :: not(f(x)) === !f(x)', () => {\n fc.assert(fc.property(fc.json(), fc.func(fc.boolean()), (x, f) => {\n const g = Fun.not(f);\n Assert.eq('eq', f(x), !g(x));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59018, "name": "unknown", "code": "UnitTest.test('Check not :: not(not(f(x))) === f(x)', () => {\n fc.assert(fc.property(fc.json(), fc.func(fc.boolean()), (x, f) => {\n const g = Fun.not(Fun.not(f));\n Assert.eq('eq', f(x), g(x));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59019, "name": "unknown", "code": "UnitTest.test('Check apply :: apply(constant(a)) === a', () => {\n fc.assert(fc.property(fc.json(), (x) => {\n Assert.eq('eq', x, Fun.apply(Fun.constant(x)));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59020, "name": "unknown", "code": "UnitTest.test('Check call :: apply(constant(a)) === undefined', () => {\n fc.assert(fc.property(fc.json(), (x) => {\n let hack: any = null;\n const output = Fun.call(() => {\n hack = x;\n });\n\n Assert.eq('eq', undefined, output);\n Assert.eq('eq', x, hack);\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59027, "name": "unknown", "code": "UnitTest.test('Check that value, value always equal comparison.bothValues', () => {\n fc.assert(fc.property(\n arbResultValue(fc.integer()),\n arbResultValue(fc.integer()),\n function (r1, r2) {\n const comparison = Results.compare(r1, r2);\n return comparison.match({\n bothErrors: Fun.constant(false),\n firstError: Fun.constant(false),\n secondError: Fun.constant(false),\n bothValues: Fun.constant(true)\n });\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Results.compare` should return `bothValues` if both inputs are result values.", "mode": "fast-check"} {"id": 59028, "name": "unknown", "code": "UnitTest.test('Results.unite', () => {\n fc.assert(fc.property(fc.integer(), (a) => {\n Assert.eq('should be error', a, Results.unite(Result.error(a)));\n Assert.eq('should be value', a, Results.unite(Result.value(a)));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59029, "name": "unknown", "code": "UnitTest.test('Checking value.is(value.getOrDie()) === true', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), (res) => {\n Assert.eq('eq', true, res.is(res.getOrDie()));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59030, "name": "unknown", "code": "UnitTest.test('Checking value.isValue === true', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), (res) => {\n Assert.eq('eq', true, res.isValue());\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59031, "name": "unknown", "code": "UnitTest.test('Checking value.isError === false', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), (res) => {\n Assert.eq('eq', false, res.isError());\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59032, "name": "unknown", "code": "UnitTest.test('Checking value.getOr(v) === value.value', () => {\n fc.assert(fc.property(fc.integer(), (a) => {\n Assert.eq('eq', a, Result.value(a).getOr(a));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59033, "name": "unknown", "code": "UnitTest.test('Checking value.getOrDie() does not throw', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), (res) => {\n res.getOrDie();\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59034, "name": "unknown", "code": "UnitTest.test('Checking value.or(oValue) === value', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), (a, b) => {\n Assert.eq('eq value', Result.value(a), Result.value(a).or(Result.value(b)), tResult());\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59035, "name": "unknown", "code": "UnitTest.test('Checking error.or(value) === value', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), (a, b) => {\n Assert.eq('eq or', Result.value(b), Result.error(a).or(Result.value(b)), tResult());\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59036, "name": "unknown", "code": "UnitTest.test('Checking value.orThunk(die) does not throw', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), (res) => {\n res.orThunk(Fun.die('dies'));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59037, "name": "unknown", "code": "UnitTest.test('Checking value.fold(die, id) === value.getOrDie()', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), (res) => {\n const actual = res.getOrDie();\n Assert.eq('eq', actual, res.fold(Fun.die('should not get here'), Fun.identity));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59038, "name": "unknown", "code": "UnitTest.test('Checking value.map(f) === f(value.getOrDie())', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), fc.func(fc.json()), (res, f) => {\n Assert.eq('eq', res.map(f).getOrDie(), f(res.getOrDie()));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59050, "name": "unknown", "code": "UnitTest.test('Result.error: error.or(oValue) === oValue', () => {\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.eq('eq', Result.value(i), Result.error(s).or(Result.value(i)), tResult());\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Result.error` returns the alternative value when using `or` with `Result.value`, ensuring `Result.error(s).or(Result.value(i))` equals `Result.value(i)`.", "mode": "fast-check"} {"id": 59053, "name": "unknown", "code": "UnitTest.test('Result.error: error.map(\u22a5) === error', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.eq('eq', Result.error(i), Result.error(i).map(Fun.die('\u22a5')), tResult());\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Calling `map` on a `Result.error` with a function that should never be invoked results in the original `Result.error`.", "mode": "fast-check"} {"id": 59054, "name": "unknown", "code": "UnitTest.test('Result.error: error.mapError(f) === f(error)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n const f = (x) => x % 3;\n Assert.eq('eq', Result.error(f(i)), Result.error(i).mapError(f), tResult());\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Mapping a function over an error should produce the same result as directly applying the function to the error.", "mode": "fast-check"} {"id": 59055, "name": "unknown", "code": "UnitTest.test('Result.error: error.each(\u22a5) === undefined', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), (res) => {\n const actual = res.each(Fun.die('\u22a5'));\n Assert.eq('eq', undefined, actual);\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property verifies that invoking `each` on a `Result.error` returns `undefined`.", "mode": "fast-check"} {"id": 59057, "name": "unknown", "code": "UnitTest.test('Given f :: s -> RE, Result.error: error.bind(f) === error', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), fc.func(arbResultError(fc.integer())), (res, f) => {\n const actual = res.bind(f);\n Assert.eq('eq', true, getErrorOrDie(res) === getErrorOrDie(actual));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": ["getErrorOrDie"], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should hold that binding a function to a `Result.error` does not change the error value.", "mode": "fast-check"} {"id": 59058, "name": "unknown", "code": "UnitTest.test('Result.error: error.forall === true', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), fc.func(fc.boolean()), (res, f) => {\n Assert.eq('eq', true, res.forall(f));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Result.error` instance method `forall` should always return true for any function applied to it.", "mode": "fast-check"} {"id": 59062, "name": "unknown", "code": "promiseTest('LazyValue: pure', () =>\n fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n LazyValue.pure(i).get((v) => {\n eqAsync('LazyValue.pure', i, v, reject);\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/async/LazyValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`LazyValue.pure` correctly returns the initial integer passed to it.", "mode": "fast-check"} {"id": 59063, "name": "unknown", "code": "promiseTest('LazyValue: pure, map', () =>\n fc.assert(fc.asyncProperty(fc.integer(), fc.func(fc.string()), (i, f) => new Promise((resolve, reject) => {\n LazyValue.pure(i).map(f).get((v) => {\n eqAsync('LazyValue.map', f(i), v, reject);\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/async/LazyValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`LazyValue.pure(i).map(f).get` should result in the function `f` applied to `i`, matching the expected output through asynchronous equality.", "mode": "fast-check"} {"id": 59067, "name": "unknown", "code": "promiseTest('Future: future soon get', () =>\n fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n Future.nu((cb) => {\n setTimeout(() => {\n cb(i);\n }, 3);\n }).get((ii) => {\n eqAsync('get', i, ii, reject, tNumber);\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Future.nu` invokes its callback with a delayed integer, and `get` retrieves it to ensure equality with the original integer asynchronously.", "mode": "fast-check"} {"id": 59077, "name": "unknown", "code": "promiseTest('FutureResult: pure get', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.pure(i).get((ii) => {\n eqAsync('eq', Result.value(i), ii, reject, tResult());\n resolve();\n });\n}))))", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`FutureResult.pure` correctly retrieves the encapsulated integer value using `get`, validating it against an expected `Result.value`.", "mode": "fast-check"} {"id": 59079, "name": "unknown", "code": "promiseTest('FutureResult: error get', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.error(i).get((ii) => {\n eqAsync('eq', Result.error(i), ii, reject, tResult());\n resolve();\n });\n}))))", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`FutureResult.error(i).get` returns a result matching `Result.error(i)`.", "mode": "fast-check"} {"id": 59090, "name": "unknown", "code": "UnitTest.test('Arr.reverse: 1 element', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (a) => {\n Assert.eq('reverse 1 element', [ a ], Arr.reverse([ a ]));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ReverseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.reverse` should return the same single-element array when reversing an array containing only one element.", "mode": "fast-check"} {"id": 59091, "name": "unknown", "code": "UnitTest.test('Arr.reverse: 2 elements', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), (a, b) => {\n Assert.eq('reverse 2 elements', [ b, a ], Arr.reverse([ a, b ]));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ReverseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Reversing a two-element array should result in an array where the order of elements is swapped.", "mode": "fast-check"} {"id": 59092, "name": "unknown", "code": "UnitTest.test('Arr.reverse: 3 elements', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), fc.integer(), (a, b, c) => {\n Assert.eq('reverse 3 elements', [ c, b, a ], Arr.reverse([ a, b, c ]));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ReverseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Reversing an array of three integers results in the expected order.", "mode": "fast-check"} {"id": 59094, "name": "unknown", "code": "UnitTest.test('Check that if the filter always returns false, then everything is in \"fail\"', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n (arr) => {\n const output = Arr.partition(arr, Fun.constant(false));\n Assert.eq('eq', 0, output.pass.length);\n Assert.eq('eq', arr, output.fail);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/PartitionTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "If the filter always returns false, all elements should be in the \"fail\" partition, and \"pass\" should be empty.", "mode": "fast-check"} {"id": 59087, "name": "unknown", "code": "UnitTest.test('zipToObject has matching keys and values', () => {\n fc.assert(fc.property(\n fc.array(fc.asciiString(1, 30)),\n (rawValues: string[]) => {\n const values = Unique.stringArray(rawValues);\n\n const keys = Arr.map(values, (v, i) => i);\n\n const output = Zip.zipToObject(keys, values);\n\n const oKeys = Obj.keys(output);\n Assert.eq('Output keys did not match', oKeys.length, values.length);\n\n Assert.eq('Output keys', true, Arr.forall(oKeys, (oKey) => {\n const index = parseInt(oKey, 10);\n const expected = values[index];\n return output[oKey] === expected;\n }));\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ZipTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59088, "name": "unknown", "code": "UnitTest.test('zipToTuples matches corresponding tuples', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.array(fc.integer()),\n (keys, values) => {\n if (keys.length !== values.length) {\n Assert.throws('Should throw with different lengths', () => Zip.zipToTuples(keys, values));\n } else {\n const output = Zip.zipToTuples(keys, values);\n Assert.eq('Output keys did not match', keys.length, output.length);\n Assert.eq('', true, Arr.forall(output, (x, i) => x.k === keys[i] && x.v === values[i]));\n }\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ZipTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59095, "name": "unknown", "code": "UnitTest.test('Check that if the filter always returns true, then everything is in \"pass\"', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n (arr) => {\n const output = Arr.partition(arr, Fun.constant(true));\n Assert.eq('eq', 0, output.fail.length);\n Assert.eq('eq', arr, output.pass);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/PartitionTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "If the filter function always returns true, all elements of the array should be in the \"pass\" partition, and the \"fail\" partition should be empty.", "mode": "fast-check"} {"id": 59096, "name": "unknown", "code": "UnitTest.test('Check that everything in fail fails predicate and everything in pass passes predicate', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n (arr) => {\n const predicate = (x) => x % 3 === 0;\n const output = Arr.partition(arr, predicate);\n return Arr.forall(output.fail, (x) => !predicate(x)) && Arr.forall(output.pass, predicate);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/PartitionTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Elements in the `fail` array should not satisfy the predicate, and elements in the `pass` array should satisfy the predicate.", "mode": "fast-check"} {"id": 59097, "name": "unknown", "code": "UnitTest.test('Obj.size: inductive case', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(1, 30), fc.integer()),\n fc.asciiString(1, 30),\n fc.integer(),\n (obj, k, v) => {\n const objWithoutK = Obj.filter(obj, (x, i) => i !== k);\n Assert.eq('Adding key adds 1 to size',\n Obj.size(objWithoutK) + 1,\n Obj.size({ k: v, ...objWithoutK })\n );\n }));\n })", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ObjSizeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Verifies that adding a key-value pair to an object increases its size by one.", "mode": "fast-check"} {"id": 59098, "name": "unknown", "code": "UnitTest.test('Obj.keys are all in input', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.integer()), (obj) => {\n const keys = Obj.keys(obj);\n return Arr.forall(keys, (k) => obj.hasOwnProperty(k));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ObjKeysTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Obj.keys` returns keys that are all present in the given object.", "mode": "fast-check"} {"id": 59115, "name": "unknown", "code": "UnitTest.test('Flattening two lists === concat', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.array(fc.integer()), (xs, ys) => {\n Assert.eq('flatten/concat', Arr.flatten([ xs, ys ]), xs.concat(ys));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/FlattenTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Flattening two lists with `Arr.flatten` should produce the same result as using `concat`.", "mode": "fast-check"} {"id": 59124, "name": "unknown", "code": "UnitTest.test('Element not found when predicate always returns false', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => !Arr.exists(arr, never)));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ExistsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.exists` returns false when a predicate that always returns false is applied to an array of integers.", "mode": "fast-check"} {"id": 59126, "name": "unknown", "code": "UnitTest.test('difference: \u2200 xs ys. x \u2208 xs -> x \u2209 (ys - xs)', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.array(fc.integer()), (xs, ys) => {\n const diff = Arr.difference(ys, xs);\n return Arr.forall(xs, (x) => !Arr.contains(diff, x));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/DifferenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The difference between two arrays should not contain any elements from the first array if they are subtracted from the second array.", "mode": "fast-check"} {"id": 59128, "name": "unknown", "code": "UnitTest.test('Arr.contains: array contains element', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), fc.array(fc.integer()), (prefix, element, suffix) => {\n const arr2 = Arr.flatten([ prefix, [ element ], suffix ]);\n Assert.eq('in array', true, Arr.contains(arr2, element));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ContainsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.contains` should return true when an array, formed by flattening a prefix, an element, and a suffix, includes the specified element.", "mode": "fast-check"} {"id": 59141, "name": "unknown", "code": "UnitTest.test('Arr.bind: binding an array of empty arrays with identity equals an empty array', () => {\n fc.assert(fc.property(fc.array(fc.constant([])), (arr) => {\n Assert.eq('bind empty arrays', [], Arr.bind(arr, Fun.identity), tArray(tNumber));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ArrBindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.bind` applied to an array of empty arrays with the identity function results in an empty array.", "mode": "fast-check"} {"id": 59142, "name": "unknown", "code": "UnitTest.test('Arr.bind: bind (pure .) is map', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), (arr, j) => {\n const f = (x: number) => x + j;\n Assert.eq('bind pure', Arr.map(arr, f), Arr.bind(arr, Fun.compose(Arr.pure, f)), tArray(tNumber));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ArrBindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.bind` applied with a function composed with `Arr.pure` behaves like `Arr.map`.", "mode": "fast-check"} {"id": 59143, "name": "unknown", "code": "UnitTest.test('Arr.bind: Monad Law: left identity', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), (i, j) => {\n const f = (x: number) => [ x, j, x + j ];\n Assert.eq('left id', f(i), Arr.bind(Arr.pure(i), f), tArray(tNumber));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ArrBindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.bind` satisfies the monad law of left identity, ensuring that binding a function `f` to a wrapped integer `i` yields the same result as directly applying `f` to `i`.", "mode": "fast-check"} {"id": 59151, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n hexaString({ minLength: 3, maxLength: 3 }),\n async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Editing is enabled for input values meeting validity requirements when uppercase hexadecimal strings of length 3 are used.", "mode": "fast-check"} {"id": 59154, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 0, max: 7 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Valid input values between 0 and 7 allow editing, as they ensure `checkValidity` returns true.", "mode": "fast-check"} {"id": 59164, "name": "unknown", "code": "it('edits bufTime attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 0 }).map(num => `${num}`),\n async bufTime => {\n inputs[6].value = bufTime;\n await (inputs[6]).requestUpdate();\n expect(inputs[6].checkValidity()).to.be.true;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `bufTime` attribute is edited only if the input is a valid non-negative integer string.", "mode": "fast-check"} {"id": 59171, "name": "unknown", "code": "it('rejects name attribute starting with decimals', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal, 1, 1), async name => {\n nameTextField.value = name;\n await nameTextField.requestUpdate();\n expect(nameTextField.checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/gsecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59172, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV4(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59173, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv4), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59174, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV4(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59175, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv4), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59176, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV4(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59177, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv4), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59179, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59181, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59183, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59198, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n nat({ max: 65535 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test confirms that the input field remains valid after setting it to any natural number up to 65535 and updating the element.", "mode": "fast-check"} {"id": 59193, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59195, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59199, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59201, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59203, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n nat({ max: 65535 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59204, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59205, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n nat({ max: 65535 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59206, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59207, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 1025, max: 65535 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59208, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59209, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV6(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59210, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv6), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59211, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV6SubNet(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59212, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9/]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59213, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV6(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59214, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv6), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59215, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n fc.hexaString({ minLength: 1, maxLength: 5 }),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59216, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n invertedRegex(/^[0-9a-fA-F]{1,5}$/),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59217, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n nat({ max: 255 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59218, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59219, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV6(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59220, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv6), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59221, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV4(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59222, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv4), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59223, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(regExp.OSI, 1, 2), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59224, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59225, "name": "unknown", "code": "it('edits name attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.abstractDataAttributeName, 1, 32),\n async name => {\n nameTextField.value = name;\n await nameTextField.requestUpdate();\n expect(nameTextField.checkValidity()).to.be.true;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/abstractda.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59226, "name": "unknown", "code": "it('rejects name attribute starting with decimals', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal, 1, 1), async name => {\n nameTextField.value = name;\n await nameTextField.requestUpdate();\n expect(nameTextField.checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/abstractda.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59227, "name": "unknown", "code": "it('for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.lnClass, 4, 4),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/editors/templates/lnodetype-wizard.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59228, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tName, 1), async name => {\n parent.wizardUI.inputs[0].value = name;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59229, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc), async desc => {\n parent.wizardUI.inputs[1].value = desc;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[1].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59230, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.unsigned, 1), async nomFreq => {\n parent.wizardUI.inputs[2].value = nomFreq;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[2].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59231, "name": "unknown", "code": "it('rejects action for invalid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.unsigned, 1),\n async nomFreq => {\n parent.wizardUI.inputs[2].value = nomFreq;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[2].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59232, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(fc.integer(1, 255), async numPhases => {\n parent.wizardUI.inputs[3].value = String(numPhases);\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[3].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59233, "name": "unknown", "code": "it('rejects edition for invalid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.integer, 1),\n async nomFreq => {\n parent.wizardUI.inputs[3].value = nomFreq;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[3].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59234, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal), async nomFreq => {\n parent.wizardUI.inputs[4].value = nomFreq;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[4].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59235, "name": "unknown", "code": "it('rejects edition for invalid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.decimal, 1),\n async voltage => {\n parent.wizardUI.inputs[4].value = voltage;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[4].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59236, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tName, 1), async name => {\n parent.wizardUI.inputs[0].value = name;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/integration/editors/substation/substation-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59237, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc), async desc => {\n parent.wizardUI.inputs[1].value = desc;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[1].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/integration/editors/substation/substation-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59238, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tName, 1), async name => {\n parent.wizardUI.inputs[1].value = name;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/integration/editors/substation/conducting-equipment-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59239, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc), async desc => {\n parent.wizardUI.inputs[2].value = desc;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[1].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/integration/editors/substation/conducting-equipment-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59240, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tName, 1), async name => {\n parent.wizardUI.inputs[0].value = name;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/integration/editors/substation/bay-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59241, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc), async desc => {\n parent.wizardUI.inputs[1].value = desc;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[1].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/integration/editors/substation/bay-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59242, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tName, 1), async name => {\n parent.wizardUI.inputs[0].value = name;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/integration/editors/communication/subnetwork-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59243, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc), async desc => {\n parent.wizardUI.inputs[1].value = desc;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[1].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/integration/editors/communication/subnetwork-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59244, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc, 1), async type => {\n parent.wizardUI.inputs[2].value = type;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[2].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/integration/editors/communication/subnetwork-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59245, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal), async BitRate => {\n parent.wizardUI.inputs[3].value = BitRate;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[3].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/integration/editors/communication/subnetwork-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59246, "name": "unknown", "code": "it('rejects edition for invalid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.decimal, 1),\n async BitRate => {\n parent.wizardUI.inputs[3].value = BitRate;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[3].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/integration/editors/communication/subnetwork-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59247, "name": "unknown", "code": "UnitTest.test('ShadowDom - SelectorFind.descendant', () => {\n if (SugarShadowDom.isSupported()) {\n fc.assert(fc.property(htmlBlockTagName(), htmlInlineTagName(), fc.hexaString(), (block, inline, text) => {\n withShadowElement((ss) => {\n const id = 'theid';\n const inner = SugarElement.fromHtml(`<${block}>

hello<${inline} id=\"${id}\">${text}

`);\n Insert.append(ss, inner);\n\n const frog: SugarElement = SelectorFind.descendant(ss, `#${id}`).getOrDie('Element not found');\n Assert.eq('textcontent', text, frog.dom.textContent);\n });\n }));\n }\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/sugar/src/test/ts/browser/ShadowDomTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59248, "name": "unknown", "code": "UnitTest.test('All valid floats are valid', () => {\n fc.assert(fc.property(fc.oneof(\n // small to medium floats\n fc.float(),\n // big floats\n fc.tuple(fc.float(), fc.integer(-20, 20)).map(([ mantissa, exponent ]) => mantissa * Math.pow(10, exponent))\n ), (num) => {\n const parsed = Dimension.parse(num.toString(), [ 'empty' ]).getOrDie();\n Assert.eq('Number is unchanged by stringifying and parsing', num, parsed.value);\n Assert.eq('Unit is empty', '', parsed.unit);\n return true;\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/sugar/src/test/ts/atomic/DimensionParseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59249, "name": "unknown", "code": "UnitTest.test('All valid integers are valid', () => {\n fc.assert(fc.property(fc.integer(), (num) => {\n const parsed = Dimension.parse(num.toString(), [ 'empty' ]).getOrDie();\n Assert.eq('Number is unchanged by stringifying and parsing', num, parsed.value);\n Assert.eq('Unit is empty', '', parsed.unit);\n return true;\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/sugar/src/test/ts/atomic/DimensionParseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59252, "name": "unknown", "code": "test('TINY-4773: AutoLink: multiple @ characters', (editor) => {\n fc.assert(fc.property(fc.hexaString(0, 30), fc.hexaString(0, 30), fc.hexaString(0, 30), (s1, s2, s3) => {\n assertNoLink(editor, `${s1}@@${s2}@.@${s3}`, `${s1}@@${s2}@.@${s3}`);\n }));\n })", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/tinymce/src/plugins/autolink/test/ts/browser/AutoLinkPluginTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59253, "name": "unknown", "code": "test('TINY-4773: AutoLink: ending in @ character', (editor) => {\n fc.assert(fc.property(fc.hexaString(0, 100), (s1) => {\n assertNoLink(editor, `${s1}@`, `${s1}@`);\n }));\n })", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/tinymce/src/plugins/autolink/test/ts/browser/AutoLinkPluginTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59254, "name": "unknown", "code": "promiseTest('LazyValue: pure', () =>\n fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n LazyValue.pure(i).get((v) => {\n eqAsync('LazyValue.pure', i, v, reject);\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/async/LazyValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59255, "name": "unknown", "code": "promiseTest('LazyValue: pure, map', () =>\n fc.assert(fc.asyncProperty(fc.integer(), fc.func(fc.string()), (i, f) => new Promise((resolve, reject) => {\n LazyValue.pure(i).map(f).get((v) => {\n eqAsync('LazyValue.map', f(i), v, reject);\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/async/LazyValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59256, "name": "unknown", "code": "promiseTest('LazyValue: delayed, map', () =>\n fc.assert(fc.asyncProperty(fc.integer(), fc.func(fc.string()), (i, f) => new Promise((resolve, reject) => {\n LazyValue.nu((c) => {\n setTimeout(() => {\n c(i);\n }, 2);\n }).map(f).get((v) => {\n eqAsync('LazyValue.map', f(i), v, reject);\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/async/LazyValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59257, "name": "unknown", "code": "promiseTest('LazyValue: parallel spec', () => fc.assert(fc.asyncProperty(fc.array(fc.integer(), 0, 20), (vals) => new Promise((resolve, reject) => {\n const lazyVals = Arr.map(vals, LazyValue.pure);\n LazyValues.par(lazyVals).get((actual) => {\n eqAsync('pars', vals, actual, reject);\n resolve();\n });\n}))))", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/async/LazyValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59258, "name": "unknown", "code": "promiseTest('Future: pure get', () =>\n fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n Future.pure(i).get((ii) => {\n eqAsync('pure get', i, ii, reject, tNumber);\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59259, "name": "unknown", "code": "promiseTest('Future: future soon get', () =>\n fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n Future.nu((cb) => {\n setTimeout(() => {\n cb(i);\n }, 3);\n }).get((ii) => {\n eqAsync('get', i, ii, reject, tNumber);\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59260, "name": "unknown", "code": "promiseTest('Future: map', () =>\n fc.assert(fc.asyncProperty(fc.integer(), fc.func(fc.string()), (i, f) => new Promise((resolve, reject) => {\n Future.pure(i).map(f).get((ii) => {\n eqAsync('get', f(i), ii, reject, tString);\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59261, "name": "unknown", "code": "promiseTest('Future: bind', () =>\n fc.assert(fc.asyncProperty(fc.integer(), fc.func(fc.string()), (i, f) => new Promise((resolve, reject) => {\n Future.pure(i).bind(Fun.compose(Future.pure, f)).get((ii) => {\n eqAsync('get', f(i), ii, reject, tString);\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59262, "name": "unknown", "code": "promiseTest('Future: anonBind', () =>\n fc.assert(fc.asyncProperty(fc.integer(), fc.string(), (i, s) => new Promise((resolve, reject) => {\n Future.pure(i).anonBind(Future.pure(s)).get((ii) => {\n eqAsync('get', s, ii, reject, tString);\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59263, "name": "unknown", "code": "promiseTest('Future: parallel spec', () =>\n fc.assert(fc.asyncProperty(fc.array(fc.tuple(fc.integer(1, 10), fc.integer())), (tuples) => new Promise((resolve, reject) => {\n Futures.par(Arr.map(tuples, ([ timeout, value ]) => Future.nu((cb) => {\n setTimeout(() => {\n cb(value);\n }, timeout);\n }))).get((ii) => {\n eqAsync('pars', tuples.map(([ _, i ]) => i), ii, reject, tArray(tNumber));\n resolve();\n });\n })))\n)", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59264, "name": "unknown", "code": "promiseTest('Future: mapM spec', () =>\n fc.assert(fc.asyncProperty(fc.array(fc.tuple(fc.integer(1, 10), fc.integer())), (tuples) => new Promise((resolve, reject) => {\n Futures.mapM(tuples, ([ timeout, value ]) => Future.nu((cb) => {\n setTimeout(() => {\n cb(value);\n }, timeout);\n })).get((ii) => {\n eqAsync('pars', tuples.map(([ _, i ]) => i), ii, reject, tArray(tNumber));\n resolve();\n });\n })))\n)", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59265, "name": "unknown", "code": "promiseTest('FutureResult: nu', () => fc.assert(fc.asyncProperty(arbResult(fc.integer(), fc.integer()), (r) => new Promise((resolve, reject) => {\n FutureResult.nu((completer) => {\n completer(r);\n }).get((ii) => {\n eqAsync('eq', r, ii, reject, tResult());\n resolve();\n });\n}))))", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59266, "name": "unknown", "code": "promiseTest('FutureResult: fromFuture', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.fromFuture(Future.pure(i)).get((ii) => {\n eqAsync('eq', Result.value(i), ii, reject, tResult());\n resolve();\n });\n}))))", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59267, "name": "unknown", "code": "promiseTest('FutureResult: wrap get', () => fc.assert(fc.asyncProperty(arbResult(fc.integer(), fc.integer()), (r) => new Promise((resolve, reject) => {\n FutureResult.wrap(Future.pure(r)).get((ii) => {\n eqAsync('eq', r, ii, reject, tResult());\n resolve();\n });\n}))))", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59268, "name": "unknown", "code": "promiseTest('FutureResult: fromResult get', () => fc.assert(fc.asyncProperty(arbResult(fc.integer(), fc.integer()), (r) => new Promise((resolve, reject) => {\n FutureResult.fromResult(r).get((ii) => {\n eqAsync('eq', r, ii, reject, tResult());\n resolve();\n });\n}))))", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59269, "name": "unknown", "code": "promiseTest('FutureResult: pure get', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.pure(i).get((ii) => {\n eqAsync('eq', Result.value(i), ii, reject, tResult());\n resolve();\n });\n}))))", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59270, "name": "unknown", "code": "promiseTest('FutureResult: value get', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.value(i).get((ii) => {\n eqAsync('eq', Result.value(i), ii, reject, tResult());\n resolve();\n });\n}))))", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59271, "name": "unknown", "code": "promiseTest('FutureResult: error get', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.error(i).get((ii) => {\n eqAsync('eq', Result.error(i), ii, reject, tResult());\n resolve();\n });\n}))))", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59272, "name": "unknown", "code": "promiseTest('FutureResult: value mapResult', () => {\n const f = (x) => x + 3;\n return fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.value(i).mapResult(f).get((ii) => {\n eqAsync('eq', Result.value(f(i)), ii, reject, tResult());\n resolve();\n });\n })));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59273, "name": "unknown", "code": "promiseTest('FutureResult: error mapResult', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.error(i).mapResult(Fun.die('\u22a5')).get((ii) => {\n eqAsync('eq', Result.error(i), ii, reject, tResult());\n resolve();\n });\n}))))", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59274, "name": "unknown", "code": "promiseTest('FutureResult: value mapError', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.value(i).mapError(Fun.die('\u22a5')).get((ii) => {\n eqAsync('eq', Result.value(i), ii, reject, tResult());\n resolve();\n });\n}))))", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59275, "name": "unknown", "code": "promiseTest('FutureResult: err mapError', () => {\n const f = (x) => x + 3;\n return fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.error(i).mapError(f).get((ii) => {\n eqAsync('eq', Result.error(f(i)), ii, reject, tResult());\n resolve();\n });\n })));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59276, "name": "unknown", "code": "promiseTest('FutureResult: value bindFuture value', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n const f = (x) => x % 4;\n FutureResult.value(i).bindFuture((x) => FutureResult.value(f(x))).get((actual) => {\n eqAsync('bind result', Result.value(f(i)), actual, reject, tResult(tNumber));\n resolve();\n });\n}))))", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59277, "name": "unknown", "code": "promiseTest('FutureResult: bindFuture: value bindFuture error', () => fc.assert(fc.asyncProperty(fc.integer(), fc.string(), (i, s) => new Promise((resolve, reject) => {\n FutureResult.value(i).bindFuture(() => FutureResult.error(s)).get((actual) => {\n eqAsync('bind result', Result.error(s), actual, reject, tResult(tNumber));\n resolve();\n });\n}))))", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59278, "name": "unknown", "code": "promiseTest('FutureResult: error bindFuture', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.error(i).bindFuture(Fun.die('\u22a5')).get((actual) => {\n eqAsync('bind result', Result.error(i), actual, reject, tResult(tNumber));\n resolve();\n });\n}))))", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59279, "name": "unknown", "code": "UnitTest.test('Error is thrown if not all arguments are supplied', () => {\n fc.assert(fc.property(arbAdt, fc.array(arbKeys, 1, 40), (subject, exclusions) => {\n const original = Arr.filter(allKeys, (k) => !Arr.contains(exclusions, k));\n\n try {\n const branches = Arr.mapToObject(original, () => Fun.identity);\n subject.match(branches);\n return false;\n } catch (err) {\n return err.message.indexOf('nothing') > -1;\n }\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59280, "name": "unknown", "code": "UnitTest.test('adt.nothing.match should pass [ ]', () => {\n fc.assert(fc.property(arbNothing, (subject) => {\n const contents = subject.match({\n nothing: record,\n unknown: Fun.die('should not be unknown'),\n exact: Fun.die('should not be exact')\n });\n Assert.eq('eq', [], contents);\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59281, "name": "unknown", "code": "UnitTest.test('adt.nothing.match should be same as fold', () => {\n fc.assert(fc.property(arbNothing, (subject) => {\n const matched = subject.match({\n nothing: record,\n unknown: Fun.die('should not be unknown'),\n exact: Fun.die('should not be exact')\n });\n\n const folded = subject.fold(record, Fun.die('should not be unknown'), Fun.die('should not be exact'));\n Assert.eq('eq', matched, folded);\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59282, "name": "unknown", "code": "UnitTest.test('adt.unknown.match should pass 1 parameter: [ guesses ]', () => {\n fc.assert(fc.property(arbUnknown, (subject) => {\n const contents = subject.match({\n nothing: Fun.die('should not be nothing'),\n unknown: record,\n exact: Fun.die('should not be exact')\n });\n Assert.eq('eq', 1, contents.length);\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59283, "name": "unknown", "code": "UnitTest.test('adt.unknown.match should be same as fold', () => {\n fc.assert(fc.property(arbUnknown, (subject) => {\n const matched = subject.match({\n nothing: Fun.die('should not be nothing'),\n unknown: record,\n exact: Fun.die('should not be exact')\n });\n\n const folded = subject.fold(Fun.die('should not be nothing'), record, Fun.die('should not be exact'));\n Assert.eq('eq', matched, folded);\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59284, "name": "unknown", "code": "UnitTest.test('adt.exact.match should pass 2 parameters [ value, precision ]', () => {\n fc.assert(fc.property(arbExact, (subject) => {\n const contents = subject.match({\n nothing: Fun.die('should not be nothing'),\n unknown: Fun.die('should not be unknown'),\n exact: record\n });\n Assert.eq('eq', 2, contents.length);\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59285, "name": "unknown", "code": "UnitTest.test('adt.exact.match should be same as fold', () => {\n fc.assert(fc.property(arbExact, (subject) => {\n const matched = subject.match({\n nothing: Fun.die('should not be nothing'),\n unknown: Fun.die('should not be unknown'),\n exact: record\n });\n\n const folded = subject.fold(Fun.die('should not be nothing'), Fun.die('should not be unknown'), record);\n Assert.eq('eq', matched, folded);\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59286, "name": "unknown", "code": "UnitTest.test('adt.match must have the right arguments, not just the right number', () => {\n fc.assert(fc.property(arbAdt, (subject) => {\n try {\n subject.match({\n not: Fun.identity,\n the: Fun.identity,\n right: Fun.identity\n });\n return false;\n } catch (err) {\n return err.message.indexOf('nothing') > -1;\n }\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59287, "name": "unknown", "code": "UnitTest.test('Cell: cell(x).get() === x', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n const cell = Cell(i);\n Assert.eq('eq', i, cell.get());\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/struct/CellTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59288, "name": "unknown", "code": "UnitTest.test('Cell: cell.get() === last set call', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), fc.integer(), (a, b, c) => {\n const cell = Cell(a);\n Assert.eq('a', a, cell.get());\n cell.set(b);\n Assert.eq('b', b, cell.get());\n cell.set(c);\n Assert.eq('c', c, cell.get());\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/struct/CellTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59298, "name": "unknown", "code": "UnitTest.test('removeLeading removes prefix', () => {\n fc.assert(fc.property(\n fc.asciiString(),\n fc.asciiString(),\n (prefix, suffix) => {\n Assert.eq('removeLeading', suffix, Strings.removeLeading(prefix + suffix, prefix));\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/str/RemoveLeadingTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `removeLeading` should remove the specified prefix from the beginning of a string, leaving the suffix unchanged.", "mode": "fast-check"} {"id": 59299, "name": "unknown", "code": "UnitTest.test('ensureTrailing is identity if string already ends with suffix', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(),\n function (prefix, suffix) {\n const s = prefix + suffix;\n Assert.eq('id', s, Strings.ensureTrailing(s, suffix));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/str/EnsureTrailingTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Strings.ensureTrailing` should return the original string if it already ends with the specified suffix.", "mode": "fast-check"} {"id": 59301, "name": "unknown", "code": "UnitTest.test('startsWith a prefix', () => {\n fc.assert(fc.property(fc.string(), fc.string(),\n (prefix, suffix) => Strings.startsWith(prefix + suffix, prefix)\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/str/EnsureLeadingTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "A string concatenated with a prefix should be verified to start with that prefix.", "mode": "fast-check"} {"id": 59310, "name": "unknown", "code": "UnitTest.test('StringMatch.matches(StringMatch.contains(s1), s1 + s) === true', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(),\n (s, s1) => {\n Assert.eq('eq', true, StringMatch.matches(\n StringMatch.contains(s1, StringMatch.caseInsensitive),\n s1 + s\n ));\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`StringMatch.matches` should return true when using `StringMatch.contains` with a case-insensitive match of `s1` and the string `s1 + s`.", "mode": "fast-check"} {"id": 59311, "name": "unknown", "code": "UnitTest.test('StringMatch.matches(StringMatch.contains(s1), s + s1) === true', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(),\n (s, s1) => {\n Assert.eq('eq', true, StringMatch.matches(\n StringMatch.contains(s1, StringMatch.caseInsensitive),\n s + s1\n ));\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`StringMatch.matches` returns true when using `StringMatch.contains` with a case-insensitive match for `s1` appended to any string `s`.", "mode": "fast-check"} {"id": 59312, "name": "unknown", "code": "UnitTest.test('StringMatch.matches(StringMatch.contains(s1), s) === s.indexOf(s1)', () => {\n fc.assert(fc.property(\n fc.asciiString(),\n fc.asciiString(1, 40),\n (s, s1) => {\n Assert.eq('eq', s.toLowerCase().indexOf(s1.toLowerCase()) > -1, StringMatch.matches(\n StringMatch.contains(s1, StringMatch.caseInsensitive),\n s\n ));\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`StringMatch.matches(StringMatch.contains(s1))` should return true if and only if `s.indexOf(s1)` is greater than -1, indicating that `s1` is a substring of `s`, ignoring case.", "mode": "fast-check"} {"id": 59313, "name": "unknown", "code": "UnitTest.test('StringMatch.matches(StringMatch.contains(s), s) === true', () => {\n fc.assert(fc.property(\n fc.string(),\n (s) => {\n Assert.eq('eq', true, StringMatch.matches(\n StringMatch.contains(s, StringMatch.caseInsensitive),\n s\n ));\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`StringMatch.matches` should return true when using `StringMatch.contains` with a string in a case-insensitive manner.", "mode": "fast-check"} {"id": 59308, "name": "unknown", "code": "UnitTest.test('capitalize: head is uppercase', () => {\n fc.assert(fc.property(fc.ascii(), fc.asciiString(30), (h, t) => {\n const actualH = Strings.capitalize(h + t).charAt(0);\n Assert.eq('head is uppercase', h.toUpperCase(), actualH, tString);\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/str/CapitalizeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59324, "name": "unknown", "code": "UnitTest.test('Optionals.cat of nones.concat(somes).concat(nones) should be somes', () => {\n fc.assert(fc.property(\n fc.array(fc.json()),\n fc.array(fc.json()),\n fc.array(fc.json()),\n (before, on, after) => {\n const beforeNones = Arr.map(before, Optional.none);\n const afterNones = Arr.map(after, Optional.none);\n const onSomes = Arr.map(on, Optional.some);\n const output = Optionals.cat(beforeNones.concat(onSomes).concat(afterNones));\n Assert.eq('eq', on, output);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optionals.cat` should return only the elements wrapped in `Optional.some`, ignoring those wrapped in `Optional.none`.", "mode": "fast-check"} {"id": 59326, "name": "unknown", "code": "UnitTest.test('Optionals.someIf: true -> some', () => {\n fc.assert(fc.property(fc.integer(), (n) => {\n Assert.eq('eq', Optional.some(n), Optionals.someIf(true, n), tOptional());\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalsSomeIfTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optionals.someIf` should return `Optional.some(n)` when the condition is true.", "mode": "fast-check"} {"id": 59327, "name": "unknown", "code": "UnitTest.test('Optionals.sequence: Single some value', () => {\n fc.assert(fc.property(fc.integer(), (n) => {\n Assert.eq('eq', Optional.some([ n ]), Optionals.sequence([ Optional.some(n) ]), tOptional());\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalsSequenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optionals.sequence` converts an array containing a single `Optional.some` value into an `Optional.some` of an array with that value.", "mode": "fast-check"} {"id": 59328, "name": "unknown", "code": "UnitTest.test('Optionals.sequence: Two some values', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), (n, m) => {\n Assert.eq('eq', Optional.some([ n, m ]), Optionals.sequence([ Optional.some(n), Optional.some(m) ]), tOptional());\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalsSequenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optionals.sequence` constructs a single `Optional` containing an array of values when given a sequence of `Optional` instances, all containing values.", "mode": "fast-check"} {"id": 59329, "name": "unknown", "code": "UnitTest.test('Optionals.sequence: Array of numbers', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (n) => {\n const someNumbers = Arr.map(n, (x) => Optional.some(x));\n Assert.eq('eq', Optional.some(n), Optionals.sequence(someNumbers), tOptional());\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalsSequenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optionals.sequence` converts an array of `Optional` numbers back into an `Optional` array of numbers.", "mode": "fast-check"} {"id": 59336, "name": "unknown", "code": "UnitTest.test('Optional.some(x) === Optional.some(x)', () => {\n fc.assert(fc.property(fc.integer(), (i) => Assert.eq('eq', true, Optional.some(i).equals(Optional.some(i)))));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optional.some(x).equals(Optional.some(x))` should return true for any integer `x`.", "mode": "fast-check"} {"id": 59337, "name": "unknown", "code": "UnitTest.test('Optional.some(x) === Optional.some(x) (same ref)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n const ob = Optional.some(i);\n Assert.eq('eq', true, ob.equals(ob));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optional.some(x)` is equal to itself when the reference is the same.", "mode": "fast-check"} {"id": 59342, "name": "unknown", "code": "UnitTest.test('Checking some(x).equals_(some(y), _, _ -> true) === true', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), (a, b) => {\n const opt1 = Optional.some(a);\n const opt2 = Optional.some(b);\n Assert.eq('eq', true, opt1.equals_(opt2, Fun.always));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optional.some(x).equals_(Optional.some(y), _, _ -> true)` should return true.", "mode": "fast-check"} {"id": 59343, "name": "unknown", "code": "UnitTest.test('Checking some(x).equals_(some(y), f) iff. f(x, y)', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), arbOptionSome(fc.integer()), fc.func(fc.boolean()), (a, b, f) => {\n const opt1 = Optional.some(a);\n const opt2 = Optional.some(b);\n return f(a, b) === opt1.equals_(opt2, f);\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Two `Optional.some` objects are equal using a comparator function `f` if and only if `f` applied to their values returns true.", "mode": "fast-check"} {"id": 59357, "name": "unknown", "code": "UnitTest.test('Checking some(x).exists(_ -> false) === false', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => !opt.exists(Fun.never)));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`some(x).exists(_ -> false)` should always return false for any integer wrapped in an `opt`.", "mode": "fast-check"} {"id": 59358, "name": "unknown", "code": "UnitTest.test('Checking some(x).exists(_ -> true) === true', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => opt.exists(Fun.always)));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`opt.exists(Fun.always)` should always return true for `some(x)`.", "mode": "fast-check"} {"id": 59346, "name": "unknown", "code": "UnitTest.test('Checking some(x).isSome === true', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => opt.isSome()));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59347, "name": "unknown", "code": "UnitTest.test('Checking some(x).isNone === false', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => !opt.isNone()));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59359, "name": "unknown", "code": "UnitTest.test('Checking some(x).exists(f) iff. f(x)', () => {\n fc.assert(fc.property(fc.integer(), fc.func(fc.boolean()), (i, f) => {\n const opt = Optional.some(i);\n if (f(i)) {\n Assert.eq('eq', true, opt.exists(f));\n } else {\n Assert.eq('eq', false, opt.exists(f));\n }\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optional.some(x).exists(f)` should return true if and only if the function `f(x)` returns true.", "mode": "fast-check"} {"id": 59360, "name": "unknown", "code": "UnitTest.test('Checking some(x).forall(_ -> false) === false', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => !opt.forall(Fun.never)));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`some(x).forall(_ -> false)` should always evaluate to false when using `OptionalSome`.", "mode": "fast-check"} {"id": 59354, "name": "unknown", "code": "UnitTest.test('Checking some(x).each(f) === undefined and f gets x', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => {\n let hack: number | null = null;\n const actual = opt.each((x) => {\n hack = x;\n });\n Assert.eq('eq', undefined, actual);\n Assert.eq('hack', hack, opt.getOrDie());\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59361, "name": "unknown", "code": "UnitTest.test('Checking some(x).forall(_ -> true) === true', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => opt.forall(Fun.always)));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`opt.forall(Fun.always)` should return true for `some(x)` with any integer value `x`.", "mode": "fast-check"} {"id": 59370, "name": "unknown", "code": "UnitTest.test('Checking none.or(oSomeValue) === oSomeValue', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n const output = Optional.none().or(Optional.some(i));\n Assert.eq('eq', true, output.is(i));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optional.none().or(Optional.some(i))` should produce an `Optional` containing the value `i`.", "mode": "fast-check"} {"id": 59374, "name": "unknown", "code": "UnitTest.test('Optional.getOr', () => {\n fc.assert(fc.property(fc.integer(), (x) => {\n Assert.eq('none', x, Optional.none().getOr(x));\n Assert.eq('none', x, Optional.none().getOrThunk(() => x));\n }));\n fc.assert(fc.property(fc.integer(), fc.integer(), (x, y) => {\n Assert.eq('some', x, Optional.some(x).getOr(y));\n Assert.eq('some', x, Optional.some(x).getOrThunk(Fun.die('boom')));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalGetOrTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optional.getOr` should return the provided value for `Optional.none`, and the wrapped value for `Optional.some`; `Optional.getOrThunk` should behave similarly but take a function returning the alternative value.", "mode": "fast-check"} {"id": 59379, "name": "unknown", "code": "UnitTest.test('ResultInstances.eq: value(x) = value(x)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.eq(\n 'results should be equal',\n Result.value(i),\n Result.value(i),\n tResult(tNumber, tString)\n );\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/ResultInstancesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59380, "name": "unknown", "code": "UnitTest.test('ResultInstances.eq: error(x) = error(x)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.eq(\n 'results should be equal',\n Result.error(i),\n Result.error(i),\n tResult(tString, tNumber)\n );\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/ResultInstancesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59381, "name": "unknown", "code": "UnitTest.test('ResultInstances.eq: value(a) != error(e)', () => {\n fc.assert(fc.property(fc.integer(), fc.string(), (a, e) => {\n Assert.eq(\n 'results should not be equal #1',\n false,\n tResult(tNumber, tString).eq(\n Result.value(a),\n Result.error(e)\n ));\n\n Assert.eq(\n 'results should not be equal #2',\n false,\n tResult(tNumber, tString).eq(\n Result.error(e),\n Result.value(a)\n ));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/ResultInstancesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59382, "name": "unknown", "code": "UnitTest.test('ResultInstances.eq: (a = b) = (value(a) = value(b))', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), (a, b) => {\n Assert.eq(\n 'eq',\n a === b,\n tResult(tNumber, tString).eq(\n Result.value(a),\n Result.value(b)\n ));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/ResultInstancesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59383, "name": "unknown", "code": "UnitTest.test('ResultInstances.eq: (a = b) = (error(a) = error(b))', () => {\n fc.assert(fc.property(fc.string(), fc.string(), (a, b) => {\n Assert.eq(\n 'eq',\n a === b,\n tResult(tNumber, tString).eq(\n Result.error(a),\n Result.error(b)\n ));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/ResultInstancesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59384, "name": "unknown", "code": "UnitTest.test('ResultInstances.pprint', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.eq('pprint value',\n `Result.value(\n ${i}\n)`,\n Pprint.render(Result.value(i), tResult(tNumber, tString))\n );\n\n Assert.eq('pprint error',\n `Result.error(\n ${i}\n)`,\n Pprint.render(Result.error(i), tResult(tString, tNumber))\n );\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/ResultInstancesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59385, "name": "unknown", "code": "UnitTest.test('Obj.map: map id obj = obj', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.integer()), (obj) => {\n const actual = Obj.map(obj, Fun.identity);\n Assert.eq('map id', obj, actual);\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/obj/ObjMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59386, "name": "unknown", "code": "UnitTest.test('map constant obj means that values(obj) are all the constant', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.integer()), fc.integer(), (obj, x) => {\n const output = Obj.map(obj, Fun.constant(x));\n const values = Obj.values(output);\n return Arr.forall(values, (v) => v === x);\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/obj/ObjMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59387, "name": "unknown", "code": "UnitTest.test('tupleMap obj (x, i) -> { k: i, v: x }', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.integer()), (obj) => {\n const output = Obj.tupleMap(obj, (x, i) => ({ k: i, v: x }));\n Assert.eq('tupleMap', obj, output);\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/obj/ObjMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59388, "name": "unknown", "code": "UnitTest.test('mapToArray is symmetric with tupleMap', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.integer()), (obj) => {\n const array = Obj.mapToArray(obj, (x, i) => ({ k: i, v: x }));\n\n const aKeys = Arr.map(array, (x) => x.k);\n const aValues = Arr.map(array, (x) => x.v);\n\n const keys = Obj.keys(obj);\n const values = Obj.values(obj);\n\n Assert.eq('same keys', Arr.sort(keys), Arr.sort(aKeys));\n Assert.eq('same values', Arr.sort(values), Arr.sort(aValues));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/obj/ObjMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59389, "name": "unknown", "code": "UnitTest.test('Obj.isEmpty: single key/value', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.json(),\n (k: string, v: any) => {\n const o = { [k]: v };\n Assert.eq('eq', false, Obj.isEmpty(o));\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/obj/ObjIsEmptyTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59390, "name": "unknown", "code": "UnitTest.test('the value found by find always passes predicate', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(), fc.json()),\n fc.func(fc.boolean()),\n function (obj, pred) {\n // It looks like the way that fc.fun works is it cares about all of its arguments, so therefore\n // we have to only pass in one if we want it to be deterministic. Just an assumption\n const value = Obj.find(obj, function (v) {\n return pred(v);\n });\n return value.fold(function () {\n const values = Obj.values(obj);\n return !Arr.exists(values, function (v) {\n return pred(v);\n });\n }, function (v) {\n return pred(v);\n });\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/obj/ObjFindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59392, "name": "unknown", "code": "UnitTest.test('If object is empty, find is always none', () => {\n fc.assert(fc.property(\n fc.func(fc.boolean()),\n function (pred) {\n const value = Obj.find({ }, pred);\n return value.isNone();\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/obj/ObjFindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59394, "name": "unknown", "code": "UnitTest.test('Each + set should equal the same object', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(), fc.json()),\n function (obj: Record) {\n const values = { };\n const output = Obj.each(obj, function (x, i) {\n values[i] = x;\n });\n Assert.eq('eq', obj, values);\n Assert.eq('output', undefined, output);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/obj/ObjEachTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59395, "name": "unknown", "code": "UnitTest.test('Merged with identity on left', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), function (obj) {\n Assert.eq('eq', obj, Merger.merge({}, obj));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59396, "name": "unknown", "code": "UnitTest.test('Merged with identity on right', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), function (obj) {\n Assert.eq('eq', obj, Merger.merge(obj, {}));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59397, "name": "unknown", "code": "UnitTest.test('Merged with itself is itself', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), function (obj) {\n Assert.eq('eq', obj, Merger.merge(obj, obj));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59398, "name": "unknown", "code": "UnitTest.test('Merge(a, Merge(b, c)) === Merge(Merge(a, b), c)', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), fc.dictionary(fc.asciiString(), fc.json()), fc.dictionary(fc.asciiString(), fc.json()), function (a, b, c) {\n const one = Merger.merge(a, Merger.merge(b, c));\n const other = Merger.merge(Merger.merge(a, b), c);\n Assert.eq('eq', one, other);\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59399, "name": "unknown", "code": "UnitTest.test('Merge(a, b) contains all the keys of b', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), fc.dictionary(fc.asciiString(), fc.json()), function (a, b) {\n const output = Merger.merge(a, b);\n const keys = Obj.keys(b);\n const oKeys = Obj.keys(output);\n return Arr.forall(keys, function (k) {\n return Arr.contains(oKeys, k);\n });\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59400, "name": "unknown", "code": "UnitTest.test('Deep-merged with identity on left', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), function (obj) {\n Assert.eq('eq', obj, Merger.deepMerge({}, obj));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59401, "name": "unknown", "code": "UnitTest.test('Deep-merged with identity on right', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), function (obj) {\n Assert.eq('eq', obj, Merger.deepMerge(obj, {}));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59402, "name": "unknown", "code": "UnitTest.test('Deep-merged with itself is itself', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), function (obj) {\n Assert.eq('eq', obj, Merger.deepMerge(obj, obj));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59403, "name": "unknown", "code": "UnitTest.test('Deep-merge(a, Deep-merge(b, c)) === Deep-merge(Deep-merge(a, b), c)', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), fc.dictionary(fc.asciiString(), fc.json()), fc.dictionary(fc.asciiString(), fc.json()), function (a, b, c) {\n const one = Merger.merge(a, Merger.merge(b, c));\n const other = Merger.merge(Merger.merge(a, b), c);\n Assert.eq('eq', one, other);\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59404, "name": "unknown", "code": "UnitTest.test('Deep-merge(a, b) contains all the keys of b', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), fc.dictionary(fc.asciiString(), fc.json()), function (a, b) {\n const output = Merger.deepMerge(a, b);\n const keys = Obj.keys(b);\n const oKeys = Obj.keys(output);\n return Arr.forall(keys, function (k) {\n return Arr.contains(oKeys, k);\n });\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59407, "name": "unknown", "code": "UnitTest.test('Check that everything in f fails predicate and everything in t passes predicate', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(1, 30), fc.integer()),\n (obj) => {\n const predicate = (x) => x % 2 === 0;\n const output = Obj.bifilter(obj, predicate);\n\n const matches = (k) => predicate(obj[k]);\n\n const falseKeys = Obj.keys(output.f);\n const trueKeys = Obj.keys(output.t);\n\n Assert.eq('Something in \"f\" passed predicate', false, Arr.exists(falseKeys, matches));\n Assert.eq('Something in \"t\" failed predicate', true, Arr.forall(trueKeys, matches));\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/obj/BiFilterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59408, "name": "unknown", "code": "UnitTest.test('Checking that creating a namespace (forge) from an obj will enable that value to be retrieved by resolving (path)', () => {\n fc.assert(fc.property(\n // NOTE: This value is being modified, so it cannot be shrunk.\n fc.dictionary(fc.asciiString(),\n // We want to make sure every path in the object is an object\n // also, because that is a limitation of forge.\n fc.dictionary(fc.asciiString(),\n fc.dictionary(fc.asciiString(), fc.constant({}))\n )\n ),\n fc.array(fc.asciiString(1, 30), 1, 40),\n fc.asciiString(1, 30),\n fc.asciiString(1, 30),\n function (dict, parts, field, newValue) {\n const created = Resolve.forge(parts, dict);\n created[field] = newValue;\n const resolved = Resolve.path(parts.concat([ field ]), dict);\n Assert.eq(\n 'Checking that namespace works with resolve',\n newValue,\n resolved\n );\n }\n ), { endOnFailure: true });\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/obj/ResolveTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59409, "name": "unknown", "code": "UnitTest.test('Num.clamp', () => {\n fc.assert(fc.property(\n fc.nat(1000),\n fc.nat(1000),\n fc.nat(1000),\n (a, b, c) => {\n const low = a;\n const med = low + b;\n const high = med + c;\n // low <= med <= high\n Assert.eq('Number should be unchanged when item is within bounds', med, Num.clamp(med, low, high));\n Assert.eq('Number should snap to min', med, Num.clamp(med, low, high));\n Assert.eq('Number should snap to max', med, Num.clamp(high, low, med));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/num/NumClampTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59410, "name": "unknown", "code": "UnitTest.test('CycleBy should have an adjustment of delta, or be the min or max', () => {\n fc.assert(fc.property(\n fc.nat(),\n fc.integer(),\n fc.nat(),\n fc.nat(),\n (value, delta, min, range) => {\n const max = min + range;\n const actual = Num.cycleBy(value, delta, min, max);\n return (actual - value) === delta || actual === min || actual === max;\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/num/NumCycleByTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59411, "name": "unknown", "code": "UnitTest.test('CycleBy 0 has no effect', () => {\n fc.assert(fc.property(fc.nat(), fc.nat(), (value, delta) => {\n const actual = Num.cycleBy(value, 0, value, value + delta);\n Assert.eq('eq', value, actual);\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/num/NumCycleByTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59412, "name": "unknown", "code": "UnitTest.test('CycleBy delta is max', () => {\n fc.assert(fc.property(fc.nat(), fc.nat(), (value, delta) => {\n const max = value + delta;\n const actual = Num.cycleBy(value, delta, value, max);\n Assert.eq('eq', max, actual);\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/num/NumCycleByTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59413, "name": "unknown", "code": "UnitTest.test('Check that values should be empty and errors should be all if we only generate errors', () => {\n fc.assert(fc.property(\n fc.array(arbResultError(fc.integer())),\n function (resErrors) {\n const actual = Results.partition(resErrors);\n if (actual.values.length !== 0) {\n Assert.fail('Values length should be 0');\n } else if (resErrors.length !== actual.errors.length) {\n Assert.fail('Errors length should be ' + resErrors.length);\n }\n return true;\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59414, "name": "unknown", "code": "UnitTest.test('Check that errors should be empty and values should be all if we only generate values', () => {\n fc.assert(fc.property(\n fc.array(arbResultValue(fc.integer())),\n function (resValues) {\n const actual = Results.partition(resValues);\n if (actual.errors.length !== 0) {\n Assert.fail('Errors length should be 0');\n } else if (resValues.length !== actual.values.length) {\n Assert.fail('Values length should be ' + resValues.length);\n }\n return true;\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59415, "name": "unknown", "code": "UnitTest.test('Check that the total number of values and errors matches the input size', () => {\n fc.assert(fc.property(\n fc.array(arbResult(fc.integer(), fc.string())),\n function (results) {\n const actual = Results.partition(results);\n Assert.eq('Total number should match size of input', results.length, actual.errors.length + actual.values.length);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59420, "name": "unknown", "code": "UnitTest.test('Results.unite', () => {\n fc.assert(fc.property(fc.integer(), (a) => {\n Assert.eq('should be error', a, Results.unite(Result.error(a)));\n Assert.eq('should be value', a, Results.unite(Result.value(a)));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The method `Results.unite` should return the input number regardless of whether it is wrapped as an error or a value.", "mode": "fast-check"} {"id": 59424, "name": "unknown", "code": "UnitTest.test('Checking value.getOr(v) === value.value', () => {\n fc.assert(fc.property(fc.integer(), (a) => {\n Assert.eq('eq', a, Result.value(a).getOr(a));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures that `Result.value(a).getOr(a)` returns the value `a`.", "mode": "fast-check"} {"id": 59428, "name": "unknown", "code": "UnitTest.test('Checking value.orThunk(die) does not throw', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), (res) => {\n res.orThunk(Fun.die('dies'));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`orThunk(die)` function executes without throwing an error when applied to `arbResultValue` containing integers.", "mode": "fast-check"} {"id": 59430, "name": "unknown", "code": "UnitTest.test('Checking value.map(f) === f(value.getOrDie())', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), fc.func(fc.json()), (res, f) => {\n Assert.eq('eq', res.map(f).getOrDie(), f(res.getOrDie()));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`value.map(f)` should equal `f(value.getOrDie())` for a given result value and function `f`.", "mode": "fast-check"} {"id": 59431, "name": "unknown", "code": "UnitTest.test('Checking value.each(f) === undefined', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), fc.func(fc.json()), (res, f) => {\n const actual = res.each(f);\n Assert.eq('eq', undefined, actual);\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59432, "name": "unknown", "code": "UnitTest.test('Given f :: s -> RV, checking value.bind(f).getOrDie() === f(value.getOrDie()).getOrDie()', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), fc.func(arbResultValue(fc.integer())), (res, f) => {\n Assert.eq('eq', res.bind(f).getOrDie(), f(res.getOrDie()).getOrDie());\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59433, "name": "unknown", "code": "UnitTest.test('Given f :: s -> RE, checking value.bind(f).fold(id, die) === f(value.getOrDie()).fold(id, die)', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), fc.func(arbResultError(fc.integer())), (res, f) => {\n const toErrString = (r) => r.fold(Fun.identity, Fun.die('Not a Result.error'));\n Assert.eq('eq', toErrString(res.bind(f)), toErrString(f(res.getOrDie())));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59434, "name": "unknown", "code": "UnitTest.test('Checking value.forall is true iff. f(value.getOrDie() === true)', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), fc.func(fc.boolean()), (res, f) => {\n Assert.eq('eq', f(res.getOrDie()), res.forall(f));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59435, "name": "unknown", "code": "UnitTest.test('Checking value.exists is true iff. f(value.getOrDie() === true)', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), fc.func(fc.boolean()), (res, f) => {\n Assert.eq('eq', f(res.getOrDie()), res.exists(f));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59437, "name": "unknown", "code": "UnitTest.test('Result.error: error.is === false', () => {\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.eq('eq', false, Result.error(s).is(i));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59438, "name": "unknown", "code": "UnitTest.test('Result.error: error.isValue === false', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), (res) => {\n Assert.eq('eq', false, res.isValue());\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59439, "name": "unknown", "code": "UnitTest.test('Result.error: error.isError === true', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), (res) => {\n Assert.eq('eq', true, res.isError());\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59440, "name": "unknown", "code": "UnitTest.test('Result.error: error.getOr(v) === v', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), fc.json(), (res, json) => {\n Assert.eq('eq', json, res.getOr(json));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59441, "name": "unknown", "code": "UnitTest.test('Result.error: error.getOrDie() always throws', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), (res) => {\n Assert.throws('should throw', () => {\n res.getOrDie();\n });\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59442, "name": "unknown", "code": "UnitTest.test('Result.error: error.or(oValue) === oValue', () => {\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.eq('eq', Result.value(i), Result.error(s).or(Result.value(i)), tResult());\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59443, "name": "unknown", "code": "UnitTest.test('Result.error: error.orThunk(_ -> v) === v', () => {\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.eq('eq', Result.value(i), Result.error(s).orThunk(() => Result.value(i)), tResult());\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59444, "name": "unknown", "code": "UnitTest.test('Result.error: error.fold(_ -> x, die) === x', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), fc.json(), (res, json) => {\n const actual = res.fold(Fun.constant(json), Fun.die('Should not die'));\n Assert.eq('eq', json, actual);\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59445, "name": "unknown", "code": "UnitTest.test('Result.error: error.map(\u22a5) === error', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.eq('eq', Result.error(i), Result.error(i).map(Fun.die('\u22a5')), tResult());\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59446, "name": "unknown", "code": "UnitTest.test('Result.error: error.mapError(f) === f(error)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n const f = (x) => x % 3;\n Assert.eq('eq', Result.error(f(i)), Result.error(i).mapError(f), tResult());\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59447, "name": "unknown", "code": "UnitTest.test('Result.error: error.each(\u22a5) === undefined', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), (res) => {\n const actual = res.each(Fun.die('\u22a5'));\n Assert.eq('eq', undefined, actual);\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59448, "name": "unknown", "code": "UnitTest.test('Given f :: s -> RV, Result.error: error.bind(f) === error', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), fc.func(arbResultValue(fc.integer())), (res, f) => {\n const actual = res.bind(f);\n Assert.eq('eq', true, getErrorOrDie(res) === getErrorOrDie(actual));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": ["getErrorOrDie"], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59449, "name": "unknown", "code": "UnitTest.test('Given f :: s -> RE, Result.error: error.bind(f) === error', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), fc.func(arbResultError(fc.integer())), (res, f) => {\n const actual = res.bind(f);\n Assert.eq('eq', true, getErrorOrDie(res) === getErrorOrDie(actual));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": ["getErrorOrDie"], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59450, "name": "unknown", "code": "UnitTest.test('Result.error: error.forall === true', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), fc.func(fc.boolean()), (res, f) => {\n Assert.eq('eq', true, res.forall(f));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59451, "name": "unknown", "code": "UnitTest.test('Result.error: error.exists === false', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.eq('eq', false, Result.error(i).exists(Fun.die('\u22a5')));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59453, "name": "unknown", "code": "UnitTest.test('Id: Two ids should not be the same', () => {\n const arbId = fc.string(1, 30).map(Id.generate);\n fc.assert(fc.property(arbId, arbId, (id1, id2) => id1 !== id2));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/IdTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59454, "name": "unknown", "code": "UnitTest.test('Arr.groupBy: Adjacent groups have different hashes, and everything in a group has the same hash', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.func(fc.asciiString()),\n (xs, f) => {\n const groups = Arr.groupBy(xs, (x) => f(x));\n\n /* Properties about groups\n * 1. No two adjacent groups can have the same g(..) value\n * 2. Each group must have the same g(..) value\n */\n\n const hasEmptyGroups = Arr.exists(groups, (g) => g.length === 0);\n\n if (hasEmptyGroups) {\n Assert.fail('Should not have empty groups');\n }\n // No consecutive groups should have the same result of g.\n const values = Arr.map(groups, (group) => {\n const first = f(group[0]);\n const mapped = Arr.map(group, (g) => f(g));\n\n const isSame = Arr.forall(mapped, (m) => m === first);\n if (!isSame) {\n Assert.fail('Not everything in a group has the same g(..) value');\n }\n return first;\n });\n\n const hasSameGroup = Arr.exists(values, (v, i) => i > 0 ? values[i - 1] === values[i] : false);\n\n if (hasSameGroup) {\n Assert.fail('A group is next to another group with the same g(..) value');\n }\n return true;\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/GroupByTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59455, "name": "unknown", "code": "UnitTest.test('Flattening groups equals the original array', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.func(fc.string()),\n (xs, f) => {\n const groups = Arr.groupBy(xs, (x) => f(x));\n\n const output = Arr.flatten(groups);\n Assert.eq('eq', xs, output);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/GroupByTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59456, "name": "unknown", "code": "UnitTest.test('Arr.reverse: Reversing twice is identity', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n Assert.eq('reverse twice', arr, Arr.reverse(Arr.reverse(arr)));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ReverseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59457, "name": "unknown", "code": "UnitTest.test('Arr.reverse: 1 element', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (a) => {\n Assert.eq('reverse 1 element', [ a ], Arr.reverse([ a ]));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ReverseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59458, "name": "unknown", "code": "UnitTest.test('Arr.reverse: 2 elements', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), (a, b) => {\n Assert.eq('reverse 2 elements', [ b, a ], Arr.reverse([ a, b ]));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ReverseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59459, "name": "unknown", "code": "UnitTest.test('Arr.reverse: 3 elements', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), fc.integer(), (a, b, c) => {\n Assert.eq('reverse 3 elements', [ c, b, a ], Arr.reverse([ a, b, c ]));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ReverseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59460, "name": "unknown", "code": "UnitTest.test('Arr.reverse: \u2200 xs. x \u2208 (reverse xs) <-> x \u2208 xs', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (xs) => {\n const rxs = Arr.reverse(xs);\n Assert.eq('\u2200 xs. x \u2208 (reverse xs) -> x \u2208 xs', true, Arr.forall(rxs, (x) => Arr.contains(xs, x)));\n Assert.eq('\u2200 xs. x \u2208 xs -> x \u2208 (reverse xs)', true, Arr.forall(xs, (x) => Arr.contains(rxs, x)));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ReverseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59463, "name": "unknown", "code": "UnitTest.test('Check that everything in fail fails predicate and everything in pass passes predicate', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n (arr) => {\n const predicate = (x) => x % 3 === 0;\n const output = Arr.partition(arr, predicate);\n return Arr.forall(output.fail, (x) => !predicate(x)) && Arr.forall(output.pass, predicate);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/PartitionTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59464, "name": "unknown", "code": "UnitTest.test('Obj.size: inductive case', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(1, 30), fc.integer()),\n fc.asciiString(1, 30),\n fc.integer(),\n (obj, k, v) => {\n const objWithoutK = Obj.filter(obj, (x, i) => i !== k);\n Assert.eq('Adding key adds 1 to size',\n Obj.size(objWithoutK) + 1,\n Obj.size({ k: v, ...objWithoutK })\n );\n }));\n })", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ObjSizeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59465, "name": "unknown", "code": "UnitTest.test('Obj.keys are all in input', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.integer()), (obj) => {\n const keys = Obj.keys(obj);\n return Arr.forall(keys, (k) => obj.hasOwnProperty(k));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ObjKeysTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59466, "name": "unknown", "code": "UnitTest.test('Obj.filter: filter const true is identity', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.integer()), (obj) => {\n Assert.eq('id', obj, Obj.filter(obj, () => true));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ObjFilterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59467, "name": "unknown", "code": "UnitTest.test('Length of interspersed = len(arr) + len(arr)-1', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.integer(),\n (arr, delimiter) => {\n const actual = Jam.intersperse(arr, delimiter);\n const expected = arr.length === 0 ? 0 : arr.length * 2 - 1;\n Assert.eq('eq', expected, actual.length);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/IntersperseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59468, "name": "unknown", "code": "UnitTest.test('Every odd element matches delimiter', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.integer(),\n (arr, delimiter) => {\n const actual = Jam.intersperse(arr, delimiter);\n return Arr.forall(actual, (x, i) => i % 2 === 1 ? x === delimiter : true);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/IntersperseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59469, "name": "unknown", "code": "UnitTest.test('Filtering out delimiters (assuming different type to array to avoid removing original array) should equal original', () => {\n fc.assert(fc.property(\n fc.array(fc.nat()),\n arbNegativeInteger(),\n (arr, delimiter) => {\n const actual = Jam.intersperse(arr, delimiter);\n const filtered = Arr.filter(actual, (a) => a !== delimiter);\n Assert.eq('eq', arr, filtered);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/IntersperseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59473, "name": "unknown", "code": "UnitTest.test('foldl concat [ ] xs === reverse(xs)', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n (arr: number[]) => {\n const output: number[] = Arr.foldl(arr, (b: number[], a: number) => [ a ].concat(b), [ ]);\n Assert.eq('eq', Arr.reverse(arr), output);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/FoldTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59474, "name": "unknown", "code": "UnitTest.test('foldr concat [ ] xs === xs', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n (arr: number[]) => {\n const output = Arr.foldr(arr, (b: number[], a: number) => [ a ].concat(b), [ ]);\n Assert.eq('eq', arr, output);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/FoldTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59475, "name": "unknown", "code": "UnitTest.test('foldr concat ys xs === xs ++ ys', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.array(fc.integer()),\n (xs, ys) => {\n const output = Arr.foldr(xs, (b, a) => [ a ].concat(b), ys);\n Assert.eq('eq', xs.concat(ys), output);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/FoldTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59476, "name": "unknown", "code": "UnitTest.test('foldl concat ys xs === reverse(xs) ++ ys', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.array(fc.integer()),\n (xs, ys) => {\n const output = Arr.foldl(xs, (b, a) => [ a ].concat(b), ys);\n Assert.eq('eq', Arr.reverse(xs).concat(ys), output);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/FoldTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59477, "name": "unknown", "code": "UnitTest.test('Arr.flatten: consistent with chunking', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.integer(1, 5),\n (arr, chunkSize) => {\n const chunks = Arr.chunk(arr, chunkSize);\n const bound = Arr.flatten(chunks);\n return Assert.eq('chunking', arr, bound);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/FlattenTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59478, "name": "unknown", "code": "UnitTest.test('Arr.flatten: Wrap then flatten array is identity', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n Assert.eq('wrap then flatten', Arr.flatten(Arr.pure(arr)), arr);\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/FlattenTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59479, "name": "unknown", "code": "UnitTest.test('Mapping pure then flattening array is identity', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n Assert.eq('map pure then flatten', Arr.flatten(Arr.map(arr, Arr.pure)), arr);\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/FlattenTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59480, "name": "unknown", "code": "UnitTest.test('Flattening two lists === concat', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.array(fc.integer()), (xs, ys) => {\n Assert.eq('flatten/concat', Arr.flatten([ xs, ys ]), xs.concat(ys));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/FlattenTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59482, "name": "unknown", "code": "UnitTest.test('Arr.findIndex: Element found passes predicate', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n const pred = (x) => x % 3 === 0;\n return Arr.findIndex(arr, pred).forall((x) => pred(arr[x]));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/FindIndexTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59485, "name": "unknown", "code": "UnitTest.test('Arr.findIndex: consistent with exists', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n const pred = (x) => x % 6 === 0;\n Assert.eq('findIndex vs find', Arr.exists(arr, pred), Arr.findIndex(arr, pred).isSome());\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/FindIndexTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59486, "name": "unknown", "code": "UnitTest.test('Element exists in middle of array', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), fc.array(fc.integer()), (prefix, element, suffix) => {\n const arr2 = Arr.flatten([ prefix, [ element ], suffix ]);\n Assert.eq('in array', true, Arr.exists(arr2, eqc(element)));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ExistsTest.ts", "start_line": null, "end_line": null, "dependencies": ["eqc"], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59487, "name": "unknown", "code": "UnitTest.test('Element exists in singleton array of itself', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (i) => {\n Assert.eq('in array', true, Arr.exists([ i ], eqc(i)));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ExistsTest.ts", "start_line": null, "end_line": null, "dependencies": ["eqc"], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59488, "name": "unknown", "code": "UnitTest.test('Element does not exist in empty array', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (i) => {\n Assert.eq('not in empty array', false, Arr.exists([], eqc(i)));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ExistsTest.ts", "start_line": null, "end_line": null, "dependencies": ["eqc"], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59489, "name": "unknown", "code": "UnitTest.test('Element not found when predicate always returns false', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => !Arr.exists(arr, never)));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ExistsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59490, "name": "unknown", "code": "UnitTest.test('Element exists in non-empty array when predicate always returns true', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), (xs, x) => {\n const arr = Arr.flatten([ xs, [ x ]]);\n return Arr.exists(arr, always);\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ExistsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59492, "name": "unknown", "code": "UnitTest.test('difference: \u2200 xs ys. x \u2208 xs -> x \u2209 (ys - xs)', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.array(fc.integer()), (xs, ys) => {\n const diff = Arr.difference(ys, xs);\n return Arr.forall(xs, (x) => !Arr.contains(diff, x));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/DifferenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59493, "name": "unknown", "code": "UnitTest.test('difference: \u2200 xs ys. x \u2208 (ys - xs) -> x \u2209 ys', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.array(fc.integer()), (xs, ys) => {\n const diff = Arr.difference(ys, xs);\n return Arr.forall(diff, (d) => Arr.contains(ys, d));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/DifferenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59494, "name": "unknown", "code": "UnitTest.test('Arr.contains: array contains element', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), fc.array(fc.integer()), (prefix, element, suffix) => {\n const arr2 = Arr.flatten([ prefix, [ element ], suffix ]);\n Assert.eq('in array', true, Arr.contains(arr2, element));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ContainsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59503, "name": "unknown", "code": "UnitTest.test('Check not :: not(not(f(x))) === f(x)', () => {\n fc.assert(fc.property(fc.json(), fc.func(fc.boolean()), (x, f) => {\n const g = Fun.not(Fun.not(f));\n Assert.eq('eq', f(x), g(x));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Fun.not` applied twice to a function should yield the original function's result for a given input.", "mode": "fast-check"} {"id": 59512, "name": "unknown", "code": "UnitTest.test('Arr.find: value not found', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n const result = Arr.find(arr, () => false);\n Assert.eq('Element not found in array', Optional.none(), result, tOptional(tNumber));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ArrFindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.find` should return `Optional.none()` when no element is found in the array.", "mode": "fast-check"} {"id": 59506, "name": "unknown", "code": "UnitTest.test('Chunking should create an array of the appropriate length except for the last one', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.nat(),\n (arr, rawChunkSize) => {\n // ensure chunkSize is at least one\n const chunkSize = rawChunkSize + 1;\n const chunks = Arr.chunk(arr, chunkSize);\n\n const hasRightSize = (part) => part.length === chunkSize;\n\n const numChunks = chunks.length;\n const firstParts = chunks.slice(0, numChunks - 1);\n Assert.eq('Incorrect chunk size', true, Arr.forall(firstParts, hasRightSize));\n if (arr.length === 0) {\n Assert.eq('empty', [], chunks, tArray(tArray(tNumber)));\n } else {\n Assert.eq('nonEmpty', true, chunks[chunks.length - 1].length <= chunkSize);\n }\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ChunkTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59507, "name": "unknown", "code": "UnitTest.test('Arr.sort: idempotency', () => {\n fc.assert(fc.property(\n fc.array(fc.nat()), (arr) => {\n Assert.eq('idempotency', Arr.sort(arr), Arr.sort(Arr.sort(arr)), tArray(tNumber));\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ArrSortTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59515, "name": "unknown", "code": "UnitTest.test('Arr.findMap finds an element', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.integer(),\n fc.integer(),\n fc.array(fc.integer()),\n (prefix, element, ret, suffix) => {\n const arr = [ ...prefix, element, ...suffix ];\n Assert.eq('eq', Optional.some(ret), Arr.findMap(arr, (x) => Optionals.someIf(x === element, ret)), tOptional());\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ArrFindMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.findMap` should return an `Optional` containing a specified return value when an element in the array satisfies a given condition.", "mode": "fast-check"} {"id": 59517, "name": "unknown", "code": "UnitTest.test('Arr.bind: binding an array of empty arrays with identity equals an empty array', () => {\n fc.assert(fc.property(fc.array(fc.constant([])), (arr) => {\n Assert.eq('bind empty arrays', [], Arr.bind(arr, Fun.identity), tArray(tNumber));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ArrBindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59518, "name": "unknown", "code": "UnitTest.test('Arr.bind: bind (pure .) is map', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), (arr, j) => {\n const f = (x: number) => x + j;\n Assert.eq('bind pure', Arr.map(arr, f), Arr.bind(arr, Fun.compose(Arr.pure, f)), tArray(tNumber));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ArrBindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59519, "name": "unknown", "code": "UnitTest.test('Arr.bind: Monad Law: left identity', () => {\n fc.assert(fc.property(fc.integer(), fc.integer(), (i, j) => {\n const f = (x: number) => [ x, j, x + j ];\n Assert.eq('left id', f(i), Arr.bind(Arr.pure(i), f), tArray(tNumber));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ArrBindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59520, "name": "unknown", "code": "UnitTest.test('Arr.bind: Monad Law: right identity', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n Assert.eq('right id', arr, Arr.bind(arr, Arr.pure), tArray(tNumber));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ArrBindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59521, "name": "unknown", "code": "UnitTest.test('Arr.bind: Monad Law: associativity', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), (arr, j) => {\n const f = (x: number) => [ x, j, x + j ];\n const g = (x: number) => [ j, x, x + j ];\n Assert.eq('assoc', Arr.bind(arr, (x) => Arr.bind(f(x), g)), Arr.bind(Arr.bind(arr, f), g), tArray(tNumber));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ArrBindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59531, "name": "unknown", "code": "UnitTest.test('KAssert.eqResult: fail', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('value(a) != (value(!a)) #1', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b));\n });\n Assert.throws('value(a) != (value(!a)) #2', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b), tNumber);\n });\n Assert.throws('value(a) != (value(!a)) #2', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b), tNumber, tBoom());\n });\n }));\n\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('error(a) != (error(!a)) #1', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b));\n });\n Assert.throws('error(a) != (error(!a)) #2', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b), tBoom());\n });\n Assert.throws('result(a) != (result(!a)) #2', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b), tBoom(), tNumber);\n });\n }));\n\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.throws('value != error #1', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s));\n });\n Assert.throws('value != error #2', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s), tBoom());\n });\n Assert.throws('value != error #3', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s), tBoom());\n });\n\n Assert.throws('error != value #1', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s));\n });\n Assert.throws('error != value #2', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s), tBoom());\n });\n Assert.throws('error != value #3', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s), tBoom(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`KAssert.eqResult` throws an exception when comparing different result types, such as different `value` results, different `error` results, and `value` vs. `error` results.", "mode": "fast-check"} {"id": 59534, "name": "unknown", "code": "UnitTest.test('KAssert.eqSome: success (reflexivity)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n KAssert.eqSome('eq', i, Optional.some(i));\n KAssert.eqSome('eq', i, Optional.some(i), tNumber);\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59535, "name": "unknown", "code": "UnitTest.test('KAssert.eqSome: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #1', () => {\n KAssert.eqSome('eq', a, Optional.some(b));\n });\n }));\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #2', () => {\n KAssert.eqSome('eq', a, Optional.some(b), tNumber);\n });\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59536, "name": "unknown", "code": "UnitTest.test('KAssert.eqSome: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #1', () => {\n KAssert.eqSome('eq', a, Optional.some(b));\n });\n }));\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #2', () => {\n KAssert.eqSome('eq', a, Optional.some(b), tNumber);\n });\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59537, "name": "unknown", "code": "UnitTest.test('KAssert.eqNone: failure', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('some(i) != none', () => {\n KAssert.eqNone('eq', Optional.some(i));\n });\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59538, "name": "unknown", "code": "UnitTest.test('KAssert.eqOption: success (reflexivity)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n KAssert.eqOptional('eq', Optional.some(i), Optional.some(i));\n KAssert.eqOptional('eq', Optional.some(i), Optional.some(i), tNumber);\n }));\n KAssert.eqOptional('eq', Optional.none(), Optional.none());\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59550, "name": "unknown", "code": "it('should reject non-positive and non-integer numbers', () => {\n fc.assert(\n fc.property(\n fc.oneof(\n fc.integer({ min: -1000, max: 0 }), // Non-positive integers\n fc\n .float({ min: Math.fround(0.1), max: Math.fround(1000) })\n .filter(n => !Number.isInteger(n)) // Only non-integers\n ),\n num => {\n const result = isPositiveInteger(num);\n expect(result).toBe(false);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/packages/types/test/validators.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "`isPositiveInteger` should return false for non-positive and non-integer numbers.", "mode": "fast-check"} {"id": 59551, "name": "unknown", "code": "it('should validate non-negative numbers correctly', () => {\n fc.assert(\n fc.property(\n fc.float({ min: 0, max: Math.fround(1000), noNaN: true }),\n num => {\n const result = isNonNegativeNumber(num);\n expect(result).toBe(true);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/packages/types/test/validators.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "`isNonNegativeNumber` validates that a given float number is non-negative.", "mode": "fast-check"} {"id": 59553, "name": "unknown", "code": "it('should validate regex patterns correctly', () => {\n fc.assert(\n fc.property(fc.string(), str => {\n const validator = createRegexValidator(/^[a-zA-Z]+$/);\n const result = validator(str);\n const expected = /^[a-zA-Z]+$/.test(str);\n expect(result).toBe(expected);\n })\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/packages/types/test/validators.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "`createRegexValidator` correctly validates strings against a regex pattern for alphabetical characters only.", "mode": "fast-check"} {"id": 59559, "name": "unknown", "code": "it('should always return object with valid boolean', () => {\n fc.assert(\n fc.property(fc.string(), password => {\n const result = validatePassword(password);\n return (\n typeof result === 'object' &&\n typeof result.valid === 'boolean' &&\n (result.valid || typeof result.reason === 'string')\n );\n })\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/examples/property-testing/validation-functions.example.ts", "start_line": null, "end_line": null, "dependencies": ["validatePassword"], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "The function `validatePassword` should consistently return an object containing a `valid` boolean, and if `valid` is false, the object should also contain a `reason` string.", "mode": "fast-check"} {"id": 59568, "name": "unknown", "code": "it('should consistently return boolean values', () => {\n fc.assert(\n fc.property(fc.string(), input => {\n const result = isValidEmail(input);\n expect(typeof result).toBe('boolean');\n })\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/apps/backend-api/test/utils/validators.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "`isValidEmail` consistently returns boolean values for any string input.", "mode": "fast-check"} {"id": 59574, "name": "unknown", "code": "it('should always return object with isValid and errors properties', () => {\n fc.assert(\n fc.property(fc.string(), password => {\n const result = validatePasswordStrength(password);\n\n expect(typeof result.isValid).toBe('boolean');\n expect(Array.isArray(result.errors)).toBe(true);\n expect(result.isValid === (result.errors.length === 0)).toBe(true);\n })\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/apps/backend-api/test/utils/validators.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "`validatePasswordStrength` returns an object containing `isValid` as a boolean and `errors` as an array, with `isValid` being true if `errors` is empty.", "mode": "fast-check"} {"id": 59576, "name": "unknown", "code": "it('should be monotonic (adding items never decreases total)', () => {\n fc.assert(\n fc.property(\n generators.items(),\n generators.items(),\n (items1, items2) => {\n const total1 = calculateTotal(items1);\n const total2 = calculateTotal([...items1, ...items2]);\n\n expect(total2).toBeGreaterThanOrEqual(total1);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/apps/backend-api/test/utils/enhanced-property-tests.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "Adding items to a list should not decrease the calculated total.", "mode": "fast-check"} {"id": 59583, "name": "unknown", "code": "it('should equal sum of individual items', () => {\n fc.assert(\n fc.property(\n fc.array(\n fc.record({\n price: fc.float({ min: 0, max: Math.fround(100), noNaN: true }),\n quantity: fc.integer({ min: 0, max: 10 }),\n }),\n { maxLength: 5 }\n ),\n items => {\n const total = calculateTotal(items);\n const manual = items.reduce(\n (sum, item) => sum + item.price * item.quantity,\n 0\n );\n expect(total).toBeCloseTo(manual, 10);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/apps/backend-api/test/utils/calculations.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "`calculateTotal` should equal the sum of items' prices multiplied by their quantities across an array.", "mode": "fast-check"} {"id": 59584, "name": "unknown", "code": "it('should never return discount greater than price', () => {\n fc.assert(\n fc.property(\n fc.float({ min: 0, max: Math.fround(10000), noNaN: true }),\n fc.float({ min: 0, max: Math.fround(100), noNaN: true }),\n (price, discountPercent) => {\n const discount = calculateDiscount(price, discountPercent);\n expect(discount).toBeLessThanOrEqual(price);\n expect(discount).toBeGreaterThanOrEqual(0);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/apps/backend-api/test/utils/calculations.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "The calculated discount should always be between 0 and the original price.", "mode": "fast-check"} {"id": 59585, "name": "unknown", "code": "it('should be monotonic (higher discount % = higher discount amount)', () => {\n fc.assert(\n fc.property(\n fc.float({ min: 1, max: Math.fround(1000), noNaN: true }),\n fc.float({ min: 0, max: Math.fround(50), noNaN: true }),\n fc.float({ min: 0, max: Math.fround(50), noNaN: true }),\n (price, discount1, discount2) => {\n const [lower, higher] =\n discount1 <= discount2\n ? [discount1, discount2]\n : [discount2, discount1];\n\n const discountAmount1 = calculateDiscount(price, lower);\n const discountAmount2 = calculateDiscount(price, higher);\n\n expect(discountAmount1).toBeLessThanOrEqual(discountAmount2);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/apps/backend-api/test/utils/calculations.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "Higher discount percentages should yield higher discount amounts.", "mode": "fast-check"} {"id": 59588, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59589, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59590, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59591, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(reversesUncompress);\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59592, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(reversesUncompress);\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59593, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(reversesUncompress);\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59594, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(isEquivalentToDeriveUncompressedThenCompress);\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59595, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(isEquivalentToDeriveUncompressedThenCompress);\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59596, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(isEquivalentToDeriveUncompressedThenCompress);\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59597, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(isEquivalentToDeriveCompressedThenUncompress);\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59598, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(isEquivalentToDeriveCompressedThenUncompress);\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59599, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(isEquivalentToDeriveCompressedThenUncompress);\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59600, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(malleationIsJustNegation);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59601, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(malleationIsJustNegation);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59602, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59603, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59604, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59605, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(malleateThenNormalizeEqualsInitial);\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59606, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(malleateThenNormalizeEqualsInitial);\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59607, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(malleateThenNormalizeEqualsInitial);\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59608, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(malleateThenNormalizeEqualsInitial);\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59609, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59610, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59611, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59612, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59613, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59614, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59615, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59616, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(reversesCompress);\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59617, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(reversesCompress);\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59618, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59619, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59620, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59621, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59622, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59623, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59624, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59625, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59626, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59627, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(createsValidSignatures);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59631, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSinglePass);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/hash.spec.helper.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59632, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59633, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59634, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59635, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59636, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59637, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59638, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59639, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59640, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59641, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59642, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59643, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59644, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59645, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59646, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59647, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59648, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59649, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59650, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59651, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59652, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59653, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59654, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59655, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59656, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(correctsUpToTwoErrors(20));\n fc.assert(correctsUpToTwoErrors(24));\n fc.assert(correctsUpToTwoErrors(28));\n fc.assert(correctsUpToTwoErrors(32));\n fc.assert(correctsUpToTwoErrors(40));\n fc.assert(correctsUpToTwoErrors(48));\n fc.assert(correctsUpToTwoErrors(56));\n fc.assert(correctsUpToTwoErrors(64));\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59657, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(correctsUpToTwoErrors(20));\n fc.assert(correctsUpToTwoErrors(24));\n fc.assert(correctsUpToTwoErrors(28));\n fc.assert(correctsUpToTwoErrors(32));\n fc.assert(correctsUpToTwoErrors(40));\n fc.assert(correctsUpToTwoErrors(48));\n fc.assert(correctsUpToTwoErrors(56));\n fc.assert(correctsUpToTwoErrors(64));\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59658, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(correctsUpToTwoErrors(20));\n fc.assert(correctsUpToTwoErrors(24));\n fc.assert(correctsUpToTwoErrors(28));\n fc.assert(correctsUpToTwoErrors(32));\n fc.assert(correctsUpToTwoErrors(40));\n fc.assert(correctsUpToTwoErrors(48));\n fc.assert(correctsUpToTwoErrors(56));\n fc.assert(correctsUpToTwoErrors(64));\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59659, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(correctsUpToTwoErrors(20));\n fc.assert(correctsUpToTwoErrors(24));\n fc.assert(correctsUpToTwoErrors(28));\n fc.assert(correctsUpToTwoErrors(32));\n fc.assert(correctsUpToTwoErrors(40));\n fc.assert(correctsUpToTwoErrors(48));\n fc.assert(correctsUpToTwoErrors(56));\n fc.assert(correctsUpToTwoErrors(64));\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59660, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(correctsUpToTwoErrors(20));\n fc.assert(correctsUpToTwoErrors(24));\n fc.assert(correctsUpToTwoErrors(28));\n fc.assert(correctsUpToTwoErrors(32));\n fc.assert(correctsUpToTwoErrors(40));\n fc.assert(correctsUpToTwoErrors(48));\n fc.assert(correctsUpToTwoErrors(56));\n fc.assert(correctsUpToTwoErrors(64));\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59661, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(correctsUpToTwoErrors(20));\n fc.assert(correctsUpToTwoErrors(24));\n fc.assert(correctsUpToTwoErrors(28));\n fc.assert(correctsUpToTwoErrors(32));\n fc.assert(correctsUpToTwoErrors(40));\n fc.assert(correctsUpToTwoErrors(48));\n fc.assert(correctsUpToTwoErrors(56));\n fc.assert(correctsUpToTwoErrors(64));\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59662, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(correctsUpToTwoErrors(20));\n fc.assert(correctsUpToTwoErrors(24));\n fc.assert(correctsUpToTwoErrors(28));\n fc.assert(correctsUpToTwoErrors(32));\n fc.assert(correctsUpToTwoErrors(40));\n fc.assert(correctsUpToTwoErrors(48));\n fc.assert(correctsUpToTwoErrors(56));\n fc.assert(correctsUpToTwoErrors(64));\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59663, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(correctsUpToTwoErrors(20));\n fc.assert(correctsUpToTwoErrors(24));\n fc.assert(correctsUpToTwoErrors(28));\n fc.assert(correctsUpToTwoErrors(32));\n fc.assert(correctsUpToTwoErrors(40));\n fc.assert(correctsUpToTwoErrors(48));\n fc.assert(correctsUpToTwoErrors(56));\n fc.assert(correctsUpToTwoErrors(64));\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59673, "name": "unknown", "code": "it('takes the first n from a list', () => {\n fc.assert(\n fc.property(\n fc.integer({ min: -1000, max: 1000 }),\n fc.nat(1000),\n (len, num) => {\n const a = Range(0, len).toArray();\n const v = List(a);\n expect(v.take(num).toArray()).toEqual(a.slice(0, num));\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/immutable-js/immutable-js/__tests__/slice.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "immutable-js/immutable-js", "url": "https://github.com/immutable-js/immutable-js.git", "license": "MIT", "stars": 33051, "forks": 1777}, "metrics": null, "summary": "Verifies that taking the first `n` elements from a list matches the expected slice of an array with the same elements.", "mode": "fast-check"} {"id": 59675, "name": "unknown", "code": "it('is not dependent on order', () => {\n fc.assert(\n fc.property(genHeterogeneousishArray, (vals) => {\n expect(\n is(\n Seq(shuffle(vals.slice())).min(),\n Seq(vals).min()\n )\n ).toEqual(true);\n })\n );\n })", "language": "typescript", "source_file": "./repos/immutable-js/immutable-js/__tests__/minmax.ts", "start_line": null, "end_line": null, "dependencies": ["shuffle"], "repo": {"name": "immutable-js/immutable-js", "url": "https://github.com/immutable-js/immutable-js.git", "license": "MIT", "stars": 33051, "forks": 1777}, "metrics": null, "summary": "`Seq.min()` produces consistent results regardless of the order of elements in the input array.", "mode": "fast-check"} {"id": 59676, "name": "unknown", "code": "it('behaves the same as Array.join', () => {\n fc.assert(\n fc.property(fc.array(genPrimitive), genPrimitive, (array, joiner) => {\n // @ts-expect-error unexpected values for typescript joiner, but valid at runtime despite the unexpected errors\n expect(Seq(array).join(joiner)).toBe(array.join(joiner));\n })\n );\n })", "language": "typescript", "source_file": "./repos/immutable-js/immutable-js/__tests__/join.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "immutable-js/immutable-js", "url": "https://github.com/immutable-js/immutable-js.git", "license": "MIT", "stars": 33051, "forks": 1777}, "metrics": null, "summary": "`Seq(array).join(joiner)` produces the same result as `array.join(joiner)` for arrays of primitive values.", "mode": "fast-check"} {"id": 59677, "name": "unknown", "code": "it('generates unsigned 31-bit integers', () => {\n fc.assert(\n fc.property(genValue, (value) => {\n const hashVal = hash(value);\n expect(Number.isInteger(hashVal)).toBe(true);\n expect(hashVal).toBeGreaterThan(-(2 ** 31));\n expect(hashVal).toBeLessThan(2 ** 31);\n })\n );\n })", "language": "typescript", "source_file": "./repos/immutable-js/immutable-js/__tests__/hash.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "immutable-js/immutable-js", "url": "https://github.com/immutable-js/immutable-js.git", "license": "MIT", "stars": 33051, "forks": 1777}, "metrics": null, "summary": "The `hash` function generates unsigned 31-bit integers for given values.", "mode": "fast-check"} {"id": 59682, "name": "unknown", "code": "it('slices the same as array slices', () => {\n fc.assert(\n fc.property(\n shrinkInt,\n shrinkInt,\n shrinkInt,\n shrinkInt,\n (from, to, begin, end) => {\n const r = Range(from, to);\n const a = r.toArray();\n expect(r.slice(begin, end).toArray()).toEqual(a.slice(begin, end));\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/immutable-js/immutable-js/__tests__/Range.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "immutable-js/immutable-js", "url": "https://github.com/immutable-js/immutable-js.git", "license": "MIT", "stars": 33051, "forks": 1777}, "metrics": null, "summary": "The result of slicing a `Range` should match the result of slicing its array equivalent.", "mode": "fast-check"} {"id": 59683, "name": "unknown", "code": "it('deletes down to empty map', () => {\n fc.assert(\n fc.property(fc.nat(100), (size) => {\n let m = Range(0, size).toMap();\n expect(m.size).toBe(size);\n for (let ii = size - 1; ii >= 0; ii--) {\n m = m.remove(ii);\n expect(m.size).toBe(ii);\n }\n expect(m).toBe(Map());\n })\n );\n })", "language": "typescript", "source_file": "./repos/immutable-js/immutable-js/__tests__/Map.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "immutable-js/immutable-js", "url": "https://github.com/immutable-js/immutable-js.git", "license": "MIT", "stars": 33051, "forks": 1777}, "metrics": null, "summary": "A map created from a range should decrease in size with each deletion until it becomes an empty map.", "mode": "fast-check"} {"id": 59685, "name": "unknown", "code": "it('sets', () => {\n fc.assert(\n fc.property(fc.nat(100), (len) => {\n let map = Map();\n for (let ii = 0; ii < len; ii++) {\n expect(map.size).toBe(ii);\n map = map.set('' + ii, ii);\n }\n expect(map.size).toBe(len);\n expect(is(map.toSet(), Range(0, len).toSet())).toBe(true);\n })\n );\n })", "language": "typescript", "source_file": "./repos/immutable-js/immutable-js/__tests__/Map.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "immutable-js/immutable-js", "url": "https://github.com/immutable-js/immutable-js.git", "license": "MIT", "stars": 33051, "forks": 1777}, "metrics": null, "summary": "A `Map` object has the same number of elements as the number of `set` operations performed, and converting it to a set matches a range set from 0 to the number of operations.", "mode": "fast-check"} {"id": 59686, "name": "unknown", "code": "it('has and get', () => {\n fc.assert(\n fc.property(fc.nat(100), (len) => {\n const map = Range(0, len)\n .toKeyedSeq()\n .mapKeys((x) => '' + x)\n .toMap();\n for (let ii = 0; ii < len; ii++) {\n expect(map.get('' + ii)).toBe(ii);\n expect(map.has('' + ii)).toBe(true);\n }\n })\n );\n })", "language": "typescript", "source_file": "./repos/immutable-js/immutable-js/__tests__/Map.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "immutable-js/immutable-js", "url": "https://github.com/immutable-js/immutable-js.git", "license": "MIT", "stars": 33051, "forks": 1777}, "metrics": null, "summary": "`Map` correctly retrieves and confirms the existence of stringified numeric keys within a mapped sequence.", "mode": "fast-check"} {"id": 59687, "name": "unknown", "code": "it('deletes', () => {\n fc.assert(\n fc.property(fc.nat(100), (len) => {\n let map = Range(0, len).toMap();\n for (let ii = 0; ii < len; ii++) {\n expect(map.size).toBe(len - ii);\n map = map.remove(ii);\n }\n expect(map.size).toBe(0);\n expect(map.toObject()).toEqual({});\n })\n );\n })", "language": "typescript", "source_file": "./repos/immutable-js/immutable-js/__tests__/Map.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "immutable-js/immutable-js", "url": "https://github.com/immutable-js/immutable-js.git", "license": "MIT", "stars": 33051, "forks": 1777}, "metrics": null, "summary": "The map should decrease in size by one for each deletion and be empty with a size of zero and an empty object after all elements are removed.", "mode": "fast-check"} {"id": 59693, "name": "unknown", "code": "it('toJS isomorphic value', () => {\n fc.assert(\n fc.property(fc.jsonValue(), (v: JsonValue) => {\n const imm = fromJS(v);\n expect(\n // @ts-expect-error Property 'toJS' does not exist on type '{}'.ts(2339)\n imm && imm.toJS ? imm.toJS() : imm\n ).toEqual(v);\n }),\n { numRuns: 30 }\n );\n })", "language": "typescript", "source_file": "./repos/immutable-js/immutable-js/__tests__/Conversion.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "immutable-js/immutable-js", "url": "https://github.com/immutable-js/immutable-js.git", "license": "MIT", "stars": 33051, "forks": 1777}, "metrics": null, "summary": "The conversion from a JSON value to an immutable object using `fromJS` and back to a JSON value using `toJS` should preserve equality with the original JSON value.", "mode": "fast-check"} {"id": 59695, "name": "unknown", "code": "it('pop removes the highest index, just like array', () => {\n fc.assert(\n fc.property(fc.nat(100), (len) => {\n const a = arrayOfSize(len);\n let v = List(a);\n\n while (a.length) {\n expect(v.size).toBe(a.length);\n expect(v.toArray()).toEqual(a);\n v = v.pop();\n a.pop();\n }\n expect(v.size).toBe(a.length);\n expect(v.toArray()).toEqual(a);\n })\n );\n })", "language": "typescript", "source_file": "./repos/immutable-js/immutable-js/__tests__/List.ts", "start_line": null, "end_line": null, "dependencies": ["arrayOfSize"], "repo": {"name": "immutable-js/immutable-js", "url": "https://github.com/immutable-js/immutable-js.git", "license": "MIT", "stars": 33051, "forks": 1777}, "metrics": null, "summary": "`List.pop()` should remove the highest index element, matching the behavior of native JavaScript arrays.", "mode": "fast-check"} {"id": 59699, "name": "unknown", "code": "it('iterates through List in reverse', () => {\n fc.assert(\n fc.property(pInt, pInt, (start, len) => {\n const l1 = Range(0, start + len).toList();\n const l2: List = l1.slice(start, start + len);\n const s = l2.toSeq().reverse(); // impl calls List.__iterator(REVERSE)\n expect(s.size).toBe(len);\n const valueIter = s.values();\n const keyIter = s.keys();\n const entryIter = s.entries();\n for (let ii = 0; ii < len; ii++) {\n expect(valueIter.next().value).toBe(start + len - 1 - ii);\n expect(keyIter.next().value).toBe(ii);\n expect(entryIter.next().value).toEqual([ii, start + len - 1 - ii]);\n }\n })\n );\n })", "language": "typescript", "source_file": "./repos/immutable-js/immutable-js/__tests__/List.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "immutable-js/immutable-js", "url": "https://github.com/immutable-js/immutable-js.git", "license": "MIT", "stars": 33051, "forks": 1777}, "metrics": null, "summary": "Iterating through a sliced `List` in reverse should correctly yield values, keys, and entries in expected reverse order.", "mode": "fast-check"} {"id": 59700, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(MAC(), async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59701, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.MAC), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59702, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n hexaString({ minLength: 4, maxLength: 4 }),\n async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59703, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(hexaString({ minLength: 5 }), async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59704, "name": "unknown", "code": "it('does not allow to edit characters < 4', async () =>\n await fc.assert(\n fc.asyncProperty(\n hexaString({ minLength: 0, maxLength: 3 }),\n async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59705, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n hexaString({ minLength: 3, maxLength: 3 }),\n async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59706, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(hexaString({ minLength: 4 }), async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59707, "name": "unknown", "code": "it('does not allow to edit characters < 3', async () =>\n await fc.assert(\n fc.asyncProperty(\n hexaString({ minLength: 0, maxLength: 2 }),\n async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59708, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 0, max: 7 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59709, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 8 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59710, "name": "unknown", "code": "it('edits name attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tAsciName, 1, 32), async name => {\n inputs[0].value = name;\n await (inputs[0]).requestUpdate();\n expect(inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59711, "name": "unknown", "code": "it('rejects name attribute starting with decimals', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal, 1, 1), async name => {\n inputs[0].value = name;\n await (inputs[0]).requestUpdate();\n expect(inputs[0].checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59712, "name": "unknown", "code": "it('edits smpRate attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 0 }).map(num => `${num}`),\n async smpRate => {\n inputs[4].value = smpRate;\n await (inputs[4]).requestUpdate();\n expect(inputs[4].checkValidity()).to.be.true;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59713, "name": "unknown", "code": "it('rejects smpRate attribute in case input is not unsigned int', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.uint, 1),\n async smpRate => {\n inputs[4].value = smpRate;\n await (inputs[4]).requestUpdate();\n expect(inputs[4].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59714, "name": "unknown", "code": "it('edits nofASDU attribute only for valid inputs', async () => {\n const input = inputs[5];\n input.nullSwitch?.click();\n await input.requestUpdate();\n\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 0 }).map(num => `${num}`),\n async nofASDU => {\n input.value = nofASDU;\n await input.requestUpdate();\n expect(input.checkValidity()).to.be.true;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59715, "name": "unknown", "code": "it('rejects nofASDU attribute in case input is not unsigned int', async () => {\n const input = inputs[5];\n input.nullSwitch?.click();\n await input.requestUpdate();\n\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.uint, 1),\n async nofASDU => {\n input.value = nofASDU;\n await input.requestUpdate();\n expect(input.checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59716, "name": "unknown", "code": "it('edits name attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tAsciName, 1, 32), async name => {\n inputs[0].value = name;\n await (inputs[0]).requestUpdate();\n expect(inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59717, "name": "unknown", "code": "it('rejects name attribute starting with decimals', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal, 1, 1), async name => {\n inputs[0].value = name;\n await (inputs[0]).requestUpdate();\n expect(inputs[0].checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59718, "name": "unknown", "code": "it('edits bufTime attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 0 }).map(num => `${num}`),\n async bufTime => {\n inputs[6].value = bufTime;\n await (inputs[6]).requestUpdate();\n expect(inputs[6].checkValidity()).to.be.true;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59719, "name": "unknown", "code": "it('rejects bufTime attribute starting with not being a unsigned int', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.uint, 1),\n async bufTime => {\n inputs[6].value = bufTime;\n await (inputs[6]).requestUpdate();\n expect(inputs[6].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59720, "name": "unknown", "code": "it('edits intgPd attribute only for valid inputs', async () => {\n const input = inputs[7];\n input.nullSwitch?.click();\n await input.requestUpdate();\n\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 0 }).map(num => `${num}`),\n async intgPd => {\n input.value = intgPd;\n await input.requestUpdate();\n expect(input.checkValidity()).to.be.true;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59721, "name": "unknown", "code": "it('rejects intgPd attribute starting with not being a unsigned int', async () => {\n const input = inputs[7];\n input.nullSwitch?.click();\n await input.requestUpdate();\n\n await fc.assert(\n fc.asyncProperty(regexString(inverseRegExp.uint, 1), async intgPd => {\n input.value = intgPd;\n await input.requestUpdate();\n expect(input.checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59722, "name": "unknown", "code": "it('edits prefix attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tAsciName, 1, 11), async name => {\n inputs[2].value = name;\n await (inputs[2]).requestUpdate();\n expect(inputs[2].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/lnode.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59723, "name": "unknown", "code": "it('rejects name attribute starting with decimals', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal, 1, 1), async name => {\n inputs[2].value = name;\n await (inputs[2]).requestUpdate();\n expect(inputs[2].checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/lnode.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59724, "name": "unknown", "code": "it('edits name attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tAsciName, 1, 32), async name => {\n nameTextField.value = name;\n await nameTextField.requestUpdate();\n expect(nameTextField.checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/gsecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59725, "name": "unknown", "code": "it('rejects name attribute starting with decimals', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal, 1, 1), async name => {\n nameTextField.value = name;\n await nameTextField.requestUpdate();\n expect(nameTextField.checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/gsecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59726, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV4(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59727, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv4), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59728, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV4(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59729, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv4), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59730, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV4(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59731, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv4), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59732, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(regExp.OSI, 1, 8), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59733, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59734, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSI, 1, 16),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59735, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59736, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSI, 1, 16),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59737, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59738, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(regExp.OSIAPi, 1), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59739, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSIAPi), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59740, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSIid, 1, 5),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59741, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSIid), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59742, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSIid, 1, 5),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59743, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSIid), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59744, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSIid, 1, 5),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59745, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSIid), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59746, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSI, 1, 40),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59747, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59748, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(regExp.OSI, 3, 3), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59749, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59750, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(/^[0-7]$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59751, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-7]$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59752, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n nat({ max: 65535 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59753, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59754, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n nat({ max: 65535 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59755, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59756, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(/^\\S*$/, 1), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59757, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n nat({ max: 65535 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59758, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59759, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n nat({ max: 65535 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59760, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59761, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 1025, max: 65535 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59762, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59763, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV6(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59764, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv6), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59765, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV6SubNet(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59766, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9/]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59767, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV6(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59768, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv6), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59769, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n fc.hexaString({ minLength: 1, maxLength: 5 }),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59770, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n invertedRegex(/^[0-9a-fA-F]{1,5}$/),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59771, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n nat({ max: 255 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59772, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59773, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV6(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59774, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv6), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59775, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV4(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59776, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv4), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59777, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(regExp.OSI, 1, 2), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59778, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59779, "name": "unknown", "code": "it('edits name attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.abstractDataAttributeName, 1, 32),\n async name => {\n nameTextField.value = name;\n await nameTextField.requestUpdate();\n expect(nameTextField.checkValidity()).to.be.true;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/abstractda.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59780, "name": "unknown", "code": "it('rejects name attribute starting with decimals', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal, 1, 1), async name => {\n nameTextField.value = name;\n await nameTextField.requestUpdate();\n expect(nameTextField.checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/wizards/abstractda.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59781, "name": "unknown", "code": "it('for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.lnClass, 4, 4),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/unit/editors/templates/lnodetype-wizard.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59782, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tName, 1), async name => {\n parent.wizardUI.inputs[0].value = name;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59783, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc), async desc => {\n parent.wizardUI.inputs[1].value = desc;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[1].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59784, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.unsigned, 1), async nomFreq => {\n parent.wizardUI.inputs[2].value = nomFreq;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[2].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59785, "name": "unknown", "code": "it('rejects action for invalid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.unsigned, 1),\n async nomFreq => {\n parent.wizardUI.inputs[2].value = nomFreq;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[2].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59786, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(fc.integer(1, 255), async numPhases => {\n parent.wizardUI.inputs[3].value = String(numPhases);\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[3].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59787, "name": "unknown", "code": "it('rejects edition for invalid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.integer, 1),\n async nomFreq => {\n parent.wizardUI.inputs[3].value = nomFreq;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[3].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59788, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal), async nomFreq => {\n parent.wizardUI.inputs[4].value = nomFreq;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[4].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59789, "name": "unknown", "code": "it('rejects edition for invalid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.decimal, 1),\n async voltage => {\n parent.wizardUI.inputs[4].value = voltage;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[4].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59790, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tName, 1), async name => {\n parent.wizardUI.inputs[0].value = name;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/integration/editors/substation/substation-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59791, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc), async desc => {\n parent.wizardUI.inputs[1].value = desc;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[1].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/integration/editors/substation/substation-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59792, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tName, 1), async name => {\n parent.wizardUI.inputs[1].value = name;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/integration/editors/substation/conducting-equipment-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59793, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc), async desc => {\n parent.wizardUI.inputs[2].value = desc;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[1].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/integration/editors/substation/conducting-equipment-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59794, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tName, 1), async name => {\n parent.wizardUI.inputs[0].value = name;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/integration/editors/substation/bay-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59795, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc), async desc => {\n parent.wizardUI.inputs[1].value = desc;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[1].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/integration/editors/substation/bay-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59796, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tName, 1), async name => {\n parent.wizardUI.inputs[0].value = name;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/integration/editors/communication/subnetwork-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59797, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc), async desc => {\n parent.wizardUI.inputs[1].value = desc;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[1].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/integration/editors/communication/subnetwork-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59798, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc, 1), async type => {\n parent.wizardUI.inputs[2].value = type;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[2].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/integration/editors/communication/subnetwork-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59799, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal), async BitRate => {\n parent.wizardUI.inputs[3].value = BitRate;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[3].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/integration/editors/communication/subnetwork-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59800, "name": "unknown", "code": "it('rejects edition for invalid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.decimal, 1),\n async BitRate => {\n parent.wizardUI.inputs[3].value = BitRate;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[3].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/openscd/open-scd/packages/plugins/test/integration/editors/communication/subnetwork-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/open-scd", "url": "https://github.com/openscd/open-scd.git", "license": "Apache-2.0", "stars": 117, "forks": 46}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59809, "name": "unknown", "code": "it(\"generated random strings with given length\", () => {\n fc.assert(\n fc.property(fc.integer({ min: 0, max: 256 }), (n) => {\n expect(nanoid(n).length).toBe(n);\n })\n );\n })", "language": "typescript", "source_file": "./repos/liveblocks/liveblocks/packages/liveblocks-core/src/lib/__tests__/nanoid.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "liveblocks/liveblocks", "url": "https://github.com/liveblocks/liveblocks.git", "license": "Apache-2.0", "stars": 4080, "forks": 361}, "metrics": null, "summary": "`nanoid` generates random strings of the specified length.", "mode": "fast-check"} {"id": 59812, "name": "unknown", "code": "test(\"subscribing once\", () => {\n fc.assert(\n fc.property(\n anything(),\n\n (payload) => {\n const callback = jest.fn();\n const hub = makeEventSource();\n\n const dereg1 = hub.observable.subscribeOnce(callback);\n hub.notify(payload);\n hub.notify(payload);\n hub.notify(payload);\n\n expect(callback).toHaveBeenCalledTimes(1); // Called only once, not three times\n for (const [arg] of callback.mock.calls) {\n expect(arg).toBe(payload);\n }\n\n // Deregistering has no effect\n dereg1();\n hub.notify(payload);\n expect(callback).toHaveBeenCalledTimes(1); // Called only once, not three times\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/liveblocks/liveblocks/packages/liveblocks-core/src/lib/__tests__/EventSource.test.ts", "start_line": null, "end_line": null, "dependencies": ["anything"], "repo": {"name": "liveblocks/liveblocks", "url": "https://github.com/liveblocks/liveblocks.git", "license": "Apache-2.0", "stars": 4080, "forks": 361}, "metrics": null, "summary": "Subscribing once to an event source should result in the callback being called exactly once with the correct payload, regardless of the number of notifications and deregistrations.", "mode": "fast-check"} {"id": 59818, "name": "unknown", "code": "describe(\"Continuous and discrete splits\", () => {\n makeTest({\n name: \"is empty, with no common elements\",\n data: [1.33455, 1.432, 2.0],\n minWeight: 2,\n continuous: [1.33455, 1.432, 2.0],\n discrete: { xs: [], ys: [] },\n });\n\n makeTest({\n name: \"only stores 3.5 as discrete when minWeight is 3\",\n data: [1.33455, 1.432, 2.0, 2.0, 3.5, 3.5, 3.5],\n minWeight: 3,\n continuous: [1.33455, 1.432, 2.0, 2.0],\n discrete: { xs: [3.5], ys: [3] },\n });\n\n makeTest({\n name: \"doesn't store 3.5 as discrete when minWeight is 5\",\n data: [1.33455, 1.432, 2.0, 2.0, 3.5, 3.5, 3.5],\n minWeight: 5,\n continuous: [1.33455, 1.432, 2.0, 2.0, 3.5, 3.5, 3.5],\n discrete: { xs: [], ys: [] },\n });\n\n makeTest({\n name: \"more general test\",\n data: [10, 10, 11, 11, 11, 12, 13, 13, 13, 13, 13, 14],\n minWeight: 3,\n continuous: [10, 10, 12, 14],\n discrete: { xs: [11, 13], ys: [3, 5] },\n });\n\n const makeDuplicatedArray = (count: number) => {\n const arr = range(1, count + 1);\n return [...arr, ...arr, ...arr, ...arr].sort((a, b) => a - b);\n };\n\n test(\"split at count=10\", () => {\n expect(split(makeDuplicatedArray(10), 2).discreteShape.xs.length).toEqual(\n 10\n );\n });\n\n test(\"split at count=500\", () => {\n expect(split(makeDuplicatedArray(500), 2).discreteShape.xs.length).toEqual(\n 500\n );\n });\n\n // Function for fast-check property testing\n const testSegments = (counts: number[], weight: number) => {\n // Prepare segments of random-length equal numbers\n const segments: number[][] = [];\n let cur = 0;\n for (const count of counts) {\n cur += 0.01 + Math.random(); // random() can produce 0\n const segment: number[] = [];\n for (let i = 0; i < count; i++) {\n segment.push(cur);\n }\n segments.push(segment);\n }\n const allValues = flatten(segments);\n const result = split(allValues, weight);\n\n // Then split based on the segment length directly\n const contSegments = segments.filter((s) => s.length < weight);\n const discSegments = segments.filter((s) => s.length >= weight);\n\n expect(result.continuousSamples).toEqual(flatten(contSegments));\n expect(result.discreteShape).toEqual({\n xs: discSegments.map((s) => s[0]),\n ys: discSegments.map((s) => s.length),\n });\n };\n\n fc.assert(\n fc.property(\n fc.array(fc.integer({ max: 30 }), { minLength: 0, maxLength: 50 }), // random lengths of segments of equal values\n fc.integer({ min: 2, max: 20 }),\n testSegments\n )\n );\n})", "language": "typescript", "source_file": "./repos/quantified-uncertainty/squiggle/packages/squiggle-lang/__tests__/dists/SplitContinuousAndDiscrete_test.ts", "start_line": null, "end_line": null, "dependencies": ["makeTest"], "repo": {"name": "quantified-uncertainty/squiggle", "url": "https://github.com/quantified-uncertainty/squiggle.git", "license": "MIT", "stars": 188, "forks": 26}, "metrics": null, "summary": "The function `split` separates input data into continuous and discrete segments based on a given minimum weight, ensuring continuous samples are below the weight and discrete shapes meet or exceed it.", "mode": "fast-check"} {"id": 59819, "name": "unknown", "code": "it(\"match\", () => {\n const f = Weather.match({\n Rain: n => `${n}mm`,\n [_]: () => \"not rain\",\n })\n\n fc.assert(\n fc.property(fc.integer(), n =>\n expect(f(Weather.mk.Rain(n))).toBe(`${n}mm`),\n ),\n )\n\n expect(f(Weather.mk.Sun)).toBe(\"not rain\")\n })", "language": "typescript", "source_file": "./repos/unsplash/sum-types/test/unit/index.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "unsplash/sum-types", "url": "https://github.com/unsplash/sum-types.git", "license": "MIT", "stars": 44, "forks": 2}, "metrics": null, "summary": "`Weather.match` returns a formatted string with rainfall for `Rain` type or \"not rain\" for other types.", "mode": "fast-check"} {"id": 59826, "name": "unknown", "code": "it('should return true for any string that is the same forwards and backwards (ignoring case and non-alphanumerics)', () => {\n fc.assert(\n fc.property(fc.string(), (s) => {\n // Normalize string: remove non-alphanumerics, lowercase\n const normalized = s.replace(/[^a-zA-Z0-9]/g, '').toLowerCase();\n const reversed = normalized.split('').reverse().join('');\n // If normalized === reversed, isPalindrome should be true\n if (normalized === reversed && normalized.length > 0) {\n return isPalindrome(s) === true;\n }\n // Otherwise, we don't care about the result\n return true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/mariogalea/qualitymatters-ts-fastcheck/tests/isPalindrome.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mariogalea/qualitymatters-ts-fastcheck", "url": "https://github.com/mariogalea/qualitymatters-ts-fastcheck.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`isPalindrome` should return true for strings that are identical forwards and backwards when normalized by removing non-alphanumeric characters and converting to lowercase.", "mode": "fast-check"} {"id": 59829, "name": "unknown", "code": "it('should deliver published events to all subscribers', () => {\n fc.assert(\n fc.property(fc.array(fc.string()), (events) => {\n const bus = new EventBus();\n const received: string[] = [];\n bus.subscribe((e) => received.push(e));\n for (const event of events) {\n bus.publish(event);\n }\n // All published events should be received in order\n return JSON.stringify(received) === JSON.stringify(events);\n })\n );\n })", "language": "typescript", "source_file": "./repos/mariogalea/qualitymatters-ts-fastcheck/tests/eventBus.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mariogalea/qualitymatters-ts-fastcheck", "url": "https://github.com/mariogalea/qualitymatters-ts-fastcheck.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Published events should be received by all subscribers in the correct order.", "mode": "fast-check"} {"id": 59842, "name": "unknown", "code": "test('getContests', () => {\n fc.assert(\n fc.property(electionDescription(groupContext), manifest => {\n manifest.ballotStyles.forEach(ballotStyle => {\n expect(\n manifest.getContests(ballotStyle.ballotStyleId).forEach(contest => {\n expect(ballotStyle.geopoliticalUnitIds).toContain(\n contest.geopoliticalUnitId\n );\n })\n );\n });\n })\n );\n })", "language": "typescript", "source_file": "./repos/shreyasminocha/egts/test/electionguard/ballot/manifest.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "shreyasminocha/egts", "url": "https://github.com/shreyasminocha/egts.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "For each ballot style in an election manifest, `getContests` retrieves contests with geopolitical unit IDs that match those in the ballot style.", "mode": "fast-check"} {"id": 59843, "name": "unknown", "code": "test(\"Shuffling selections doesn't affect equality\", () => {\n fc.assert(\n fc.property(\n fc\n .tuple(\n partyLists(groupContext, 5),\n fc.uniqueArray(geopoliticalUnit(groupContext), {minLength: 1})\n )\n .chain(([parties, gpIds]) =>\n contestDescription(groupContext, 1, parties, gpIds)\n ),\n c => {\n const contest = c.contestDescription;\n const copy = new ManifestContestDescription(\n groupContext,\n contest.contestId,\n contest.sequenceOrder,\n contest.geopoliticalUnitId,\n contest.voteVariation,\n contest.numberElected,\n contest.votesAllowed,\n contest.name,\n shuffleArray(contest.selections),\n contest.ballotTitle,\n contest.ballotSubtitle\n );\n\n expect(copy.equals(contest)).toBe(true);\n }\n ),\n fcFastConfig\n );\n })", "language": "typescript", "source_file": "./repos/shreyasminocha/egts/test/electionguard/ballot/manifest.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "shreyasminocha/egts", "url": "https://github.com/shreyasminocha/egts.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Shuffling the selections of a contest should not affect its equality with the original contest.", "mode": "fast-check"} {"id": 59855, "name": "unknown", "code": "test('An assertion failure is reproducible', () => {\n fc.assert(\n fc.property(fc.nat().noShrink(), (seed) => {\n const g = dev.Gen.integer();\n const p = dev.property(g, (x) => x < 5);\n\n const config0: Partial = { seed };\n const error0 = tryAssert(p, config0);\n expect(error0).not.toBeNull();\n expect(error0!.message).not.toEqual('');\n\n const reproductionJson = error0!.message.match(/Reproduction: (\\{.*\\})/)![1];\n const config1: Partial = JSON.parse(reproductionJson);\n const error1 = tryAssert(p, config1);\n expect(error1).not.toBeNull();\n expect(error1!.message).not.toEqual('');\n\n const normalizeMessage = (str: string): string => str.split('\\n').slice(1).join('\\n');\n const errorMessage0 = normalizeMessage(error0!.message);\n const errorMessage1 = normalizeMessage(error1!.message);\n expect(errorMessage0).toEqual(errorMessage1);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Runners/Assert.test.ts", "start_line": null, "end_line": null, "dependencies": ["tryAssert"], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "An assertion failure can be reproduced with a specific configuration, ensuring that error messages for the original and reproduced failures are identical.", "mode": "fast-check"} {"id": 59860, "name": "unknown", "code": "it('reflects [min, max, origin]', () => {\n fc.assert(\n fc.property(genRangeParams(), LocalGen.scaleMode(), ({ min, max, origin }, scaleMode) => {\n const range = Range.createFrom(nativeCalculator, min, max, origin, scaleMode);\n\n const expectedRange: Partial> = {\n bounds: [min, max],\n origin,\n };\n expect(range).toMatchObject(expectedRange);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Number/Range.test.ts", "start_line": null, "end_line": null, "dependencies": ["genRangeParams"], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Range.createFrom` should produce a range object with `min`, `max`, and `origin` properties matching the expected values from the input parameters.", "mode": "fast-check"} {"id": 54429, "name": "unknown", "code": "it('should be able to revert toRoman using fromRoman', () => {\n fc.assert(\n fc.property(romanNumberArb, (n) => {\n expect(fromRoman(toRoman(n))).toBe(n);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/003-misc/roman/main.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Converting a number to a Roman numeral and back should return the original number.", "mode": "fast-check"} {"id": 59868, "name": "unknown", "code": "it('returns [min,max] when given size = 100', () => {\n fc.assert(\n fc.property(genRangeParams(), ({ min, max, origin }) => {\n const range = Range.createFrom(nativeCalculator, min, max, origin, 'linear');\n\n const bounds = range.getSizedBounds(nativeCalculator.loadIntegerUnchecked(100));\n\n const expectedBounds: Bounds = [min, max];\n expect(bounds).toMatchObject(expectedBounds);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Number/Range.test.ts", "start_line": null, "end_line": null, "dependencies": ["genRangeParams"], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Returns the bounds [min, max] for a range when the size is set to 100.", "mode": "fast-check"} {"id": 59869, "name": "unknown", "code": "test('GenTree.unfold(x, id, , ) => a tree with a root node of x', () => {\n fc.assert(\n fc.property(\n domainGen.anything(),\n domainGen.func(domainGen.anyShrinks()),\n domainGen.func(domainGen.naturalNumber()),\n (x, accExpander, calculateComplexity) => {\n const tree = GenTree.unfold(x, id, accExpander, calculateComplexity);\n\n expect(tree.node.value).toEqual(x);\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/GenTree/GenTree.Unfold.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`GenTree.unfold` should produce a tree where the root node's value is equal to the initial input `x`.", "mode": "fast-check"} {"id": 59870, "name": "unknown", "code": "test('GenTree.unfold(x, , , ) => a tree with a root node of accToValue(x)', () => {\n fc.assert(\n fc.property(\n domainGen.anything(),\n domainGen.anyFunc(),\n domainGen.func(domainGen.anyShrinks()),\n domainGen.func(domainGen.naturalNumber()),\n (x, accToValue, accExpander, calculateComplexity) => {\n const tree = GenTree.unfold(x, accToValue, accExpander, calculateComplexity);\n\n expect(tree.node.value).toEqual(accToValue(x));\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/GenTree/GenTree.Unfold.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`GenTree.unfold` produces a tree where the root node's value is derived from `accToValue` applied to the initial argument `x`.", "mode": "fast-check"} {"id": 59875, "name": "unknown", "code": "test('GenTree.concat([tree1, tree2], , ) => the root node contains the root nodes of [tree1, tree2]', () => {\n fc.assert(\n fc.property(\n domainGen.anyTree(),\n domainGen.anyTree(),\n domainGen.naturalNumber(),\n (tree1, tree2, concatComplexity) => {\n const treeConcat = GenTree.concat([tree1, tree2], () => concatComplexity, Shrink.none());\n\n const expectedNode: GenTree.Node = {\n id: NodeId.join(tree1.node.id, tree2.node.id),\n value: [tree1.node.value, tree2.node.value],\n complexity: tree1.node.complexity + tree2.node.complexity + concatComplexity,\n };\n expect(treeConcat.node).toEqual(expectedNode);\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/GenTree/GenTree.Concat.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`GenTree.concat` combines two trees into a new root node containing the root nodes of the original trees, with complexity calculated as the sum of both tree complexities plus an additional complexity value.", "mode": "fast-check"} {"id": 59876, "name": "unknown", "code": "test.skip('GenTree.concat(trees, , ) => the root tree contains all the shrinks of each tree', () => {\n fc.assert(\n fc.property(\n domainGen.array(domainGen.anyTree()),\n domainGen.func(domainGen.naturalNumber()),\n (trees, calculateComplexity) => {\n const treeConcat = GenTree.concat(trees, calculateComplexity, Shrink.none());\n\n expect(count(treeConcat.shrinks)).toEqual(\n trees.reduce((accShrinkCount, tree) => accShrinkCount + count(tree.shrinks), 0),\n );\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/GenTree/GenTree.Concat.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The root tree produced by `GenTree.concat` should contain all the shrinks from each individual tree provided.", "mode": "fast-check"} {"id": 59883, "name": "unknown", "code": "test('Gen.integer().between(x, y).origin(z), size = 0 *produces* integers equal to z', () => {\n fc.assert(\n fc.property(domainGen.sampleConfig(), domainGen.setOfSize(domainGen.integer(), 3), (config, [a, b, c]) => {\n const [x, z, y] = [a, b, c].sort((a, b) => a - b);\n const gen = dev.Gen.integer().between(x, y).origin(z);\n\n const sample = dev.sample(gen, { ...config, size: 0 });\n\n for (const value of sample.values) {\n expect(value).toEqual(z);\n }\n }),\n );\n})", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Gen/Gen.Integer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "With `size` set to 0, the `Gen.integer().between(x, y).origin(z)` produces integers equal to `z`.", "mode": "fast-check"} {"id": 59884, "name": "unknown", "code": "test('Gen.integer().between(x, y).origin(z), size = 50 *produces* integers in the lower half of the range', () => {\n fc.assert(\n fc.property(\n domainGen.sampleConfig(),\n domainGen.setOfSize(domainGen.integer({ min: -100, max: 100 }), 3),\n (config, [a, b, c]) => {\n const [x, z, y] = [a, b, c].sort((a, b) => a - b);\n const gen = dev.Gen.integer().between(x, y).origin(z);\n\n const sample = dev.sample(gen, { ...config, size: 50 });\n\n const leftMidpoint = Math.floor((z - x) / 2 + x);\n const rightMidpoint = Math.ceil((y - z) / 2 + z);\n for (const value of sample.values) {\n expect(value).toBeGreaterThanOrEqual(leftMidpoint);\n expect(value).toBeLessThanOrEqual(rightMidpoint);\n }\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Gen/Gen.Integer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Gen.integer().between(x, y).origin(z)` produces integers concentrated in the lower half of the range between x and y when sampled with size 50.", "mode": "fast-check"} {"id": 59891, "name": "unknown", "code": "test('Gen.integer().lessThanEqual(x), x \u2209 \u2124 *produces* error; maximum must be an integer', () => {\n fc.assert(\n fc.property(domainGen.sampleConfig(), domainGen.decimalWithAtLeastOneDp(), (config, x) => {\n const gen = dev.Gen.integer().lessThanEqual(x);\n\n expect(() => dev.sample(gen, config)).toThrow('Maximum must be an integer');\n }),\n );\n })", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Gen/Gen.Integer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Gen.integer().lessThanEqual(x)` throws an error when `x` is not an integer, stating that the maximum must be an integer.", "mode": "fast-check"} {"id": 59892, "name": "unknown", "code": "test('Gen.integer().origin(x), x \u2209 \u2124 *produces* error; origin must be an integer', () => {\n fc.assert(\n fc.property(domainGen.sampleConfig(), domainGen.decimalWithAtLeastOneDp(), (config, x) => {\n const gen = dev.Gen.integer().origin(x);\n\n expect(() => dev.sample(gen, config)).toThrow('Origin must be an integer');\n }),\n );\n })", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Gen/Gen.Integer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Gen.integer().origin(x)` throws an error if `x` is not an integer, ensuring the origin must be an integer.", "mode": "fast-check"} {"id": 59900, "name": "unknown", "code": "test('default(max) = 10', () => {\n fc.assert(\n fc.property(domainGen.sampleConfig(), domainGen.gen(), (config, elementGen) => {\n const genDefault = dev.Gen.array(elementGen);\n const genAlt = dev.Gen.array(elementGen).ofMaxLength(10);\n\n expect(dev.sample(genDefault, config)).toEqual(dev.sample(genAlt, config));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Gen/Gen.Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The array generator's default maximum length is 10, matching the explicitly set maximum length of 10 in alternative generation.", "mode": "fast-check"} {"id": 59904, "name": "unknown", "code": "test('Gen.array(gen).ofLength(x) = Gen.array(gen).betweenLengths(x, x)', () => {\n fc.assert(\n fc.property(domainGen.sampleConfig(), domainGen.gen(), genArrayLength(), (config, elementGen, x) => {\n const genArray = dev.Gen.array(elementGen).ofLength(x);\n const genArrayAlt = dev.Gen.array(elementGen).betweenLengths(x, x);\n\n expect(dev.sample(genArray, config)).toEqual(dev.sample(genArrayAlt, config));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Gen/Gen.Array.test.ts", "start_line": null, "end_line": null, "dependencies": ["genArrayLength"], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should hold that generating an array of a specific length is equivalent to generating an array with both minimum and maximum lengths set to that specific length.", "mode": "fast-check"} {"id": 59905, "name": "unknown", "code": "test('Gen.array(gen).ofMinLength(x), x \u2209 \u2124 *produces* error; minimum must be an integer', () => {\n fc.assert(\n fc.property(domainGen.sampleConfig(), domainGen.gen(), domainGen.decimalWithAtLeastOneDp(), (config, gen, x) => {\n const genArray = dev.Gen.array(gen).ofMinLength(x);\n\n expect(() => dev.sample(genArray, config)).toThrowError('Minimum must be an integer');\n }),\n );\n })", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Gen/Gen.Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Calling `Gen.array(gen).ofMinLength(x)` with a non-integer `x` should produce an error stating that the minimum must be an integer.", "mode": "fast-check"} {"id": 59906, "name": "unknown", "code": "test('Gen.array(gen).ofMaxLength(x), x \u2209 \u2124 *produces* error; maximum must be an integer', () => {\n fc.assert(\n fc.property(domainGen.sampleConfig(), domainGen.gen(), domainGen.decimalWithAtLeastOneDp(), (config, gen, x) => {\n const genArray = dev.Gen.array(gen).ofMaxLength(x);\n\n expect(() => dev.sample(genArray, config)).toThrow('Maximum must be an integer');\n }),\n );\n })", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Gen/Gen.Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Generating an array with non-integer maximum length should produce an error with the message 'Maximum must be an integer'.", "mode": "fast-check"} {"id": 59907, "name": "unknown", "code": "test('Gen.array(gen).ofMinLength(x), x < 0 *produces* error; minimum must be at least 0', () => {\n fc.assert(\n fc.property(domainGen.sampleConfig(), domainGen.gen(), domainGen.integer({ max: -1 }), (config, gen, x) => {\n const genArray = dev.Gen.array(gen).ofMinLength(x);\n\n expect(() => dev.sample(genArray, config)).toThrow('Minimum must be at least 0');\n }),\n );\n })", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Gen/Gen.Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Generating an array with a specified minimum length less than 0 should produce an error stating the minimum must be at least 0.", "mode": "fast-check"} {"id": 59910, "name": "unknown", "code": "test.each([\n { label: 'ASCII', unit: 'binary-ascii' },\n { label: 'Printable characters', unit: 'grapheme' },\n { label: 'Full Unicode range', unit: 'binary' },\n {\n label: 'Special ASCII characters',\n unit: fc.constantFrom(...'-._~!$()*,;=:@/?[]{}\\\\|^')\n }\n ] as const)('Property-based fuzzy testing - $label', ({ unit }) => {\n fc.assert(\n fc.property(fc.string({ unit }), str => {\n const search = `?key=${encodeQueryValue(str)}`\n const expected = new URLSearchParams(search).get('key')\n expect(expected).toBe(str)\n })\n )\n })", "language": "typescript", "source_file": "./repos/rec-eng/nuqs/src/url-encoding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "rec-eng/nuqs", "url": "https://github.com/rec-eng/nuqs.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59911, "name": "unknown", "code": "describe('middlewares/max-time', () => {\n fc.assert(fc.property(fc.nat(), fc.nat(), (duration, max,) => {\n it(\n `throws only if the response is too slow(${ duration }<=${ max })`,\n () => {\n const response: Result = {\n id: 'example',\n validators: [],\n duration,\n maxDuration: max,\n response: {\n headers: {},\n cookies: {},\n uri: '',\n status: 0,\n body: '',\n },\n };\n if (duration > max) {\n expect(() => post(response,),)\n .to.throw(\n `The response time was above ${ max } ns`,\n );\n return;\n }\n expect(() => post(response,),).to.not.throw();\n },\n );\n },),);\n},)", "language": "typescript", "source_file": "./repos/flexDev914/framework/property/middlewares/max-time.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "flexDev914/framework", "url": "https://github.com/flexDev914/framework.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59912, "name": "unknown", "code": "describe('helper/language', () => {\n after(async() => {\n await locale('en',);\n },);\n fc.assert(fc.property(fc.string(), (lang,) => {\n it(`no_tasks should return english string if set to ${ lang }`, async() => {\n if (\n lang.match(/^[a-z]{2}$/u,)\n && existsSync(process.cwd() + 'language/' + lang + '.yml',)\n ) {\n //skip\n return true;\n }\n await locale(lang,);\n expect(language('no_tasks',),).to.be.equal('Can\\'t measure zero tasks.',);\n return true;\n },);\n },),);\n fc.assert(fc.property(fc.string(), (key,) => {\n it(`${ key } should return a string`, () => {\n expect(language(key as languageKey,),).to.be.a('string',);\n },);\n },),);\n},)", "language": "typescript", "source_file": "./repos/flexDev914/framework/property/helper/language.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "flexDev914/framework", "url": "https://github.com/flexDev914/framework.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59913, "name": "unknown", "code": "describe('helper/language', () => {\n after(async() => {\n await locale('en',);\n },);\n fc.assert(fc.property(fc.string(), (lang,) => {\n it(`no_tasks should return english string if set to ${ lang }`, async() => {\n if (\n lang.match(/^[a-z]{2}$/u,)\n && existsSync(process.cwd() + 'language/' + lang + '.yml',)\n ) {\n //skip\n return true;\n }\n await locale(lang,);\n expect(language('no_tasks',),).to.be.equal('Can\\'t measure zero tasks.',);\n return true;\n },);\n },),);\n fc.assert(fc.property(fc.string(), (key,) => {\n it(`${ key } should return a string`, () => {\n expect(language(key as languageKey,),).to.be.a('string',);\n },);\n },),);\n},)", "language": "typescript", "source_file": "./repos/flexDev914/framework/property/helper/language.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "flexDev914/framework", "url": "https://github.com/flexDev914/framework.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59914, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(MAC(), async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59915, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.MAC), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59916, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n hexaString({ minLength: 4, maxLength: 4 }),\n async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59917, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(hexaString({ minLength: 5 }), async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59918, "name": "unknown", "code": "it('does not allow to edit characters < 4', async () =>\n await fc.assert(\n fc.asyncProperty(\n hexaString({ minLength: 0, maxLength: 3 }),\n async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59919, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n hexaString({ minLength: 3, maxLength: 3 }),\n async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59920, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(hexaString({ minLength: 4 }), async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59921, "name": "unknown", "code": "it('does not allow to edit characters < 3', async () =>\n await fc.assert(\n fc.asyncProperty(\n hexaString({ minLength: 0, maxLength: 2 }),\n async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59922, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 0, max: 7 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59923, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 8 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59924, "name": "unknown", "code": "it('edits name attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tAsciName, 1, 32), async name => {\n inputs[0].value = name;\n await (inputs[0]).requestUpdate();\n expect(inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59925, "name": "unknown", "code": "it('rejects name attribute starting with decimals', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal, 1, 1), async name => {\n inputs[0].value = name;\n await (inputs[0]).requestUpdate();\n expect(inputs[0].checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59926, "name": "unknown", "code": "it('edits bufTime attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 0 }).map(num => `${num}`),\n async bufTime => {\n inputs[6].value = bufTime;\n await (inputs[6]).requestUpdate();\n expect(inputs[6].checkValidity()).to.be.true;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59927, "name": "unknown", "code": "it('rejects bufTime attribute starting with not being a unsigned int', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.uint, 1),\n async bufTime => {\n inputs[6].value = bufTime;\n await (inputs[6]).requestUpdate();\n expect(inputs[6].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59928, "name": "unknown", "code": "it('edits intgPd attribute only for valid inputs', async () => {\n const input = inputs[7];\n input.nullSwitch?.click();\n await input.requestUpdate();\n\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 0 }).map(num => `${num}`),\n async intgPd => {\n input.value = intgPd;\n await input.requestUpdate();\n expect(input.checkValidity()).to.be.true;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59929, "name": "unknown", "code": "it('rejects intgPd attribute starting with not being a unsigned int', async () => {\n const input = inputs[7];\n input.nullSwitch?.click();\n await input.requestUpdate();\n\n await fc.assert(\n fc.asyncProperty(regexString(inverseRegExp.uint, 1), async intgPd => {\n input.value = intgPd;\n await input.requestUpdate();\n expect(input.checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59930, "name": "unknown", "code": "it('edits prefix attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tAsciName, 1, 11), async name => {\n inputs[2].value = name;\n await (inputs[2]).requestUpdate();\n expect(inputs[2].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/lnode.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59931, "name": "unknown", "code": "it('rejects name attribute starting with decimals', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal, 1, 1), async name => {\n inputs[2].value = name;\n await (inputs[2]).requestUpdate();\n expect(inputs[2].checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/lnode.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59932, "name": "unknown", "code": "it('edits name attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tAsciName, 1, 32), async name => {\n inputs[0].value = name;\n await (inputs[0]).requestUpdate();\n expect(inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59933, "name": "unknown", "code": "it('rejects name attribute starting with decimals', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal, 1, 1), async name => {\n inputs[0].value = name;\n await (inputs[0]).requestUpdate();\n expect(inputs[0].checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59934, "name": "unknown", "code": "it('edits smpRate attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 0 }).map(num => `${num}`),\n async smpRate => {\n inputs[4].value = smpRate;\n await (inputs[4]).requestUpdate();\n expect(inputs[4].checkValidity()).to.be.true;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59935, "name": "unknown", "code": "it('rejects smpRate attribute in case input is not unsigned int', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.uint, 1),\n async smpRate => {\n inputs[4].value = smpRate;\n await (inputs[4]).requestUpdate();\n expect(inputs[4].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59936, "name": "unknown", "code": "it('edits nofASDU attribute only for valid inputs', async () => {\n const input = inputs[5];\n input.nullSwitch?.click();\n await input.requestUpdate();\n\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 0 }).map(num => `${num}`),\n async nofASDU => {\n input.value = nofASDU;\n await input.requestUpdate();\n expect(input.checkValidity()).to.be.true;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59937, "name": "unknown", "code": "it('rejects nofASDU attribute in case input is not unsigned int', async () => {\n const input = inputs[5];\n input.nullSwitch?.click();\n await input.requestUpdate();\n\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.uint, 1),\n async nofASDU => {\n input.value = nofASDU;\n await input.requestUpdate();\n expect(input.checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59938, "name": "unknown", "code": "it('edits name attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tAsciName, 1, 32), async name => {\n nameTextField.value = name;\n await nameTextField.requestUpdate();\n expect(nameTextField.checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/gsecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59939, "name": "unknown", "code": "it('rejects name attribute starting with decimals', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal, 1, 1), async name => {\n nameTextField.value = name;\n await nameTextField.requestUpdate();\n expect(nameTextField.checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/gsecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59940, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV4(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59941, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv4), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59942, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV4(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59943, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv4), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59944, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV4(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59945, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv4), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59946, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(regExp.OSI, 1, 8), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59947, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59948, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSI, 1, 16),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59949, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59950, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSI, 1, 16),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59951, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59952, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(regExp.OSIAPi, 1), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59953, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSIAPi), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59954, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSIid, 1, 5),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59955, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSIid), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59956, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSIid, 1, 5),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59957, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSIid), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59958, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSIid, 1, 5),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59959, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSIid), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59960, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSI, 1, 40),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59961, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59962, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(regExp.OSI, 3, 3), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59963, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59964, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(/^[0-7]$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59965, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-7]$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59966, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n nat({ max: 65535 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59967, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59968, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n nat({ max: 65535 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59969, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59970, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(/^\\S*$/, 1), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59971, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n nat({ max: 65535 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59972, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59973, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n nat({ max: 65535 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59974, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59976, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59977, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV6(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59978, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv6), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59979, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV6SubNet(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59980, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9/]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59981, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV6(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59982, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv6), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59983, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n fc.hexaString({ minLength: 1, maxLength: 5 }),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59984, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n invertedRegex(/^[0-9a-fA-F]{1,5}$/),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59985, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n nat({ max: 255 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59986, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59987, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV6(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59988, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv6), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59989, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV4(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59990, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv4), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59991, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(regExp.OSI, 1, 2), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59992, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59993, "name": "unknown", "code": "it('edits name attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.abstractDataAttributeName, 1, 32),\n async name => {\n nameTextField.value = name;\n await nameTextField.requestUpdate();\n expect(nameTextField.checkValidity()).to.be.true;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/abstractda.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59994, "name": "unknown", "code": "it('rejects name attribute starting with decimals', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal, 1, 1), async name => {\n nameTextField.value = name;\n await nameTextField.requestUpdate();\n expect(nameTextField.checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/abstractda.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59995, "name": "unknown", "code": "it('for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.lnClass, 4, 4),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/editors/templates/lnodetype-wizard.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59996, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tName, 1), async name => {\n parent.wizardUI.inputs[0].value = name;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59997, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc), async desc => {\n parent.wizardUI.inputs[1].value = desc;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[1].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59998, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.unsigned, 1), async nomFreq => {\n parent.wizardUI.inputs[2].value = nomFreq;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[2].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 59999, "name": "unknown", "code": "it('rejects action for invalid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.unsigned, 1),\n async nomFreq => {\n parent.wizardUI.inputs[2].value = nomFreq;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[2].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60000, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(fc.integer(1, 255), async numPhases => {\n parent.wizardUI.inputs[3].value = String(numPhases);\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[3].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60001, "name": "unknown", "code": "it('rejects edition for invalid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.integer, 1),\n async nomFreq => {\n parent.wizardUI.inputs[3].value = nomFreq;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[3].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60002, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal), async nomFreq => {\n parent.wizardUI.inputs[4].value = nomFreq;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[4].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60003, "name": "unknown", "code": "it('rejects edition for invalid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.decimal, 1),\n async voltage => {\n parent.wizardUI.inputs[4].value = voltage;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[4].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60004, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tName, 1), async name => {\n parent.wizardUI.inputs[1].value = name;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/integration/editors/substation/conducting-equipment-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60005, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc), async desc => {\n parent.wizardUI.inputs[2].value = desc;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[1].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/integration/editors/substation/conducting-equipment-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60006, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tName, 1), async name => {\n parent.wizardUI.inputs[0].value = name;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/integration/editors/substation/bay-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60007, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc), async desc => {\n parent.wizardUI.inputs[1].value = desc;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[1].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/integration/editors/substation/bay-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60008, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tName, 1), async name => {\n parent.wizardUI.inputs[0].value = name;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/integration/editors/substation/substation-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60009, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc), async desc => {\n parent.wizardUI.inputs[1].value = desc;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[1].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/integration/editors/substation/substation-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60010, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tName, 1), async name => {\n parent.wizardUI.inputs[0].value = name;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/integration/editors/communication/subnetwork-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60011, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc), async desc => {\n parent.wizardUI.inputs[1].value = desc;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[1].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/integration/editors/communication/subnetwork-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60012, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc, 1), async type => {\n parent.wizardUI.inputs[2].value = type;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[2].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/integration/editors/communication/subnetwork-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60013, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal), async BitRate => {\n parent.wizardUI.inputs[3].value = BitRate;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[3].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/integration/editors/communication/subnetwork-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60014, "name": "unknown", "code": "it('rejects edition for invalid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.decimal, 1),\n async BitRate => {\n parent.wizardUI.inputs[3].value = BitRate;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[3].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/integration/editors/communication/subnetwork-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60015, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(MAC(), async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60016, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.MAC), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60017, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n hexaString({ minLength: 4, maxLength: 4 }),\n async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60018, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(hexaString({ minLength: 5 }), async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60019, "name": "unknown", "code": "it('does not allow to edit characters < 4', async () =>\n await fc.assert(\n fc.asyncProperty(\n hexaString({ minLength: 0, maxLength: 3 }),\n async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60020, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n hexaString({ minLength: 3, maxLength: 3 }),\n async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60021, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(hexaString({ minLength: 4 }), async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60022, "name": "unknown", "code": "it('does not allow to edit characters < 3', async () =>\n await fc.assert(\n fc.asyncProperty(\n hexaString({ minLength: 0, maxLength: 2 }),\n async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60023, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 0, max: 7 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60024, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 8 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60025, "name": "unknown", "code": "it('edits name attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tAsciName, 1, 32), async name => {\n inputs[0].value = name;\n await (inputs[0]).requestUpdate();\n expect(inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60026, "name": "unknown", "code": "it('rejects name attribute starting with decimals', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal, 1, 1), async name => {\n inputs[0].value = name;\n await (inputs[0]).requestUpdate();\n expect(inputs[0].checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60027, "name": "unknown", "code": "it('edits smpRate attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 0 }).map(num => `${num}`),\n async smpRate => {\n inputs[4].value = smpRate;\n await (inputs[4]).requestUpdate();\n expect(inputs[4].checkValidity()).to.be.true;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60028, "name": "unknown", "code": "it('rejects smpRate attribute in case input is not unsigned int', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.uint, 1),\n async smpRate => {\n inputs[4].value = smpRate;\n await (inputs[4]).requestUpdate();\n expect(inputs[4].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60029, "name": "unknown", "code": "it('edits nofASDU attribute only for valid inputs', async () => {\n const input = inputs[5];\n input.nullSwitch?.click();\n await input.requestUpdate();\n\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 0 }).map(num => `${num}`),\n async nofASDU => {\n input.value = nofASDU;\n await input.requestUpdate();\n expect(input.checkValidity()).to.be.true;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60030, "name": "unknown", "code": "it('rejects nofASDU attribute in case input is not unsigned int', async () => {\n const input = inputs[5];\n input.nullSwitch?.click();\n await input.requestUpdate();\n\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.uint, 1),\n async nofASDU => {\n input.value = nofASDU;\n await input.requestUpdate();\n expect(input.checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60031, "name": "unknown", "code": "it('edits name attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tAsciName, 1, 32), async name => {\n inputs[0].value = name;\n await (inputs[0]).requestUpdate();\n expect(inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60032, "name": "unknown", "code": "it('rejects name attribute starting with decimals', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal, 1, 1), async name => {\n inputs[0].value = name;\n await (inputs[0]).requestUpdate();\n expect(inputs[0].checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60033, "name": "unknown", "code": "it('edits bufTime attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 0 }).map(num => `${num}`),\n async bufTime => {\n inputs[6].value = bufTime;\n await (inputs[6]).requestUpdate();\n expect(inputs[6].checkValidity()).to.be.true;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60034, "name": "unknown", "code": "it('rejects bufTime attribute starting with not being a unsigned int', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.uint, 1),\n async bufTime => {\n inputs[6].value = bufTime;\n await (inputs[6]).requestUpdate();\n expect(inputs[6].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60035, "name": "unknown", "code": "it('edits intgPd attribute only for valid inputs', async () => {\n const input = inputs[7];\n input.nullSwitch?.click();\n await input.requestUpdate();\n\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 0 }).map(num => `${num}`),\n async intgPd => {\n input.value = intgPd;\n await input.requestUpdate();\n expect(input.checkValidity()).to.be.true;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60036, "name": "unknown", "code": "it('rejects intgPd attribute starting with not being a unsigned int', async () => {\n const input = inputs[7];\n input.nullSwitch?.click();\n await input.requestUpdate();\n\n await fc.assert(\n fc.asyncProperty(regexString(inverseRegExp.uint, 1), async intgPd => {\n input.value = intgPd;\n await input.requestUpdate();\n expect(input.checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60037, "name": "unknown", "code": "it('edits prefix attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tAsciName, 1, 11), async name => {\n inputs[2].value = name;\n await (inputs[2]).requestUpdate();\n expect(inputs[2].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/lnode.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60038, "name": "unknown", "code": "it('rejects name attribute starting with decimals', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal, 1, 1), async name => {\n inputs[2].value = name;\n await (inputs[2]).requestUpdate();\n expect(inputs[2].checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/lnode.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60039, "name": "unknown", "code": "it('edits name attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tAsciName, 1, 32), async name => {\n nameTextField.value = name;\n await nameTextField.requestUpdate();\n expect(nameTextField.checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/gsecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60040, "name": "unknown", "code": "it('rejects name attribute starting with decimals', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal, 1, 1), async name => {\n nameTextField.value = name;\n await nameTextField.requestUpdate();\n expect(nameTextField.checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/gsecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60041, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV4(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60042, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv4), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60043, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV4(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60044, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv4), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60045, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV4(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60046, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv4), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60047, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(regExp.OSI, 1, 8), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60048, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60049, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSI, 1, 16),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60050, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60051, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSI, 1, 16),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60052, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60053, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(regExp.OSIAPi, 1), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60054, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSIAPi), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60055, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSIid, 1, 5),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60056, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSIid), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60057, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSIid, 1, 5),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60058, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSIid), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60059, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSIid, 1, 5),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60060, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSIid), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60061, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSI, 1, 40),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60062, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60063, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(regExp.OSI, 3, 3), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60064, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60065, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(/^[0-7]$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60066, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-7]$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60067, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n nat({ max: 65535 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60068, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60069, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n nat({ max: 65535 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60070, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60071, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(/^\\S*$/, 1), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60072, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n nat({ max: 65535 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60073, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60074, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n nat({ max: 65535 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60075, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60076, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 1025, max: 65535 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60077, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60078, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV6(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60079, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv6), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60080, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV6SubNet(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60081, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9/]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60082, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV6(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60083, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv6), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60084, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n fc.hexaString({ minLength: 1, maxLength: 5 }),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60085, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n invertedRegex(/^[0-9a-fA-F]{1,5}$/),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60086, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n nat({ max: 255 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60087, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60088, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV6(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60089, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv6), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60090, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV4(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60091, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv4), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60092, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(regExp.OSI, 1, 2), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60093, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60094, "name": "unknown", "code": "it('edits name attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.abstractDataAttributeName, 1, 32),\n async name => {\n nameTextField.value = name;\n await nameTextField.requestUpdate();\n expect(nameTextField.checkValidity()).to.be.true;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/abstractda.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60095, "name": "unknown", "code": "it('rejects name attribute starting with decimals', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal, 1, 1), async name => {\n nameTextField.value = name;\n await nameTextField.requestUpdate();\n expect(nameTextField.checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/wizards/abstractda.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60096, "name": "unknown", "code": "it('for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.lnClass, 4, 4),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/unit/editors/templates/lnodetype-wizard.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60097, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tName, 1), async name => {\n parent.wizardUI.inputs[0].value = name;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60098, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc), async desc => {\n parent.wizardUI.inputs[1].value = desc;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[1].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60099, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.unsigned, 1), async nomFreq => {\n parent.wizardUI.inputs[2].value = nomFreq;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[2].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60100, "name": "unknown", "code": "it('rejects action for invalid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.unsigned, 1),\n async nomFreq => {\n parent.wizardUI.inputs[2].value = nomFreq;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[2].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60101, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(fc.integer(1, 255), async numPhases => {\n parent.wizardUI.inputs[3].value = String(numPhases);\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[3].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60102, "name": "unknown", "code": "it('rejects edition for invalid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.integer, 1),\n async nomFreq => {\n parent.wizardUI.inputs[3].value = nomFreq;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[3].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60103, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal), async nomFreq => {\n parent.wizardUI.inputs[4].value = nomFreq;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[4].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60104, "name": "unknown", "code": "it('rejects edition for invalid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.decimal, 1),\n async voltage => {\n parent.wizardUI.inputs[4].value = voltage;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[4].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60105, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tName, 1), async name => {\n parent.wizardUI.inputs[1].value = name;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/integration/editors/substation/conducting-equipment-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60106, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc), async desc => {\n parent.wizardUI.inputs[2].value = desc;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[1].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/integration/editors/substation/conducting-equipment-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60107, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tName, 1), async name => {\n parent.wizardUI.inputs[0].value = name;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/integration/editors/substation/bay-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60108, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc), async desc => {\n parent.wizardUI.inputs[1].value = desc;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[1].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/integration/editors/substation/bay-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60109, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tName, 1), async name => {\n parent.wizardUI.inputs[0].value = name;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/integration/editors/communication/subnetwork-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60110, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc), async desc => {\n parent.wizardUI.inputs[1].value = desc;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[1].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/integration/editors/communication/subnetwork-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60111, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc, 1), async type => {\n parent.wizardUI.inputs[2].value = type;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[2].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/integration/editors/communication/subnetwork-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60112, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal), async BitRate => {\n parent.wizardUI.inputs[3].value = BitRate;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[3].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/integration/editors/communication/subnetwork-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60113, "name": "unknown", "code": "it('rejects edition for invalid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.decimal, 1),\n async BitRate => {\n parent.wizardUI.inputs[3].value = BitRate;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[3].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/integration/editors/communication/subnetwork-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60114, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tName, 1), async name => {\n parent.wizardUI.inputs[0].value = name;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/integration/editors/substation/substation-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60115, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc), async desc => {\n parent.wizardUI.inputs[1].value = desc;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[1].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/trusz/open-scd-self-contained-plugins/packages/plugins/test/integration/editors/substation/substation-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/open-scd-self-contained-plugins", "url": "https://github.com/trusz/open-scd-self-contained-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60119, "name": "unknown", "code": "it.concurrent('returns a number for the value object', () => {\n fc.assert(\n fc.property(valueObjArb, (valueObj) => {\n expect(typeof valueObj.hashCode()).toBe('number');\n }),\n );\n })", "language": "typescript", "source_file": "./repos/determined-ai/determined/webui/react/src/utils/asValueObject.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "determined-ai/determined", "url": "https://github.com/determined-ai/determined.git", "license": "Apache-2.0", "stars": 3159, "forks": 365}, "metrics": null, "summary": "`hashCode` method of `valueObj` returns a number.", "mode": "fast-check"} {"id": 60120, "name": "unknown", "code": "it.concurrent('returns different numbers for different value objects', () => {\n fc.assert(\n fc.property(differValueObjArb, ([testVal, other]) => {\n expect(testVal.hashCode()).not.toEqual(other.hashCode());\n }),\n );\n })", "language": "typescript", "source_file": "./repos/determined-ai/determined/webui/react/src/utils/asValueObject.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "determined-ai/determined", "url": "https://github.com/determined-ai/determined.git", "license": "Apache-2.0", "stars": 3159, "forks": 365}, "metrics": null, "summary": "`hashCode()` produces different results for different value objects.", "mode": "fast-check"} {"id": 60121, "name": "unknown", "code": "it.concurrent('only includes values in the codec in the hash', () => {\n fc.assert(\n fc.property(extraValueObjArb, ([testObj, extraObj]) => {\n expect(testObj.hashCode()).toEqual(extraObj.hashCode());\n }),\n );\n })", "language": "typescript", "source_file": "./repos/determined-ai/determined/webui/react/src/utils/asValueObject.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "determined-ai/determined", "url": "https://github.com/determined-ai/determined.git", "license": "Apache-2.0", "stars": 3159, "forks": 365}, "metrics": null, "summary": "Only values included in the codec affect the hash code of the object.", "mode": "fast-check"} {"id": 60123, "name": "unknown", "code": "it.concurrent(\"returns false if the objects aren't equal\", () => {\n fc.assert(\n fc.property(differValueObjArb, ([valueObj, otherObj]) => {\n expect(valueObj.equals(otherObj)).toBe(false);\n expect(otherObj.equals(valueObj)).toBe(false);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/determined-ai/determined/webui/react/src/utils/asValueObject.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "determined-ai/determined", "url": "https://github.com/determined-ai/determined.git", "license": "Apache-2.0", "stars": 3159, "forks": 365}, "metrics": null, "summary": "The property should hold that for pairs of different value objects, the `equals` method returns false for both objects.", "mode": "fast-check"} {"id": 60125, "name": "unknown", "code": "it.concurrent('immutable.is returns false when setting to another object', () => {\n fc.assert(\n fc.property(withMapArb(differValueObjArb), ([valueMap, otherMap]) => {\n expect(is(valueMap, otherMap)).toBe(false);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/determined-ai/determined/webui/react/src/utils/asValueObject.test.ts", "start_line": null, "end_line": null, "dependencies": ["withMapArb"], "repo": {"name": "determined-ai/determined", "url": "https://github.com/determined-ai/determined.git", "license": "Apache-2.0", "stars": 3159, "forks": 365}, "metrics": null, "summary": "`immutable.is` returns false when comparing two different map objects.", "mode": "fast-check"} {"id": 60126, "name": "unknown", "code": "it.concurrent('immutable.is returns true when setting to an object with extra props', () => {\n fc.assert(\n fc.property(withMapArb(extraValueObjArb), ([valueMap, otherMap]) => {\n expect(is(valueMap, otherMap)).toBe(true);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/determined-ai/determined/webui/react/src/utils/asValueObject.test.ts", "start_line": null, "end_line": null, "dependencies": ["withMapArb"], "repo": {"name": "determined-ai/determined", "url": "https://github.com/determined-ai/determined.git", "license": "Apache-2.0", "stars": 3159, "forks": 365}, "metrics": null, "summary": "`immutable.is` should return true when comparing two maps, where one map is a copy of the other with additional properties.", "mode": "fast-check"} {"id": 60129, "name": "unknown", "code": "it('merged abort controller aborts if any constituent aborts', () => {\n fc.assert(\n fc.property(argArbWithSelection(1), ([args, abortControllers]) => {\n const [abortController] = abortControllers;\n const result = mergeAbortControllers(...args);\n\n abortController.abort();\n expect(result.signal.aborted).toBe(true);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/determined-ai/determined/webui/react/src/utils/mergeAbortControllers.test.ts", "start_line": null, "end_line": null, "dependencies": ["argArbWithSelection"], "repo": {"name": "determined-ai/determined", "url": "https://github.com/determined-ai/determined.git", "license": "Apache-2.0", "stars": 3159, "forks": 365}, "metrics": null, "summary": "The merged abort controller's signal should be aborted if any constituent abort controller is aborted.", "mode": "fast-check"} {"id": 60132, "name": "unknown", "code": "it('merging an aborted controller results in an aborted controller', () => {\n fc.assert(\n fc.property(argArbWithSelection(1), ([args, abortControllers]) => {\n const [abortController] = abortControllers;\n abortController.abort();\n const result = mergeAbortControllers(...args);\n\n expect(result.signal.aborted).toBe(true);\n expect(result.signal.reason).toBe(abortController.signal.reason);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/determined-ai/determined/webui/react/src/utils/mergeAbortControllers.test.ts", "start_line": null, "end_line": null, "dependencies": ["argArbWithSelection"], "repo": {"name": "determined-ai/determined", "url": "https://github.com/determined-ai/determined.git", "license": "Apache-2.0", "stars": 3159, "forks": 365}, "metrics": null, "summary": "Merging abort controllers, including an aborted one, results in a controller that is also aborted with the same reason.", "mode": "fast-check"} {"id": 60134, "name": "unknown", "code": "it(\"performs the effect N + 1 times if it continues to fail\", () =>\n fc.assert(\n fc.asyncProperty(fc.integer({ min: 0, max: 10 }), async (retryCount) => {\n let attempts = 0;\n const io = IO(() => (attempts = attempts + 1))\n .andThen(() => IO.raise(\"Always fails\"))\n .retry(retryCount);\n\n await expect(io.run()).rejects.toBe(\"Always fails\");\n expect(attempts).toBe(retryCount + 1);\n })\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/retry.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "An effect is attempted `N + 1` times when it persistently fails, based on the specified retry count `N`.", "mode": "fast-check"} {"id": 60135, "name": "unknown", "code": "it(\"succeeds if the IO succeeds before the retries are exhausted\", () =>\n fc.assert(\n fc.asyncProperty(\n fc.integer({ min: 0, max: 10 }),\n fc.integer({ min: 0, max: 10 }),\n async (retryCount, attemptsBeforeSuccess) => {\n fc.pre(retryCount >= attemptsBeforeSuccess);\n\n let attempts = 0;\n\n const io = IO(() => (attempts = attempts + 1))\n .andThen((attempts) =>\n attempts > attemptsBeforeSuccess\n ? IO.wrap(\"success\")\n : IO.raise(\"fail\")\n )\n .retry({ count: retryCount });\n\n await expect(io.run()).resolves.toBe(\"success\");\n }\n )\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/retry.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The `IO` operation should succeed with a result of \"success\" if the number of permitted retries is greater than or equal to the attempts needed to succeed.", "mode": "fast-check"} {"id": 60141, "name": "unknown", "code": "it(\"can be updated with a pure function using the modify instance method\", () =>\n fc.assert(\n fc.asyncProperty(fc.integer(), async (initialValue) => {\n const program = Ref.create(initialValue).andThen((ref) =>\n // return a tuple of the result of \"modify\" and the ref's value\n // afterwards, to check they are equal.\n IO.sequence([ref.modify((x) => x + 1), ref.get] as const)\n );\n\n const result = await program.run();\n expect(result[0]).toBe(initialValue + 1);\n expect(result[1]).toBe(initialValue + 1);\n })\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/ref.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The `modify` method of a `Ref` instance should correctly update its value using a pure function, resulting in the updated value being consistent when retrieved immediately after modification.", "mode": "fast-check"} {"id": 54433, "name": "unknown", "code": "it('should return same value for positive and negative romans excluding minus sign', () => {\n fc.assert(\n fc.property(posRomanNumberArb, (n) => {\n expect(toRoman(-n)).toBe(`-${toRoman(n)}`);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/003-misc/roman/main.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The conversion of a positive Roman numeral to its negative form should correctly prepend a minus sign without altering the numeral representation.", "mode": "fast-check"} {"id": 60148, "name": "unknown", "code": "it(\"obeys the law that `wrap` is a left-identity for `andThen`\", () =>\n fc.assert(\n fc.asyncProperty(\n fc.anything(),\n arbitraries.unaryFunction.map(IO.lift),\n async (x, f) => {\n const wrapPlusAndThen = IO.wrap(x).andThen(f);\n const directCall = f(x);\n expect(await wrapPlusAndThen.run()).toEqual(await directCall.run());\n }\n )\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/monad-laws.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The property verifies that using `wrap` followed by `andThen` on a value is equivalent to directly applying a function elevated to `IO`.", "mode": "fast-check"} {"id": 60149, "name": "unknown", "code": "it(\"obeys the law that `wrap` is a right-identity for `andThen`\", () =>\n fc.assert(\n fc.asyncProperty(arbitraries.successfulIo, async (io) => {\n const andThenWithWrap = io.andThen((a) => IO.wrap(a));\n expect(await andThenWithWrap.run()).toEqual(await io.run());\n })\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/monad-laws.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`andThen` followed by `wrap` should preserve the original `IO` operation, acting as a right-identity.", "mode": "fast-check"} {"id": 60150, "name": "unknown", "code": "it(\"obeys the law that bind is associative\", () =>\n fc.assert(\n fc.asyncProperty(\n arbitraries.successfulIo,\n arbitraries.unaryFunction.map(IO.lift),\n arbitraries.unaryFunction.map(IO.lift),\n async (io, f, g) => {\n const leftAssociative = io.andThen((a) => f(a).andThen((b) => g(b)));\n const rightAssociative = io.andThen((a) => f(a)).andThen((b) => g(b));\n expect(await leftAssociative.run()).toEqual(\n await rightAssociative.run()\n );\n }\n )\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/monad-laws.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The `bind` operation on `IO` monads should be associative, meaning that the order in which monadic functions are bound does not change the result.", "mode": "fast-check"} {"id": 60152, "name": "unknown", "code": "it(\"creates an IO which rejects when run if the side-effect throws\", () =>\n fc.assert(\n fc.asyncProperty(fc.anything(), (thrownValue) => {\n const effect = () => {\n throw thrownValue;\n };\n return expect(IO(effect).run()).rejects.toBe(thrownValue);\n })\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/core.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Executing an `IO` with a side-effect that throws should result in a rejected promise with the thrown value.", "mode": "fast-check"} {"id": 60162, "name": "unknown", "code": "it(\"combines an array of IOs into a single IO returning the earliest result to resolve\", () =>\n fc.assert(\n fc.asyncProperty(\n fc.array(fc.integer({ min: 0, max: 4 }).map((int) => int * 10)),\n async (delays) => {\n // IO.race does not allow empty arrays\n fc.pre(delays.length > 0);\n\n // An array of actions which each wait the specified delay\n // before returning its value.\n const actions = delays.map((delay) =>\n IO.wrap(delay).delay(delay, \"milliseconds\")\n );\n\n const expectedWinner = Math.min(...delays);\n const raced = IO.race([actions[0], ...actions.slice(1)]);\n const winner = await raced.run();\n return expect(winner).toEqual(expectedWinner);\n }\n )\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/concurrency.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Combining an array of IO actions should return the result of the earliest resolving action based on specified delays.", "mode": "fast-check"} {"id": 60163, "name": "unknown", "code": "it(\"replaces the resulting value of a successful IO with the provided value\", () =>\n fc.assert(\n fc.asyncProperty(\n arbitraries.successfulIo,\n fc.anything(),\n async (io, replacementValue) => {\n await expect(io.as(replacementValue).run()).resolves.toBe(\n replacementValue\n );\n }\n )\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/as.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Replacing the result of a successful IO operation with a specified value should yield that value when executed.", "mode": "fast-check"} {"id": 60164, "name": "unknown", "code": "it(\"has no effect on an IO which fails\", () =>\n fc.assert(\n fc.asyncProperty(\n arbitraries.unsuccessfulIo,\n fc.anything(),\n async (io, replacementValue) => {\n const resultWithAs = await io.as(replacementValue).runSafe();\n const resultWithoutAs = await io.runSafe();\n expect(resultWithAs).toEqual(resultWithoutAs);\n }\n )\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/as.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Applying `as` to a failing IO should not alter the result of `runSafe`.", "mode": "fast-check"} {"id": 60176, "name": "unknown", "code": "test(\"encoded, decode pairing Changes\", () => {\n fc.assert(\n fc.property(\n fc.uint8Array({ minLength: 16, maxLength: 16 }),\n fc.tuple(fc.bigIntN(64), fc.integer({ min: 0 })),\n fc.array(\n fc.tuple(\n fc.string(),\n fc.uint8Array({ minLength: 1, maxLength: 10 }),\n fc.string(),\n fc.oneof(\n fc.string(),\n fc.boolean(),\n fc.integer(),\n fc.double(),\n fc.constant(null),\n fc.bigInt({\n min: BigInt(Number.MAX_SAFE_INTEGER) + 1n,\n max: 9223372036854775807n,\n }),\n fc.uint8Array()\n ),\n fc.bigIntN(64),\n fc.bigIntN(64),\n fc.oneof(\n fc.uint8Array({ minLength: 16, maxLength: 16 }),\n fc.constant(null)\n ),\n fc.bigIntN(64),\n fc.integer({ min: 0 })\n )\n ),\n (sender, since, changes) => {\n const msg = {\n _tag: tags.Changes,\n sender,\n since,\n changes,\n } as const;\n const encoded = encode(msg);\n const decoded = decode(encoded);\n expect(decoded).toEqual(msg);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/vlcn-io/js/packages/ws-common/src/__tests__/encodeDecode.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "vlcn-io/js", "url": "https://github.com/vlcn-io/js.git", "license": "MIT", "stars": 67, "forks": 8}, "metrics": null, "summary": "Encoding and decoding a message containing changes should result in the original message being accurately reconstructed.", "mode": "fast-check"} {"id": 60178, "name": "unknown", "code": "test(\"encoded, decode pairing StartStreaming\", () => {\n fc.assert(\n fc.property(\n fc.tuple(fc.bigIntN(64), fc.integer({ min: 0 })),\n fc.array(fc.uint8Array({ minLength: 16, maxLength: 16 })),\n fc.boolean(),\n (since, excludeSites, localOnly) => {\n const msg = {\n _tag: tags.StartStreaming,\n since,\n excludeSites,\n localOnly,\n } as const;\n const encoded = encode(msg);\n const decoded = decode(encoded);\n expect(decoded).toEqual(msg);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/vlcn-io/js/packages/ws-common/src/__tests__/encodeDecode.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "vlcn-io/js", "url": "https://github.com/vlcn-io/js.git", "license": "MIT", "stars": 67, "forks": 8}, "metrics": null, "summary": "Encoding and decoding a `StartStreaming` message should result in the original message.", "mode": "fast-check"} {"id": 60185, "name": "unknown", "code": "test(\"encode, decode pairing for EstablishOutboundStreamMsg\", () => {\n fc.assert(\n fc.property(\n fc.uint8Array({ minLength: 16, maxLength: 16 }),\n fc.uint8Array({ minLength: 16, maxLength: 16 }),\n fc.tuple(fc.bigIntN(64), fc.integer({ min: 0 })),\n fc.bigIntN(64),\n (toDbid, fromDbid, seqStart, schemaVersion) => {\n const serializer = new JsonSerializer();\n const msg = {\n _tag: tags.establishOutboundStream,\n toDbid,\n fromDbid,\n seqStart,\n schemaVersion,\n } as const;\n const encoded = JSON.stringify(serializer.encode(msg));\n const decoded = serializer.decode(JSON.parse(encoded));\n expect(decoded).toEqual(msg);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/vlcn-io/js/packages/direct-connect-common/src/msg/__tests__/JsonSerializer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "vlcn-io/js", "url": "https://github.com/vlcn-io/js.git", "license": "MIT", "stars": 67, "forks": 8}, "metrics": null, "summary": "Encoding and decoding operations using `JsonSerializer` for `EstablishOutboundStreamMsg` should maintain message equality.", "mode": "fast-check"} {"id": 60186, "name": "unknown", "code": "test(\"encode, decode pairing for AckChangesMsg\", () => {\n fc.assert(\n fc.property(fc.tuple(fc.bigIntN(64), fc.integer({ min: 0 })), (seqEnd) => {\n const serializer = new JsonSerializer();\n const msg = { _tag: tags.ackChanges, seqEnd } as const;\n const encoded = JSON.stringify(serializer.encode(msg));\n const decoded = serializer.decode(JSON.parse(encoded));\n expect(decoded).toEqual(msg);\n })\n );\n})", "language": "typescript", "source_file": "./repos/vlcn-io/js/packages/direct-connect-common/src/msg/__tests__/JsonSerializer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "vlcn-io/js", "url": "https://github.com/vlcn-io/js.git", "license": "MIT", "stars": 67, "forks": 8}, "metrics": null, "summary": "Encoding and decoding using `JsonSerializer` should result in the original `AckChangesMsg` object.", "mode": "fast-check"} {"id": 60206, "name": "unknown", "code": "it(\"should correctly merge Tailwind CSS classes and fuzzed input\", () => {\n fc.assert(\n fc.property(fc.string(), (className) => {\n if (className.trim() === \"\") {\n return expect(cn(\"px-2 py-1\", \"px-4\", className)).toBe(\"py-1 px-4\");\n }\n\n expect(cn(\"px-2 py-1\", \"px-4\", className)).toBe(\n `py-1 px-4 ${className.trim().replace(/\\s{2,}/g, \" \")}`,\n );\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dsm23/dsm23-bun-next-template/src/utils/fuzz.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dsm23/dsm23-bun-next-template", "url": "https://github.com/dsm23/dsm23-bun-next-template.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`cn` merges Tailwind CSS classes, ensuring trimmed input and resolving class conflicts by keeping the latter.", "mode": "fast-check"} {"id": 60207, "name": "unknown", "code": "it('should preserve date ordering', () => {\n fc.assert(\n fc.property(fc.tuple(fc.date(), fc.date()), ([date1, date2]) => {\n // Property: Date comparison should be consistent\n const comparison = date1.getTime() - date2.getTime();\n\n if (comparison < 0) {\n return date1 < date2;\n } else if (comparison > 0) {\n return date1 > date2;\n } else {\n return date1.getTime() === date2.getTime();\n }\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/date-time-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Date comparisons should correctly reflect the order based on their numeric timestamps.", "mode": "fast-check"} {"id": 54434, "name": "unknown", "code": "it('should produce only one of the allowed letters', () => {\n const letters: string[] = LettersValue.map(([_, v]) => v);\n fc.assert(\n fc.property(posRomanNumberArb, (n) => {\n expect([...toRoman(n)].every((c) => letters.includes(c))).toBe(true);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/003-misc/roman/main.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The property should ensure that the `toRoman` function produces only allowed Roman numeral letters.", "mode": "fast-check"} {"id": 60209, "name": "unknown", "code": "it('should maintain temporal monotonicity', () => {\n fc.assert(\n fc.property(\n fc.array(fc.date({ min: new Date('2024-01-01'), max: new Date('2024-12-31') }), {\n minLength: 3,\n maxLength: 10,\n }),\n (dates) => {\n // Property: Sorted dates should maintain order\n const sortedDates = [...dates].sort((a, b) => a.getTime() - b.getTime());\n\n for (let i = 1; i < sortedDates.length; i++) {\n if (sortedDates[i].getTime() < sortedDates[i - 1].getTime()) {\n return false;\n }\n }\n\n return true;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/date-time-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Sorted date arrays should maintain chronological order.", "mode": "fast-check"} {"id": 60215, "name": "unknown", "code": "it('should handle time zone consistency', () => {\n fc.assert(\n fc.property(domainArbitraries.validTimeSlot, (timeSlot) => {\n // Property: Start and end times should be in the same timezone\n const startOffset = timeSlot.start.getTimezoneOffset();\n const endOffset = timeSlot.end.getTimezoneOffset();\n\n return startOffset === endOffset;\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/date-time-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Start and end times of a time slot should have the same timezone offset.", "mode": "fast-check"} {"id": 60219, "name": "unknown", "code": "it('should convert between time units correctly', () => {\n fc.assert(\n fc.property(domainArbitraries.lessonDuration, (minutes) => {\n // Property: Time unit conversions should be reversible\n const hours = minutes / 60;\n const seconds = minutes * 60;\n const milliseconds = minutes * 60 * 1000;\n\n // Convert back\n const backToMinutesFromHours = hours * 60;\n const backToMinutesFromSeconds = seconds / 60;\n const backToMinutesFromMs = milliseconds / (60 * 1000);\n\n return (\n Math.abs(backToMinutesFromHours - minutes) < 0.001 &&\n Math.abs(backToMinutesFromSeconds - minutes) < 0.001 &&\n Math.abs(backToMinutesFromMs - minutes) < 0.001\n );\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/date-time-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Time unit conversions (minutes to hours, seconds, and milliseconds) should be reversible, maintaining accuracy within a small margin of error.", "mode": "fast-check"} {"id": 60221, "name": "unknown", "code": "it('should calculate unit duration correctly', () => {\n fc.assert(\n fc.property(domainArbitraries.unitTimeline, (timeline) => {\n // Property: Unit duration should match calculated values\n const { startDate, endDate, totalHours, lessonCount, averageLessonDuration } = timeline;\n\n const calculatedTotalMinutes = lessonCount * averageLessonDuration;\n const calculatedTotalHours = calculatedTotalMinutes / 60;\n\n // Should be within reasonable tolerance\n return Math.abs(totalHours - calculatedTotalHours) <= 1; // Within 1 hour\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/date-time-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The unit duration should closely approximate the calculated total hours based on lesson count and average lesson duration, allowing for a deviation of up to one hour.", "mode": "fast-check"} {"id": 54436, "name": "unknown", "code": "it('should not produce a too long roman output', () => {\n const MaxRomanReprLength = (NumLetters - 1) / 2 + (3 * (NumLetters + 1)) / 2 + 1;\n fc.assert(\n fc.property(romanNumberArb, (n) => {\n expect(toRoman(n).length).toBeLessThanOrEqual(MaxRomanReprLength);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/003-misc/roman/main.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The length of the Roman numeral output generated by `toRoman` should not exceed the maximum calculated Roman representation length.", "mode": "fast-check"} {"id": 60223, "name": "unknown", "code": "it('should handle recurring events correctly', () => {\n fc.assert(\n fc.property(\n fc.date({ min: new Date('2024-01-01'), max: new Date('2024-12-31') }),\n fc.integer({ min: 1, max: 52 }), // weeks\n (startDate, intervalWeeks) => {\n // Property: Recurring events should maintain consistent intervals\n const occurrences: Date[] = [];\n const msPerWeek = 7 * 24 * 60 * 60 * 1000;\n\n for (let i = 0; i < 10; i++) {\n // Generate 10 occurrences\n const occurrence = new Date(startDate.getTime() + i * intervalWeeks * msPerWeek);\n occurrences.push(occurrence);\n }\n\n // Check intervals between consecutive occurrences\n for (let i = 1; i < occurrences.length; i++) {\n const actualInterval = occurrences[i].getTime() - occurrences[i - 1].getTime();\n const expectedInterval = intervalWeeks * msPerWeek;\n\n if (Math.abs(actualInterval - expectedInterval) > 1000) {\n // Within 1 second tolerance\n return false;\n }\n }\n\n return true;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/date-time-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Recurring events should maintain consistent weekly intervals between occurrences within a one-second tolerance.", "mode": "fast-check"} {"id": 60228, "name": "unknown", "code": "it('should handle local date string formatting consistently', () => {\n fc.assert(\n fc.property(domainArbitraries.schoolDay, (date) => {\n // Property: Date string formatting should be consistent\n const dateString = date.toDateString();\n const localString = date.toLocaleDateString();\n\n // Both should be non-empty strings\n return dateString.length > 0 && localString.length > 0;\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/date-time-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Date string formatting from `toDateString` and `toLocaleDateString` should produce non-empty strings consistently.", "mode": "fast-check"} {"id": 60233, "name": "unknown", "code": "it('should handle month boundary edge cases', () => {\n fc.assert(\n fc.property(\n fc.integer({ min: 1, max: 12 }),\n fc.integer({ min: 2020, max: 2025 }),\n (month, year) => {\n // Property: Month boundaries should be handled correctly\n const lastDayOfMonth = new Date(year, month, 0).getDate();\n const firstDayOfMonth = new Date(year, month - 1, 1);\n const lastDayDate = new Date(year, month - 1, lastDayOfMonth);\n\n // Adding one day to last day should give first day of next month\n const nextDay = new Date(lastDayDate.getTime() + 24 * 60 * 60 * 1000);\n\n return nextDay.getDate() === 1 && nextDay.getMonth() === month % 12;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/date-time-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Month boundaries should be handled correctly, ensuring that adding one day to a month's last day results in the first day of the next month.", "mode": "fast-check"} {"id": 60235, "name": "unknown", "code": "it('should maintain precision in time calculations', () => {\n fc.assert(\n fc.property(fc.date(), fc.integer({ min: 1, max: 1000 }), (baseDate, milliseconds) => {\n // Property: Millisecond precision should be maintained\n const adjusted = new Date(baseDate.getTime() + milliseconds);\n const difference = adjusted.getTime() - baseDate.getTime();\n\n return difference === milliseconds;\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/date-time-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The time difference between a base date and its millisecond-adjusted date should equal the millisecond offset applied.", "mode": "fast-check"} {"id": 60236, "name": "unknown", "code": "it('should perform date operations efficiently', () => {\n fc.assert(\n fc.property(fc.array(fc.date(), { minLength: 100, maxLength: 100 }), (dates) => {\n // Property: Date operations should be performant\n const startTime = Date.now();\n\n // Perform various date operations\n const sorted = [...dates].sort((a, b) => a.getTime() - b.getTime());\n const filtered = sorted.filter((date) => date.getDay() >= 1 && date.getDay() <= 5);\n const mapped = filtered.map((date) => new Date(date.getTime() + 24 * 60 * 60 * 1000));\n\n const endTime = Date.now();\n const operationTime = endTime - startTime;\n\n // Should complete operations on 100 dates in under 100ms\n return operationTime < 100 && mapped.length >= 0;\n }),\n { ...getPropertyTestConfig('fast'), numRuns: 10 },\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/date-time-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Date operations on an array of 100 dates should complete in under 100 milliseconds, with the operations including sorting, filtering weekdays, and mapping to the next day.", "mode": "fast-check"} {"id": 60251, "name": "unknown", "code": "it('should generate diverse subject distributions', () => {\n fc.assert(\n fc.property(\n fc.array(domainArbitraries.subject, { minLength: 100, maxLength: 100 }),\n (subjects) => {\n // Property: Subject distribution should be reasonably diverse\n const subjectCounts = new Map();\n\n subjects.forEach((subject) => {\n subjectCounts.set(subject, (subjectCounts.get(subject) || 0) + 1);\n });\n\n // Should have at least 3 different subjects\n const uniqueSubjects = subjectCounts.size;\n\n // No single subject should dominate (>80% of total)\n const maxCount = Math.max(...subjectCounts.values());\n const dominanceRatio = maxCount / subjects.length;\n\n return uniqueSubjects >= 3 && dominanceRatio < 0.8;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/curriculum-expectation-validation.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Subject distributions must contain at least 3 unique subjects, and no single subject should account for more than 80% of the total.", "mode": "fast-check"} {"id": 60252, "name": "unknown", "code": "it('should generate balanced grade distributions', () => {\n fc.assert(\n fc.property(\n fc.array(domainArbitraries.grade, { minLength: 100, maxLength: 100 }),\n (grades) => {\n // Property: Grade distribution should cover all elementary grades\n const gradeSet = new Set(grades);\n const gradeRange = Math.max(...grades) - Math.min(...grades);\n\n // Should cover at least 5 different grades\n // Should span at least 4 grade levels\n return gradeSet.size >= 5 && gradeRange >= 4;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/curriculum-expectation-validation.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Generated grade distributions should contain at least 5 different grades and span at least 4 grade levels.", "mode": "fast-check"} {"id": 54437, "name": "unknown", "code": "it('should read simple roman strings (no letter doing a minus)', () => {\n fc.assert(\n fc.property(fc.array(fc.nat(3), { minLength: NumLetters, maxLength: NumLetters }), (choices) => {\n fc.pre(choices.find((e) => e !== 0) !== undefined);\n\n let romanRepr = '';\n let expected = 0;\n for (let ridx = 0; ridx !== choices.length; ++ridx) {\n const idx = NumLetters - ridx - 1;\n const num = idx % 2 && choices[idx] > 1 ? 1 : choices[idx];\n romanRepr += LettersValue[idx][1].repeat(num);\n expected += num * LettersValue[idx][0];\n }\n expect(fromRoman(romanRepr)).toBe(expected);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/003-misc/roman/main.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Converting simple Roman numeral strings (with no subtractive combinations) results in the correct integer value using `fromRoman`.", "mode": "fast-check"} {"id": 54438, "name": "unknown", "code": "it('should contain a single start point located at the specified point', () => {\n fc.assert(\n fc.property(seedArb, inputsArb, (seed, ins) => {\n const maze = mazeGenerator(seed, ins.dim, ins.startPt, ins.endPt);\n expect(maze[ins.startPt.y][ins.startPt.x]).toBe(CellType.Start);\n expect(_.flatten(maze).filter((c) => c === CellType.Start)).toHaveLength(1);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/003-misc/mazeGenerator/main.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "A generated maze should have a single start point located at the specified coordinates.", "mode": "fast-check"} {"id": 54439, "name": "unknown", "code": "it('should contain a single end point located at the specified point', () => {\n fc.assert(\n fc.property(seedArb, inputsArb, (seed, ins) => {\n const maze = mazeGenerator(seed, ins.dim, ins.startPt, ins.endPt);\n expect(maze[ins.endPt.y][ins.endPt.x]).toBe(CellType.End);\n expect(_.flatten(maze).filter((c) => c === CellType.End)).toHaveLength(1);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/003-misc/mazeGenerator/main.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "A generated maze contains a single endpoint located at the specified coordinates, ensuring `CellType.End` appears exactly once.", "mode": "fast-check"} {"id": 54435, "name": "unknown", "code": "it('should not output too many times the same letter', () => {\n const letters: string[] = LettersValue.map(([_, v]) => v);\n fc.assert(\n fc.property(posRomanNumberArb, (n) => {\n const repr = toRoman(n);\n for (let idx = 0; idx !== letters.length; ++idx) {\n expect([...repr].filter((c) => c === letters[idx]).length).toBeLessThanOrEqual(\n idx % 2\n ? 1 // 5 * 10^N appear at most 1 time\n : 4, // 10^N appear at most 4 times\n );\n }\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/003-misc/roman/main.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The test ensures that the Roman numeral representation of a number does not use more than four occurrences of `10^N` letters or more than one occurrence of `5 * 10^N` letters.", "mode": "fast-check"} {"id": 60299, "name": "unknown", "code": "it('should handle scheduling constraints correctly', () => {\n fc.assert(\n fc.property(\n fc.record({\n lessons: fc.array(domainArbitraries.fullLessonPlan, { minLength: 3, maxLength: 10 }),\n constraints: fc.record({\n maxDailyLessons: fc.integer({ min: 3, max: 8 }),\n minBreakMinutes: fc.integer({ min: 5, max: 15 }),\n schoolStartHour: fc.integer({ min: 7, max: 9 }),\n schoolEndHour: fc.integer({ min: 14, max: 16 }),\n }),\n }),\n ({ lessons, constraints }) => {\n // Property: Scheduling should respect all constraints\n const { maxDailyLessons, minBreakMinutes, schoolStartHour, schoolEndHour } =\n constraints;\n\n // Group lessons by day\n const lessonsByDay = new Map();\n lessons.forEach((lesson) => {\n const dateKey = lesson.date.toDateString();\n if (!lessonsByDay.has(dateKey)) {\n lessonsByDay.set(dateKey, []);\n }\n lessonsByDay.get(dateKey)!.push(lesson);\n });\n\n // Check constraints for each day\n for (const [, dailyLessons] of lessonsByDay) {\n // Max daily lessons constraint\n if (dailyLessons.length > maxDailyLessons) {\n return false;\n }\n\n // School hours constraint\n for (const lesson of dailyLessons) {\n const hour = lesson.date.getHours();\n const endTime = new Date(lesson.date.getTime() + lesson.duration * 60 * 1000);\n const endHour = endTime.getHours();\n\n if (hour < schoolStartHour || endHour > schoolEndHour) {\n return false;\n }\n }\n\n // Break time constraint (for consecutive lessons)\n const sortedDaily = dailyLessons.sort((a, b) => a.date.getTime() - b.date.getTime());\n for (let i = 1; i < sortedDaily.length; i++) {\n const prevEnd = new Date(\n sortedDaily[i - 1].date.getTime() + sortedDaily[i - 1].duration * 60 * 1000,\n );\n const currentStart = sortedDaily[i].date;\n const breakMinutes = (currentStart.getTime() - prevEnd.getTime()) / (1000 * 60);\n\n if (breakMinutes < minBreakMinutes) {\n return false;\n }\n }\n }\n\n return true;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/lesson-plan-scheduling.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Scheduling must respect constraints for maximum daily lessons, school hours, and minimum break times for consecutive lessons.", "mode": "fast-check"} {"id": 60303, "name": "unknown", "code": "it('should limit expectation count based on grade level', () => {\n fc.assert(\n fc.property(domainArbitraries.curriculumProgression, (progression) => {\n // Property: Lower grades should have fewer expectations per lesson\n const { grade, expectations } = progression;\n\n if (grade <= 3) {\n return expectations.length <= 2;\n } else if (grade <= 6) {\n return expectations.length <= 3;\n } else {\n return expectations.length <= 4;\n }\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/grade-progression-logic.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Expectation counts per lesson should be limited based on grade level: grades 3 and below have up to 2, grades 4 to 6 have up to 3, and above have up to 4 expectations.", "mode": "fast-check"} {"id": 54440, "name": "unknown", "code": "it('should have at least one path from start to end', () => {\n fc.assert(\n fc.property(seedArb, inputsArb, (seed, ins) => {\n const maze = mazeGenerator(seed, ins.dim, ins.startPt, ins.endPt);\n return hasPathFromStartToEnd(maze, ins.startPt);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/003-misc/mazeGenerator/main.spec.ts", "start_line": null, "end_line": null, "dependencies": ["hasPathFromStartToEnd"], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "A generated maze should have at least one path from the start point to the end point.", "mode": "fast-check"} {"id": 60317, "name": "unknown", "code": "it('should validate grade-appropriate content correctly', () => {\n fc.assert(\n fc.property(domainArbitraries.grade, fc.lorem({ maxCount: 10 }), (grade, content) => {\n const result = validateGradeAppropriate(grade, content);\n return typeof result === 'boolean';\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/grade-progression-logic.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`validateGradeAppropriate` function returns a boolean indicating if the given content is appropriate for the specified grade.", "mode": "fast-check"} {"id": 60318, "name": "unknown", "code": "it('should validate sequential progression correctly', () => {\n fc.assert(\n fc.property(\n fc.tuple(domainArbitraries.grade, domainArbitraries.grade),\n fc.array(domainArbitraries.curriculumCode, { minLength: 1, maxLength: 5 }),\n ([fromGrade, toGrade], expectations) => {\n const result = validateSequentialProgress(fromGrade, toGrade, expectations);\n\n if (toGrade > fromGrade) {\n return typeof result === 'boolean';\n } else {\n return result === false; // Should reject non-progressive sequences\n }\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/grade-progression-logic.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Validation ensures that the `validateSequentialProgress` function returns a boolean when `toGrade` is greater than `fromGrade`, and false for non-progressive sequences.", "mode": "fast-check"} {"id": 60319, "name": "unknown", "code": "it('should validate developmental alignment correctly', () => {\n fc.assert(\n fc.property(\n domainArbitraries.grade,\n fc.array(domainArbitraries.activityType, { minLength: 1, maxLength: 5 }),\n (grade, activities) => {\n const result = validateDevelopmentalAlignment(grade, activities);\n return typeof result === 'boolean';\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/grade-progression-logic.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`validateDevelopmentalAlignment` returns a boolean when given a grade and an array of activity types.", "mode": "fast-check"} {"id": 60325, "name": "unknown", "code": "it('should maintain long range plan consistency', () => {\n fc.assert(\n fc.property(domainArbitraries.longRangePlan, (plan) => {\n // Invariant: Long range plans must have valid structure\n const hasValidId = plan.id && plan.id.length > 0;\n const hasValidTitle = plan.title.trim().length > 0;\n const hasValidAcademicYear = /^\\d{4}-\\d{4}$/.test(plan.academicYear);\n const hasValidGrade = plan.grade >= 1 && plan.grade <= 8;\n const hasValidSubject = plan.subject.trim().length > 0;\n\n // Academic year consistency\n const [startYear, endYear] = plan.academicYear.split('-').map(Number);\n const validYearProgression = endYear === startYear + 1;\n\n return (\n hasValidId &&\n hasValidTitle &&\n hasValidAcademicYear &&\n hasValidGrade &&\n hasValidSubject &&\n validYearProgression\n );\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/invariants/data-model-invariants.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Ensures that long range plans have a valid structure, including non-empty IDs and titles, correct academic year format and progression, a grade within 1 to 8, and a non-empty subject.", "mode": "fast-check"} {"id": 60329, "name": "unknown", "code": "it('should maintain lesson plan scheduling constraints', () => {\n fc.assert(\n fc.property(domainArbitraries.fullLessonPlan, (lessonPlan) => {\n // Invariant: Lesson plans must fit within school constraints\n const isSchoolDay = lessonPlan.date.getDay() >= 1 && lessonPlan.date.getDay() <= 5;\n const hasReasonableDuration = lessonPlan.duration >= 15 && lessonPlan.duration <= 120;\n const hasValidMaterials = lessonPlan.materials.length > 0;\n const hasValidExpectations =\n lessonPlan.expectations.length > 0 && lessonPlan.expectations.length <= 4;\n\n return isSchoolDay && hasReasonableDuration && hasValidMaterials && hasValidExpectations;\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/invariants/data-model-invariants.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Lesson plans should fit within constraints such as being on a weekday, having a duration between 15 and 120 minutes, including materials, and having one to four expectations.", "mode": "fast-check"} {"id": 60345, "name": "unknown", "code": "it('should generate valid curriculum codes', () => {\n fc.assert(\n fc.property(curriculumCodeArbitrary, (code) => {\n // Property: All generated codes follow the pattern [A-E][1-5].[1-10]\n const codePattern = /^[A-E][1-5]\\.[1-9]$|^[A-E][1-5]\\.10$/;\n return codePattern.test(code);\n }),\n { numRuns: 100 },\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/curriculum-simple.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Generated curriculum codes must match the pattern `[A-E][1-5].[1-10]`.", "mode": "fast-check"} {"id": 60358, "name": "unknown", "code": "it('should handle user authentication correctly', () => {\n fc.assert(\n fc.property(\n fc.record({\n email: domainArbitraries.email,\n password: fc.string({ minLength: 8, maxLength: 128 }),\n role: domainArbitraries.userRole,\n }),\n (credentials) => {\n // Property: Authentication should validate credentials properly\n const authenticateUser = (creds: typeof credentials) => {\n const validationErrors: string[] = [];\n\n // Email validation\n if (!creds.email.includes('@') || !creds.email.includes('.')) {\n validationErrors.push('Invalid email format');\n }\n\n // Password validation\n if (creds.password.length < 8) {\n validationErrors.push('Password must be at least 8 characters');\n }\n\n // Role validation\n if (!['teacher', 'administrator', 'substitute'].includes(creds.role)) {\n validationErrors.push('Invalid user role');\n }\n\n if (validationErrors.length === 0) {\n return {\n success: true,\n data: {\n user: {\n email: creds.email,\n role: creds.role,\n id: 'user_' + Math.random().toString(36).substr(2, 9),\n },\n token: 'jwt_' + Math.random().toString(36).substr(2, 20),\n },\n error: null,\n };\n } else {\n return {\n success: false,\n data: null,\n error: validationErrors.join(', '),\n };\n }\n };\n\n const authResult = authenticateUser(credentials);\n\n // Should return valid authentication response\n return (\n (authResult.success && authResult.data && authResult.data.token) ||\n (!authResult.success && authResult.error)\n );\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/api/api-contract.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "User authentication should correctly validate credentials including email format, password length, and user role, returning success with a token if valid, or errors otherwise.", "mode": "fast-check"} {"id": 60390, "name": "unknown", "code": "it(\"should successfully cast symbols\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(fc.string(), (description) => {\n const input = Symbol(description);\n expect(castSymbol(input)).toStrictEqual({\n status: \"success\",\n value: input,\n values: []\n });\n })\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Casting a symbol should result in a success object containing the symbol and an empty values array.", "mode": "fast-check"} {"id": 60392, "name": "unknown", "code": "it(\"should fail to cast non-null\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(\n fc.anything().filter((input) => input !== null),\n (input) => {\n expect(castNull(input)).toStrictEqual({\n status: \"failure\",\n expected: \"null\",\n actual: input\n });\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `castNull` should return a failure status when attempting to cast any non-null input.", "mode": "fast-check"} {"id": 60411, "name": "unknown", "code": "it(\"should successfully cast enumeration values\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(fc.constantFrom(\"male\", \"female\"), (input) => {\n expect(castGender(input)).toStrictEqual({\n status: \"success\",\n value: input,\n values: []\n });\n })\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `castGender` function should successfully cast enumeration values of \"male\" or \"female\" to an object with a status of \"success\" and the same input value.", "mode": "fast-check"} {"id": 60412, "name": "unknown", "code": "it(\"should fail to cast non-enumeration values\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(\n fc\n .string()\n .filter((input) => input !== \"male\")\n .filter((input) => input !== \"female\"),\n (input) => {\n expect(castGender(input)).toStrictEqual({\n status: \"failure\",\n expected: \"enumeration\",\n values: new Set([\"male\", \"female\"]),\n actual: input\n });\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "A non-enumeration string input to `castGender` should return a failure status with expected values \"male\" and \"female\".", "mode": "fast-check"} {"id": 60413, "name": "unknown", "code": "it(\"should successfully cast foo and bar\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(\n fc.record({ foo: fc.string(), bar: fc.double() }),\n (input) => {\n const { foo, bar } = input;\n expect(castFooBar(input)).toStrictEqual({\n status: \"success\",\n value: { foo },\n values: [{ bar }]\n });\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `castFooBar` should return an object with a `status` of \"success,\" containing a `value` with the field `foo` and `values` as an array with the field `bar` for records with fields `foo` and `bar`.", "mode": "fast-check"} {"id": 60414, "name": "unknown", "code": "it(\"should successfully cast foo\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(fc.record({ foo: fc.string() }), (input) => {\n expect(castFooBar(input)).toStrictEqual({\n status: \"success\",\n value: input,\n values: []\n });\n })\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`castFooBar` casts objects with a `foo` property to a result containing the object with a \"success\" status and an empty `values` array.", "mode": "fast-check"} {"id": 60421, "name": "unknown", "code": "it(\"should fail to cast non-strings\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(\n fc.anything().filter((input) => typeof input !== \"string\"),\n (input) => {\n expect(castLength(input)).toStrictEqual({\n status: \"failure\",\n expected: \"string\",\n actual: input\n });\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`castLength` returns a failure status for non-string inputs, specifying \"string\" as expected and the actual input type.", "mode": "fast-check"} {"id": 60429, "name": "unknown", "code": "it('should success to create user', async () => {\n await fc.assert(\n fc.asyncProperty(accountCreateRequestDtoArbitrary, async (requestDto) => {\n const {\n name: accountName,\n id,\n balance,\n } = await accountController.create(requestDto);\n expect(accountName).toEqual(requestDto.name);\n expect(id).toEqual(expect.any(Number));\n expect(balance).toEqual(0);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/DPS0340/nestjs-fast-check-practice/src/presentation/controllers/account.controller.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DPS0340/nestjs-fast-check-practice", "url": "https://github.com/DPS0340/nestjs-fast-check-practice.git", "license": "MIT", "stars": 7, "forks": 0}, "metrics": null, "summary": "Creating a user should result in matching account properties, assigning a numeric ID, and initializing the balance to zero.", "mode": "fast-check"} {"id": 54445, "name": "unknown", "code": "it('should have the same length as source', () => {\n fc.assert(\n fc.property(fc.array(fc.integer()), (data) => {\n expect(sort(data)).toHaveLength(data.length);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/001-simple/sort/main.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The sorted array should have the same length as the source array.", "mode": "fast-check"} {"id": 54446, "name": "unknown", "code": "it('should have exactly the same number of occurences as source for each item', () => {\n fc.assert(\n fc.property(fc.array(fc.integer()), (data) => {\n const sorted = sort(data);\n expect(_.groupBy(sorted)).toEqual(_.groupBy(data));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/001-simple/sort/main.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The number of occurrences of each item should remain the same in the sorted array as in the source array.", "mode": "fast-check"} {"id": 54447, "name": "unknown", "code": "it('should produce an ordered array', () => {\n fc.assert(\n fc.property(fc.array(fc.integer()), (data) => {\n const sorted = sort(data);\n for (let idx = 1; idx < sorted.length; ++idx) {\n expect(sorted[idx - 1]).toBeLessThanOrEqual(sorted[idx]);\n }\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/001-simple/sort/main.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Sorting should result in arrays with elements in non-decreasing order.", "mode": "fast-check"} {"id": 54915, "name": "unknown", "code": "it('divideBy', ctx => {\n console.log(`Testing ${ctx.task.name}...`)\n type TestParams = {\n dividendHex: string\n divisorHex: string\n }\n const toResult = (params: TestParams) => ({\n fromJuce: JSON.parse(\n execTestBin('divide-by', JSON.stringify(params))\n ),\n fromPort: (() => {\n const dividend = JuceBigInteger.fromHex(params.dividendHex)\n const divisor = JuceBigInteger.fromHex(params.divisorHex)\n const remainder = new JuceBigInteger()\n dividend.divideBy(divisor, remainder)\n return {\n quotientHex: dividend.toHex(),\n remainderHex: remainder.toHex()\n }\n })()\n })\n const baseString = `{\"dividendHex\":\"a\",\"divisorHex\":\"0\"}`\n const baseCase = JSON.parse(baseString)\n const baseResult = toResult(baseCase)\n console.log({ baseCase, baseResult })\n expect(baseResult.fromJuce).toMatchObject(baseResult.fromPort)\n let latest\n fc.assert(\n fc.property(\n fc.record({\n dividendHex: hexArbitrary,\n divisorHex: hexArbitrary\n }),\n input => {\n const result = toResult(input)\n latest = { input, result }\n expect(result.fromJuce).toMatchObject(result.fromPort)\n }\n )\n )\n console.log(latest)\n })", "language": "typescript", "source_file": "./repos/ianacaburian/generate-key-file/src/test/JuceBigInteger.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "ianacaburian/generate-key-file", "url": "https://github.com/ianacaburian/generate-key-file.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `divideBy` method of `JuceBigInteger` should produce matching quotient and remainder results when compared with a binary execution for randomly generated hex inputs.", "mode": "fast-check"} {"id": 60432, "name": "unknown", "code": "it(\"Options of useModel() are generated\", () => {\n fc.assert(\n fc.property(fcUseModelOptions(), (options) => {\n expect(options).toBeDefined();\n return true;\n }),\n );\n })", "language": "typescript", "source_file": "./repos/simonsobs/nextline-web/src/utils/monaco-editor/__tests__/model.spec.ts", "start_line": null, "end_line": null, "dependencies": ["fcUseModelOptions"], "repo": {"name": "simonsobs/nextline-web", "url": "https://github.com/simonsobs/nextline-web.git", "license": "MIT", "stars": 4, "forks": 1}, "metrics": null, "summary": "Options generated by `fcUseModelOptions` are defined.", "mode": "fast-check"} {"id": 60468, "name": "unknown", "code": "test('decode date', () => {\n fc.assert(\n fc.property(fc.date(), (d) => {\n const dateString = d.toISOString();\n expect(date(dateString)).toEqual(d);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/tskj/typescript-json-decoder/tests/property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tskj/typescript-json-decoder", "url": "https://github.com/tskj/typescript-json-decoder.git", "license": "MIT", "stars": 59, "forks": 7}, "metrics": null, "summary": "Decoding a date string with `date` should result in an equivalent date object to the original.", "mode": "fast-check"} {"id": 60470, "name": "unknown", "code": "it('round-trips any integer string', () => {\n fc.assert(\n fc.property(fc.integer(), (n) => {\n expect(numbers.parseIntOrNull(n.toString())).toBe(n);\n })\n );\n })", "language": "typescript", "source_file": "./repos/6529-Collections/6529seize-backend/src/tests/numbers.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "6529-Collections/6529seize-backend", "url": "https://github.com/6529-Collections/6529seize-backend.git", "license": "Apache-2.0", "stars": 6, "forks": 5}, "metrics": null, "summary": "Converting an integer to a string and back using `parseIntOrNull` should return the original integer.", "mode": "fast-check"} {"id": 60472, "name": "unknown", "code": "it('should return the value if it\\'s larger than the minimum and smaller than the maximum', () =>\n fc.assert(\n fc.property(fc.double({ noNaN: true }), (value) => {\n const expectedValue = value;\n const actualValue = clamp(value - 1, value, value + 1);\n\n return expectedValue === actualValue;\n }),\n ))", "language": "typescript", "source_file": "./repos/NDLANO/h5p-editor-topic-map/src/utils/number.utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "NDLANO/h5p-editor-topic-map", "url": "https://github.com/NDLANO/h5p-editor-topic-map.git", "license": "MIT", "stars": 0, "forks": 2}, "metrics": null, "summary": "The property should ensure that clamping a value between itself minus one and itself plus one returns the original value.", "mode": "fast-check"} {"id": 60473, "name": "unknown", "code": "it('should handle any number', () =>\n fc.assert(\n fc.property(fc.double(), (scaleFactor) => {\n const item: TopicMapItemType = {\n id: 'test',\n xPercentagePosition: 10,\n yPercentagePosition: 10,\n widthPercentage: 20,\n heightPercentage: 20,\n topicImage: { path: '', alt: '' },\n label: 'Label',\n dialog: {\n hasNote: true,\n links: [],\n },\n description: '',\n };\n\n const expectedItem: TopicMapItemType = {\n id: 'test',\n xPercentagePosition: 10 * scaleFactor,\n yPercentagePosition: 10 * scaleFactor,\n widthPercentage: 20 * scaleFactor,\n heightPercentage: 20 * scaleFactor,\n topicImage: { path: '', alt: '' },\n label: 'Label',\n dialog: {\n hasNote: true,\n links: [],\n },\n description: '',\n };\n\n const actualItem = resizeItem(item, scaleFactor);\n\n expect(actualItem).toEqual(expectedItem);\n }),\n { verbose: true },\n ))", "language": "typescript", "source_file": "./repos/NDLANO/h5p-editor-topic-map/src/utils/grid.utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "NDLANO/h5p-editor-topic-map", "url": "https://github.com/NDLANO/h5p-editor-topic-map.git", "license": "MIT", "stars": 0, "forks": 2}, "metrics": null, "summary": "`resizeItem` should correctly adjust a `TopicMapItemType` based on any numeric `scaleFactor`, resulting in proportional changes to position and size attributes.", "mode": "fast-check"} {"id": 60481, "name": "unknown", "code": "it('should correctly determine if the regex is like the string', () => {\n fc.assert(\n fc.property(\n fc.oneof(fc.stringMatching(TESTER_GEN), fc.stringMatching(ALTERNATE_GEN)),\n fc.stringMatching(STRING_GEN),\n (a, b) => {\n return isLike(a)(b) === new RegExp(a).test(b);\n },\n ),\n { verbose: 2 },\n );\n})", "language": "typescript", "source_file": "./repos/gohypergiant/standard-toolkit/packages/predicates/src/is-like/index.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "gohypergiant/standard-toolkit", "url": "https://github.com/gohypergiant/standard-toolkit.git", "license": "Apache-2.0", "stars": 13, "forks": 2}, "metrics": null, "summary": "`isLike` should determine if a regex pattern matches a string similarly to `RegExp.prototype.test`.", "mode": "fast-check"} {"id": 60482, "name": "unknown", "code": "it('should correctly test if the value is between the two tuple elements', () => {\n fc.assert(\n fc.property(fc.tuple(fc.integer(), fc.integer()), fc.integer(), (a, b) => {\n const sorted = [...a].sort();\n return isNotBetween(a)(b) === !(b >= sorted[0] && b <= sorted[1]);\n }),\n {\n verbose: 2,\n // manual cases\n examples: [\n [[50, 198], 100],\n [[100, 89], 50],\n [[50, 60], 50],\n ],\n },\n );\n})", "language": "typescript", "source_file": "./repos/gohypergiant/standard-toolkit/packages/predicates/src/is-not-between/index.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "gohypergiant/standard-toolkit", "url": "https://github.com/gohypergiant/standard-toolkit.git", "license": "Apache-2.0", "stars": 13, "forks": 2}, "metrics": null, "summary": "`isNotBetween` returns true if a value is not within the range defined by two elements in a tuple.", "mode": "fast-check"} {"id": 60484, "name": "unknown", "code": "it('should correctly test for greater than values', () => {\n fc.assert(\n fc.property(fc.integer(), fc.integer(), (a, b) => {\n return isGreater(a)(b) === b > a;\n }),\n {\n verbose: 2,\n // manual cases\n examples: [\n [50, 100],\n [100, 50],\n ],\n },\n );\n})", "language": "typescript", "source_file": "./repos/gohypergiant/standard-toolkit/packages/predicates/src/is-greater/index.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "gohypergiant/standard-toolkit", "url": "https://github.com/gohypergiant/standard-toolkit.git", "license": "Apache-2.0", "stars": 13, "forks": 2}, "metrics": null, "summary": "`isGreater` correctly determines if one integer is greater than another.", "mode": "fast-check"} {"id": 60496, "name": "unknown", "code": "it('should always find the value when inside the array', () => {\n fc.assert(\n fc.property(\n fc.array(fc.anything(anythingSettings)),\n fc.array(fc.anything(anythingSettings)),\n fc.anything(anythingSettings).filter(v => !Number.isNaN(v)),\n (startValues, endValues, v) => {\n // Given: startValues, endValues arrays and v value (not NaN)\n expect([...startValues, v, ...endValues]).toContain(v);\n },\n ),\n assertSettings,\n );\n })", "language": "typescript", "source_file": "./repos/Saghen/expect-fp/src/__tests__/matchers-toContain.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Saghen/expect-fp", "url": "https://github.com/Saghen/expect-fp.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "The array containing a non-NaN value should always include that value when checked with `toContain`.", "mode": "fast-check"} {"id": 60497, "name": "unknown", "code": "it('should not find the value if it has been cloned into the array', () => {\n fc.assert(\n fc.property(\n fc.array(fc.anything(anythingSettings)),\n fc.array(fc.anything(anythingSettings)),\n fc.clone(fc.anything(anythingSettings), 2),\n (startValues, endValues, [a, b]) => {\n // Given: startValues, endValues arrays\n // and [a, b] equal, but not the same values\n // with `typeof a === 'object && a !== null`\n fc.pre(typeof a === 'object' && a !== null);\n expect([...startValues, a, ...endValues]).not.toContain(b);\n },\n ),\n assertSettings,\n );\n })", "language": "typescript", "source_file": "./repos/Saghen/expect-fp/src/__tests__/matchers-toContain.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Saghen/expect-fp", "url": "https://github.com/Saghen/expect-fp.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "An array containing a cloned object should not be recognized as containing the original object.", "mode": "fast-check"} {"id": 60498, "name": "unknown", "code": "it('test', () => {\n const _url = toArbitrary(() => faker.internet.url());\n\n fc.assert(\n fc.property(_url, (url) => {\n expect(validation.Validators.website(url)).toEqual(ValidationErrors.None);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/Zajno/common-utils/packages/common/src/validation/__tests__/validator.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Zajno/common-utils", "url": "https://github.com/Zajno/common-utils.git", "license": "MIT", "stars": 5, "forks": 2}, "metrics": null, "summary": "Website URLs should be validated without errors by `validation.Validators.website`.", "mode": "fast-check"} {"id": 60504, "name": "unknown", "code": "it('test ip', () => {\n const _url = toArbitrary(() => faker.internet.ip());\n\n fc.assert(\n fc.property(_url, (url) => {\n expect(validation.Validators.website(url)).toEqual(ValidationErrors.Website);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/Zajno/common-utils/packages/common/src/validation/__tests__/validator.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Zajno/common-utils", "url": "https://github.com/Zajno/common-utils.git", "license": "MIT", "stars": 5, "forks": 2}, "metrics": null, "summary": "The `Validators.website` function should return `ValidationErrors.Website` for generated IP addresses.", "mode": "fast-check"} {"id": 60505, "name": "unknown", "code": "it('test website with directory path', () => {\n const _url = toArbitrary(() => faker.image.url());\n\n fc.assert(\n fc.property(_url, (url) => {\n expect(validation.Validators.website(url)).toEqual(ValidationErrors.None);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/Zajno/common-utils/packages/common/src/validation/__tests__/validator.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Zajno/common-utils", "url": "https://github.com/Zajno/common-utils.git", "license": "MIT", "stars": 5, "forks": 2}, "metrics": null, "summary": "Validation should recognize URLs with directory paths as valid websites without errors.", "mode": "fast-check"} {"id": 60516, "name": "unknown", "code": "test('should returns false for everything else', () =>\n fc.assert(\n fc.property(\n fc.oneof(fc.anything(), fc.string(9)),\n (phone) => !isResidentialPhoneNumber(phone as any)\n )\n ))", "language": "typescript", "source_file": "./repos/jonathanpalma/sivar-utils/src/lib/__tests__/telephones.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "jonathanpalma/sivar-utils", "url": "https://github.com/jonathanpalma/sivar-utils.git", "license": "MIT", "stars": 37, "forks": 9}, "metrics": null, "summary": "The function `isResidentialPhoneNumber` should return false for any input that is not a 9-character string.", "mode": "fast-check"} {"id": 60527, "name": "unknown", "code": "it('edits name attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tAsciName, 1, 32), async name => {\n nameTextField.value = name;\n await nameTextField.requestUpdate();\n expect(nameTextField.checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/gsecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60528, "name": "unknown", "code": "it('rejects name attribute starting with decimals', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal, 1, 1), async name => {\n nameTextField.value = name;\n await nameTextField.requestUpdate();\n expect(nameTextField.checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/gsecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60529, "name": "unknown", "code": "it('edits name attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tAsciName, 1, 32), async name => {\n inputs[0].value = name;\n await (inputs[0]).requestUpdate();\n expect(inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60530, "name": "unknown", "code": "it('rejects name attribute starting with decimals', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal, 1, 1), async name => {\n inputs[0].value = name;\n await (inputs[0]).requestUpdate();\n expect(inputs[0].checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60531, "name": "unknown", "code": "it('edits bufTime attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 0 }).map(num => `${num}`),\n async bufTime => {\n inputs[6].value = bufTime;\n await (inputs[6]).requestUpdate();\n expect(inputs[6].checkValidity()).to.be.true;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60532, "name": "unknown", "code": "it('rejects bufTime attribute starting with not being a unsigned int', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.uint, 1),\n async bufTime => {\n inputs[6].value = bufTime;\n await (inputs[6]).requestUpdate();\n expect(inputs[6].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60533, "name": "unknown", "code": "it('edits intgPd attribute only for valid inputs', async () => {\n const input = inputs[7];\n input.nullSwitch?.click();\n await input.requestUpdate();\n\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 0 }).map(num => `${num}`),\n async intgPd => {\n input.value = intgPd;\n await input.requestUpdate();\n expect(input.checkValidity()).to.be.true;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60534, "name": "unknown", "code": "it('rejects intgPd attribute starting with not being a unsigned int', async () => {\n const input = inputs[7];\n input.nullSwitch?.click();\n await input.requestUpdate();\n\n await fc.assert(\n fc.asyncProperty(regexString(inverseRegExp.uint, 1), async intgPd => {\n input.value = intgPd;\n await input.requestUpdate();\n expect(input.checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/reportcontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60535, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(MAC(), async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60536, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.MAC), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60537, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n hexaString({ minLength: 4, maxLength: 4 }),\n async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60538, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(hexaString({ minLength: 5 }), async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60539, "name": "unknown", "code": "it('does not allow to edit characters < 4', async () =>\n await fc.assert(\n fc.asyncProperty(\n hexaString({ minLength: 0, maxLength: 3 }),\n async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60540, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n hexaString({ minLength: 3, maxLength: 3 }),\n async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60541, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(hexaString({ minLength: 4 }), async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60542, "name": "unknown", "code": "it('does not allow to edit characters < 3', async () =>\n await fc.assert(\n fc.asyncProperty(\n hexaString({ minLength: 0, maxLength: 2 }),\n async testValue => {\n input!.value = testValue.toUpperCase();\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60543, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 0, max: 7 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60544, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 8 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/smv.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60545, "name": "unknown", "code": "it('edits name attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tAsciName, 1, 32), async name => {\n inputs[0].value = name;\n await (inputs[0]).requestUpdate();\n expect(inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60546, "name": "unknown", "code": "it('rejects name attribute starting with decimals', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal, 1, 1), async name => {\n inputs[0].value = name;\n await (inputs[0]).requestUpdate();\n expect(inputs[0].checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60547, "name": "unknown", "code": "it('edits smpRate attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 0 }).map(num => `${num}`),\n async smpRate => {\n inputs[4].value = smpRate;\n await (inputs[4]).requestUpdate();\n expect(inputs[4].checkValidity()).to.be.true;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60548, "name": "unknown", "code": "it('rejects smpRate attribute in case input is not unsigned int', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.uint, 1),\n async smpRate => {\n inputs[4].value = smpRate;\n await (inputs[4]).requestUpdate();\n expect(inputs[4].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60549, "name": "unknown", "code": "it('edits nofASDU attribute only for valid inputs', async () => {\n const input = inputs[5];\n input.nullSwitch?.click();\n await input.requestUpdate();\n\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 0 }).map(num => `${num}`),\n async nofASDU => {\n input.value = nofASDU;\n await input.requestUpdate();\n expect(input.checkValidity()).to.be.true;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60550, "name": "unknown", "code": "it('rejects nofASDU attribute in case input is not unsigned int', async () => {\n const input = inputs[5];\n input.nullSwitch?.click();\n await input.requestUpdate();\n\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.uint, 1),\n async nofASDU => {\n input.value = nofASDU;\n await input.requestUpdate();\n expect(input.checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60551, "name": "unknown", "code": "it('edits prefix attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tAsciName, 1, 11), async name => {\n inputs[2].value = name;\n await (inputs[2]).requestUpdate();\n expect(inputs[2].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/lnode.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60552, "name": "unknown", "code": "it('rejects name attribute starting with decimals', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal, 1, 1), async name => {\n inputs[2].value = name;\n await (inputs[2]).requestUpdate();\n expect(inputs[2].checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/lnode.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60553, "name": "unknown", "code": "it('edits name attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.abstractDataAttributeName, 1, 32),\n async name => {\n nameTextField.value = name;\n await nameTextField.requestUpdate();\n expect(nameTextField.checkValidity()).to.be.true;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/abstractda.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60554, "name": "unknown", "code": "it('rejects name attribute starting with decimals', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal, 1, 1), async name => {\n nameTextField.value = name;\n await nameTextField.requestUpdate();\n expect(nameTextField.checkValidity()).to.be.false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/abstractda.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60555, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV4(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60556, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv4), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60557, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV4(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60558, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv4), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60559, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV4(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60560, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv4), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60561, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(regExp.OSI, 1, 8), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60562, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60563, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSI, 1, 16),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60564, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60565, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSI, 1, 16),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60566, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60567, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(regExp.OSIAPi, 1), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60568, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSIAPi), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60569, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSIid, 1, 5),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60570, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSIid), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60571, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSIid, 1, 5),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60572, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSIid), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60573, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSIid, 1, 5),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60574, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSIid), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60575, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.OSI, 1, 40),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60576, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60577, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(regExp.OSI, 3, 3), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60578, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60579, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(/^[0-7]$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60580, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-7]$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60581, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n nat({ max: 65535 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60582, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60583, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n nat({ max: 65535 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60584, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60585, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(/^\\S*$/, 1), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60586, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n nat({ max: 65535 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60587, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60588, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n nat({ max: 65535 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60589, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60590, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 1025, max: 65535 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60591, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60592, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV6(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60593, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv6), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60594, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV6SubNet(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60595, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9/]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60596, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV6(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60597, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv6), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60598, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n fc.hexaString({ minLength: 1, maxLength: 5 }),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60599, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n invertedRegex(/^[0-9a-fA-F]{1,5}$/),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60600, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n nat({ max: 255 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60601, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60602, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV6(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60603, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv6), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60604, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV4(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60605, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv4), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60606, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(regExp.OSI, 1, 2), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60607, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.OSI), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60608, "name": "unknown", "code": "it('for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n regexString(regExp.lnClass, 4, 4),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/unit/editors/templates/lnodetype-wizard.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60609, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tName, 1), async name => {\n parent.wizardUI.inputs[0].value = name;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/integration/editors/substation/substation-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60610, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc), async desc => {\n parent.wizardUI.inputs[1].value = desc;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[1].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/integration/editors/substation/substation-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60611, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tName, 1), async name => {\n parent.wizardUI.inputs[0].value = name;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/integration/editors/substation/bay-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60612, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc), async desc => {\n parent.wizardUI.inputs[1].value = desc;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[1].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/integration/editors/substation/bay-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60613, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tName, 1), async name => {\n parent.wizardUI.inputs[1].value = name;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/integration/editors/substation/conducting-equipment-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60614, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc), async desc => {\n parent.wizardUI.inputs[2].value = desc;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[1].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/integration/editors/substation/conducting-equipment-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60615, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tName, 1), async name => {\n parent.wizardUI.inputs[0].value = name;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60616, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc), async desc => {\n parent.wizardUI.inputs[1].value = desc;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[1].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60617, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.unsigned, 1), async nomFreq => {\n parent.wizardUI.inputs[2].value = nomFreq;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[2].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60618, "name": "unknown", "code": "it('rejects action for invalid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.unsigned, 1),\n async nomFreq => {\n parent.wizardUI.inputs[2].value = nomFreq;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[2].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60619, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(fc.integer(1, 255), async numPhases => {\n parent.wizardUI.inputs[3].value = String(numPhases);\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[3].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60620, "name": "unknown", "code": "it('rejects edition for invalid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.integer, 1),\n async nomFreq => {\n parent.wizardUI.inputs[3].value = nomFreq;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[3].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60621, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal), async nomFreq => {\n parent.wizardUI.inputs[4].value = nomFreq;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[4].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60622, "name": "unknown", "code": "it('rejects edition for invalid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.decimal, 1),\n async voltage => {\n parent.wizardUI.inputs[4].value = voltage;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[4].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/integration/editors/substation/voltage-level-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60623, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.tName, 1), async name => {\n parent.wizardUI.inputs[0].value = name;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[0].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/integration/editors/communication/subnetwork-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60624, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc), async desc => {\n parent.wizardUI.inputs[1].value = desc;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[1].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/integration/editors/communication/subnetwork-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60625, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.desc, 1), async type => {\n parent.wizardUI.inputs[2].value = type;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[2].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/integration/editors/communication/subnetwork-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60626, "name": "unknown", "code": "it('edits only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(regexString(regExp.decimal), async BitRate => {\n parent.wizardUI.inputs[3].value = BitRate;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[3].checkValidity()).to.be.true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/integration/editors/communication/subnetwork-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60627, "name": "unknown", "code": "it('rejects edition for invalid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n regexString(inverseRegExp.decimal, 1),\n async BitRate => {\n parent.wizardUI.inputs[3].value = BitRate;\n await parent.updateComplete;\n expect(parent.wizardUI.inputs[3].checkValidity()).to.be.false;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/philippilievskibearingpointcom/compas-open-scd-loader-test/packages/plugins/test/integration/editors/communication/subnetwork-editor-wizarding.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "philippilievskibearingpointcom/compas-open-scd-loader-test", "url": "https://github.com/philippilievskibearingpointcom/compas-open-scd-loader-test.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": null, "mode": "fast-check"} {"id": 60633, "name": "unknown", "code": "it('password length matches line count', () =>\n fc.assert(\n fc.property(fc.integer({ min: 1, max: 20 }), (count) => {\n let input = repeat('U', count).join(EOL);\n let password = solveAdvancedBathroomCode(input);\n\n expect(password?.toString()).to.have.length(count);\n })\n ))", "language": "typescript", "source_file": "./repos/comradevanti-katas/AdventOfCode/2016/day-2/src/domain.spec.ts", "start_line": null, "end_line": null, "dependencies": ["repeat"], "repo": {"name": "comradevanti-katas/AdventOfCode", "url": "https://github.com/comradevanti-katas/AdventOfCode.git", "license": "Unlicense", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `solveAdvancedBathroomCode` function should produce a password with a length equal to the count of input lines.", "mode": "fast-check"} {"id": 54442, "name": "unknown", "code": "it('should have exactly one path leaving the end', () => {\n fc.assert(\n fc.property(seedArb, inputsArb, (seed, ins) => {\n const maze = mazeGenerator(seed, ins.dim, ins.startPt, ins.endPt);\n const numPathsLeavingEnd = neighboorsFor(ins.endPt).reduce((count, pt) => {\n const cell = cellTypeAt(maze, pt);\n if (cell === null || cell === CellType.Wall) return count;\n else return count + 1;\n }, 0);\n expect(numPathsLeavingEnd).toBe(1);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/003-misc/mazeGenerator/main.spec.ts", "start_line": null, "end_line": null, "dependencies": ["neighboorsFor", "cellTypeAt"], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The generated maze should have exactly one open path leading out from the end point.", "mode": "fast-check"} {"id": 54443, "name": "unknown", "code": "it('should have only non-isolated path, start, end', () => {\n fc.assert(\n fc.property(seedArb, inputsArb, (seed, ins) => {\n const maze: (CellType | 'Visited')[][] = mazeGenerator(seed, ins.dim, ins.startPt, ins.endPt);\n\n const ptsToVisit = [ins.startPt, ins.endPt];\n while (ptsToVisit.length > 0) {\n const [pt] = ptsToVisit.splice(ptsToVisit.length - 1);\n maze[pt.y][pt.x] = 'Visited';\n\n ptsToVisit.push(\n ...neighboorsFor(pt).filter((nPt) => {\n const cell = cellTypeAt(maze, nPt);\n return cell !== null && cell !== CellType.Wall && cell !== 'Visited';\n }),\n );\n }\n // All cells are either Walls or marked as visited\n expect(_.flatten(maze).filter((c) => c !== CellType.Wall && c !== 'Visited')).toHaveLength(0);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/003-misc/mazeGenerator/main.spec.ts", "start_line": null, "end_line": null, "dependencies": ["neighboorsFor", "cellTypeAt"], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "In a generated maze, all path, start, and end cells should be reachable and marked as visited, ensuring no non-isolated walkable cells remain.", "mode": "fast-check"} {"id": 54453, "name": "unknown", "code": "it('should confirm b is a substring of a + b + c', () => {\n fc.assert(\n fc.property(fc.string(), fc.string(), fc.string(), (a, b, c) => {\n return indexOf(a + b + c, b) !== -1;\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/001-simple/indexOf/main.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The test checks that `b` is always a substring of the concatenated string `a + b + c` by verifying that `indexOf` returns a position other than -1.", "mode": "fast-check"} {"id": 54916, "name": "unknown", "code": "it('exponentModulo', ctx => {\n console.log(`Testing ${ctx.task.name}...`)\n type TestParams = {\n baseHex: string\n exponentHex: string\n modulusHex: string\n }\n const toResult = (\n params: TestParams,\n count: bigint | undefined = undefined\n ) => ({\n fromJuce: JSON.parse(\n execTestBin(\n 'exponent-modulo',\n JSON.stringify({\n ...params,\n count: count ? count.toString() : ''\n })\n )\n ),\n fromPort: (() => {\n const base = JuceBigInteger.fromHex(params.baseHex)\n const exponent = JuceBigInteger.fromHex(params.exponentHex)\n const modulus = JuceBigInteger.fromHex(params.modulusHex)\n base.exponentModulo(exponent, modulus)\n return {\n exponentModuloHex: base.toHex()\n }\n })()\n })\n const baseString =\n `{\"baseHex\":\"1400000007\",` +\n `\"exponentHex\":\"1400000006\",\"modulusHex\":\"1400000005\"}`\n const baseCase = JSON.parse(baseString)\n const baseResult = toResult(baseCase)\n console.log({ baseCase, baseResult })\n expect(baseResult.fromPort.exponentModuloHex).toBe(\n baseResult.fromJuce.exponentModuloHex\n )\n let latest\n fc.assert(\n fc.property(\n fc.record({\n baseHex: hexArbitrary,\n exponentHex: hexArbitrary,\n modulusHex: hexArbitrary\n }),\n input => {\n const result = toResult(input)\n latest = { input, result }\n return (\n result.fromPort.exponentModuloHex ===\n result.fromJuce.exponentModuloHex\n )\n }\n )\n )\n console.log(latest)\n })", "language": "typescript", "source_file": "./repos/ianacaburian/generate-key-file/src/test/JuceBigInteger.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "ianacaburian/generate-key-file", "url": "https://github.com/ianacaburian/generate-key-file.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `exponentModulo` function should produce the same hex output for both `fromJuce` and `fromPort` implementations when given random hexadecimal inputs for base, exponent, and modulus.", "mode": "fast-check"} {"id": 54919, "name": "unknown", "code": "it('encryptXMLLine', ctx => {\n console.log(`Testing ${ctx.task.name}...`)\n type TestParams = {\n xmlLine: string\n privateKeyString: string\n }\n const toResult = (params: TestParams) => ({\n fromJuce: JSON.parse(\n execTestBin('encrypt-xml-line', JSON.stringify(params))\n ),\n fromUtil: {\n encryptedXMLLine: JuceKeyFileUtils.encryptXMLLine(\n params.xmlLine,\n new JuceRSAKey(params.privateKeyString)\n )\n }\n })\n const baseString = `{\"xmlLine\":\"'\",\"privateKeyString\":\"6,4\"}`\n const baseCase = JSON.parse(baseString)\n const baseResult = toResult(baseCase)\n console.log({ baseCase, baseResult })\n expect(baseResult.fromUtil.encryptedXMLLine).toBe(\n baseResult.fromJuce.encryptedXMLLine\n )\n let latest\n fc.assert(\n fc.property(\n fc.record({\n xmlLine: fc.string({ minLength: 200 }),\n privateKeyPart1Hex: hexArbitrary,\n privateKeyPart2Hex: hexArbitrary\n }),\n input => {\n const privateKeyString =\n input.privateKeyPart1Hex +\n ',' +\n input.privateKeyPart2Hex\n const result = toResult({\n xmlLine: input.xmlLine,\n privateKeyString\n })\n latest = { input, result }\n return (\n result.fromUtil.encryptedXMLLine ===\n result.fromJuce.encryptedXMLLine\n )\n }\n )\n )\n console.log(latest)\n })", "language": "typescript", "source_file": "./repos/ianacaburian/generate-key-file/src/test/JuceKeyFileUtils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "ianacaburian/generate-key-file", "url": "https://github.com/ianacaburian/generate-key-file.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The output of `encryptXMLLine` using `JuceKeyFileUtils` should match the result of `encrypt-xml-line` from `execTestBin` for the same XML line and private key string.", "mode": "fast-check"} {"id": 54920, "name": "unknown", "code": "it('createKeyFile', ctx => {\n console.log(`Testing ${ctx.task.name}...`)\n type TestParams = {\n comment: string\n xmlLine: string\n privateKeyString: string\n }\n const toResult = (\n params: TestParams,\n count: bigint | undefined = undefined\n ) => ({\n fromJuce: JSON.parse(\n execTestBin(\n 'create-key-file',\n JSON.stringify({\n ...params,\n count: count ? count.toString() : ''\n })\n )\n ),\n fromUtil: {\n keyFile: JuceKeyFileUtils.createKeyFile(\n params.comment,\n params.xmlLine,\n new JuceRSAKey(params.privateKeyString)\n )\n }\n })\n const baseCase = {\n comment: 'Expires: 02 Oct 2024 10:15:59pm',\n xmlLine:\n ' ',\n privateKeyString:\n '67852384bf5109ce8eaee433371b5d7100157e7a355412a04e3e8442e0bfc231,92a747a6b9b2cde49f77c3488e116f0c5086ff4e94c14f97f7e55b15a57677bf'\n }\n const baseResult = toResult(baseCase)\n console.log({ baseCase, baseResult })\n expect(baseResult.fromUtil.keyFile).toBe(baseResult.fromJuce.keyFile)\n let latest\n fc.assert(\n fc.property(\n fc.record({\n comment: fc.string({ minLength: 200 }),\n xmlLine: fc.string({ minLength: 200 }),\n privateKeyPart1Hex: hexArbitrary,\n privateKeyPart2Hex: hexArbitrary\n }),\n input => {\n const privateKeyString =\n input.privateKeyPart1Hex +\n ',' +\n input.privateKeyPart2Hex\n const result = toResult({\n comment: input.comment,\n xmlLine: input.xmlLine,\n privateKeyString\n })\n latest = { input, result }\n return result.fromUtil.keyFile === result.fromJuce.keyFile\n }\n )\n )\n console.log(latest)\n })", "language": "typescript", "source_file": "./repos/ianacaburian/generate-key-file/src/test/JuceKeyFileUtils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "ianacaburian/generate-key-file", "url": "https://github.com/ianacaburian/generate-key-file.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`JuceKeyFileUtils.createKeyFile` generates a key file identical to the one produced by the `create-key-file` binary when provided with the same parameters.", "mode": "fast-check"} {"id": 54501, "name": "unknown", "code": "it(\"should mark value as 'canShrinkWithoutContext' whenever one of the original values is equal regarding Object.is\", () => {\n fc.assert(\n fc.property(fc.array(fc.anything(), { minLength: 1 }), fc.nat(), (values, mod) => {\n // Arrange\n const selectedValue = values[mod % values.length];\n\n // Act\n const arb = new ConstantArbitrary(values);\n const out = arb.canShrinkWithoutContext(selectedValue);\n\n // Assert\n expect(out).toBe(true);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/ConstantArbitrary.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`ConstantArbitrary` returns true for `canShrinkWithoutContext` when one of the original values matches the selected value using `Object.is`.", "mode": "fast-check"} {"id": 54516, "name": "unknown", "code": "it('should only consider the received maxLength when set to \"max\"', () => {\n fc.assert(\n fc.property(\n sizeRelatedGlobalConfigArb,\n fc.integer({ min: 0, max: MaxLengthUpperBound }),\n fc.integer({ min: 0, max: MaxLengthUpperBound }),\n fc.boolean(),\n (config, lengthA, lengthB, specifiedMaxLength) => {\n // Arrange\n const size = 'max';\n const [minLength, maxLength] = lengthA < lengthB ? [lengthA, lengthB] : [lengthB, lengthA];\n\n // Act\n const computedLength = withConfiguredGlobal(config, () =>\n maxGeneratedLengthFromSizeForArbitrary(size, minLength, maxLength, specifiedMaxLength),\n );\n\n // Assert\n expect(computedLength).toBe(maxLength);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/helpers/MaxLengthFromMinLength.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "When `size` is set to \"max\", the function should return the received `maxLength` regardless of other parameters.", "mode": "fast-check"} {"id": 54521, "name": "unknown", "code": "it('should only consider the received depthSize when set to a numeric value', () => {\n fc.assert(\n fc.property(\n sizeRelatedGlobalConfigArb,\n fc.double({ min: 0 }),\n fc.boolean(),\n (config, size, specifiedMaxDepth) => {\n // Arrange / Act\n const computedDepthBias = withConfiguredGlobal(config, () =>\n depthBiasFromSizeForArbitrary(size, specifiedMaxDepth),\n );\n\n // Assert\n expect(computedDepthBias).toBe(1 / size);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/helpers/MaxLengthFromMinLength.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The computed depth bias should be \\( \\frac{1}{\\text{size}} \\) when the depth size is set to a numeric value.", "mode": "fast-check"} {"id": 54921, "name": "unknown", "code": "it('generateKeyFile', ctx => {\n console.log(`Testing ${ctx.task.name}...`)\n type TestParams = {\n userEmail: string\n userName: string\n publicKey: string\n privateKey: string\n }\n const toResult = (\n { userEmail, userName, publicKey, privateKey }: TestParams,\n count: bigint | undefined = undefined\n ) => {\n const generateParams = {\n userEmail,\n userName,\n appName,\n machineNumbers,\n privateKey\n }\n const keyFileContent = JuceKeyGeneration.generateKeyFile(\n generateParams,\n new Date('1970-01-01T00:00:00.000Z')\n )\n const applyResult = JSON.parse(\n execTestBin(\n 'apply-key-file',\n JSON.stringify({\n keyFileContent,\n publicKey,\n count: count ? count.toString() : undefined\n })\n )\n )\n return {\n ...applyResult,\n generateParams,\n publicKey\n }\n }\n const baseEmail = 'a@a.a'\n const basePublicKey =\n '11,92a747a6b9b2cde49f77c3488e116f0c5086ff4e94c14f97f7e55b15a57677bf'\n const basePrivateKey =\n '67852384bf5109ce8eaee433371b5d7100157e7a355412a04e3e8442e0bfc231,92a747a6b9b2cde49f77c3488e116f0c5086ff4e94c14f97f7e55b15a57677bf'\n const baseString =\n `{\"userEmail\":\"${baseEmail}\",\"userName\":\"&\",` +\n `\"publicKey\":\"${basePublicKey}\",\"privateKey\":\"${basePrivateKey}\"}`\n const baseCase = JSON.parse(baseString)\n const baseResult = toResult({\n ...baseCase,\n publicKey: basePublicKey,\n privateKey: basePrivateKey\n })\n console.log({ baseCase, baseResult })\n expect(baseResult.unlockMessage).toBe('OK')\n expect(baseResult.unlockEmail).toBe(baseEmail)\n expect(baseResult.isUnlocked).toBe('UNLOCKED')\n let latest\n let count = 0n\n fc.assert(\n fc.property(\n fc.record({\n userEmail: fc.string({ minLength: 100 }),\n userName: fc.string({ minLength: 100 })\n }),\n input => {\n count += 1n\n const { publicKey, privateKey } = JSON.parse(\n execTestBin('create-key-pair')\n )\n const params = {\n ...input,\n publicKey,\n privateKey\n }\n const result = toResult(params, count)\n latest = { input, result }\n return (\n result.unlockMessage === 'OK' &&\n result.unlockEmail === input.userEmail &&\n result.isUnlocked === 'UNLOCKED'\n )\n }\n )\n )\n console.log(latest)\n })", "language": "typescript", "source_file": "./repos/ianacaburian/generate-key-file/src/test/JuceKeyGeneration.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "ianacaburian/generate-key-file", "url": "https://github.com/ianacaburian/generate-key-file.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`JuceKeyGeneration.generateKeyFile` correctly creates key files so that when applied, it consistently generates an 'OK' unlock message, matches the input email, and results in an 'UNLOCKED' status.", "mode": "fast-check"} {"id": 54528, "name": "unknown", "code": "it('should only include values between current and target in the stream', () =>\n fc.assert(\n fc.property(fc.maxSafeInteger(), fc.maxSafeInteger(), fc.boolean(), (current, target, tryAsap) => {\n // Arrange / Act\n const shrinks = [...shrinkInteger(current, target, tryAsap)];\n const values = shrinks.map((v) => v.value);\n\n // Assert\n for (const v of values) {\n expect(v).toBeGreaterThanOrEqual(Math.min(current, target));\n expect(v).toBeLessThanOrEqual(Math.max(current, target));\n }\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/helpers/ShrinkInteger.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Ensures that the values produced by `shrinkInteger` fall within the range between the current and target integers.", "mode": "fast-check"} {"id": 54550, "name": "unknown", "code": "it(\"should always pass bias to values' arbitrary when minLength equals maxGeneratedLength\", () => {\n fc.assert(\n fc.property(\n fc.array(fc.tuple(fc.anything(), fc.anything(), fc.boolean())),\n fc.nat(),\n fc.nat(MaxLengthUpperBound),\n fc.anything(),\n fc.integer({ min: 2 }),\n fc.boolean(),\n (generatedValues, seed, aLength, integerContext, biasFactor, withSetBuilder) => {\n // Arrange\n const { acceptedValues, instance, setBuilder, generate } = prepareSetBuilderData(\n generatedValues,\n !withSetBuilder,\n );\n const { minLength, maxLength } = extractLengths(seed, aLength, aLength, acceptedValues);\n const { instance: integerInstance, generate: generateInteger } = fakeArbitrary();\n generateInteger.mockReturnValue(new Value(minLength, integerContext));\n const integer = vi.spyOn(IntegerMock, 'integer');\n integer.mockReturnValue(integerInstance);\n const { instance: mrng } = fakeRandom();\n\n // Act\n const arb = new ArrayArbitrary(\n instance,\n minLength,\n minLength,\n maxLength,\n undefined,\n withSetBuilder ? setBuilder : undefined,\n [],\n );\n const g = arb.generate(mrng, biasFactor);\n\n // Assert\n expect(g.hasToBeCloned).toBe(false);\n if (!withSetBuilder) {\n // In the case of set the generated value might be smaller\n // The generator is allowed to stop whenever it considers at already tried to many times (maxGeneratedLength times)\n expect(g.value).toEqual([...acceptedValues].map((v) => v.value).slice(0, minLength));\n } else {\n expect(g.value).toEqual(\n [...acceptedValues].map((v) => v.value).slice(0, Math.min(g.value.length, minLength)),\n );\n }\n expect(integer).toHaveBeenCalledTimes(1);\n expect(integer).toHaveBeenCalledWith({ min: minLength, max: minLength });\n expect(generateInteger).toHaveBeenCalledTimes(1);\n expect(generateInteger).toHaveBeenCalledWith(mrng, undefined); // no need to bias it\n expect(setBuilder).toHaveBeenCalledTimes(withSetBuilder ? 1 : 0);\n expect(generate.mock.calls.length).toBeGreaterThanOrEqual(minLength);\n for (const call of generate.mock.calls) {\n expect(call).toEqual([mrng, biasFactor]); // but bias all sub-values\n }\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/ArrayArbitrary.spec.ts", "start_line": null, "end_line": null, "dependencies": ["prepareSetBuilderData", "extractLengths"], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Bias should always be passed to values' arbitrary when `minLength` equals `maxGeneratedLength`, ensuring correct generation and set management.", "mode": "fast-check"} {"id": 54607, "name": "unknown", "code": "test(\"fuzz `event` w/ `record`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(\n\t\t\tfc.record({\n\t\t\t\theaders: fc.record({\n\t\t\t\t\t\"content-type\": fc.constant(\"application/json\"),\n\t\t\t\t}),\n\t\t\t\tbody: fc.string(),\n\t\t\t}),\n\t\t\tasync (event) => {\n\t\t\t\ttry {\n\t\t\t\t\tawait handler(event, context);\n\t\t\t\t} catch (e) {\n\t\t\t\t\tif (e.cause?.package !== \"@middy/http-json-body-parser\") {\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/http-json-body-parser/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": "The test checks that processing an event with a JSON `content-type` header and a string body using `handler` either succeeds or throws an error specifically caused by `@middy/http-json-body-parser`.", "mode": "fast-check"} {"id": 54697, "name": "unknown", "code": "test(\"fuzz accountUsernameRecover w/ sub\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (sub) => {\n\t\t\ttry {\n\t\t\t\tawait accountUsernameRecover(sub);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(sub, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/account-username/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The `accountUsernameRecover` function should handle inputs without throwing unexpected errors, where expected errors are limited to certain HTTP status codes.", "mode": "fast-check"} {"id": 54721, "name": "unknown", "code": "it('child transactions should always have a parent_id', async () => {\n await fc.assert(\n fc\n .asyncProperty(fc.array(messageArb, { maxLength: 100 }), async msgs => {\n let tracer = execTracer();\n tracer.start();\n let cleanup = addSyncListener((oldValues, newValues) => {\n let ts = newValues.get('transactions');\n if (\n ts &&\n [...ts.values()].find(\n t =>\n t.isChild === 1 && t.parent_id == null && t.id.includes('/')\n )\n ) {\n } else {\n tracer.event('applied');\n }\n });\n\n await sendMessages(msgs);\n await tracer.expect('applied');\n\n let transactions = await db.all(\n 'SELECT * FROM transactions',\n [],\n true\n );\n for (let trans of transactions) {\n let transMsgs = msgs\n .filter(msg => msg.row === trans.id)\n .sort((m1, m2) => {\n let t1 = m1.timestamp.toString();\n let t2 = m2.timestamp.toString();\n if (t1 < t2) {\n return 1;\n } else if (t1 > t2) {\n return -1;\n }\n return 0;\n });\n let msg = transMsgs.find(m => m.column === 'parent_id');\n\n if (\n trans.isChild === 1 &&\n trans.id.includes('/') &&\n (msg == null || msg.value == null)\n ) {\n // This is a child transaction didn't have a `parent_id`\n // set in the messages. It should have gotten set from\n // the `id`\n let [parentId] = trans.id.split('/');\n expect(parentId).not.toBe(null);\n expect(trans.parent_id).toBe(parentId);\n } else if (msg) {\n // At least one message set `parent_id`\n expect(trans.parent_id).toBe(msg.value);\n } else {\n // `parent_id` should never have been set\n expect(trans.parent_id).toBe(null);\n }\n }\n\n cleanup();\n tracer.end();\n })\n .beforeEach(() => {\n return db.execQuery(`DELETE FROM transactions`);\n })\n );\n })", "language": "typescript", "source_file": "./repos/TomAFrench/temp-actual/packages/loot-core/src/server/sync/migrate.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "TomAFrench/temp-actual", "url": "https://github.com/TomAFrench/temp-actual.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Child transactions in the system must have a `parent_id` assigned, either through message setting or derived from the transaction `id`.", "mode": "fast-check"} {"id": 54743, "name": "unknown", "code": "test('Integer.subtract should be Distributive', () => {\n fc.assert(fc.property(arbitraryInteger(), arbitraryInteger(), arbitraryInteger(),\n (a, b, c) => a.multiply(b.subtract(c)).equals(a.multiply(b).subtract(a.multiply(c)))))\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/integer.test.ts", "start_line": null, "end_line": null, "dependencies": ["arbitraryInteger"], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "`Integer.subtract` operation is distributive over multiplication, ensuring \\( a \\times (b - c) = (a \\times b) - (a \\times c) \\) for arbitrary integers.", "mode": "fast-check"} {"id": 54922, "name": "unknown", "code": "it('generateExpiringKeyFile', ctx => {\n console.log(`Testing ${ctx.task.name}...`)\n type TestParams = {\n userEmail: string\n userName: string\n publicKey: string\n privateKey: string\n expiryTime: string\n }\n const toResult = (\n params: TestParams,\n count: bigint | undefined = undefined\n ) => {\n const generateParams: GenerateExpiringKeyFileParams = {\n userEmail: params.userEmail,\n userName: params.userName,\n appName,\n machineNumbers,\n privateKey: params.privateKey,\n expiryTime: new Date(parseInt(params.expiryTime, 16))\n }\n const keyFileContent = JuceKeyGeneration.generateExpiringKeyFile(\n generateParams,\n new Date('1970-01-01T00:00:00.000Z')\n )\n const applyResult = JSON.parse(\n execTestBin(\n 'apply-key-file',\n JSON.stringify({\n keyFileContent,\n publicKey: params.publicKey,\n count: count ? count.toString() : undefined\n })\n )\n )\n return {\n ...applyResult,\n generateParams,\n publicKey: params.publicKey\n }\n }\n const baseEmail = 'a@a.a'\n const baseName = '&'\n const baseExpiryTime = JuceKeyFileUtils.toHexStringMilliseconds(\n new Date('1970-01-01T00:00:00.001Z')\n )\n const basePublicKey =\n '11,92a747a6b9b2cde49f77c3488e116f0c5086ff4e94c14f97f7e55b15a57677bf'\n const basePrivateKey =\n '67852384bf5109ce8eaee433371b5d7100157e7a355412a04e3e8442e0bfc231,92a747a6b9b2cde49f77c3488e116f0c5086ff4e94c14f97f7e55b15a57677bf'\n const baseString =\n `{\"userEmail\":\"${baseEmail}\",\"userName\":\"${baseName}\",` +\n `\"expiryTime\":\"${baseExpiryTime}\"}`\n const baseCase = JSON.parse(baseString)\n const baseResult = toResult({\n ...baseCase,\n publicKey: basePublicKey,\n privateKey: basePrivateKey\n })\n console.log({ baseCase, baseResult })\n expect(baseResult.unlockMessage).toBe('OK')\n expect(baseResult.unlockEmail).toBe(baseEmail)\n expect(baseResult.isUnlocked).toBe('LOCKED')\n expect(baseResult.unlockExpiryTime).toBe(baseExpiryTime)\n const arbitrary = ZodFastCheck()\n .inputOf(\n z.object({\n userEmail: z.string(),\n userName: z.string(),\n expiryTime: z.date()\n })\n )\n .filter(\n input =>\n input.userEmail.length > 0 &&\n input.userName.length > 0 &&\n input.expiryTime > new Date('1970-01-01T00:00:00.000Z')\n )\n let latest\n let count = 0n\n fc.assert(\n fc.property(arbitrary, input => {\n count += 1n\n const inputExpiryTimeString =\n JuceKeyFileUtils.toHexStringMilliseconds(input.expiryTime)\n const { publicKey, privateKey } = JSON.parse(\n execTestBin('create-key-pair')\n )\n const params = {\n userEmail: input.userEmail,\n userName: input.userName,\n publicKey,\n privateKey,\n expiryTime: inputExpiryTimeString\n }\n const result = toResult(params, count)\n latest = { input, inputExpiryTimeString, result }\n return (\n result.unlockMessage === 'OK' &&\n result.unlockEmail === input.userEmail &&\n result.isUnlocked === 'LOCKED' &&\n result.unlockExpiryTime === inputExpiryTimeString\n )\n })\n )\n console.log({ latest })\n })", "language": "typescript", "source_file": "./repos/ianacaburian/generate-key-file/src/test/JuceKeyGeneration.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "ianacaburian/generate-key-file", "url": "https://github.com/ianacaburian/generate-key-file.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`generateExpiringKeyFile` creates a key file that, when tested, results in an unlock message of 'OK', the correct unlock email, a locked status, and the expected unlock expiry time based on varied user inputs.", "mode": "fast-check"} {"id": 54923, "name": "unknown", "code": "it('should catch errors if the retried function always throws', async () => {\n await fc.assert(\n fc.asyncProperty(defaultProps(), async (config) => {\n const errorFunction = jasmine\n .createSpy('errorFunction', () => {\n // A function that always throws an error\n throw new Error('Always fails');\n })\n .and.callThrough();\n\n const { result, exceptions } = await retry(errorFunction, config);\n\n // result should be undefined since we always throw\n expect(result).toBe(undefined);\n\n // should have been called config.maxAttempts times\n expect(errorFunction.calls.count()).toEqual(config.maxAttempts);\n\n // Size of errors should be equal to maxAttempts because the function always fails\n expect(exceptions.length).toEqual(config.maxAttempts);\n }),\n { numRuns: 10 },\n );\n })", "language": "typescript", "source_file": "./repos/duckduckgo/content-scope-scripts/injected/unit-test/timer-utils.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "duckduckgo/content-scope-scripts", "url": "https://github.com/duckduckgo/content-scope-scripts.git", "license": "Apache-2.0", "stars": 52, "forks": 29}, "metrics": null, "summary": "A function that consistently throws errors should result in a null return value and record errors matching the maximum number of retry attempts.", "mode": "fast-check"} {"id": 54989, "name": "unknown", "code": "test(\"Should accept input of `string`\", async () => {\n\t\tfc.assert(\n\t\t\tfc.asyncProperty(fc.string(), async (input) => {\n\t\t\t\ttry {\n\t\t\t\t\tawait run(input);\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcatchError(input, e);\n\t\t\t\t}\n\t\t\t}),\n\t\t\t{\n\t\t\t\tnumRuns: 10, // 1_000_000\n\t\t\t\tverbose: 2,\n\t\t\t\texamples: [],\n\t\t\t},\n\t\t);\n\t})", "language": "typescript", "source_file": "./repos/willfarrell/template-npm/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/template-npm", "url": "https://github.com/willfarrell/template-npm.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The function `run` should process input strings without throwing an error, except when the error message equals \"false\".", "mode": "fast-check"} {"id": 54990, "name": "unknown", "code": "test(\"Should accept input of `boolean`\", async () => {\n\t\tfc.assert(\n\t\t\tfc.asyncProperty(fc.boolean(), async (input) => {\n\t\t\t\ttry {\n\t\t\t\t\tawait run(input);\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcatchError(input, e);\n\t\t\t\t}\n\t\t\t}),\n\t\t\t{\n\t\t\t\tnumRuns: 10,\n\t\t\t\tverbose: 2,\n\t\t\t\texamples: [],\n\t\t\t},\n\t\t);\n\t})", "language": "typescript", "source_file": "./repos/willfarrell/template-npm/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/template-npm", "url": "https://github.com/willfarrell/template-npm.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The function `run` should handle input of type `boolean` without throwing an error unless the message is \"false\".", "mode": "fast-check"} {"id": 54991, "name": "unknown", "code": "it('should follow full renderer structure', () => {\n fc.assert(fc.property(\n arbitraryReactElement(),\n (x) => equal(full.toJSON(RTR.create(x)), shallow._toJSON(x))\n ), {numRuns: 1000});\n })", "language": "typescript", "source_file": "./repos/wix-incubator/react-component-driver/react-component-driver/tests/sanity.spec.js", "start_line": null, "end_line": null, "dependencies": ["arbitraryReactElement", "equal"], "repo": {"name": "wix-incubator/react-component-driver", "url": "https://github.com/wix-incubator/react-component-driver.git", "license": "MIT", "stars": 7, "forks": 2}, "metrics": null, "summary": "The full renderer's output structure from `full.toJSON(RTR.create(x))` should match the shallow renderer's output structure from `shallow._toJSON(x)`.", "mode": "fast-check"} {"id": 54997, "name": "unknown", "code": "it(\"mul backward pass gradient property\", () => {\n fc.assert(\n fc.property(valueArbitrary, valueArbitrary, (a, b) => {\n const fresh_a = eng.value(a.data);\n const fresh_b = eng.value(b.data);\n const result = eng.mul(fresh_a, fresh_b);\n result.backward(); // Call the method!\n // Check gradients: d(res)/da = b.data, d(res)/db = a.data\n return (\n closeTo(fresh_a.grad, fresh_b.data) &&\n closeTo(fresh_b.grad, fresh_a.data)\n );\n }),\n );\n })", "language": "typescript", "source_file": "./repos/ianchanning/micrograd-js/engine.test.js", "start_line": null, "end_line": null, "dependencies": ["closeTo"], "repo": {"name": "ianchanning/micrograd-js", "url": "https://github.com/ianchanning/micrograd-js.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The gradient of the result from multiplying two values should match the data of the other value during a backward pass.", "mode": "fast-check"} {"id": 55153, "name": "unknown", "code": "test(\"should yield negative integers\", () => {\n fc.assert(\n fc.property(NegativeIntArbitrary, (num) => {\n assert.ok(Negative.is(num));\n assert.ok(Int.is(num));\n assert.ok(NegativeInt.is(num));\n }),\n {\n verbose: true,\n numRuns: 100,\n }\n );\n})", "language": "typescript", "source_file": "./repos/EricCrosson/numbers-ts/packages/fast-check-numbers/test/property/test-negative-int.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "EricCrosson/numbers-ts", "url": "https://github.com/EricCrosson/numbers-ts.git", "license": "ISC", "stars": 3, "forks": 2}, "metrics": null, "summary": "The test ensures that values generated by `NegativeIntArbitrary` satisfy being negative integers, validating them with `Negative.is`, `Int.is`, and `NegativeInt.is`.", "mode": "fast-check"} {"id": 55154, "name": "unknown", "code": "test(\"should yield integers\", () => {\n fc.assert(\n fc.property(IntArbitrary, (num) => {\n assert.ok(Int.is(num));\n }),\n {\n verbose: true,\n numRuns: 100,\n }\n );\n})", "language": "typescript", "source_file": "./repos/EricCrosson/numbers-ts/packages/fast-check-numbers/test/property/test-int.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "EricCrosson/numbers-ts", "url": "https://github.com/EricCrosson/numbers-ts.git", "license": "ISC", "stars": 3, "forks": 2}, "metrics": null, "summary": "`IntArbitrary` generates numbers that are validated as integers using `Int.is`.", "mode": "fast-check"} {"id": 55172, "name": "unknown", "code": "test(\"paths match themselves\", () => {\n fc.assert(\n fc.property(fc.oneof(arb.filePath(), arb.folderPath()), (path) =>\n new Glob(path).matches(path)\n )\n );\n})", "language": "typescript", "source_file": "./repos/mausworks/tidier/packages/tidier-core/src/glob.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mausworks/tidier", "url": "https://github.com/mausworks/tidier.git", "license": "ISC", "stars": 202, "forks": 2}, "metrics": null, "summary": "Each path should match itself using the `Glob` class.", "mode": "fast-check"} {"id": 55176, "name": "unknown", "code": "test(\"ANYTHING matches any string\", () => {\n fc.assert(fc.property(fc.string(), Glob.ANYTHING.matches));\n})", "language": "typescript", "source_file": "./repos/mausworks/tidier/packages/tidier-core/src/glob.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mausworks/tidier", "url": "https://github.com/mausworks/tidier.git", "license": "ISC", "stars": 202, "forks": 2}, "metrics": null, "summary": "`ANYTHING` should match any given string.", "mode": "fast-check"} {"id": 55187, "name": "unknown", "code": "test('idToEpoch and prefixEpochToArray rountrip', () => {\n\tfc.assert(\n\t\tfc.property(\n\t\t\tfc.record({\n\t\t\t\tepoch: fc.integer({\n\t\t\t\t\tmin: 0,\n\t\t\t\t\tmax: epochMax,\n\t\t\t\t}),\n\t\t\t\tid: fc.uint8Array({\n\t\t\t\t\tminLength: idLength,\n\t\t\t\t\tmaxLength: idLength,\n\t\t\t\t}),\n\t\t\t}),\n\t\t\t({ epoch, id }) => {\n\t\t\t\tprefixEpochToArray(epoch, id)\n\t\t\t\tconst actual = idToEpoch(id)\n\t\t\t\tassert.equal(actual, epoch)\n\t\t\t},\n\t\t),\n\t)\n})", "language": "typescript", "source_file": "./repos/AlexErrant/Pentive/shared/tests/binary.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "AlexErrant/Pentive", "url": "https://github.com/AlexErrant/Pentive.git", "license": "Apache-2.0", "stars": 42, "forks": 3}, "metrics": null, "summary": "`prefixEpochToArray` prefixes an epoch to an array, and `idToEpoch` retrieves the epoch, ensuring that the roundtrip transformation starts and ends with the same epoch value.", "mode": "fast-check"} {"id": 55194, "name": "unknown", "code": "it(\"should parse decompressed CSV\", () =>\n fc.assert(\n fc.asyncProperty(\n fc.gen().map((g) => {\n const header = g(FC.header, {\n // TextEncoderStream can't handle utf-16 string.\n fieldConstraints: {\n kindExcludes: [\"string16bits\"],\n },\n });\n const EOL = g(FC.eol);\n const csvData = g(FC.csvData, {\n // TextEncoderStream can't handle utf-16 string.\n fieldConstraints: {\n kindExcludes: [\"string16bits\"],\n },\n columnsConstraints: {\n minLength: header.length,\n maxLength: header.length,\n },\n });\n const EOF = g(fc.boolean);\n const csv = [\n header.map((v) => escapeField(v, { quote: true })).join(\",\"),\n ...csvData.map((row) =>\n row.map((v) => escapeField(v, { quote: true })).join(\",\"),\n ),\n ...(EOF ? [\"\"] : []),\n ].join(EOL);\n const data =\n csvData.length >= 1\n ? csvData.map((row) =>\n Object.fromEntries(row.map((v, i) => [header[i], v])),\n )\n : [];\n const decompression = g(() =>\n fc.constantFrom(\n \"gzip\",\n \"deflate\",\n // NOTE: Node.js doesn't support raw deflate.\n // \"deflate-raw\",\n ),\n );\n return {\n data,\n csv: new SingleValueReadableStream(csv)\n .pipeThrough(new TextEncoderStream())\n .pipeThrough(new CompressionStream(decompression)),\n decompression: decompression,\n };\n }),\n async ({ data, csv, decompression }) => {\n let i = 0;\n for await (const row of parseUint8ArrayStream(csv, {\n decomposition: decompression,\n })) {\n expect(data[i++]).toStrictEqual(row);\n }\n },\n ),\n ))", "language": "typescript", "source_file": "./repos/kamiazya/web-csv-toolbox/src/parseUint8ArrayStream.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "kamiazya/web-csv-toolbox", "url": "https://github.com/kamiazya/web-csv-toolbox.git", "license": "MIT", "stars": 15, "forks": 4}, "metrics": null, "summary": "CSV data decompressed from a stream should correctly match the original dataset.", "mode": "fast-check"} {"id": 55211, "name": "unknown", "code": "it(\"should throw an error if delimiter is the same as quotation\", async () => {\n fc.assert(\n fc.property(\n FC.text({ minLength: 1, maxLength: 1, excludes: [...CRLF] }).filter(\n (v) => v.length === 1,\n ),\n (value) => {\n expect(() =>\n assertCommonOptions({ quotation: value, delimiter: value }),\n ).toThrowErrorMatchingInlineSnapshot(\n // biome-ignore lint/style/noUnusedTemplateLiteral: This is a snapshot\n `[RangeError: delimiter must not be the same as quotation, use different characters]`,\n );\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/kamiazya/web-csv-toolbox/src/assertCommonOptions.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "kamiazya/web-csv-toolbox", "url": "https://github.com/kamiazya/web-csv-toolbox.git", "license": "MIT", "stars": 15, "forks": 4}, "metrics": null, "summary": "An error is thrown if the delimiter is the same as the quotation character.", "mode": "fast-check"} {"id": 55243, "name": "unknown", "code": "test('Additive identity', () => {\n fc.assert(\n fc.property(fcCalendarDate(), (date) => {\n expect(addDays(date, 0)).toEqual(date);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/tskj/typescript-calendar-date/specs/index.tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tskj/typescript-calendar-date", "url": "https://github.com/tskj/typescript-calendar-date.git", "license": "MIT", "stars": 9, "forks": 0}, "metrics": null, "summary": "`addDays` with an argument of 0 should return the original date.", "mode": "fast-check"} {"id": 55244, "name": "unknown", "code": "test('Subtraction identity', () => {\n fc.assert(\n fc.property(fcCalendarDate(), (date) => {\n expect(numberOfDaysBetween({ start: date, end: date })).toBe(0);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/tskj/typescript-calendar-date/specs/index.tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tskj/typescript-calendar-date", "url": "https://github.com/tskj/typescript-calendar-date.git", "license": "MIT", "stars": 9, "forks": 0}, "metrics": null, "summary": "`numberOfDaysBetween` returns zero when the start and end dates are the same.", "mode": "fast-check"} {"id": 55245, "name": "unknown", "code": "test('Associativity for months', () => {\n fc.assert(\n fc.property(\n fcCalendarMonth(),\n fc.integer(-500, 500),\n fc.integer(-500, 500),\n (date, x, y) => {\n expect(addMonths(date, x + y)).toEqual(\n addMonths(addMonths(date, x), y),\n );\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/tskj/typescript-calendar-date/specs/index.tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tskj/typescript-calendar-date", "url": "https://github.com/tskj/typescript-calendar-date.git", "license": "MIT", "stars": 9, "forks": 0}, "metrics": null, "summary": "Adding months to a date should be associative, meaning `addMonths(date, x + y)` should equal `addMonths(addMonths(date, x), y)`.", "mode": "fast-check"} {"id": 55249, "name": "unknown", "code": "test('arbitrary matches regex', () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(arbitraryFromPattern(pattern), (s) => regex.test(s)),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/skeate/kuvio/test/test-utils/test-pattern.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "skeate/kuvio", "url": "https://github.com/skeate/kuvio.git", "license": "MIT", "stars": 9, "forks": 1}, "metrics": null, "summary": "Generated strings from `arbitraryFromPattern(pattern)` should match the specified regex.", "mode": "fast-check"} {"id": 55323, "name": "unknown", "code": "it(\"should behave the same way when pushing and shifting\", () => {\n fc.assert(\n fc.property(\n fc.array(\n fc.tuple(\n fc.constantFrom(\"push\", \"pop\", \"shift\", \"unshift\", \"set\", \"insert\", \"slice\", \"splice\"),\n fc.tuple(fc.integer({ max: 1000, min: -1000 }), fc.nat())\n ),\n { maxLength: 10000 }\n ),\n (testData) => {\n let immList = Immutable.List();\n let list = List.empty();\n testData.forEach(([op, [index, value]]) => {\n if (op === \"push\") {\n immList = immList.push(value);\n list = list.push(value);\n } else if (op === \"pop\") {\n immList = immList.pop();\n list = list.pop();\n } else if (op === \"shift\") {\n immList = immList.shift();\n list = list.shift();\n } else if (op === \"unshift\") {\n immList = immList.unshift(value);\n list = list.unshift(value);\n } else if (op === \"insert\") {\n immList = immList.insert(index, value);\n list = list.insert(index, value);\n } else if (op === \"slice\") {\n immList = immList.slice(index);\n list = list.slice(index);\n /*} else if (op === \"splice\") {\n immList = immList.splice(index, value);\n list = list.splice(index, value);*/\n } else {\n immList = immList.set(index, value);\n list = list.set(index, value);\n\n }\n });\n const expected = immList.toJS().map(x => x === null ? undefined : x);\n expect([...list]).toEqual(expected);\n }\n ), { numRuns: 9900 }\n );\n })", "language": "typescript", "source_file": "./repos/alexvictoor/ts-immutable/src/list.fc.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "alexvictoor/ts-immutable", "url": "https://github.com/alexvictoor/ts-immutable.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Operations on `Immutable.List` and a custom list should result in equivalent states after applying a series of operations like `push`, `pop`, `shift`, `unshift`, `set`, `insert`, and `slice`.", "mode": "fast-check"} {"id": 55338, "name": "unknown", "code": "it('should not change the list of tabs, just its order', () => {\n fc.assert(\n fc.property(tabsWithSelectionArb, ({ tabs, selectedTabs, movePosition }) => {\n // Arrange / Act\n const newTabs = reorderTabs(tabs, selectedTabs, movePosition);\n\n // Assert\n expect([...newTabs].sort()).toEqual([...tabs].sort());\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/higher-level-algorithms/reorderTabs.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "Reordering tabs should not alter the list of tabs, only their order within the list.", "mode": "fast-check"} {"id": 55432, "name": "unknown", "code": "it(\"returns empty string for non-positive number\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.integer({ max: 0 }),\n\t\t\t\t\tfc.string(),\n\t\t\t\t\t(n, x) => f(n)(x) === \"\",\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Function `f` should return an empty string when the first argument is a non-positive integer, regardless of the second argument.", "mode": "fast-check"} {"id": 55435, "name": "unknown", "code": "it(\"returns whole string for number that's too large\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.string(),\n\t\t\t\t\tfc.integer({ min: 0, max: Number.MAX_SAFE_INTEGER }),\n\t\t\t\t\t(x, n) => f(x.length + n)(x) === x,\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "A function `f` returns the whole string unchanged when given an index larger than the string length.", "mode": "fast-check"} {"id": 55336, "name": "unknown", "code": "it('should insert all the selected tabs before the move position', () => {\n fc.assert(\n fc.property(tabsWithSelectionArb, ({ tabs, selectedTabs, movePosition }) => {\n // Arrange / Act\n const newTabs = reorderTabs(tabs, selectedTabs, movePosition);\n\n // Assert\n const movePositionIndex = newTabs.indexOf(movePosition);\n for (const selected of selectedTabs) {\n const selectedIndex = newTabs.indexOf(selected);\n expect(selectedIndex).toBeLessThan(movePositionIndex);\n }\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/higher-level-algorithms/reorderTabs.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "Selected tabs should be inserted before the specified move position in the reordered list.", "mode": "fast-check"} {"id": 55333, "name": "unknown", "code": "it('should be able to rebuild after given only the diff', () => {\n fc.assert(\n fc.property(diffArb, (diff) => {\n // Arrange\n const before = beforeFromDiff(diff);\n const after = afterFromDiff(diff);\n\n // Act\n const computedDiff = textDiffer(before, after);\n\n // Assert\n expect(afterFromDiff(computedDiff)).toEqual(after);\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/higher-level-algorithms/textDiffer.spec.ts", "start_line": null, "end_line": null, "dependencies": ["beforeFromDiff", "afterFromDiff"], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "Rebuilding using the `textDiffer` function retains the correct \"after\" state from a diff.", "mode": "fast-check"} {"id": 55337, "name": "unknown", "code": "it('should not alter non-selected tabs', () => {\n fc.assert(\n fc.property(tabsWithSelectionArb, ({ tabs, selectedTabs, movePosition }) => {\n // Arrange / Act\n const newTabs = reorderTabs(tabs, selectedTabs, movePosition);\n\n // Assert\n expect(newTabs.filter((t) => !selectedTabs.includes(t))).toEqual(tabs.filter((t) => !selectedTabs.includes(t)));\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/higher-level-algorithms/reorderTabs.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "Reordering tabs should leave non-selected tabs unchanged.", "mode": "fast-check"} {"id": 55632, "name": "unknown", "code": "it(\"returns lifted identity on identity converging function and lifted identity tuple\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.anything(), x =>\n\t\t\t\t\texpect(f(identity)([identity])(x)).toEqual([x]),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Function.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The test checks that applying a function `f` with a lifted identity function and a lifted identity tuple results in an output equal to a tuple containing the input.", "mode": "fast-check"} {"id": 55499, "name": "unknown", "code": "it(\"returns None if target is out of bounds\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.anything()), xs =>\n\t\t\t\t\texpect(f(0)(A.size(xs))(xs)).toEqual(O.none),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Returns `None` if the target index is out of the array's bounds.", "mode": "fast-check"} {"id": 55504, "name": "unknown", "code": "it(\"returns None if source is out of bounds\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.anything()), xs =>\n\t\t\t\t\texpect(f(0)(A.size(xs))(xs)).toEqual(O.none),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` should return `None` when the source index is out of the bounds of the array.", "mode": "fast-check"} {"id": 55507, "name": "unknown", "code": "it(\"returns the same array size\", () => {\n\t\t\tconst n = 10\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.anything(), { minLength: n, maxLength: n }),\n\t\t\t\t\tfc.integer({ min: 0, max: n - 1 }),\n\t\t\t\t\tfc.integer({ min: 0, max: n - 1 }),\n\t\t\t\t\t(xs, i, j) =>\n\t\t\t\t\t\tpipe(\n\t\t\t\t\t\t\tf(i)(j)(xs),\n\t\t\t\t\t\t\tO.exists(ys => A.size(ys) === n),\n\t\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `pipe(f(i)(j)(xs))` should return an array with the same size `n` as the input array `xs`.", "mode": "fast-check"} {"id": 55516, "name": "unknown", "code": "it(\"does not mistakenly pass along undefined values\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.array(fc.anything().filter(x => x !== undefined))),\n\t\t\t\t\tflow(\n\t\t\t\t\t\tf,\n\t\t\t\t\t\tA.flatten,\n\t\t\t\t\t\tA.every(x => x !== undefined),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Ensures that flattened arrays do not contain any undefined values, given an input of arrays composed without undefined elements.", "mode": "fast-check"} {"id": 55520, "name": "unknown", "code": "it(\"one empty input returns other input whole\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.integer()), xs =>\n\t\t\t\t\texpect(f(xs)([])).toEqual(xs),\n\t\t\t\t),\n\t\t\t)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.integer()), xs =>\n\t\t\t\t\texpect(f([])(xs)).toEqual(xs),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Two assertions check that when one input array is empty, the function `f` returns the other input array unchanged.", "mode": "fast-check"} {"id": 55523, "name": "unknown", "code": "it(\"returns identity on singleton non-empty array\", () => {\n\t\t\tfc.assert(fc.property(fc.integer(), n => f([n]) === n))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "A function `f` applied to a singleton non-empty array should return the single element itself.", "mode": "fast-check"} {"id": 55529, "name": "unknown", "code": "it(\"returns element at index\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.anything(), { minLength: 2 }), xs =>\n\t\t\t\t\texpect(pipe(xs, f, O.map(fst))).toEqual(A.lookup(1)(xs)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The test ensures that applying a function `f` and mapping with `fst` returns the element at index 1 of an array.", "mode": "fast-check"} {"id": 55521, "name": "unknown", "code": "it(\"returns identity on singleton non-empty array\", () => {\n\t\t\tfc.assert(fc.property(fc.integer(), n => f([n]) === n))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "For a singleton non-empty integer array, the function `f` returns its single element.", "mode": "fast-check"} {"id": 55528, "name": "unknown", "code": "it(\"returns array of input size minus one\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.anything(), { minLength: 2 }), xs =>\n\t\t\t\t\texpect(pipe(xs, f, O.map(flow(snd, A.size)))).toEqual(\n\t\t\t\t\t\tpipe(xs, A.size, decrement, O.some),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` applied to an array of at least two elements results in an option containing an array whose size is one less than the input.", "mode": "fast-check"} {"id": 55635, "name": "unknown", "code": "it(\"returns identity on empty array\", () => {\n\t\t\tfc.assert(fc.property(fc.anything(), x => expect(f([])(x)).toEqual(x)))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Function.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`f` applied to an empty array should act as the identity function, returning the input unchanged.", "mode": "fast-check"} {"id": 55641, "name": "unknown", "code": "it(\"always returns a non-empty array\", () => {\n\t\t\tfc.assert(fc.property(triple, ([x, y, z]) => !!f(x)(y)(z).length))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Enum.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f(x)(y)(z)` should always return a non-empty array for any `x`, `y`, `z` in a triple.", "mode": "fast-check"} {"id": 55644, "name": "unknown", "code": "it(\"never throws in toEnum\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.string(), { minLength: 1, maxLength: 100 }),\n\t\t\t\t\tfc.integer(),\n\t\t\t\t\t(xs, y) => {\n\t\t\t\t\t\tconst E = f(Str.Ord)(xs as NonEmptyArray)\n\n\t\t\t\t\t\tE.toEnum(y)\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Enum.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`toEnum` function invoked with any integer and a non-empty array of strings should not throw an error.", "mode": "fast-check"} {"id": 55657, "name": "unknown", "code": "it(\"returns false for anything else\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.oneof(fc.integer(), fc.string(), fc.boolean(), fc.object()),\n\t\t\t\t\tnot(isDate),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Date.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`not(isDate)` returns true for inputs that are not dates, ensuring it correctly identifies non-date values like integers, strings, booleans, and objects.", "mode": "fast-check"} {"id": 55661, "name": "unknown", "code": "it(\"returns identity given identity function\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string(), fc.string(), (l, r) => {\n\t\t\t\t\texpect(f(identity)([l, r])).toEqual([l, r])\n\t\t\t\t\texpect(g(identity)(E.left(l))).toEqual(E.left(l))\n\t\t\t\t\texpect(g(identity)(E.right(r))).toEqual(E.right(r))\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Bifunctor.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Functions `f` and `g` should return their inputs unchanged when provided with the identity function.", "mode": "fast-check"} {"id": 55663, "name": "unknown", "code": "it(\"is equivalent to doubly applied bimap\", () => {\n\t\t\tconst h = Str.isAlphaNum\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string(), fc.string(), (l, r) => {\n\t\t\t\t\texpect(f(h)([l, r])).toEqual(Tuple.bimap(h, h)([l, r]))\n\t\t\t\t\texpect(g(h)(E.left(l))).toEqual(E.bimap(h, h)(E.left(l)))\n\t\t\t\t\texpect(g(h)(E.right(r))).toEqual(E.bimap(h, h)(E.right(r)))\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Bifunctor.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The functions `f` and `g` applied to pairs and `Either` types using `h` should produce equivalent results to applying `Tuple.bimap` and `E.bimap` with `h`.", "mode": "fast-check"} {"id": 55724, "name": "unknown", "code": "it(\"returns These Both for only mixed Eithers\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.anything(), { minLength: 1 }),\n\t\t\t\t\tfc.array(fc.anything(), { minLength: 1 }),\n\t\t\t\t\t(xs, ys) => {\n\t\t\t\t\t\tconst zs = NEA.concat(\n\t\t\t\t\t\t\tpipe(\n\t\t\t\t\t\t\t\txs as NonEmptyArray,\n\t\t\t\t\t\t\t\tNEA.map(E.left),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t)(pipe(ys as NonEmptyArray, NEA.map(E.right)))\n\n\t\t\t\t\t\texpect(f(zs)).toEqual(T.both(xs, ys))\n\t\t\t\t\t\texpect(f(NEA.reverse(zs))).toEqual(\n\t\t\t\t\t\t\tT.both(A.reverse(xs), A.reverse(ys)),\n\t\t\t\t\t\t)\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The property should ensure that `f` returns `These Both` for arrays combining `E.left` and `E.right` elements, regardless of their order, with mixed Eithers maintaining element separation and order in `NonEmptyArray`.", "mode": "fast-check"} {"id": 55680, "name": "unknown", "code": "it(\"returns empty array for tuple A.size larger than input array A.size\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.anything()),\n\t\t\t\t\txs => !f(A.size(xs) + 1)(xs).length,\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Returns an empty array when the requested tuple size is larger than the input array size.", "mode": "fast-check"} {"id": 55718, "name": "unknown", "code": "it(\"copies the array contents\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.anything()), xs => expect(f(xs)).toEqual(xs)),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` should produce a copy of the array, resulting in contents that match the original array.", "mode": "fast-check"} {"id": 55721, "name": "unknown", "code": "it(\"does not reuse the input reference/object\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.anything()), xs => {\n\t\t\t\t\tconst ys = f(xs)\n\n\t\t\t\t\texpect(xs).toBe(xs)\n\t\t\t\t\texpect(xs).not.toBe(ys)\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` creates a new object or array rather than reusing the input reference.", "mode": "fast-check"} {"id": 55728, "name": "unknown", "code": "it(\"returns lifted input on true\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.anything(), x =>\n\t\t\t\t\texpect(f(true)(constant(x))).toEqual(O.some(x)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Alternative.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "When given `true`, the function `f` returns a lifted input as `O.some(x)`.", "mode": "fast-check"} {"id": 55731, "name": "unknown", "code": "it(\"returns left-most non-empty value\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.anything(), fc.anything(), fc.anything(), (x, y, z) =>\n\t\t\t\t\texpect(\n\t\t\t\t\t\tf([constant(O.none), constant(O.some(x)), constant(O.some(y))])(\n\t\t\t\t\t\t\tconstant(z),\n\t\t\t\t\t\t),\n\t\t\t\t\t).toEqual(O.some(x)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Alternative.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function returns the left-most non-empty value from a list containing `O.none` and `O.some` values.", "mode": "fast-check"} {"id": 55729, "name": "unknown", "code": "it(\"returns constant empty on empty input\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.anything(), x =>\n\t\t\t\t\texpect(f([])(constant(x))).toEqual(O.none),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Alternative.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f`, when given an empty input and applied with `constant`, should return `O.none`.", "mode": "fast-check"} {"id": 55853, "name": "unknown", "code": "it('should return true for controller principal from a query method', async () => {\n const actor = await getCanisterActor('canister');\n\n await fc.assert(\n fc.asyncProperty(\n fc.uint8Array({ minLength: 29, maxLength: 29 }),\n async (bytes) => {\n const principal = Principal.fromUint8Array(bytes);\n\n execSync(\n `dfx canister update-settings canister --add-controller ${principal}`,\n {\n stdio: 'inherit'\n }\n );\n\n const isController =\n await actor.queryIsController(principal);\n\n execSync(\n `dfx canister update-settings canister --remove-controller ${principal}`,\n {\n stdio: 'inherit'\n }\n );\n\n expect(isController).toStrictEqual(true);\n }\n ),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/is_controller/test/tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "Verifies that a `queryIsController` method returns true for a principal that has been temporarily added as a controller.", "mode": "fast-check"} {"id": 55865, "name": "unknown", "code": "it('should hit the instruction limit without chunking', async () => {\n const actor = await getCanisterActor('canister');\n\n await fc.assert(\n fc.asyncProperty(fc.nat({ max }), async (constant) => {\n await expect(\n actor.measureSum(\n 20_000_000 + 1_000_000 * constant,\n false\n )\n ).rejects.toThrow(\n 'Canister exceeded the limit of 40000000000 instructions for single message execution'\n );\n }),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/chunk/test/tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "The property requires that invoking `measureSum` with large inputs, without chunking, results in an error due to exceeding the instruction limit.", "mode": "fast-check"} {"id": 55870, "name": "unknown", "code": "it('sets certified data in init', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.uint8Array({ minLength: 0, maxLength: 32 }),\n async (data) => {\n uninstallCanister();\n deployCanister({\n setData: true,\n data\n });\n const agent = await createAuthenticatedAgent(whoami());\n const actor = await getCanisterActor(\n CANISTER_NAME,\n {\n agent\n }\n );\n\n await testCertifiedData(\n data,\n actor,\n agent,\n CANISTER_NAME\n );\n }\n ),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/certified_data/test/tests.ts", "start_line": null, "end_line": null, "dependencies": ["uninstallCanister", "deployCanister", "testCertifiedData"], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "Setting certified data during canister initialization should match the expected data and be verifiable with a certificate.", "mode": "fast-check"} {"id": 55883, "name": "unknown", "code": "t.test('literal', () => {\n fc.assert(fc.property(fc.float(), roundtrip))\n fc.assert(fc.property(fc.string(), roundtrip))\n fc.assert(fc.property(fc.boolean(), roundtrip))\n })", "language": "typescript", "source_file": "./repos/briancavalier/braindump/packages/codec/src/roundtrip.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "briancavalier/braindump", "url": "https://github.com/briancavalier/braindump.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "The property ensures that the `roundtrip` function consistently returns the original value when applied to floats, strings, and booleans.", "mode": "fast-check"} {"id": 55986, "name": "unknown", "code": "it('negative range', () => {\n fc.assert(fc.property(fc.char(), fc.integer(-100, 0), (c, count) => {\n const actual = Strings.repeat(c, count);\n assert.equal(actual.length, 0);\n assert.equal(actual, '');\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/str/RepeatTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Repeating a character with a non-positive count results in an empty string.", "mode": "fast-check"} {"id": 56025, "name": "unknown", "code": "it('Check always :: f(x) === true', () => {\n fc.assert(fc.property(fc.json(), (json) => {\n assert.isTrue(Fun.always(json));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Fun.always` should return true for any JSON input.", "mode": "fast-check"} {"id": 56033, "name": "unknown", "code": "it('Check that errors should be empty and values should be all if we only generate values', () => {\n fc.assert(fc.property(\n fc.array(arbResultValue(fc.integer())),\n (resValues) => {\n const actual = Results.partition(resValues);\n if (actual.errors.length !== 0) {\n assert.fail('Errors length should be 0');\n } else if (resValues.length !== actual.values.length) {\n assert.fail('Values length should be ' + resValues.length);\n }\n return true;\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "When only generating values, `Results.partition` should result in an empty errors array and a values array that matches the length of the input.", "mode": "fast-check"} {"id": 56036, "name": "unknown", "code": "it('Check that error, value always equal comparison.firstError', () => {\n fc.assert(fc.property(\n arbResultError(fc.integer()),\n arbResultValue(fc.string()),\n (r1, r2) => {\n const comparison = Results.compare(r1, r2);\n return comparison.match({\n bothErrors: Fun.never,\n firstError: Fun.always,\n secondError: Fun.never,\n bothValues: Fun.never\n });\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Comparison of two results returns `firstError` when one is an error and the other is a value.", "mode": "fast-check"} {"id": 56061, "name": "unknown", "code": "it('error.or(oValue) === oValue', () => {\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n assertResult(Result.error(s).or(Result.value(i)), Result.value(i));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Result.error.or(oValue)` returns `oValue`.", "mode": "fast-check"} {"id": 56069, "name": "unknown", "code": "it('error.forall === true', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), fc.func(fc.boolean()), (res, f) => {\n assert.isTrue(res.forall(f));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The `forall` method on a `ResultError` instance should always return true when applied with any boolean function.", "mode": "fast-check"} {"id": 56065, "name": "unknown", "code": "it('error.mapError(f) === f(error)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n const f = (x: number) => x % 3;\n assertResult(Result.error(i).mapError(f), Result.error(f(i)));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Result.error(i).mapError(f)` should be equivalent to `Result.error(f(i))`.", "mode": "fast-check"} {"id": 56254, "name": "unknown", "code": "it(\"should convert Okay to a string\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(fc.anything(), toStringOkay));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`toStringOkay` should correctly convert any value wrapped in `Okay` to a string.", "mode": "fast-check"} {"id": 56257, "name": "unknown", "code": "it(\"should preserve identity morphisms\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(result(fc.anything(), fc.anything()), mapIdentity));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should hold that applying the identity morphism to any `result` type value preserves the original value.", "mode": "fast-check"} {"id": 56385, "name": "unknown", "code": "it(\"should agree with andMapOption\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(fc.anything(), fc.anything()),\n fc.func(option(fc.anything())),\n andMapSndOptionDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`andMapSndOption` should produce results consistent with `andMapOption`.", "mode": "fast-check"} {"id": 56388, "name": "unknown", "code": "it(\"should agree with andMapOption\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n pair(fc.anything(), option(fc.anything())),\n andSndOptionDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/pair.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `andSndOptionDefinition` should exhibit consistent behavior with the `andMapOption` when applied to pairs consisting of any value and an optional value.", "mode": "fast-check"} {"id": 56284, "name": "unknown", "code": "it(\"should be equivalent to multiple flatMapOkay calls\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.integer({ min: 1 }), fc.anything()),\n fc.constant((n: number) => new Okay(collatz(n))),\n flatMapOkayUntilEquivalence,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property checks that the result of using `flatMapOkayUntilEquivalence` is equivalent to repeatedly applying `flatMapOkay` to transform an integer using the Collatz function wrapped in an `Okay` instance.", "mode": "fast-check"} {"id": 56431, "name": "unknown", "code": "it(\"should agree with isNotSame\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(ordering, isSameDefinition));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/ordering.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`isSameDefinition` should agree with `ordering`, ensuring consistent results.", "mode": "fast-check"} {"id": 56455, "name": "unknown", "code": "it(\"should fold the Option\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n option(fc.anything()),\n fc.func(fc.anything()),\n fc.anything(),\n foldEquivalence,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that folding an `Option` using a function and a default value maintains equivalence as specified by `foldEquivalence`.", "mode": "fast-check"} {"id": 56461, "name": "unknown", "code": "it(\"should have a left annihilator\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(option(fc.anything()), andLeftAnnihilation));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks if the `andLeftAnnihilation` property holds for any value wrapped in an `option`.", "mode": "fast-check"} {"id": 56464, "name": "unknown", "code": "it(\"should agree with and\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n option(fc.anything()),\n option(fc.anything()),\n andWhenDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should align the behavior of combining two optional values with the defined logic of `andWhenDefinition`.", "mode": "fast-check"} {"id": 56467, "name": "unknown", "code": "it(\"should be associative\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n option(fc.anything()),\n option(fc.anything()),\n option(fc.anything()),\n orAssociativity,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property verifies that the operation `orAssociativity` is associative when applied to three `option` values.", "mode": "fast-check"} {"id": 56470, "name": "unknown", "code": "it(\"should have a left identity\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n fc.anything(),\n fc.func(option(fc.anything())),\n flatMapLeftIdentity,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks the left identity property for a function applied to wrapped values using `flatMapLeftIdentity`.", "mode": "fast-check"} {"id": 56473, "name": "unknown", "code": "it(\"should agree with flatMap\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(option(option(fc.anything())), flattenDefinition));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should agree with the behavior of `flatMap` when applied to nested options containing any value.", "mode": "fast-check"} {"id": 56476, "name": "unknown", "code": "it(\"should have an identity input\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(option(fc.anything()), filterIdentity));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should hold that the `filterIdentity` function returns true for any given `option`.", "mode": "fast-check"} {"id": 56479, "name": "unknown", "code": "it(\"should agree with filter\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n option(fc.anything()),\n fc.func(fc.boolean()),\n isNoneOrDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that a function agrees with a filter by using an `option` and a function that returns a boolean, verifying `isNoneOrDefinition`.", "mode": "fast-check"} {"id": 56471, "name": "unknown", "code": "it(\"should have a right identity\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(option(fc.anything()), flatMapRightIdentity));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `flatMapRightIdentity` function preserves the right identity property when applied to an option containing any value.", "mode": "fast-check"} {"id": 56585, "name": "unknown", "code": "it('should deserialize dates properly', () => {\n fc.assert(\n fc.property(tableKeyArb, dateArb, (key, date) => {\n assert.deepStrictEqual(serdes.deserialize({ [key]: date.toString() }, desSchema({ [key]: { type: 'date' } })), { [key]: date });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Deserialization correctly converts string representations of dates back into date objects according to the schema.", "mode": "fast-check"} {"id": 56588, "name": "unknown", "code": "it('should deserialize inet addresses properly', () => {\n fc.assert(\n fc.property(tableKeyArb, arbs.inet(), (key, inet) => {\n assert.deepStrictEqual(serdes.deserialize({ [key]: inet.toString() }, desSchema({ [key]: { type: 'inet' } })), { [key]: inet });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Deserialization of `inet` addresses should produce the original address when matched against a schema specifying the `inet` type.", "mode": "fast-check"} {"id": 56591, "name": "unknown", "code": "it('should deserialize dates properly', () => {\n fc.assert(\n fc.property(tableKeyArb, timeArb, (key, time) => {\n assert.deepStrictEqual(serdes.deserialize({ [key]: time.toString() }, desSchema({ [key]: { type: 'time' } })), { [key]: time });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Deserializing dates should match the original `time` when reconstructed using the specified schema.", "mode": "fast-check"} {"id": 56595, "name": "unknown", "code": "it('should serialize vectors properly', () => {\n fc.assert(\n fc.property(tableKeyArb, arbs.vector(), (key, vector) => {\n assert.deepStrictEqual(serdes.serialize({ [key]: vector }), [{ [key]: { $binary: vector.asBase64() } }, false]);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Serialization of vectors results in an object with the vector encoded in Base64 format.", "mode": "fast-check"} {"id": 56587, "name": "unknown", "code": "it('should serialize inet addresses properly', () => {\n fc.assert(\n fc.property(tableKeyArb, arbs.inet(), (key, inet) => {\n assert.deepStrictEqual(serdes.serialize({ [key]: inet }), [{ [key]: inet.toString() }, false]);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Serialization of inet addresses should produce an object where the inet is converted to a string representation.", "mode": "fast-check"} {"id": 56610, "name": "unknown", "code": "it('should error on invalid type', () => {\n fc.assert(\n fc.property(fc.anything(), (generated) => {\n fc.pre(typeof generated !== 'string');\n assert.throws(() => new UUID(generated as any));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/datatypes/uuid.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`UUID` constructor throws an error when instantiated with non-string types.", "mode": "fast-check"} {"id": 56606, "name": "unknown", "code": "it('should mutate the input object in place when necessary', () => {\n fc.assert(\n fc.property(arbs.tableDefinitionAndRow({ requireOneOf: ['uuid', 'inet'] }), ([, row]) => { // forces usage of types which would cause the object to mutate\n const origStr = stableStringify(row);\n const [res] = serdes.serialize(row);\n const afterStr = stableStringify(row);\n const resStr = stableStringify(res);\n\n assert.notStrictEqual(origStr, afterStr);\n assert.strictEqual(afterStr, resStr);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/mutate-in-place.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Mutating the input object in place should result in a modified object matching the serialized output.", "mode": "fast-check"} {"id": 56608, "name": "unknown", "code": "it('should properly construct a UUID', () => {\n fc.assert(\n fc.property(fc.uuid(), (generated) => {\n assert.strictEqual(new UUID(generated).toString(), generated);\n assert.strictEqual(uuid(generated).toString(), generated);\n assert.strictEqual(uuid(uuid(generated)).toString(), generated);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/datatypes/uuid.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "A correctly constructed UUID should match its original string representation across different construction methods.", "mode": "fast-check"} {"id": 56611, "name": "unknown", "code": "it('should allow force construction on invalid UUID strings', () => {\n fc.assert(\n fc.property(fc.string(), (generated) => {\n assert.ok(new UUID(generated as any, false));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/datatypes/uuid.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`UUID` can be constructed with invalid UUID strings when forced.", "mode": "fast-check"} {"id": 56614, "name": "unknown", "code": "it('should not equal an invalid type', () => {\n fc.assert(\n fc.property(fc.uuid(), fc.anything(), (uuid1, uuid2) => {\n fc.pre(typeof uuid2 !== 'string');\n assert.ok(!uuid(uuid1).equals(uuid2 as any));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/datatypes/uuid.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The `uuid` function should not report equality when compared with a non-string type.", "mode": "fast-check"} {"id": 56617, "name": "unknown", "code": "it('should properly construct an IPv6 address', () => {\n fc.assert(\n fc.property(fc.mixedCase(fc.ipV6()), (ip) => {\n const validate = (inet: DataAPIInet) => {\n assert.strictEqual(inet.toString(), ip.toLowerCase());\n assert.strictEqual(inet.version, 6);\n };\n\n validate(new DataAPIInet(ip));\n validate(new DataAPIInet(ip, 6));\n validate(new DataAPIInet(ip, 6, false));\n validate(new DataAPIInet(ip, null, false));\n\n validate(inet(ip));\n validate(inet(ip, 6));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/datatypes/inet.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`DataAPIInet` correctly constructs an IPv6 address by converting the input to lowercase and ensuring the version is 6.", "mode": "fast-check"} {"id": 56609, "name": "unknown", "code": "it('should error on invalid UUID', () => {\n assert.throws(() => new UUID('123e4567-e89b-12d3-a456-42661417400'));\n\n fc.assert(\n fc.property(fc.string(), (generated) => {\n fc.pre(!uuidModule.validate(generated));\n assert.throws(() => new UUID(generated));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/datatypes/uuid.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Initializing a `UUID` with an invalid string should throw an error.", "mode": "fast-check"} {"id": 56612, "name": "unknown", "code": "it('should equal a similar UUID', () => {\n fc.assert(\n fc.property(fc.uuid().chain(uuid => fc.tuple(fc.constant(uuid), fc.mixedCase(fc.constant(uuid)))), ([uuid1, uuid2]) => {\n assert.ok(uuid(uuid1).equals(uuid2));\n assert.ok(uuid(uuid1).equals(uuid(uuid2)));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/datatypes/uuid.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "A UUID should be considered equal to another UUID when they are identical, even if one is mixed-case.", "mode": "fast-check"} {"id": 56615, "name": "unknown", "code": "it('should have a working inspect', () => {\n fc.assert(\n fc.property(fc.mixedCase(fc.uuid()), (generated) => {\n const uuid = new UUID(generated);\n assert.strictEqual((uuid as any)[$CustomInspect](), `UUID<${uuid.version}>(\"${generated.toLowerCase()}\")`);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/datatypes/uuid.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`UUID`'s custom inspect function should return a string formatted as `UUID(\"lowercased uuid\")`.", "mode": "fast-check"} {"id": 56618, "name": "unknown", "code": "it('should throw on invalid IPs', () => {\n for (const version of [4, 6, undefined] as const) {\n fc.assert(\n fc.property(fc.string(), (ip) => {\n fc.pre(!DataAPIInet.isIPv4(ip) && !DataAPIInet.isIPv6(ip));\n assert.throws(() => new DataAPIInet(ip, version));\n }),\n );\n }\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/datatypes/inet.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Creating a `DataAPIInet` with an invalid IP and any version should throw an error.", "mode": "fast-check"} {"id": 55344, "name": "unknown", "code": "it('should build a path of tracks being a subset of the tracks of the graph whenever a path from start to end exists', () => {\n fc.assert(\n fc.property(orientedGraphArbitrary, ({ knownPath, tracks, stations }) => {\n // Arrange\n const departure = knownPath[0];\n const destination = knownPath[knownPath.length - 1];\n\n // Act\n const shortestPath = metroRoute(departure, destination, stations, tracks);\n\n // Assert\n for (const edge of shortestPath) {\n expect(shortestPath).toContainEqual(edge);\n }\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/higher-level-algorithms/metroRoute.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The `metroRoute` function should return a path consisting of tracks that are a subset of the graph's tracks, given that a path from the start to the end exists.", "mode": "fast-check"} {"id": 55342, "name": "unknown", "code": "it('should build a path ending by the requested destination whenever a path from start to end exists', () => {\n fc.assert(\n fc.property(orientedGraphArbitrary, ({ knownPath, tracks, stations }) => {\n // Arrange\n const departure = knownPath[0];\n const destination = knownPath[knownPath.length - 1];\n\n // Act\n const shortestPath = metroRoute(departure, destination, stations, tracks);\n\n // Assert\n if (departure === destination) expect(shortestPath).toEqual([]);\n else expect(shortestPath[shortestPath.length - 1].to).toBe(destination);\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/higher-level-algorithms/metroRoute.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "A path from start to end must end with the requested destination when such a path exists in the graph.", "mode": "fast-check"} {"id": 55346, "name": "unknown", "code": "it('should not return any path whenever there is no way going from start to end', () => {\n fc.assert(\n fc.property(orientedGraphNoWayArbitrary, ({ departure, destination, stations, tracks }) => {\n // Arrange / Act\n const shortestPath = metroRoute(departure, destination, stations, tracks);\n\n // Assert\n expect(shortestPath).toBe(undefined);\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/higher-level-algorithms/metroRoute.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The test checks that `metroRoute` returns undefined when there is no possible path from the start to the end in the given graph.", "mode": "fast-check"} {"id": 55341, "name": "unknown", "code": "it('should build a path starting by the requested departure whenever a path from start to end exists', () => {\n fc.assert(\n fc.property(orientedGraphArbitrary, ({ knownPath, tracks, stations }) => {\n // Arrange\n const departure = knownPath[0];\n const destination = knownPath[knownPath.length - 1];\n\n // Act\n const shortestPath = metroRoute(departure, destination, stations, tracks);\n\n // Assert\n if (departure === destination) expect(shortestPath).toEqual([]);\n else expect(shortestPath[0].from).toBe(departure);\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/higher-level-algorithms/metroRoute.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The test ensures that if a path exists from a start to an end station in a metro system, the built path will begin with the specified departure station.", "mode": "fast-check"} {"id": 55356, "name": "unknown", "code": "it('should accept any well-parenthesed expression', () => {\n fc.assert(\n fc.property(wellParenthesedStringArbitrary, (expression) => {\n expect(validParentheses(expression)).toBe(true);\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/009-validParentheses.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "`validParentheses` should return true for any well-parenthesized expression.", "mode": "fast-check"} {"id": 55381, "name": "unknown", "code": "it('should fibo(nk) divisible by fibo(n)', () => {\n fc.assert(\n fc.property(fc.integer(1, MaxN), fc.integer(0, 100), (n, k) => {\n expect(fibonacci(n * k) % fibonacci(n)).toBe(0n);\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/005-fibonacci.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The Fibonacci of \\( n \\times k \\) is divisible by the Fibonacci of \\( n \\).", "mode": "fast-check"} {"id": 55628, "name": "unknown", "code": "it(\"associativity\", () => {\n\t\t\t\tfc.assert(\n\t\t\t\t\tfc.property(\n\t\t\t\t\t\tfc.integer(),\n\t\t\t\t\t\tfc.integer(),\n\t\t\t\t\t\tfc.integer(),\n\t\t\t\t\t\tfc.anything(),\n\t\t\t\t\t\t(x, y, z, zz) => {\n\t\t\t\t\t\t\tconst f = flow(add(y), F.of)\n\t\t\t\t\t\t\tconst g = flow(multiply(z), F.of)\n\n\t\t\t\t\t\t\tconst left = pipe(F.of(x), F.chain(f), F.chain(g), apply(zz))\n\t\t\t\t\t\t\tconst right = pipe(\n\t\t\t\t\t\t\t\tF.of(x),\n\t\t\t\t\t\t\t\tF.chain(flow(f, F.chain(g))),\n\t\t\t\t\t\t\t\tapply(zz),\n\t\t\t\t\t\t\t)\n\n\t\t\t\t\t\t\treturn expect(left).toEqual(right)\n\t\t\t\t\t\t},\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Function.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The associativity property ensures that chaining operations `f` and `g` with `flow` and `pipe` on a value `x`, and applying `zz`, produce equivalent results, regardless of grouping.", "mode": "fast-check"} {"id": 55415, "name": "unknown", "code": "it(\"flip setPathname . fromPathname = setPathname y (fromPathname x) = fromPathname y\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string(), fc.string(), (x, y) => {\n\t\t\t\t\tconst a = setPathname(y)(fromPathname(x))\n\t\t\t\t\tconst b = fromPathname(y)\n\n\t\t\t\t\texpect(a).toEqual(b)\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/URLPath.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`setPathname(y) (fromPathname(x))` should result in the same output as `fromPathname(y)`.", "mode": "fast-check"} {"id": 55427, "name": "unknown", "code": "it(\"is equivalent to doubly applied bimap\", () => {\n\t\t\tconst g = O.some\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string(), fc.string(), (l, r) =>\n\t\t\t\t\texpect(f(g)([l, r])).toEqual(bimap(g, g)([l, r])),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Tuple.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Applying function `f` to a tuple should be equivalent to applying `bimap` with the same function to both elements of the tuple.", "mode": "fast-check"} {"id": 55430, "name": "unknown", "code": "it(\"retracts pred\", () => {\n\t\t\t\tconst f = flow(E.succ, O.chain(E.pred), O.chain(E.succ))\n\t\t\t\tconst g = E.succ\n\n\t\t\t\tfc.assert(\n\t\t\t\t\tfc.property(fc.tuple(fc.boolean(), fc.boolean()), x =>\n\t\t\t\t\t\texpect(f(x)).toEqual(g(x)),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Tuple.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The property verifies that applying the function `f` on a tuple of booleans results in the same output as applying the function `g` on the same tuple.", "mode": "fast-check"} {"id": 55431, "name": "unknown", "code": "it(\"gets the value\", () => {\n\t\t\t\treturn fc.assert(\n\t\t\t\t\tfc.asyncProperty(fc.anything(), async x =>\n\t\t\t\t\t\texpect(x).toEqual(await pipe(x, T.of, execute)),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Task.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The test ensures that piping any input through `T.of` and `execute` results in a value equal to the original input.", "mode": "fast-check"} {"id": 55737, "name": "unknown", "code": "it(\"return the same value\", () => {\n fc.assert(\n fc.property(fc.tuple(fc.integer({ min: 0 }), fc.integer({ min: 0, max: 99999999 })), (v) => {\n const strV = removeTrailingZerosExceptOne(`${v[0]}.${v[1]}`);\n\n const bv = parseBigInt(strV);\n const r = formatBigInt(bv);\n expect(r).toStrictEqual(strV);\n })\n );\n })", "language": "typescript", "source_file": "./repos/archethic-foundation/libjs/tests/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "archethic-foundation/libjs", "url": "https://github.com/archethic-foundation/libjs.git", "license": "MIT", "stars": 19, "forks": 17}, "metrics": null, "summary": "`removeTrailingZerosExceptOne`, `parseBigInt`, and `formatBigInt` conversion ensures consistent string and BigInt representation of numbers with trailing zeros handled.", "mode": "fast-check"} {"id": 55923, "name": "unknown", "code": "it('Optional.none() !== Optional.some(x)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n assert.isFalse(Optionals.equals(Optional.none(), Optional.some(i)));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Optional.none()` is not equal to `Optional.some(x)` for any integer `x`.", "mode": "fast-check"} {"id": 55926, "name": "unknown", "code": "it('Optional.some(x) === Optional.some(x) (same ref)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n const ob = Optional.some(i);\n assert.isTrue(Optionals.equals(ob, ob));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Optionals.equals` returns true when comparing the same `Optional.some` instance.", "mode": "fast-check"} {"id": 55935, "name": "unknown", "code": "it('Checking some(x).isSome === true', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => opt.isSome()));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`some(x).isSome` returns true for options constructed with integers.", "mode": "fast-check"} {"id": 56087, "name": "unknown", "code": "it('Merged with identity on left', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), (obj) => {\n assert.deepEqual(Merger.merge({}, obj), obj);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Merging an empty object on the left with another object should return the original object.", "mode": "fast-check"} {"id": 56090, "name": "unknown", "code": "it('Merge(a, Merge(b, c)) === Merge(Merge(a, b), c)', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), fc.dictionary(fc.asciiString(), fc.json()), fc.dictionary(fc.asciiString(), fc.json()), (a, b, c) => {\n const one = Merger.merge(a, Merger.merge(b, c));\n const other = Merger.merge(Merger.merge(a, b), c);\n assert.deepEqual(other, one);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The test verifies that merging operations are associative: `Merge(a, Merge(b, c))` equals `Merge(Merge(a, b), c)`.", "mode": "fast-check"} {"id": 56093, "name": "unknown", "code": "it('Deep-merged with identity on right', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), (obj) => {\n assert.deepEqual(Merger.deepMerge(obj, {}), obj);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Merging any object with an empty object on the right should return the original object.", "mode": "fast-check"} {"id": 56088, "name": "unknown", "code": "it('Merged with identity on right', () => {\n fc.assert(fc.property(fc.dictionary(fc.asciiString(), fc.json()), (obj) => {\n assert.deepEqual(Merger.merge(obj, {}), obj);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/obj/MergerTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Merging an object with an empty object on the right results in the original object.", "mode": "fast-check"} {"id": 56098, "name": "unknown", "code": "it('Check that if the filter always returns false, then everything is in \"f\"', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(), fc.string(1, 40)),\n (obj) => {\n const output = Obj.bifilter(obj, Fun.never);\n assert.lengthOf(Obj.keys(output.f), Obj.keys(obj).length);\n assert.lengthOf(Obj.keys(output.t), 0);\n return true;\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/obj/BiFilterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "If the filter always returns false, all elements should be in the \"f\" partition and \"t\" should be empty after applying `Obj.bifilter`.", "mode": "fast-check"} {"id": 56103, "name": "unknown", "code": "it('wrap get', () => fc.assert(fc.asyncProperty(arbResult(fc.integer(), fc.integer()), (r) => new Promise((resolve, reject) => {\n FutureResult.wrap(Future.pure(r)).get((ii) => {\n eqAsync('eq', r, ii, reject, tResult());\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`FutureResult.wrap` should correctly obtain the result from a wrapped `Future.pure` call and pass it to the provided continuation function, ensuring it matches the original result.", "mode": "fast-check"} {"id": 56106, "name": "unknown", "code": "it('value get', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.value(i).get((ii) => {\n eqAsync('eq', Result.value(i), ii, reject, tResult());\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`FutureResult.value` should retrieve a value, ensuring it equals the original integer using `eqAsync`.", "mode": "fast-check"} {"id": 56108, "name": "unknown", "code": "it('value mapResult', () => {\n const f = (x: number) => x + 3;\n return fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.value(i).mapResult(f).get((ii) => {\n eqAsync('eq', Result.value(f(i)), ii, reject, tResult());\n resolve();\n });\n })));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`FutureResult.value(i).mapResult(f)` transforms the input using `f`, and the result should match `Result.value(f(i))`.", "mode": "fast-check"} {"id": 56319, "name": "unknown", "code": "it(\"should agree with gatherMapOkay\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n result(fc.anything(), fc.anything()),\n fc.func(task(fc.anything(), fc.anything())),\n swapMapFailDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures the function under test behaves consistently with `gatherMapOkay` when applied to `result` and a task function.", "mode": "fast-check"} {"id": 56330, "name": "unknown", "code": "it(\"should extract the value from Okay\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(fc.anything(), fc.anything(), extractOkayFromOkay));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`extractOkayFromOkay` correctly extracts the value from an `Okay` result.", "mode": "fast-check"} {"id": 56331, "name": "unknown", "code": "it(\"should return the default value for Fail\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(fc.anything(), fc.anything(), extractOkayFromFail));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`extractOkayFromFail` should return the default value when the input represents a `Fail`.", "mode": "fast-check"} {"id": 56486, "name": "unknown", "code": "it(\"should be inverted by Result#transposeFail\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n option(result(fc.anything(), fc.anything())),\n transposeFailInverse,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Result#transposeFail` inverts an `Option` of a `Result`.", "mode": "fast-check"} {"id": 56487, "name": "unknown", "code": "it(\"should agree with exchangeMapOkay\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n option(task(fc.anything(), fc.anything())),\n exchangeOkayDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should ensure consistency between `option` with `task` and the `exchangeOkayDefinition`.", "mode": "fast-check"} {"id": 56490, "name": "unknown", "code": "it(\"should return the default value for None\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(fc.anything(), extractSomeFromNone));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`extractSomeFromNone` consistently returns a default value for `None` across various inputs.", "mode": "fast-check"} {"id": 56488, "name": "unknown", "code": "it(\"should agree with exchangeMapFail\", async () => {\n expect.assertions(100);\n\n await fc.assert(\n fc.asyncProperty(\n option(task(fc.anything(), fc.anything())),\n exchangeFailDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`exchangeMapFail` should yield consistent results with transformations of `option` using `exchangeFailDefinition`.", "mode": "fast-check"} {"id": 56492, "name": "unknown", "code": "it(\"should be inverted by toOptionOkay\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(option(fc.anything()), fc.anything(), toResultOkayInverse),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`toOptionOkay` is the inverse of `toResultOkayInverse` for various inputs.", "mode": "fast-check"} {"id": 56494, "name": "unknown", "code": "it(\"should iterate over the value of Some\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(fc.anything(), valuesSome));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Iterates over the value of a `Some` option, validating it across various inputs.", "mode": "fast-check"} {"id": 56497, "name": "unknown", "code": "it(\"should convert any value into a non-nullish option\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(fc.anything(), fromNullishDefinition));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Converting any value should result in a non-nullish option.", "mode": "fast-check"} {"id": 56500, "name": "unknown", "code": "it(\"should agree with uncurry2\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n option(fc.anything()),\n option(fc.anything()),\n option(fc.anything()),\n fc.func(fc.anything()),\n uncurry3Equivalence,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/miscellaneous.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that the behavior of a function matches `uncurry2` when applied to options of various types.", "mode": "fast-check"} {"id": 56485, "name": "unknown", "code": "it(\"should be inverted by Result#transposeOkay\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n option(result(fc.anything(), fc.anything())),\n transposeOkayInverse,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Result#transposeOkay` inverts the transformation applied by the provided `transposeOkayInverse` function on an `Option` of a `Result`.", "mode": "fast-check"} {"id": 56489, "name": "unknown", "code": "it(\"should extract the value from Some\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(fc.anything(), fc.anything(), extractSomeFromSome));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`extractSomeFromSome` retrieves the value from a `Some` object.", "mode": "fast-check"} {"id": 56491, "name": "unknown", "code": "it(\"should agree with extractSome\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n option(fc.anything()),\n fc.anything(),\n extractMapSomeDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures consistency between the `option` mechanism and `extractSome` operation when applied with `extractMapSomeDefinition`.", "mode": "fast-check"} {"id": 56495, "name": "unknown", "code": "it(\"should not iterate over None\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(none, valuesNone));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that iterating over a `None` value yields no elements.", "mode": "fast-check"} {"id": 56498, "name": "unknown", "code": "it(\"should convert any value into a non-falsy option\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(fc.anything(), fromFalsyDefinition));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `fromFalsyDefinition` should convert any value into a non-falsy option.", "mode": "fast-check"} {"id": 56493, "name": "unknown", "code": "it(\"should be inverted by toOptionFail\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(option(fc.anything()), fc.anything(), toResultFailInverse),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that the `toOptionFailInverse` correctly inverts the transformation from an option to a result.", "mode": "fast-check"} {"id": 56496, "name": "unknown", "code": "it(\"should agree with the predicate\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(fc.anything(), fc.func(fc.boolean()), fromValidDefinition),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that the predicate returned by the `fromValidDefinition` method is consistent with a generated boolean function for multiple inputs.", "mode": "fast-check"} {"id": 56499, "name": "unknown", "code": "it(\"should agree with fold\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n option(fc.anything()),\n option(fc.anything()),\n fc.func(fc.anything()),\n uncurry2Equivalence,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/miscellaneous.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The result of `uncurry2Equivalence` should agree with a fold operation using randomly generated inputs and functions.", "mode": "fast-check"} {"id": 56502, "name": "unknown", "code": "it(\"should convert Integer to a string\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(integer, integerToStringDefinition));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/integer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that the conversion of an Integer to a string is correctly defined by `integerToStringDefinition`.", "mode": "fast-check"} {"id": 56505, "name": "unknown", "code": "it(\"should have the specified name\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(fc.string(), exceptionName));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/exceptions.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property verifies that the function `exceptionName` assigns the specified name to exceptions for any input string.", "mode": "fast-check"} {"id": 56508, "name": "unknown", "code": "it(\"should have a stack trace\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(fc.string(), exceptionStack));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/exceptions.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that the `exceptionStack` function handles strings and consistently produces a stack trace.", "mode": "fast-check"} {"id": 56511, "name": "unknown", "code": "it(\"should convert Bool to a string\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(bool, boolToStringDefinition));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/bool.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Converting a `Bool` type to its string representation should be correctly defined by `boolToStringDefinition`.", "mode": "fast-check"} {"id": 56514, "name": "unknown", "code": "it('works', () => {\r\n fc.assert(fc.property(fc.anything(), (x) => isNullish(x) === (x === null || x === undefined)));\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`isNullish` should return true if and only if the input is either `null` or `undefined`.", "mode": "fast-check"} {"id": 56501, "name": "unknown", "code": "it(\"should agree with uncurry3\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n option(fc.anything()),\n option(fc.anything()),\n option(fc.anything()),\n option(fc.anything()),\n fc.func(fc.anything()),\n uncurry4Equivalence,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/miscellaneous.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "It checks that a function agrees with the behavior of an `uncurry3` implementation when applied to various options and functions.", "mode": "fast-check"} {"id": 56504, "name": "unknown", "code": "it(\"should convert Product to a string\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(product, productToStringDefinition));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/integer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should hold that the conversion of a `Product` to a string is consistent with `productToStringDefinition`.", "mode": "fast-check"} {"id": 56506, "name": "unknown", "code": "it(\"should have the given message\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(fc.string(), exceptionMessage));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/exceptions.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should ensure that the `exceptionMessage` function consistently returns the provided string message.", "mode": "fast-check"} {"id": 56510, "name": "unknown", "code": "it(\"should convert DateTime to a string\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(datetime, toStringDefinition));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/datetime.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Converting a DateTime object to a string should adhere to the specified string format.", "mode": "fast-check"} {"id": 56512, "name": "unknown", "code": "it(\"should convert Any to a string\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(any, anyToStringDefinition));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/bool.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property verifies that values of type `Any` are correctly converted to strings using `anyToStringDefinition`.", "mode": "fast-check"} {"id": 56503, "name": "unknown", "code": "it(\"should convert Sum to a string\", () => {\n expect.assertions(100);\n\n fc.assert(fc.property(sum, sumToStringDefinition));\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/integer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Converting a `Sum` to a string should match the `sumToStringDefinition` criteria.", "mode": "fast-check"} {"id": 56653, "name": "unknown", "code": "it('should serialize object ids properly', () => {\n fc.assert(\n fc.property(arbs.oid(), (objectId) => {\n assert.deepStrictEqual(serdes.serialize(objectId), [{ $objectId: objectId.toString() }, false]);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/collections/ser-des/codecs.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Serialization of object IDs must produce an array with an object containing the ID as a string under the key `$objectId`, followed by `false`.", "mode": "fast-check"} {"id": 56656, "name": "unknown", "code": "describe('name', () => {\n fc.assert(\n fc.property(fc.string(), (name) => {\n const tsc = mkTSlashC(db, db._httpClient, name, opts, undefined);\n assert.strictEqual(tsc.name, name);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/table-slash-coll.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The property should ensure that the `name` field of the `tsc` object created by `mkTSlashC` matches the input `name` string.", "mode": "fast-check"} {"id": 56660, "name": "unknown", "code": "it('should convert class into opts: { deserialize: [$DesSym] }', () => {\n fc.assert(\n fc.property(fc.anything(), (anything) => {\n // @ts-expect-error - ts being stupid\n const clazz = class { static [$DesSym] = anything; };\n const codecs = cfg.mkRawCodecs(clazz);\n assert.strictEqual(codecs.length, 1);\n assert.deepStrictEqual(codecs[0].opts, { deserialize: clazz[$DesSym] });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/ser-des/codec-builders-common.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Class conversion results in `codecs` having `opts` with a `deserialize` property matching the class's static `[$DesSym]` value.", "mode": "fast-check"} {"id": 56657, "name": "unknown", "code": "it('returns the given keyspace', () => {\n fc.assert(\n fc.property(fc.string(), (keyspace) => {\n const tsc = mkTSlashC(db, db._httpClient, 'tsc', opts, { keyspace });\n assert.strictEqual(tsc.keyspace, keyspace);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/table-slash-coll.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The keyspace provided to `mkTSlashC` must match the `keyspace` property of the resulting object.", "mode": "fast-check"} {"id": 56682, "name": "unknown", "code": "it('should create a new cursor with a new projection', () => {\n fc.assert(\n fc.property(arbs.record(fc.oneof(fc.constantFrom(0, 1), fc.boolean())), arbs.record(fc.anything()), (projection, oldOptions) => {\n const cursor = new CursorImpl(parent, null!, [{}, false], oldOptions);\n\n CursorInternalDeltaAsserter\n .captureImmutDelta(cursor._internal, () => cursor.project(projection)._internal)\n .assertDelta({ _options: { ...oldOptions, projection } });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/cursors/find-cursor.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Creating a new cursor should update the internal options to include a new projection while maintaining immutability.", "mode": "fast-check"} {"id": 56687, "name": "unknown", "code": "it('should error if initialPageState is null', () => {\n fc.assert(\n fc.property(arbs.record(fc.anything()), (oldOptions) => {\n const cursor = new CursorImpl(parent, null!, [{}, false], oldOptions);\n\n assert.throws(() => cursor.initialPageState(null!), (e) => {\n return e instanceof CursorError && e.message.includes('Cannot set an initial page state to `null`');\n });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/cursors/find-cursor.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "An error should be thrown when attempting to set an initial page state to `null` in a `CursorImpl`.", "mode": "fast-check"} {"id": 56691, "name": "unknown", "code": "it('should return cursor._consumed', () => {\n fc.assert(\n fc.property(fc.integer(), (count) => {\n const cursor = new CursorImpl(parent, null!, [{}, false]);\n cursor['_consumed'] = count;\n assert.strictEqual(cursor.consumed(), count);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/__common/cursors/abstract-cursor.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The cursor's `consumed()` method should return the value of `cursor._consumed` after setting it to a random integer.", "mode": "fast-check"} {"id": 56701, "name": "unknown", "code": "it('should return the same element when only one config is provided', () => {\n fc.assert(\n fc.property(valueArb, (value) => {\n assert.deepStrictEqual(handler.concat([value]), value);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/testlib/laws.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The test verifies that the `handler.concat` function returns the same element when provided with a single configuration.", "mode": "fast-check"} {"id": 56717, "name": "unknown", "code": "test('minimal', () => {\n fc.assert(\n fc.property(\n fcTsconfig({\n compilerRuleSet: rulesForMinimal,\n }),\n (config) => {\n const validator = new TypeScriptConfigValidator(TypeScriptConfigValidationRuleSet.MINIMAL);\n validator.validate(config);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aws/jsii-compiler/test/tsconfig/tsconfig-validator.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aws/jsii-compiler", "url": "https://github.com/aws/jsii-compiler.git", "license": "Apache-2.0", "stars": 38, "forks": 18}, "metrics": null, "summary": "The `TypeScriptConfigValidator` validates configurations using the `MINIMAL` rule set.", "mode": "fast-check"} {"id": 56712, "name": "unknown", "code": "test('fail', () => {\n fc.assert(\n fc.property(\n fc.uniqueArray(fc.string(), {\n minLength: 2,\n maxLength: 2,\n }),\n ([expected, actual]) => {\n return !Match.strEq(expected, true)(actual, {\n reporter: expectViolation('Expected string', expected, actual),\n });\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aws/jsii-compiler/test/tsconfig/validator.test.ts", "start_line": null, "end_line": null, "dependencies": ["expectViolation"], "repo": {"name": "aws/jsii-compiler", "url": "https://github.com/aws/jsii-compiler.git", "license": "Apache-2.0", "stars": 38, "forks": 18}, "metrics": null, "summary": "Verifies that when two different strings are compared using `Match.strEq`, the report function `expectViolation` correctly logs the expected and actual values along with the matching failure message.", "mode": "fast-check"} {"id": 56748, "name": "unknown", "code": "test('isValidUTF8_fastcheck', () => {\n fc.assert(\n fc.property(fc.string({ size: 'medium', unit: 'grapheme' }), (data) => {\n const bytes = new TextEncoder().encode(data)\n const valid = isValidUTF8(bytes)\n expect(valid).toBe(true)\n }),\n )\n})", "language": "typescript", "source_file": "./repos/simplebitlabs/tobytes/src/utf8.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "simplebitlabs/tobytes", "url": "https://github.com/simplebitlabs/tobytes.git", "license": "MIT", "stars": 3, "forks": 0}, "metrics": null, "summary": "`isValidUTF8` returns true for strings encoded into bytes using `TextEncoder`.", "mode": "fast-check"} {"id": 56853, "name": "unknown", "code": "assertProperty: (predicate: (...args: Ts) => boolean | void) =>\n fc.assert(fc.property(...arbitraries, predicate), params)", "language": "typescript", "source_file": "./repos/nmay231/lattice-grid/src/testing-utils/fcArbitraries.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nmay231/lattice-grid", "url": "https://github.com/nmay231/lattice-grid.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`assertProperty` ensures that a given predicate function holds true for inputs generated by specified arbitraries.", "mode": "fast-check"} {"id": 56742, "name": "unknown", "code": "it(\"should correctly sum a list of values [fuzz]\", async () => {\n await fc.assert(\n fc.asyncProperty(fc.array(fc.bigInt({ min: 0n, max: r - 1n }), { minLength: 1 }), async (nums: bigint[]) => {\n const sum = nums.reduce((a, b) => a + b, 0n);\n fc.pre(sum <= r - 1n);\n\n const testCircuit = await circomkitInstance.WitnessTester(\"calculateTotal\", {\n file: \"./utils/calculateTotal\",\n template: \"CalculateTotal\",\n params: [nums.length],\n });\n\n const witness = await testCircuit.calculateWitness({ nums });\n await testCircuit.expectConstraintPass(witness);\n const total = await getSignal(testCircuit, witness, \"sum\");\n\n return total === sum;\n }),\n { numRuns: 10_000 },\n );\n })", "language": "typescript", "source_file": "./repos/krisoshea-eth/CipherVote/maci/packages/circuits/ts/__tests__/CalculateTotal.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "krisoshea-eth/CipherVote", "url": "https://github.com/krisoshea-eth/CipherVote.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": "The `calculateTotal` circuit should correctly compute the sum of an array of big integers and ensure it matches the expected sum, given that the result does not exceed a predefined maximum limit \\( r - 1 \\).", "mode": "fast-check"} {"id": 56746, "name": "unknown", "code": "it(\"correctly hashes 5 random values\", async () => {\n const n = 5;\n\n circuit = await circomkitInstance.WitnessTester(\"poseidonHasher\", {\n file: \"./utils/hashers\",\n template: \"PoseidonHasher\",\n params: [n],\n });\n\n await fc.assert(\n fc.asyncProperty(\n fc.array(fc.bigInt({ min: 0n, max: r - 1n }), { minLength: n, maxLength: n }),\n async (preImages: bigint[]) => {\n const witness = await circuit.calculateWitness({\n inputs: preImages,\n });\n await circuit.expectConstraintPass(witness);\n const output = await getSignal(circuit, witness, \"out\");\n const outputJS = hash5(preImages);\n\n return output === outputJS;\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/krisoshea-eth/CipherVote/maci/packages/circuits/ts/__tests__/Hasher.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "krisoshea-eth/CipherVote", "url": "https://github.com/krisoshea-eth/CipherVote.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": "The hash function for 5 big integer inputs should produce the same output as the `hash5` function in the circuit.", "mode": "fast-check"} {"id": 56851, "name": "unknown", "code": "it(\"should return the start index of the substring when there is one\", () => {\n fc.assert(\n fc.property(fc.string(), fc.string(), fc.string(), (a, b, c) => {\n const searchString = b;\n const text = `${a}${b}${c}`;\n const index = lastIndexOf(searchString, text);\n expect(text.substr(index, searchString.length)).toBe(searchString);\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-01.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Ensures that `lastIndexOf` returns the start index of a substring within a given string.", "mode": "fast-check"} {"id": 56852, "name": "unknown", "code": "it(\"should return the last possible index of the substring when there is one\", () => {\n fc.assert(\n fc.property(\n fc.string(),\n fc.string({ minLength: 1 }),\n fc.string(),\n (a, b, c) => {\n const searchString = b;\n const text = `${a}${b}${c}`;\n const textBis = text.substring(lastIndexOf(searchString, text) + 1);\n expect(lastIndexOf(searchString, textBis)).toBe(-1);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-01.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The test ensures that `lastIndexOf` returns the last possible index of a substring such that a subsequent search in the substring starting right after this index returns `-1`.", "mode": "fast-check"} {"id": 56867, "name": "unknown", "code": "it(\"should throw error if input is out of bounds [fuzz]\", async () => {\n const maxLevel = 1_000n;\n\n await fc.assert(\n fc.asyncProperty(\n fc.bigInt({ min: 1n, max: maxLevel }),\n fc.bigInt({ min: 1n, max: r - 1n }),\n async (levels: bigint, input: bigint) => {\n fc.pre(BigInt(leavesPerNode) ** levels < input);\n\n const witness = await circomkitInstance.WitnessTester(\"QuinaryGeneratePathIndices\", {\n file: \"./utils/trees/QuinaryGeneratePathIndices\",\n template: \"QuinaryGeneratePathIndices\",\n params: [levels],\n });\n\n return witness\n .calculateWitness({ in: input })\n .then(() => false)\n .catch((error: Error) => error.message.includes(\"Assert Failed\"));\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/privacy-scaling-explorations/maci/packages/circuits/ts/__tests__/IncrementalQuinaryTree.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "privacy-scaling-explorations/maci", "url": "https://github.com/privacy-scaling-explorations/maci.git", "license": "MIT", "stars": 571, "forks": 180}, "metrics": null, "summary": "An error should be thrown if the input for `calculateWitness` exceeds the computed bound based on `leavesPerNode` raised to the power of `levels`.", "mode": "fast-check"} {"id": 56890, "name": "unknown", "code": "test('basics', () => {\n // nulls and undefined are false in all conditions except IS NULL and IS NOT NULL\n fc.assert(\n fc.property(\n fc.oneof(fc.constant(null), fc.constant(undefined)),\n fc.oneof(\n fc.constant('='),\n fc.constant('!='),\n fc.constant('<'),\n fc.constant('<='),\n fc.constant('>'),\n fc.constant('>='),\n fc.constant('LIKE'),\n fc.constant('NOT LIKE'),\n fc.constant('ILIKE'),\n fc.constant('NOT ILIKE'),\n ),\n // hexastring to avoid sending escape chars to like\n fc.oneof(fc.hexaString(), fc.double(), fc.boolean(), fc.constant(null)),\n (a, operator, b) => {\n const condition: SimpleCondition = {\n type: 'simple',\n left: {\n type: 'column',\n name: 'foo',\n },\n op: operator as SimpleOperator,\n right: {\n type: 'literal',\n value: b,\n },\n };\n const predicate = createPredicate(condition);\n expect(predicate({foo: a})).toBe(false);\n },\n ),\n );\n\n let condition: SimpleCondition = {\n type: 'simple',\n left: {\n type: 'column',\n name: 'foo',\n },\n op: 'IS',\n right: {\n type: 'literal',\n value: null,\n },\n };\n let predicate = createPredicate(condition);\n expect(predicate({foo: null})).toBe(true);\n expect(predicate({foo: 1})).toBe(false);\n expect(predicate({foo: 'null'})).toBe(false);\n expect(predicate({foo: true})).toBe(false);\n expect(predicate({foo: false})).toBe(false);\n\n condition = {\n type: 'simple',\n left: {\n type: 'column',\n name: 'foo',\n },\n op: 'IS NOT',\n right: {\n type: 'literal',\n value: null,\n },\n };\n predicate = createPredicate(condition);\n expect(predicate({foo: null})).toBe(false);\n expect(predicate({foo: 1})).toBe(true);\n expect(predicate({foo: 'null'})).toBe(true);\n expect(predicate({foo: true})).toBe(true);\n expect(predicate({foo: false})).toBe(true);\n\n // basic operators\n fc.assert(\n fc.property(\n fc.oneof(fc.boolean(), fc.double(), fc.string()),\n fc.oneof(\n fc.constant('='),\n fc.constant('!='),\n fc.constant('<'),\n fc.constant('<='),\n fc.constant('>'),\n fc.constant('>='),\n ),\n fc.oneof(fc.boolean(), fc.double(), fc.string()),\n (a, op, b) => {\n const condition: SimpleCondition = {\n type: 'simple',\n left: {\n type: 'column',\n name: 'foo',\n },\n op: op as SimpleOperator,\n right: {\n type: 'literal',\n value: b,\n },\n };\n const predicate = createPredicate(condition);\n const jsOp = {'=': '===', '!=': '!=='}[op] ?? op;\n expect(predicate({foo: a})).toBe(eval(`a ${jsOp} b`));\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/rocicorp/mono/packages/zql/src/builder/filter.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "rocicorp/mono", "url": "https://github.com/rocicorp/mono.git", "license": "Apache-2.0", "stars": 1802, "forks": 80}, "metrics": null, "summary": "Null and undefined values should evaluate to false for all operators except IS NULL and IS NOT NULL, while basic operators evaluate correctly by comparing a column value with a literal using the specified operator.", "mode": "fast-check"} {"id": 56901, "name": "unknown", "code": "test('should return the same enabled toggles as the raw SDK correctly mapped', async () => {\n await fc.assert(\n fc\n .asyncProperty(\n clientFeaturesAndSegments({ minLength: 1 }),\n fc\n .tuple(generateContext(), commonISOTimestamp())\n .map(([context, currentTime]) => ({\n ...context,\n userId: 'constant',\n sessionId: 'constant2',\n currentTime,\n })),\n fc.context(),\n async ({ segments, features }, context, ctx) => {\n const serviceToggles = await insertAndEvaluateFeatures({\n features: features,\n context,\n segments,\n });\n\n const [head, ...rest] =\n await featureToggleService.getClientFeatures();\n if (!head) {\n return serviceToggles.length === 0;\n }\n\n const client = await offlineUnleashClientNode({\n features: [head, ...rest],\n context,\n logError: console.log,\n segments: segments.map(mapSegmentSchemaToISegment),\n });\n\n const clientContext = {\n ...context,\n\n currentTime: context.currentTime\n ? new Date(context.currentTime)\n : undefined,\n };\n\n return serviceToggles.every((feature) => {\n ctx.log(\n `Examining feature ${\n feature.name\n }: ${JSON.stringify(feature)}`,\n );\n\n // the playground differs from a normal SDK in that\n // it _must_ evaluate all strategies and features\n // regardless of whether they're supposed to be\n // enabled in the current environment or not.\n const expectedSDKState = feature.isEnabled;\n\n const enabledStateMatches =\n expectedSDKState ===\n client.isEnabled(feature.name, clientContext);\n\n ctx.log(\n `feature.isEnabled, feature.isEnabledInCurrentEnvironment, presumedSDKState: ${feature.isEnabled}, ${feature.isEnabledInCurrentEnvironment}, ${expectedSDKState}`,\n );\n ctx.log(\n `client.isEnabled: ${client.isEnabled(\n feature.name,\n clientContext,\n )}`,\n );\n expect(enabledStateMatches).toBe(true);\n\n // if x is disabled, then the variant will be the\n // disabled variant.\n if (!feature.isEnabled) {\n ctx.log(`${feature.name} is not enabled`);\n ctx.log(JSON.stringify(feature.variant));\n ctx.log(JSON.stringify(enabledStateMatches));\n ctx.log(\n JSON.stringify(\n feature.variant?.name === 'disabled',\n ),\n );\n ctx.log(\n JSON.stringify(\n feature.variant?.enabled === false,\n ),\n );\n return (\n enabledStateMatches &&\n isDisabledVariant(feature.variant)\n );\n }\n ctx.log('feature is enabled');\n\n const clientVariant = client.getVariant(\n feature.name,\n clientContext,\n );\n\n // if x is enabled, but its variant is the disabled\n // variant, then the source does not have any\n // variants\n if (isDisabledVariant(feature.variant)) {\n return (\n enabledStateMatches &&\n isDisabledVariant(clientVariant)\n );\n }\n\n ctx.log(`feature \"${feature.name}\" has a variant`);\n ctx.log(\n `Feature variant: ${JSON.stringify(\n feature.variant,\n )}`,\n );\n ctx.log(\n `Client variant: ${JSON.stringify(\n clientVariant,\n )}`,\n );\n ctx.log(\n `enabledStateMatches: ${enabledStateMatches}`,\n );\n\n // variants should be the same if the\n // toggle is enabled in both versions. If\n // they're not and one of them has a\n // variant, then they should be different.\n if (expectedSDKState === true) {\n expect(feature.variant).toEqual(clientVariant);\n } else {\n expect(feature.variant).not.toEqual(\n clientVariant,\n );\n }\n\n return enabledStateMatches;\n });\n },\n )\n .afterEach(cleanup),\n { ...testParams, examples: [] },\n );\n })", "language": "typescript", "source_file": "./repos/Unleash/unleash/src/test/e2e/services/playground-service.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Unleash/unleash", "url": "https://github.com/Unleash/unleash.git", "license": "Apache-2.0", "stars": 12374, "forks": 783}, "metrics": null, "summary": "Verifies that the enabled feature toggles returned by the playground service align with those derived from the raw SDK, ensuring consistent evaluation of features and their variants regardless of environment settings.", "mode": "fast-check"} {"id": 56920, "name": "unknown", "code": "it('applies custom context fields correctly', async () => {\n const environment = 'default';\n const contextValue = () =>\n fc.record({\n name: fc.constantFrom('Context field A', 'Context field B'),\n value: fc.constantFrom(\n 'Context value 1',\n 'Context value 2',\n ),\n });\n const constrainedFeatures = (): Arbitrary =>\n fc.uniqueArray(\n fc\n .tuple(\n clientFeature(),\n contextValue().map((context) => ({\n name: 'default',\n constraints: [\n {\n values: [context.value],\n inverted: false,\n operator: 'IN' as const,\n contextName: context.name,\n caseInsensitive: false,\n },\n ],\n })),\n )\n .map(([feature, strategy]) => ({\n ...feature,\n enabled: true,\n strategies: [strategy],\n })),\n { selector: (feature) => feature.name },\n );\n\n // generate a constraint to be used for the context and a request\n // that contains that constraint value.\n const constraintAndRequest = () =>\n fc\n .tuple(\n contextValue(),\n fc.constantFrom('top', 'nested'),\n generateRequest(),\n )\n .map(([generatedContextValue, placement, req]) => {\n const request =\n placement === 'top'\n ? {\n ...req,\n environment,\n context: {\n ...req.context,\n [generatedContextValue.name]:\n generatedContextValue.value,\n },\n }\n : {\n ...req,\n environment,\n context: {\n ...req.context,\n properties: {\n [generatedContextValue.name]:\n generatedContextValue.value,\n },\n },\n };\n\n return {\n generatedContextValue,\n request,\n };\n });\n\n await fc.assert(\n fc\n .asyncProperty(\n constraintAndRequest(),\n constrainedFeatures(),\n fc.context(),\n async (\n { generatedContextValue, request },\n features,\n ctx,\n ) => {\n await seedDatabase(db, features, environment);\n\n const body = await playgroundRequest(\n app,\n token.secret,\n request,\n );\n\n const shouldBeEnabled = features.reduce(\n (acc, next) => {\n const constraint =\n next.strategies![0].constraints![0];\n\n return {\n ...acc,\n [next.name]:\n constraint.contextName ===\n generatedContextValue.name &&\n constraint.values![0] ===\n generatedContextValue.value,\n };\n },\n {},\n );\n\n ctx.log(\n `Got these ${JSON.stringify(\n body.features,\n )} and I expect them to be enabled/disabled: ${JSON.stringify(\n shouldBeEnabled,\n )}`,\n );\n\n return body.features.every(\n (feature) =>\n feature.isEnabled ===\n shouldBeEnabled[feature.name],\n );\n },\n )\n .afterEach(reset(db)),\n testParams,\n );\n })", "language": "typescript", "source_file": "./repos/Unleash/unleash/src/test/e2e/api/admin/playground.e2e.test.ts", "start_line": null, "end_line": null, "dependencies": ["playgroundRequest", "reset"], "repo": {"name": "Unleash/unleash", "url": "https://github.com/Unleash/unleash.git", "license": "Apache-2.0", "stars": 12374, "forks": 783}, "metrics": null, "summary": "A feature's enabled status should match the expected outcome based on custom context fields and constraints when processed through the playground request.", "mode": "fast-check"} {"id": 56921, "name": "unknown", "code": "test('sdkContextSchema', () =>\n fc.assert(\n fc.property(\n generate(),\n (data: SdkContextSchema) =>\n validateSchema(sdkContextSchema.$id, data) === undefined,\n ),\n ))", "language": "typescript", "source_file": "./repos/Unleash/unleash/src/lib/openapi/spec/sdk-context-schema.test.ts", "start_line": null, "end_line": null, "dependencies": ["generate"], "repo": {"name": "Unleash/unleash", "url": "https://github.com/Unleash/unleash.git", "license": "Apache-2.0", "stars": 12374, "forks": 783}, "metrics": null, "summary": "`SdkContextSchema` is validated successfully by ensuring that randomly generated data conforming to its structure results in no validation errors.", "mode": "fast-check"} {"id": 56934, "name": "unknown", "code": "it('executorComposeOption', async () => {\n await fc.assert(\n fc.asyncProperty(\n omnicounterIncrementTypeArbitrary,\n composedIndexArbitrary,\n gasLimitArbitrary,\n nativeDropArbitrary,\n\n // Test the generation and submission of arbitrary COMPOSE Options. The transaction should succeed, and\n // the options from the transaction receipt logs should match the generated input.\n async (type, index, gasLimit, nativeDrop) => {\n const options = Options.newOptions()\n .addExecutorComposeOption(index, gasLimit, nativeDrop)\n // We also need to add a lzReceive option to avoid Executor_ZeroLzReceiveGasProvided error\n .addExecutorLzReceiveOption(MIN_GAS_LIMIT)\n const packetSentEvents = await incrementAndReturnLogs(type, options)\n expect(packetSentEvents).toEqual([\n expect.objectContaining({\n args: expect.objectContaining({\n options: expect.toEqualCaseInsensitive(options.toHex()),\n }),\n }),\n ])\n const rawPacketOptions = packetSentEvents[0]!.args.options\n expect(rawPacketOptions).toEqualCaseInsensitive(options.toHex())\n\n // test decoding\n const packetOptions = Options.fromOptions(rawPacketOptions)\n const decodedExecutorComposeOptions = packetOptions.decodeExecutorComposeOption()\n expect(decodedExecutorComposeOptions).toEqual([\n {\n index,\n gas: gasLimit,\n value: nativeDrop,\n },\n ])\n expect(packetOptions.decodeExecutorLzReceiveOption()).toEqual({\n gas: MIN_GAS_LIMIT,\n value: BigInt(0),\n })\n expect(packetOptions.decodeExecutorNativeDropOption()).toEqual([])\n expect(packetOptions.decodeExecutorOrderedExecutionOption()).toEqual(false)\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/tests/ua-devtools-evm-hardhat-test/test/omnicounter/options.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "The test verifies that generating and submitting arbitrary `COMPOSE` options results in successful transactions, with the transaction receipt logs matching the generated inputs. It also confirms proper decoding of the `ExecutorComposeOption` and other options, ensuring accuracy in the options' processing and representation.", "mode": "fast-check"} {"id": 56942, "name": "unknown", "code": "it('not parse an event with many args with unknown name from a different contract', async () => {\n await fc.assert(\n fc.asyncProperty(fc.integer({ min: 0, max: 10 }), fc.string(), async (count, name) => {\n fc.pre(name !== 'NoArgEvent')\n fc.pre(name !== 'OneArgEvent')\n fc.pre(name !== 'FourArgEvent')\n\n const receipt = await (await child.emitMany(count)).wait()\n\n expect(parseLogsWithName(receipt, parent, name)).toEqual([])\n }),\n { numRuns: 10 }\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/tests/devtools-evm-test/test/events/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Ensures that events with unspecified names from a contract's logs do not get parsed into recognizable events when emitted multiple times.", "mode": "fast-check"} {"id": 56946, "name": "unknown", "code": "it('should parse revert with arguments', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, async (eid) => {\n const errorParser = await createContractErrorParser({ contract, eid })\n const error = await assertFailed(contract.throwWithRevertAndArgument('my bad'))\n const parsedError = await errorParser(error)\n\n expect(parsedError).toEqual(new RevertError('my bad'))\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/tests/devtools-evm-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "The test checks that `createContractErrorParser` correctly parses an error from a contract revert with a specific argument.", "mode": "fast-check"} {"id": 56949, "name": "unknown", "code": "it('should parse require with a custom error with an argument', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, fc.string(), async (eid, arg) => {\n const errorParser = await createContractErrorParser({ contract, eid })\n const error = await assertFailed(contract.throwWithCustomErrorAndArgument(arg))\n const parsedError = await errorParser(error)\n\n expect(parsedError).toEqual(new CustomError('CustomErrorWithAnArgument', [arg]))\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/tests/devtools-evm-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Parses a custom error with an argument from a contract execution, ensuring it matches the expected format.", "mode": "fast-check"} {"id": 57049, "name": "unknown", "code": "it('should work for non-negative integers', () => {\n fc.assert(\n fc.property(fc.integer({ min: 0 }), (value) => {\n expect(UIntBigIntSchema.parse(value)).toBe(BigInt(value))\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`UIntBigIntSchema` correctly parses non-negative integers into their `BigInt` equivalents.", "mode": "fast-check"} {"id": 57074, "name": "unknown", "code": "it(\"should produce different serialized values if the vector don't match\", () => {\n fc.assert(\n fc.property(pointArbitrary, pointArbitrary, (pointA, pointB) => {\n fc.pre(!arePointsEqual(pointA, pointB))\n\n expect(serializePoint(pointA)).not.toBe(serializePoint(pointB))\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/omnigraph/coordinates.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Different serialized values are produced if points are not equal.", "mode": "fast-check"} {"id": 57116, "name": "unknown", "code": "it('should bail on the first submission error', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.array(transactionArbitrary),\n transactionArbitrary,\n fc.array(transactionArbitrary),\n async (firstBatch, failedTransaction, secondBatch) => {\n // We'll prepare some mock objects for this test\n // to mock the transaction responses and receipts\n const error = new Error('Failed transaction')\n const receipt = { transactionHash: '0x0' }\n const successfulWait = jest.fn().mockResolvedValue(receipt)\n const successfulResponse: OmniTransactionResponse = {\n transactionHash: '0x0',\n wait: successfulWait,\n }\n\n // In order to resolve the good ones and reject the bad ones\n // we'll prepare a map between a transaction and its response\n //\n // This map relies on the fact that we are passing the transaction object without modifying it\n // so the objects are referentially equal\n const implementations: Map> = new Map([\n ...firstBatch.map((t) => [t, Promise.resolve(successfulResponse)] as const),\n ...secondBatch.map((t) => [t, Promise.resolve(successfulResponse)] as const),\n [failedTransaction, Promise.reject(error)],\n ])\n\n const expectedSuccessful = [\n // The first batch should all go through\n ...firstBatch,\n // The transactions that are not on the chain affected by the failed transaction should also pass\n ...secondBatch.filter(({ point }) => point.eid !== failedTransaction.point.eid),\n ]\n\n const expectedPending = secondBatch.filter(\n ({ point }) => point.eid === failedTransaction.point.eid\n )\n\n // Our signAndSend will then use the map to resolve/reject transactions\n const signAndSend = jest.fn().mockImplementation((t) => implementations.get(t))\n const sign = jest.fn().mockRejectedValue('Oh god no')\n const signerFactory: OmniSignerFactory = jest\n .fn()\n .mockResolvedValue({ signAndSend, sign })\n const signAndSendTransactions = createSignAndSend(signerFactory)\n\n // Now we send all the transactions to the flow and observe the output\n const transactions = [...firstBatch, failedTransaction, ...secondBatch]\n const [successful, errors, pending] = await signAndSendTransactions(transactions)\n\n // Since we are executing groups of transactions in parallel,\n // in general the order of successful transaction will not match the order of input transactions\n expect(successful).toContainAllValues(\n expectedSuccessful.map((transaction) => ({ transaction, receipt }))\n )\n expect(errors).toEqual([{ transaction: failedTransaction, error }])\n expect(pending).toEqual([failedTransaction, ...expectedPending])\n\n // What needs to match though is the order of successful transactions within groups\n //\n // For that we group the successful transactions and make sure those are equal to the grouped original transactions\n const groupedSuccessful = groupTransactionsByEid(\n successful.map(({ transaction }) => transaction)\n )\n expect(groupedSuccessful).toEqual(groupTransactionsByEid(expectedSuccessful))\n\n // We also check that the signer factory has been called with the eids\n expect(signerFactory).toHaveBeenCalledWith(failedTransaction.point.eid)\n for (const transaction of firstBatch) {\n expect(signerFactory).toHaveBeenCalledWith(transaction.point.eid)\n }\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/transactions/signer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "The property ensures that when a series of transactions are processed, an error in the first submitted transaction causes it to stop attempting further submissions within the same group, and correctly reports successful, errored, and pending transactions.", "mode": "fast-check"} {"id": 57125, "name": "unknown", "code": "it('should return true for two nullish values', () => {\n fc.assert(\n fc.property(zeroishBytes32Arbitrary, zeroishBytes32Arbitrary, (a, b) => {\n expect(areBytes32Equal(a, b)).toBe(true)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`areBytes32Equal` returns true for two nullish `bytes32` values.", "mode": "fast-check"} {"id": 57126, "name": "unknown", "code": "it('should return true for two identical values', () => {\n fc.assert(\n fc.property(evmBytes32Arbitrary, (a) => {\n expect(areBytes32Equal(a, a)).toBe(true)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`areBytes32Equal` returns true when comparing two identical `Bytes32` values.", "mode": "fast-check"} {"id": 57129, "name": "unknown", "code": "it('should return false for a zeroish value and a non-zeroish bytes', () => {\n fc.assert(\n fc.property(zeroishBytes32Arbitrary, evmBytes32Arbitrary, (a, b) => {\n fc.pre(!isZero(b))\n\n expect(areBytes32Equal(a, b)).toBe(false)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "The test checks that `areBytes32Equal` returns false when comparing a zeroish value with a non-zeroish bytes value, where the non-zeroish bytes value is ensured not to be zero.", "mode": "fast-check"} {"id": 57139, "name": "unknown", "code": "it('should return 0 for two identical addresses', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, (address) => {\n expect(compareBytes32Ascending(address, address)).toBe(0)\n expect(compareBytes32Ascending(address, makeBytes32(address))).toBe(0)\n expect(compareBytes32Ascending(makeBytes32(address), makeBytes32(address))).toBe(0)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Comparing two identical Ethereum addresses, whether converted to a 32-byte format or not, should result in `compareBytes32Ascending` returning 0.", "mode": "fast-check"} {"id": 57144, "name": "unknown", "code": "it('should resolve if all resolve', async () => {\n await fc.assert(\n fc.asyncProperty(valuesArbitrary, async (values) => {\n const tasks = values.map((value) => jest.fn().mockResolvedValue(value))\n\n expect(await sequence(tasks)).toEqual(values)\n\n // Make sure all the tasks got called\n for (const task of tasks) {\n expect(task).toHaveBeenCalledTimes(1)\n expect(task).toHaveBeenCalledWith()\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "`sequence` resolves all tasks in order and ensures each task is called once with no arguments.", "mode": "fast-check"} {"id": 57142, "name": "unknown", "code": "it('should return a negative if address comes before the other address', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, evmAddressArbitrary, (addressA, addressB) => {\n fc.pre(addressA.toLowerCase() < addressB.toLowerCase())\n\n expect(compareBytes32Ascending(addressA, addressB)).toBeLessThan(0)\n expect(compareBytes32Ascending(addressA, makeBytes32(addressB))).toBeLessThan(0)\n expect(compareBytes32Ascending(makeBytes32(addressA), addressB)).toBeLessThan(0)\n expect(compareBytes32Ascending(makeBytes32(addressA), makeBytes32(addressB))).toBeLessThan(0)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "The function `compareBytes32Ascending` should return a negative value when one Ethereum address comes before another in a lexicographical order.", "mode": "fast-check"} {"id": 57145, "name": "unknown", "code": "it('should reject with the first rejection', async () => {\n await fc.assert(\n fc.asyncProperty(valuesArbitrary, valueArbitrary, valuesArbitrary, async (values1, error, values2) => {\n const tasks1 = values1.map((value) => jest.fn().mockResolvedValue(value))\n const failingTask = jest.fn().mockRejectedValue(error)\n const tasks2 = values2.map((value) => jest.fn().mockResolvedValue(value))\n const tasks = [...tasks1, failingTask, ...tasks2]\n\n await expect(sequence(tasks)).rejects.toBe(error)\n\n // Make sure the first batch got called\n for (const task of tasks1) {\n expect(task).toHaveBeenCalledTimes(1)\n expect(task).toHaveBeenCalledWith()\n }\n\n // Make sure the failing task got called\n expect(failingTask).toHaveBeenCalledTimes(1)\n expect(failingTask).toHaveBeenCalledWith()\n\n // Make sure the second batch didn't get called\n for (const task of tasks2) {\n expect(task).not.toHaveBeenCalled()\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "The test ensures that a sequence of asynchronous tasks will be rejected with the first encountered rejection, allowing preceding tasks to execute while preventing subsequent tasks from being called after the rejection occurs.", "mode": "fast-check"} {"id": 57248, "name": "unknown", "code": "it('should pass the original value if contract is already an OmniPoint', async () => {\n await fc.assert(\n fc.asyncProperty(pointArbitrary, async (point) => {\n const contractFactory = jest.fn().mockRejectedValue('Oh no')\n const transformer = createOmniPointHardhatTransformer(contractFactory)\n\n const transformed = await transformer(point)\n\n expect(transformed).toBe(point)\n expect(contractFactory).not.toHaveBeenCalled()\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-evm-hardhat/test/omnigraph/transformations.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "The property should maintain the original value if the input is already an OmniPoint, without invoking the `contractFactory`.", "mode": "fast-check"} {"id": 57278, "name": "unknown", "code": "it(\"should handle arbitrary inputs gracefully without crashing\", () => {\n fc.assert(fc.property(fc.string(), (arbitrary) => {\n const result = extractTestAnnotations(arbitrary);\n expect(result).toEqual({});\n }));\n })", "language": "typescript", "source_file": "./repos/stacks-network/clarunit/tests/clarity-parser.prop.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "stacks-network/clarunit", "url": "https://github.com/stacks-network/clarunit.git", "license": "MIT", "stars": 5, "forks": 7}, "metrics": null, "summary": "`extractTestAnnotations` should return an empty object when processing arbitrary string inputs without crashing.", "mode": "fast-check"} {"id": 57327, "name": "unknown", "code": "it(\"should remove from testables\", () => {\n fc.assert(\n fc.property(arbNonEmptyManifest, (manifest) => {\n const packageName = recordKeys(manifest.dependencies)[0]!;\n\n const [updated] = tryRemoveProjectDependency(\n manifest,\n packageName\n ).unwrap();\n\n const hasTestable = updated.testables?.includes(packageName) ?? false;\n expect(hasTestable).toBeFalsy();\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/dependency-management.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "Removing a package dependency from a manifest should also ensure it is not present in the `testables` list.", "mode": "fast-check"} {"id": 57332, "name": "unknown", "code": "it(\"should should be atomic\", () => {\n fc.assert(\n fc.property(\n arbManifestWithDependencyCount(10),\n arbDomainName,\n (manifest, missingPackage) => {\n // In the rare case where the generated manifest has the dependency\n // we skip this test.\n if (hasDependency(manifest, missingPackage)) return;\n\n // A mix of packages that are in the package and one\n // which is not.\n const packagesToRemove = [\n ...recordKeys(manifest.dependencies).slice(0, 2),\n missingPackage,\n ...recordKeys(manifest.dependencies).slice(3, 5),\n ];\n\n const error = tryRemoveProjectDependencies(\n manifest,\n packagesToRemove\n ).unwrapErr();\n\n expect(error).toEqual(new PackumentNotFoundError(missingPackage));\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/dependency-management.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "Removing dependencies from a manifest should result in an error if a non-existent package is included, ensuring the operation is atomic.", "mode": "fast-check"} {"id": 57336, "name": "unknown", "code": "it(\"should have correct change for existing dependency\", () => {\n fc.assert(\n fc.property(\n arbManifest,\n arbDomainName,\n abrDependencyVersion,\n (manifest, packageName, version) => {\n // Make sure version is already in the manifest\n manifest = addProjectDependency(manifest, packageName, version)[0];\n\n const [, change] = addProjectDependency(\n manifest,\n packageName,\n version\n );\n\n expect(change).toEqual({\n type: \"noChange\",\n version,\n });\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/dependency-management.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "Adding an existing dependency version to a manifest should result in a change type of \"noChange\".", "mode": "fast-check"} {"id": 57337, "name": "unknown", "code": "it(\"should round-trip\", () => {\n fc.assert(\n fc.property(fc.string(), (expected) => {\n const encoded = encodeBase64(expected);\n const actual = decodeBase64(encoded);\n\n expect(actual).toEqual(expected);\n })\n );\n })", "language": "typescript", "source_file": "./repos/openupm/openupm-cli/test/unit/domain/base64.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openupm/openupm-cli", "url": "https://github.com/openupm/openupm-cli.git", "license": "BSD-3-Clause", "stars": 270, "forks": 15}, "metrics": null, "summary": "Encoding a string with `encodeBase64` and then decoding it with `decodeBase64` should return the original string.", "mode": "fast-check"} {"id": 57447, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-9]*$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Editing is disallowed for inputs that do not match the regex pattern of digits only.", "mode": "fast-check"} {"id": 57450, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(ipV6SubNet(), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that the validity check on an input element returns true for valid IPv6 subnet values.", "mode": "fast-check"} {"id": 57449, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(regExp.IPv6), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/sprinteins/elia-set/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sprinteins/elia-set", "url": "https://github.com/sprinteins/elia-set.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Editing is disallowed for invalid IPv6 input values based on checkValidity returning false.", "mode": "fast-check"} {"id": 57521, "name": "unknown", "code": "it('Length of interspersed = len(arr) + len(arr)-1', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.integer(),\n (arr, delimiter) => {\n const actual = Jam.intersperse(arr, delimiter);\n const expected = arr.length === 0 ? 0 : arr.length * 2 - 1;\n assert.deepEqual(actual.length, expected);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/IntersperseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "The length of the array returned by `Jam.intersperse` is equal to the original array's length plus its length minus one when a delimiter is added.", "mode": "fast-check"} {"id": 57528, "name": "unknown", "code": "it('forall of a non-empty array with a predicate that always returns true is true', () => {\n fc.assert(fc.property(\n fc.array(fc.integer(), 1, 30),\n (xs) => {\n assert.isTrue(Arr.forall(xs, Fun.always));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/ForallTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "A non-empty array with a predicate that always returns true results in `Arr.forall` returning true.", "mode": "fast-check"} {"id": 57532, "name": "unknown", "code": "it('foldl concat ys xs === reverse(xs) ++ ys', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.array(fc.integer()),\n (xs, ys) => {\n const output = Arr.foldl(xs, (b, a) => [ a ].concat(b), ys);\n assert.deepEqual(output, Arr.reverse(xs).concat(ys));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/FoldTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "`Arr.foldl` with concatenation should produce the same result as reversing the first array and concatenating it with the second array.", "mode": "fast-check"} {"id": 57539, "name": "unknown", "code": "it('returns none if predicate always returns false', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n assertNone(Arr.findIndex(arr, Fun.never));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/FindIndexTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "`Arr.findIndex` returns none when the predicate always returns false on an array of integers.", "mode": "fast-check"} {"id": 57531, "name": "unknown", "code": "it('foldr concat ys xs === xs ++ ys', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()),\n fc.array(fc.integer()),\n (xs, ys) => {\n const output = Arr.foldr(xs, (b, a) => [ a ].concat(b), ys);\n assert.deepEqual(output, xs.concat(ys));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/FoldTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "`Arr.foldr` concatenates two arrays such that the result is equivalent to appending the second array to the first.", "mode": "fast-check"} {"id": 57538, "name": "unknown", "code": "it('finds elements that pass the predicate', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n const pred = (x: number) => x % 3 === 0;\n assert.isTrue(Arr.findIndex(arr, pred).forall((x) => pred(arr[x])));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/FindIndexTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "The test verifies that `Arr.findIndex` correctly identifies the index of elements in an integer array that satisfy a predicate checking if a number is divisible by 3.", "mode": "fast-check"} {"id": 57541, "name": "unknown", "code": "it('is consistent with exists', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n const pred = (x: number) => x % 6 === 0;\n assert.equal(Arr.findIndex(arr, pred).isSome(), Arr.exists(arr, pred));\n }));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/FindIndexTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "`Arr.findIndex` returning an optional value should be consistent with `Arr.exists` when using the same predicate.", "mode": "fast-check"} {"id": 57545, "name": "unknown", "code": "it('Element not found when predicate always returns false', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => !Arr.exists(arr, never)));\n })", "language": "typescript", "source_file": "./repos/mild-blue/opentiny/modules/katamari/src/test/ts/atomic/api/arr/ExistsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mild-blue/opentiny", "url": "https://github.com/mild-blue/opentiny.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "`Arr.exists` should return false when applied with a predicate that always returns false.", "mode": "fast-check"} {"id": 57808, "name": "unknown", "code": "it('queries with `splits: inline` returns only non-parents', async () => {\n await fc.assert(\n fc.asyncProperty(\n arbs.makeTransactionArray({\n splitFreq: 2,\n minLength: 2,\n maxLength: 20,\n }),\n async arr => {\n await insertTransactions(arr);\n\n const { data } = await runQuery(\n q('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .options({ splits: 'inline' })\n .serialize(),\n );\n\n expect(data.filter(t => t.is_parent).length).toBe(0);\n expect(data.filter(t => t.tombstone).length).toBe(0);\n\n const { data: defaultData } = await runQuery(\n q('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .serialize(),\n );\n\n // inline should be the default\n expect(defaultData).toEqual(data);\n },\n ),\n { numRuns: 50 },\n );\n })", "language": "typescript", "source_file": "./repos/my2/actual/packages/loot-core/src/server/aql/schema/executors.test.ts", "start_line": null, "end_line": null, "dependencies": ["insertTransactions"], "repo": {"name": "my2/actual", "url": "https://github.com/my2/actual.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Queries with `splits: inline` should return transactions that are non-parent and non-tombstoned, matching the default query behavior.", "mode": "fast-check"} {"id": 57816, "name": "unknown", "code": "describe('transaction executors', () => {\n it('queries with `splits: inline` returns only non-parents', async () => {\n await fc.assert(\n fc.asyncProperty(\n arbs.makeTransactionArray({\n splitFreq: 2,\n minLength: 2,\n maxLength: 20,\n }),\n async arr => {\n await insertTransactions(arr);\n\n const { data } = await runQuery(\n q('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .options({ splits: 'inline' })\n .serialize(),\n );\n\n expect(data.filter(t => t.is_parent).length).toBe(0);\n expect(data.filter(t => t.tombstone).length).toBe(0);\n\n const { data: defaultData } = await runQuery(\n q('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .serialize(),\n );\n\n // inline should be the default\n expect(defaultData).toEqual(data);\n },\n ),\n { numRuns: 50 },\n );\n });\n\n it('queries with `splits: none` returns only parents', async () => {\n await fc.assert(\n fc.asyncProperty(\n arbs.makeTransactionArray({\n splitFreq: 2,\n minLength: 2,\n maxLength: 8,\n }),\n async arr => {\n await insertTransactions(arr);\n\n const { data } = await runQuery(\n q('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .options({ splits: 'none' })\n .serialize(),\n );\n\n expect(data.filter(t => t.is_child).length).toBe(0);\n },\n ),\n { numRuns: 50 },\n );\n });\n\n it('aggregate queries work with `splits: grouped`', async () => {\n const payeeIds = ['payee1', 'payee2', 'payee3', 'payee4', 'payee5'];\n\n await fc.assert(\n fc\n .asyncProperty(\n arbs.makeTransactionArray({ splitFreq: 2, payeeIds, maxLength: 100 }),\n async arr => {\n await insertTransactions(arr, payeeIds);\n\n const aggQuery = q('transactions')\n .filter({\n $or: [{ amount: { $lt: -5 } }, { amount: { $gt: -2 } }],\n 'payee.name': { $gt: '' },\n })\n .options({ splits: 'grouped' })\n .calculate({ $sum: '$amount' });\n\n const { data } = await runQuery(aggQuery.serialize());\n\n const sum = aliveTransactions(arr).reduce((sum, trans) => {\n const amount = trans.amount || 0;\n const matched =\n (amount < -5 || amount > -2) && trans.payee != null;\n if (!trans.tombstone && !trans.is_parent && matched) {\n return sum + amount;\n }\n return sum;\n }, 0);\n\n expect(data).toBe(sum);\n },\n )\n .beforeEach(() => {\n setClock(null);\n setSyncingMode('import');\n return db.execQuery(`\n DELETE FROM transactions;\n DELETE FROM payees;\n DELETE FROM payee_mapping;\n `);\n }),\n );\n });\n\n function runTest(makeQuery) {\n const payeeIds = ['payee1', 'payee2', 'payee3', 'payee4', 'payee5'];\n\n async function check(arr) {\n const orderFields = ['payee.name', 'amount', 'id'];\n\n // Insert transactions and get a list of all the alive\n // ones to make it easier to check the data later (don't\n // have to always be filtering out dead ones)\n await insertTransactions(arr, payeeIds);\n const allTransactions = aliveTransactions(arr);\n\n // Query time\n const { query, expectedIds, expectedMatchedIds } = makeQuery(arr);\n\n // First to a query without order to make sure the default\n // order works\n const { data: defaultOrderData } = await runQuery(query.serialize());\n expectTransactionOrder(defaultOrderData);\n expect(new Set(defaultOrderData.map(t => t.id))).toEqual(expectedIds);\n\n // Now do the full test, and add a custom order to make\n // sure that doesn't effect anything\n const orderedQuery = query.orderBy(orderFields);\n const { data } = await runQuery(orderedQuery.serialize());\n expect(new Set(data.map(t => t.id))).toEqual(expectedIds);\n\n // Validate paging and ordering\n await expectPagedData(orderedQuery, arr.length, data);\n expectTransactionOrder(data, orderFields);\n\n const matchedIds = new Set();\n\n // Check that all the subtransactions were returned\n for (const trans of data) {\n expect(trans.tombstone).toBe(false);\n\n if (expectedMatchedIds) {\n if (!trans._unmatched) {\n expect(expectedMatchedIds.has(trans.id)).toBe(true);\n matchedIds.add(trans.id);\n } else {\n expect(expectedMatchedIds.has(trans.id)).not.toBe(true);\n }\n }\n\n if (trans.is_parent) {\n // Parent transactions should never have a category\n expect(trans.category).toBe(null);\n\n expect(trans.subtransactions.length).toBe(\n allTransactions.filter(t => t.parent_id === trans.id).length,\n );\n\n // Subtransactions should be ordered as well\n expectTransactionOrder(trans.subtransactions, orderFields);\n\n trans.subtransactions.forEach(subtrans => {\n expect(subtrans.tombstone).toBe(false);\n\n if (expectedMatchedIds) {\n if (!subtrans._unmatched) {\n expect(expectedMatchedIds.has(subtrans.id)).toBe(true);\n matchedIds.add(subtrans.id);\n } else {\n expect(expectedMatchedIds.has(subtrans.id)).not.toBe(true);\n }\n }\n });\n }\n }\n\n if (expectedMatchedIds) {\n // Check that transactions that should be matched are\n // marked as such\n expect(matchedIds).toEqual(expectedMatchedIds);\n }\n }\n\n return fc.assert(\n fc\n .asyncProperty(\n arbs.makeTransactionArray({\n splitFreq: 0.1,\n payeeIds,\n maxLength: 100,\n }),\n check,\n )\n .beforeEach(() => {\n setClock(null);\n setSyncingMode('import');\n return db.execQuery(`\n DELETE FROM transactions;\n DELETE FROM payees;\n DELETE FROM payee_mapping;\n `);\n }),\n { numRuns: 300 },\n );\n }\n\n it('queries the correct transactions without filters', async () => {\n return runTest(arr => {\n const expectedIds = new Set(\n arr.filter(t => !t.tombstone && !t.is_child).map(t => t.id),\n );\n\n // Even though we're applying some filters, these are always\n // guaranteed to return the full split transaction so they\n // should take the optimized path\n const happyQuery = q('transactions')\n .filter({\n date: { $gt: '2017-01-01' },\n })\n .options({ splits: 'grouped' })\n .select(['*', 'payee.name']);\n\n // Make sure it's actually taking the happy path\n expect(isHappyPathQuery(happyQuery.serialize())).toBe(true);\n\n return {\n expectedIds,\n query: happyQuery,\n };\n });\n });\n\n it(`queries the correct transactions with a filter`, async () => {\n return runTest(arr => {\n const expectedIds = new Set();\n\n // let parents = toGroup(\n // arr.filter(t => t.is_parent),\n // new Map(Object.entries(groupById(arr.filter(t => t.parent_id))))\n // );\n\n const parents = groupById(arr.filter(t => t.is_parent && !t.tombstone));\n const matched = new Set();\n\n // Pick out some ids to query\n let ids = arr.reduce((ids, trans, idx) => {\n if (idx % 2 === 0) {\n const amount = trans.amount == null ? 0 : trans.amount;\n const matches = (amount < -2 || amount > -1) && trans.payee > '';\n\n if (matches && isAlive(trans, parents)) {\n expectedIds.add(trans.parent_id || trans.id);\n matched.add(trans.id);\n }\n\n ids.push(trans.id);\n }\n\n return ids;\n }, []);\n\n // Because why not? It should deduplicate them\n ids = repeat(ids, 100);\n\n const unhappyQuery = q('transactions')\n .filter({\n id: [{ $oneof: ids }],\n payee: { $gt: '' },\n $or: [{ amount: { $lt: -2 } }, { amount: { $gt: -1 } }],\n })\n .options({ splits: 'grouped' })\n .select(['*', 'payee.name'])\n // Using this because we want `payee` to have ids for the above\n // filter regardless if it points to a dead one or not\n .withoutValidatedRefs();\n\n expect(isHappyPathQuery(unhappyQuery.serialize())).toBe(false);\n\n return {\n expectedIds,\n expectedMatchedIds: matched,\n query: unhappyQuery,\n };\n });\n });\n})", "language": "typescript", "source_file": "./repos/Liuzizhang/actual-zh/packages/loot-core/src/server/aql/schema/executors.test.ts", "start_line": null, "end_line": null, "dependencies": ["insertTransactions", "aliveTransactions", "expectTransactionOrder", "expectPagedData", "isAlive", "repeat"], "repo": {"name": "Liuzizhang/actual-zh", "url": "https://github.com/Liuzizhang/actual-zh.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that querying transactions with `splits: inline` returns only non-parents and no tombstones, while `splits: none` returns only parents. It validates the aggregate queries with `splits: grouped`, checking the calculation of sums, and verifies correct transaction queries both with and without filters. The expected transaction order and paging consistency are also checked, ensuring transactions and subtransactions meet defined conditions.", "mode": "fast-check"} {"id": 57809, "name": "unknown", "code": "it('queries with `splits: none` returns only parents', async () => {\n await fc.assert(\n fc.asyncProperty(\n arbs.makeTransactionArray({\n splitFreq: 2,\n minLength: 2,\n maxLength: 8,\n }),\n async arr => {\n await insertTransactions(arr);\n\n const { data } = await runQuery(\n q('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .options({ splits: 'none' })\n .serialize(),\n );\n\n expect(data.filter(t => t.is_child).length).toBe(0);\n },\n ),\n { numRuns: 50 },\n );\n })", "language": "typescript", "source_file": "./repos/my2/actual/packages/loot-core/src/server/aql/schema/executors.test.ts", "start_line": null, "end_line": null, "dependencies": ["insertTransactions"], "repo": {"name": "my2/actual", "url": "https://github.com/my2/actual.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Queries with `splits: none` should return only parent transactions, excluding any child transactions.", "mode": "fast-check"} {"id": 57825, "name": "unknown", "code": "it('aggregate queries work with `splits: grouped`', async () => {\n const payeeIds = ['payee1', 'payee2', 'payee3', 'payee4', 'payee5'];\n\n await fc.assert(\n fc\n .asyncProperty(\n arbs.makeTransactionArray({ splitFreq: 2, payeeIds, maxLength: 100 }),\n async arr => {\n await insertTransactions(arr, payeeIds);\n\n const aggQuery = q('transactions')\n .filter({\n $or: [{ amount: { $lt: -5 } }, { amount: { $gt: -2 } }],\n 'payee.name': { $gt: '' },\n })\n .options({ splits: 'grouped' })\n .calculate({ $sum: '$amount' });\n\n const { data } = await aqlQuery(aggQuery.serialize());\n\n const sum = aliveTransactions(arr).reduce((sum, trans) => {\n const amount = trans.amount || 0;\n const matched =\n (amount < -5 || amount > -2) && trans.payee != null;\n if (!trans.tombstone && !trans.is_parent && matched) {\n return sum + amount;\n }\n return sum;\n }, 0);\n\n expect(data).toBe(sum);\n },\n )\n .beforeEach(() => {\n setClock(null);\n setSyncingMode('import');\n return db.execQuery(`\n DELETE FROM transactions;\n DELETE FROM payees;\n DELETE FROM payee_mapping;\n `);\n }),\n );\n }, 20_000)", "language": "typescript", "source_file": "./repos/AppelBoomHD/actual/packages/loot-core/src/server/aql/schema/executors.test.ts", "start_line": null, "end_line": null, "dependencies": ["insertTransactions", "aliveTransactions"], "repo": {"name": "AppelBoomHD/actual", "url": "https://github.com/AppelBoomHD/actual.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Aggregate queries should produce the same sum of transaction amounts as calculated manually when using `splits: grouped` with specified filters and conditions.", "mode": "fast-check"} {"id": 58147, "name": "unknown", "code": "it('ys-xs contains no elements from xs', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.array(fc.integer()), (xs, ys) => {\n const diff = Arr.difference(ys, xs);\n return Arr.forall(xs, (x) => !Arr.contains(diff, x));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/DifferenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that the result of `Arr.difference(ys, xs)` contains no elements from `xs`.", "mode": "fast-check"} {"id": 58151, "name": "unknown", "code": "it('is idempotent', () => {\n fc.assert(fc.property(\n fc.array(fc.nat()), (arr) => {\n assert.deepEqual(Arr.sort(Arr.sort(arr)), Arr.sort(arr));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/ArrSortTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Sorting an array with `Arr.sort` is idempotent, as sorting it twice yields the same result as sorting it once.", "mode": "fast-check"} {"id": 58154, "name": "unknown", "code": "it('returns none for element of empty list', () => {\n fc.assert(fc.property(fc.integer(), (n) => {\n assertNone(Arr.get([], n));\n }));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/ArrGetTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `Arr.get` should return `none` when attempting to access any element in an empty list.", "mode": "fast-check"} {"id": 58158, "name": "unknown", "code": "it('Arr.findMap of non-empty is first if f is Optional.some', () => {\n fc.assert(fc.property(\n fc.integer(),\n fc.array(fc.integer()),\n (head, tail) => {\n const arr = [ head, ...tail ];\n assertSome(Arr.findMap(arr, Optional.some), head);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/ArrFindMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.findMap` returns the first element of a non-empty array when the function `f` is `Optional.some`.", "mode": "fast-check"} {"id": 58161, "name": "unknown", "code": "it('Arr.findMap does not find an element', () => {\n fc.assert(fc.property(\n fc.array(fc.nat()),\n fc.nat(),\n (arr, ret) => {\n assertNone(Arr.findMap(arr, (x) => Optionals.someIf(x === -1, ret)));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/adharsh-salesforce/tinymce-skins-pack/modules/katamari/src/test/ts/atomic/api/arr/ArrFindMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "adharsh-salesforce/tinymce-skins-pack", "url": "https://github.com/adharsh-salesforce/tinymce-skins-pack.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.findMap` should return `None` when no element matches the condition `x === -1` in the array.", "mode": "fast-check"} {"id": 58182, "name": "unknown", "code": "it('should never reject', async () => {\n const errorParser = await createErrorParser()\n\n await fc.assert(\n fc.asyncProperty(fc.anything(), async (error) => {\n const parsedError = await errorParser(error)\n\n expect(parsedError).toBeInstanceOf(UnknownError)\n expect(parsedError.reason).toBeUndefined()\n expect(parsedError.message).toMatch(/Unknown error: /)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/tests/devtools-evm-hardhat-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Parsing any error should result in an instance of `UnknownError` with an undefined reason and a message matching \"Unknown error: \".", "mode": "fast-check"} {"id": 58242, "name": "unknown", "code": "it('should return false if the optionalDVNs are different', async () => {\n await fc.assert(\n fc.asyncProperty(\n channelIdArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n dvnsArbitrary,\n async (channelId, oapp, ulnConfig, extraOptionalDVNs) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(channelId, oapp, {\n ...ulnConfig,\n optionalDVNs: [...ulnConfig.optionalDVNs, ...extraOptionalDVNs],\n })\n ).resolves.toBeFalsy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/ulnRead/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `hasAppUlnConfig` should return false when the `optionalDVNs` field in the ULN configuration differs due to additional elements.", "mode": "fast-check"} {"id": 58246, "name": "unknown", "code": "it('should return true if the configs are identical', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n ulnConfigArbitrary,\n async (eid, oapp, ulnConfig) => {\n getAppUlnConfigSpy.mockReset()\n getAppUlnConfigSpy.mockResolvedValue(ulnConfig)\n\n await expect(\n ulnSdk.hasAppUlnConfig(eid, oapp, ulnConfig, Uln302ConfigType.Receive)\n ).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`ulnSdk.hasAppUlnConfig` returns true when the endpoint and EVM address have a configuration identical to the provided `ulnConfig`.", "mode": "fast-check"} {"id": 58256, "name": "unknown", "code": "it('should return true if the configs are identical', async () => {\n await fc.assert(\n fc.asyncProperty(\n endpointArbitrary,\n evmAddressArbitrary,\n executorConfigArbitrary,\n async (eid, oapp, executorConfig) => {\n getAppExecutorConfigSpy.mockReset()\n getAppExecutorConfigSpy.mockResolvedValue(executorConfig)\n\n await expect(ulnSdk.hasAppExecutorConfig(eid, oapp, executorConfig)).resolves.toBeTruthy()\n }\n ),\n { numRuns: 20 }\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/protocol-devtools-evm/test/uln302/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`ulnSdk.hasAppExecutorConfig` should return true when the fetched executor configuration matches the provided configuration.", "mode": "fast-check"} {"id": 58268, "name": "unknown", "code": "it('should call onStart & onFailure when callback rejects', async () => {\n await fc.assert(\n fc.asyncProperty(fc.array(fc.anything()), fc.anything(), async (args, error) => {\n const fn = jest.fn().mockRejectedValue(error)\n const onStart = jest.fn().mockImplementation((logger: Logger) => logger.debug(`onStart`))\n const onError = jest.fn().mockImplementation((logger: Logger) => logger.debug(`onSuccess`))\n\n await expect(withAsyncLogger(fn, { onStart, onError })(...args)).rejects.toBe(error)\n\n expect(onStart).toHaveBeenCalledWith(expect.anything(), args)\n expect(onError).toHaveBeenCalledWith(expect.anything(), args, error)\n expect(onStart).toHaveBeenCalledBefore(onError)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/io-devtools/test/stdio/logger.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "When a callback function rejects, `onStart` should be called before `onError`, with each receiving the relevant arguments.", "mode": "fast-check"} {"id": 58273, "name": "unknown", "code": "it('should flatten any arrays', () => {\n fc.assert(\n fc.property(\n fc.array(fc.oneof(transactionArbitrary, nullableArbitrary, fc.array(transactionArbitrary))),\n (transactions) => {\n const flattened = flattenTransactions(transactions)\n\n for (const transaction of flattened) {\n expect(transaction).not.toBeInstanceOf(Array)\n }\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/transactions/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `flattenTransactions` removes array nesting, ensuring that all items in the output are not arrays.", "mode": "fast-check"} {"id": 58285, "name": "unknown", "code": "it('should parse successfully', () => {\n fc.assert(\n fc.property(pointArbitrary, good, (point, config) => {\n expect(schema.safeParse({ point, config }).success).toBeTruthy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`schema.safeParse` should successfully parse objects containing `point` and `config`.", "mode": "fast-check"} {"id": 58288, "name": "unknown", "code": "it('should not parse', () => {\n fc.assert(\n fc.property(vectorArbitrary, bad, (vector, config) => {\n expect(schema.safeParse({ vector, config }).success).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that the `schema.safeParse` function returns `false` when attempting to parse a given set of `vector` and `config` inputs.", "mode": "fast-check"} {"id": 58290, "name": "unknown", "code": "it('should not work for negative bigints', () => {\n fc.assert(\n fc.property(fc.bigInt({ max: BigInt(-1) }), (value) => {\n expect(() => UIntBigIntSchema.parse(value)).toThrow()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/omnigraph/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`UIntBigIntSchema` throws an error when parsing negative bigints.", "mode": "fast-check"} {"id": 58384, "name": "unknown", "code": "it('should normalize a nullish value to empty bytes', () => {\n fc.assert(\n fc.property(evmEndpointArbitrary, nullishArbitrary, (eid, address) => {\n const normalized = normalizePeer(address, eid)\n const denormalized = denormalizePeer(normalized, eid)\n\n expect(normalized).toEqual(new Uint8Array(32))\n expect(isZero(normalized)).toBe(true)\n expect(isZero(denormalized)).toBe(true)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Normalizing a nullish value results in a byte array of length 32 filled with zeros, and both the normalized and denormalized values should be zeroed arrays.", "mode": "fast-check"} {"id": 58439, "name": "unknown", "code": "it('should serialize correctly when args are empty', () => {\n fc.assert(\n fc.property(reasonArbitrary, (reason) => {\n expect(String(new CustomError(reason, []))).toBe(\n `CustomError: Contract reverted with custom error. Error ${reason}()`\n )\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm/test/errors/errors.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`CustomError` with an empty argument list serializes to a specific string format incorporating the error reason.", "mode": "fast-check"} {"id": 58444, "name": "unknown", "code": "it('should return the same address, just checksumed', () => {\n fc.assert(\n fc.property(evmAddressArbitrary, (address) => {\n expect(addChecksum(address)).toEqualCaseInsensitive(address)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools-evm/test/address.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `addChecksum` function should return the input address with the same value, but formatted with checksum.", "mode": "fast-check"} {"id": 58450, "name": "unknown", "code": "it('should resolve with the first successful task', async () => {\n await fc.assert(\n fc.asyncProperty(valuesArbitrary, valueArbitrary, async (errors, value) => {\n const tasks = errors.map((error) => jest.fn().mockRejectedValue(error))\n const task = jest.fn().mockResolvedValue(value)\n\n expect(await first([...tasks, task])).toBe(value)\n\n // Make sure all the tasks got called\n for (const factory of tasks) {\n expect(factory).toHaveBeenCalledTimes(1)\n }\n\n expect(task).toHaveBeenCalledTimes(1)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`first` resolves with the first successful task, ensuring all tasks are called once.", "mode": "fast-check"} {"id": 58463, "name": "unknown", "code": "it('should reject with the original error if the onError callback throws', async () => {\n await fc.assert(\n fc.asyncProperty(valueArbitrary, valueArbitrary, async (error, anotherError) => {\n const task = jest.fn().mockRejectedValue(error)\n const handleError = jest.fn().mockImplementation(() => {\n throw anotherError\n })\n\n await expect(tapError(task, handleError)).rejects.toBe(error)\n expect(handleError).toHaveBeenCalledOnce()\n expect(handleError).toHaveBeenCalledExactlyOnceWith(error)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`tapError` should reject with the original error if the `onError` callback throws another error.", "mode": "fast-check"} {"id": 58467, "name": "unknown", "code": "it('should return false if the amount of attempts has been reached, the wrapped strategy value otherwise', () => {\n fc.assert(\n fc.property(numAttemptsArbitrary, (numAttempts) => {\n // We'll create a simple wrapped strategy\n const wrappedStrategy = (attempt: number) => [attempt]\n const strategy = createSimpleRetryStrategy(numAttempts, wrappedStrategy)\n\n // The first N attempts should return the return value of the wrapped strategy\n for (let attempt = 1; attempt <= numAttempts; attempt++) {\n expect(strategy(attempt, 'error', [0], [0])).toEqual(wrappedStrategy(attempt))\n }\n\n // The N+1th attempt should return false\n expect(strategy(numAttempts + 1, 'error', [0], [0])).toBeFalsy()\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/common/promise.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`createSimpleRetryStrategy` returns the wrapped strategy's value for attempts up to the limit and returns false once the limit is exceeded.", "mode": "fast-check"} {"id": 58740, "name": "unknown", "code": "it('should instantiate from entries', () => {\n fc.assert(\n fc.property(fc.array(fc.tuple(keyArbitrary, valueArbitrary)), (entries) => {\n const map = new TestMap(entries)\n\n // This looks like the simplest way of deduplicating the entries\n //\n // For the test below we want to make sure that we check that the map\n // contains the last value belonging to a key - entries can contain\n // duplicate keys so we need this helper data structure to store the last value set for a key\n const valuesByHash = Object.fromEntries(entries.map(([key, value]) => [hash(key), value]))\n\n for (const [key] of entries) {\n const hashedKey = hash(key)\n expect(hashedKey in valuesByHash).toBeTruthy()\n\n const value = valuesByHash[hashedKey]\n\n expect(map.has(key)).toBeTruthy()\n expect(map.get(key)).toBe(value)\n }\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/map.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "A `TestMap` instantiated from entries should map each key to its last corresponding value, handling duplicates accordingly.", "mode": "fast-check"} {"id": 58741, "name": "unknown", "code": "it('should clear correctly', () => {\n fc.assert(\n fc.property(fc.array(fc.tuple(keyArbitrary, valueArbitrary)), (entries) => {\n const map = new TestMap(entries)\n\n map.clear()\n\n expect(map.size).toBe(0)\n expect(Array.from(map.keys())).toEqual([])\n expect(Array.from(map.values())).toEqual([])\n expect(Array.from(map.entries())).toEqual([])\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools/test/common/map.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "`TestMap` clears all entries correctly, resulting in a size of 0 and empty keys, values, and entries arrays.", "mode": "fast-check"} {"id": 58776, "name": "unknown", "code": "it('should throw if passed an invalid message', () => {\n fc.assert(\n fc.property(fc.base64String(), (serialized) => {\n expect(() => deserialize(serialized)).toThrow(/Failed to deserialize data./)\n })\n )\n })", "language": "typescript", "source_file": "./repos/etherlinkcom/OFTez/etherlink/lib/devtools/packages/devtools-ton/test/transactions/serde.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "etherlinkcom/OFTez", "url": "https://github.com/etherlinkcom/OFTez.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Deserializing an invalid base64 string should throw an error indicating failure to deserialize the data.", "mode": "fast-check"} {"id": 58853, "name": "unknown", "code": "UnitTest.test('ShadowDom - SelectorFind.descendant', () => {\n if (ShadowDom.isSupported()) {\n fc.assert(fc.property(htmlBlockTagName(), htmlInlineTagName(), fc.hexaString(), (block, inline, text) => {\n withShadowElement((ss) => {\n const id = 'theid';\n const inner = Element.fromHtml(`<${block}>

hello<${inline} id=\"${id}\">${text}

`);\n Insert.append(ss, inner);\n\n const frog: Element = SelectorFind.descendant(ss, `#${id}`).getOrDie('Element not found');\n Assert.eq('textcontent', text, frog.dom().textContent);\n });\n }));\n }\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/sugar/src/test/ts/browser/ShadowDomTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`SelectorFind.descendant` should locate an element by ID within a shadow DOM, ensuring its text content matches the provided string.", "mode": "fast-check"} {"id": 58859, "name": "unknown", "code": "UnitTest.test('KAssert.eqValue: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('should throw if numbers differ #1', () => {\n KAssert.eqValue('eq', a, Result.value(b));\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqValue('eq', a, Result.value(b), tNumber);\n });\n Assert.throws('should throw if numbers differ #2', () => {\n KAssert.eqValue('eq', a, Result.value(b), tNumber, tBoom());\n });\n }));\n\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.throws('should throw if error #1', () => {\n KAssert.eqValue('eq', i, Result.error(s));\n });\n Assert.throws('should throw if error #2', () => {\n KAssert.eqValue('eq', i, Result.error(s), tBoom());\n });\n Assert.throws('should throw if error #3', () => {\n KAssert.eqValue('eq', i, Result.error(s), tBoom(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`KAssert.eqValue` throws an error when comparing two different numbers or when comparing a number to an error result.", "mode": "fast-check"} {"id": 58861, "name": "unknown", "code": "UnitTest.test('KAssert.eqResult: fail', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('value(a) != (value(!a)) #1', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b));\n });\n Assert.throws('value(a) != (value(!a)) #2', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b), tNumber);\n });\n Assert.throws('value(a) != (value(!a)) #2', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b), tNumber, tBoom());\n });\n }));\n\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('error(a) != (error(!a)) #1', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b));\n });\n Assert.throws('error(a) != (error(!a)) #2', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b), tBoom());\n });\n Assert.throws('result(a) != (result(!a)) #2', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b), tBoom(), tNumber);\n });\n }));\n\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.throws('value != error #1', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s));\n });\n Assert.throws('value != error #2', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s), tBoom());\n });\n Assert.throws('value != error #3', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s), tBoom());\n });\n\n Assert.throws('error != value #1', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s));\n });\n Assert.throws('error != value #2', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s), tBoom());\n });\n Assert.throws('error != value #3', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s), tBoom(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`KAssert.eqResult` throws an error when comparing unequal `Result` values or types, including different values, different errors, and mismatched value/error pairs.", "mode": "fast-check"} {"id": 58864, "name": "unknown", "code": "UnitTest.test('KAssert.eqSome: success (reflexivity)', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n KAssert.eqSome('eq', i, Option.some(i));\n KAssert.eqSome('eq', i, Option.some(i), tNumber);\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`KAssert.eqSome` verifies that an integer equals `Option.some` of the same integer, ensuring reflexivity with optional types.", "mode": "fast-check"} {"id": 58869, "name": "unknown", "code": "UnitTest.test('KAssert.eqOption: failure', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #1', () => {\n KAssert.eqOption('eq', Option.some(a), Option.some(b));\n });\n }));\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('some(i) != some(!i) #2', () => {\n KAssert.eqOption('eq', Option.some(a), Option.some(b), tNumber);\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('none != some(i) #1', () => {\n KAssert.eqOption('eq', Option.none(), Option.some(i));\n });\n Assert.throws('none != some(i) #2', () => {\n KAssert.eqOption('eq', Option.none(), Option.some(i), tBoom());\n });\n }));\n fc.assert(fc.property(fc.integer(), (i) => {\n Assert.throws('some(i) != none #1', () => {\n KAssert.eqOption('eq', Option.some(i), Option.none());\n });\n Assert.throws('some(i) != none #2', () => {\n KAssert.eqOption('eq', Option.some(i), Option.none(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`KAssert.eqOption` throws an error when comparing two different `Option` values, one being `None` and the other being `Some`, or when the `Some` values are different.", "mode": "fast-check"} {"id": 58947, "name": "unknown", "code": "UnitTest.test('Checking some(x).exists(_ -> false) === false', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => !opt.exists(Fun.constant(false))));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`some(x).exists(_ -> false)` should always return false.", "mode": "fast-check"} {"id": 58963, "name": "unknown", "code": "UnitTest.test('Option.isNone', () => {\n Assert.eq('none is none', true, Option.none().isNone());\n fc.assert(fc.property(fc.anything(), (x) => {\n Assert.eq('some is not none', false, Option.some(x).isNone());\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/option/OptionIsNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Option.isNone` returns true for `Option.none()` and false for any value wrapped in `Option.some()`.", "mode": "fast-check"} {"id": 58974, "name": "unknown", "code": "UnitTest.test('Obj.isEmpty: single key/value', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.json(),\n (k: string, v: any) => {\n const o = { [k]: v };\n Assert.eq('eq', false, Obj.isEmpty(o));\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/obj/ObjIsEmptyTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Verifies that an object with a single key-value pair is not considered empty by `Obj.isEmpty`.", "mode": "fast-check"} {"id": 58997, "name": "unknown", "code": "UnitTest.test('Error is thrown if not all arguments are supplied', () => {\n fc.assert(fc.property(arbAdt, fc.array(arbKeys, 1, 40), (subject, exclusions) => {\n const original = Arr.filter(allKeys, (k) => !Arr.contains(exclusions, k));\n\n try {\n const branches = Arr.mapToObject(original, () => Fun.identity);\n subject.match(branches);\n return false;\n } catch (err) {\n return err.message.indexOf('nothing') > -1;\n }\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "An error should be thrown when calling `match` on a subject with a branches object containing fewer keys than expected.", "mode": "fast-check"} {"id": 59103, "name": "unknown", "code": "UnitTest.test('Arr.indexOf: find in middle of array', () => {\n fc.assert(fc.property(fc.array(fc.nat()), arbNegativeInteger(), fc.array(fc.nat()), (prefix, element, suffix) => {\n const arr = prefix.concat([ element ]).concat(suffix);\n Assert.eq(\n 'Element should be found immediately after the prefix array',\n Option.some(prefix.length),\n Arr.indexOf(arr, element),\n tOption(tNumber)\n );\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/IndexOfTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.indexOf` should return the index position of an element immediately following a prefix array within a concatenated array.", "mode": "fast-check"} {"id": 58998, "name": "unknown", "code": "UnitTest.test('adt.nothing.match should pass [ ]', () => {\n fc.assert(fc.property(arbNothing, (subject) => {\n const contents = subject.match({\n nothing: record,\n unknown: Fun.die('should not be unknown'),\n exact: Fun.die('should not be exact')\n });\n Assert.eq('eq', [], contents);\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that the `adt.nothing.match` function returns an empty array when matching with a `nothing` handler.", "mode": "fast-check"} {"id": 59001, "name": "unknown", "code": "UnitTest.test('adt.unknown.match should be same as fold', () => {\n fc.assert(fc.property(arbUnknown, (subject) => {\n const matched = subject.match({\n nothing: Fun.die('should not be nothing'),\n unknown: record,\n exact: Fun.die('should not be exact')\n });\n\n const folded = subject.fold(Fun.die('should not be nothing'), record, Fun.die('should not be exact'));\n Assert.eq('eq', matched, folded);\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/struct/AdtTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`subject.match` produces the same result as `subject.fold` when handling the 'unknown' case.", "mode": "fast-check"} {"id": 59130, "name": "unknown", "code": "UnitTest.test('Arr.sort: idempotency', () => {\n fc.assert(fc.property(\n fc.array(fc.nat()), (arr) => {\n Assert.eq('idempotency', Arr.sort(arr), Arr.sort(Arr.sort(arr)), tArray(tNumber));\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ArrSortTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.sort` applied to an array should produce the same result when applied multiple times consecutively.", "mode": "fast-check"} {"id": 59158, "name": "unknown", "code": "it('edits smpRate attribute only for valid inputs', async () => {\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 0 }).map(num => `${num}`),\n async smpRate => {\n inputs[4].value = smpRate;\n await (inputs[4]).requestUpdate();\n expect(inputs[4].checkValidity()).to.be.true;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/sampledvaluecontrol.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `smpRate` attribute should only be edited for valid integer inputs that satisfy the validity checks.", "mode": "fast-check"} {"id": 59197, "name": "unknown", "code": "it('does not allow to edit for invalid input', async () =>\n await fc.assert(\n fc.asyncProperty(invertedRegex(/^[0-7]$/), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.false;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Editing is disallowed for input values that do not match the regex pattern /^[0-7]$/, ensuring `input.checkValidity()` returns false.", "mode": "fast-check"} {"id": 59202, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(regexString(/^\\S*$/, 1), async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n })\n ))", "language": "typescript", "source_file": "./repos/trusz/openscd-io-center/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "trusz/openscd-io-center", "url": "https://github.com/trusz/openscd-io-center.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Editing should be allowed for input strings without whitespace.", "mode": "fast-check"} {"id": 59339, "name": "unknown", "code": "UnitTest.test('some !== none, for any predicate', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt1) => {\n Assert.eq('eq', false, opt1.equals_(Optional.none(), boom));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`some` should not equal `none` when comparing an optional integer with an empty optional using any predicate.", "mode": "fast-check"} {"id": 59368, "name": "unknown", "code": "UnitTest.test('Checking none.getOrThunk(_ -> v) === v', () => {\n fc.assert(fc.property(fc.func(fc.integer()), (thunk) => {\n Assert.eq('eq', thunk(), Optional.none().getOrThunk(thunk));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optional.none().getOrThunk(thunk)` returns the result of `thunk()`.", "mode": "fast-check"} {"id": 59372, "name": "unknown", "code": "UnitTest.test('Optional.isSome: none is not some', () => {\n Assert.eq('none is not some', false, Optional.none().isSome());\n fc.assert(fc.property(fc.anything(), (x) => {\n Assert.eq('some is some', true, Optional.some(x).isSome());\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalIsSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optional.isSome` should return false for `Optional.none` and true for any `Optional.some(x)`.", "mode": "fast-check"} {"id": 59375, "name": "unknown", "code": "UnitTest.test('Optional.getOr', () => {\n fc.assert(fc.property(fc.integer(), (x) => {\n Assert.eq('none', x, Optional.none().getOr(x));\n Assert.eq('none', x, Optional.none().getOrThunk(() => x));\n }));\n fc.assert(fc.property(fc.integer(), fc.integer(), (x, y) => {\n Assert.eq('some', x, Optional.some(x).getOr(y));\n Assert.eq('some', x, Optional.some(x).getOrThunk(Fun.die('boom')));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalGetOrTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Optional.getOr` returns the provided default value for `Optional.none` and the contained value for `Optional.some`.", "mode": "fast-check"} {"id": 59377, "name": "unknown", "code": "UnitTest.test('Checking some(x).filter(_ -> true) === some(x)', () => {\n fc.assert(fc.property(fc.integer(), (x) => {\n Assert.eq('eq', true, tOptional().eq(\n some(x),\n some(x).filter(Fun.always)\n ));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/optional/OptionalFilterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should hold that applying a filter function returning true to a `some(x)` object results in the same `some(x)` object.", "mode": "fast-check"} {"id": 59498, "name": "unknown", "code": "UnitTest.test('Check identity :: identity(a) === a', () => {\n fc.assert(fc.property(fc.json(), (json) => {\n Assert.eq('eq', json, Fun.identity(json));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/fun/FunTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The identity function should return the same value as the input for any JSON object.", "mode": "fast-check"} {"id": 59511, "name": "unknown", "code": "UnitTest.test('Arr.find: finds a value in the array', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.integer(), fc.array(fc.integer()), (prefix, i, suffix) => {\n const arr = prefix.concat([ i ]).concat(suffix);\n const pred = (x) => x === i;\n const result = Arr.find(arr, pred);\n Assert.eq('Element found in array', Optional.some(i), result, tOptional(tNumber));\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ArrFindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.find` locates and identifies a specified value within an array using a predicate function.", "mode": "fast-check"} {"id": 59516, "name": "unknown", "code": "UnitTest.test('Arr.findMap does not find an element', () => {\n fc.assert(fc.property(\n fc.array(fc.nat()),\n fc.nat(),\n (arr, ret) => {\n Assert.eq('eq', Optional.none(), Arr.findMap(arr, (x) => Optionals.someIf(x === -1, ret)), tOptional());\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ArrFindMapTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.findMap` should return `Optional.none()` if no element in the array meets the condition specified by the mapping function.", "mode": "fast-check"} {"id": 59544, "name": "unknown", "code": "it('should always return boolean for any input', () => {\n fc.assert(\n fc.property(fc.anything(), input => {\n const result = isString(input);\n expect(typeof result).toBe('boolean');\n })\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/packages/types/test/validators.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "`isString` always returns a boolean for any input type.", "mode": "fast-check"} {"id": 59533, "name": "unknown", "code": "UnitTest.test('KAssert.eqResult: fail', () => {\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('value(a) != (value(!a)) #1', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b));\n });\n Assert.throws('value(a) != (value(!a)) #2', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b), tNumber);\n });\n Assert.throws('value(a) != (value(!a)) #2', () => {\n KAssert.eqResult('eq', Result.value(a), Result.value(b), tNumber, tBoom());\n });\n }));\n\n fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {\n Assert.throws('error(a) != (error(!a)) #1', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b));\n });\n Assert.throws('error(a) != (error(!a)) #2', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b), tBoom());\n });\n Assert.throws('result(a) != (result(!a)) #2', () => {\n KAssert.eqResult('eq', Result.error(a), Result.error(b), tBoom(), tNumber);\n });\n }));\n\n fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {\n Assert.throws('value != error #1', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s));\n });\n Assert.throws('value != error #2', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s), tBoom());\n });\n Assert.throws('value != error #3', () => {\n KAssert.eqResult('eq', Result.value(i), Result.error(s), tBoom());\n });\n\n Assert.throws('error != value #1', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s));\n });\n Assert.throws('error != value #2', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s), tBoom());\n });\n Assert.throws('error != value #3', () => {\n KAssert.eqResult('eq', Result.error(i), Result.value(s), tBoom(), tBoom());\n });\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari-assertions/src/test/ts/atomic/api/KAssertTest.ts", "start_line": null, "end_line": null, "dependencies": ["tBoom"], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`KAssert.eqResult` properly throws errors when comparing different `Result` values and errors, ensuring mismatched comparisons are detected in different scenarios with `Result.value` and `Result.error`.", "mode": "fast-check"} {"id": 59556, "name": "unknown", "code": "it('should reject clearly invalid formats', () => {\n const invalidEmails = fc.oneof(\n fc.constant(''),\n fc.constant('notanemail'),\n fc.constant('@domain.com'),\n fc.constant('user@'),\n fc.string({ minLength: 1, maxLength: 5 }).filter(s => !s.includes('@'))\n );\n\n fc.assert(\n fc.property(invalidEmails, email => {\n return isValidEmail(email) === false;\n })\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/examples/property-testing/validation-functions.example.ts", "start_line": null, "end_line": null, "dependencies": ["isValidEmail"], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "`isValidEmail` returns false for strings that do not conform to basic email format requirements.", "mode": "fast-check"} {"id": 59565, "name": "unknown", "code": "it('should be monotonic with respect to weight and distance', () => {\n fc.assert(\n fc.property(shippingGenerator, ([weight, distance]) => {\n const baseShipping = calculateShipping(weight, distance);\n const heavierShipping = calculateShipping(weight * 2, distance);\n const fartherShipping = calculateShipping(weight, distance * 2);\n\n // More weight or distance should not decrease shipping cost\n return (\n heavierShipping >= baseShipping && fartherShipping >= baseShipping\n );\n })\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/examples/property-testing/business-logic.example.ts", "start_line": null, "end_line": null, "dependencies": ["calculateShipping"], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "The shipping cost should not decrease when either the weight is increased or the distance is increased.", "mode": "fast-check"} {"id": 59561, "name": "unknown", "code": "it('should accept strong passwords', () => {\n const strongPassword = fc\n .string({ minLength: 8, maxLength: 20 })\n .map(s => s + 'A1'); // Ensure it has uppercase and number\n\n fc.assert(\n fc.property(strongPassword, password => {\n const result = validatePassword(password);\n return result.valid === true;\n })\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/examples/property-testing/validation-functions.example.ts", "start_line": null, "end_line": null, "dependencies": ["validatePassword"], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "`validatePassword` should return `valid: true` for passwords that are at least 8 characters long and contain both an uppercase letter and a number.", "mode": "fast-check"} {"id": 59567, "name": "unknown", "code": "it('should have additional business logic validation', () => {\n fc.assert(\n fc.property(\n fc.tuple(generators.money(), generators.percentage()),\n ([amount, percentage]) => {\n const discount = calculateDiscount(amount, percentage);\n\n // Property: discount never exceeds original amount\n return discount <= amount;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/examples/property-testing/financial-functions.example.ts", "start_line": null, "end_line": null, "dependencies": ["calculateDiscount"], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "The discount calculated with `calculateDiscount` should not exceed the original amount.", "mode": "fast-check"} {"id": 59667, "name": "unknown", "code": "describe('helper/language', () => {\n after(async() => {\n await locale('en',);\n },);\n fc.assert(fc.property(fc.string(), (lang,) => {\n it(`no_tasks should return english string if set to ${ lang }`, async() => {\n if (\n lang.match(/^[a-z]{2}$/u,)\n && existsSync(process.cwd() + 'language/' + lang + '.yml',)\n ) {\n //skip\n return true;\n }\n await locale(lang,);\n expect(language('no_tasks',),).to.be.equal('Can\\'t measure zero tasks.',);\n return true;\n },);\n },),);\n fc.assert(fc.property(fc.string(), (key,) => {\n it(`${ key } should return a string`, () => {\n expect(language(key as languageKey,),).to.be.a('string',);\n },);\n },),);\n},)", "language": "typescript", "source_file": "./repos/idrinth-api-bench/framework/property/helper/language.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "idrinth-api-bench/framework", "url": "https://github.com/idrinth-api-bench/framework.git", "license": "MIT", "stars": 5, "forks": 5}, "metrics": null, "summary": "When a locale is set to a non-existing or unsupported language, the `language` function should return the English string for 'no_tasks'; every input key should result in a string output from the `language` function.", "mode": "fast-check"} {"id": 59665, "name": "unknown", "code": "describe('middlewares/max-time', () => {\n fc.assert(fc.property(fc.nat(), fc.nat(), (duration, max,) => {\n it(\n `throws only if the response is too slow(${ duration }<=${ max })`,\n () => {\n const response: Result = {\n id: 'example',\n validators: [],\n duration,\n maxDuration: max,\n response: {\n headers: {},\n cookies: {},\n uri: '',\n status: 0,\n body: '',\n },\n };\n if (duration > max) {\n expect(() => post(response,),)\n .to.throw(\n `The response time was above ${ max } ns`,\n );\n return;\n }\n expect(() => post(response,),).to.not.throw();\n },\n );\n },),);\n},)", "language": "typescript", "source_file": "./repos/idrinth-api-bench/framework/property/middlewares/max-time.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "idrinth-api-bench/framework", "url": "https://github.com/idrinth-api-bench/framework.git", "license": "MIT", "stars": 5, "forks": 5}, "metrics": null, "summary": "A response should only throw an error if its duration exceeds the maximum allowed time.", "mode": "fast-check"} {"id": 59669, "name": "unknown", "code": "it('is always the size of the longest sequence', () => {\n fc.assert(\n fc.property(fc.array(fc.nat(), { minLength: 1 }), (lengths) => {\n const ranges = lengths.map((l) => Range(0, l));\n const first = ranges.shift();\n expectToBeDefined(first);\n const zipped = first.zipAll.apply(first, ranges);\n const longestLength = Math.max.apply(Math, lengths);\n expect(zipped.size).toBe(longestLength);\n })\n );\n })", "language": "typescript", "source_file": "./repos/immutable-js/immutable-js/__tests__/zip.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "immutable-js/immutable-js", "url": "https://github.com/immutable-js/immutable-js.git", "license": "MIT", "stars": 33051, "forks": 1777}, "metrics": null, "summary": "The zipped sequence's size should equal the length of the longest input sequence.", "mode": "fast-check"} {"id": 59821, "name": "unknown", "code": "it(\"matchX\", () => {\n const f = Weather.matchX({\n Rain: \"rained\",\n [_]: \"didn't rain\",\n })\n\n fc.assert(\n fc.property(fc.integer(), n =>\n expect(f(Weather.mk.Rain(n))).toBe(\"rained\"),\n ),\n )\n\n expect(f(Weather.mk.Sun)).toBe(\"didn't rain\")\n })", "language": "typescript", "source_file": "./repos/unsplash/sum-types/test/unit/index.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "unsplash/sum-types", "url": "https://github.com/unsplash/sum-types.git", "license": "MIT", "stars": 44, "forks": 2}, "metrics": null, "summary": "The function `matchX` should return \"rained\" when matched with `Weather.mk.Rain` and \"didn't rain\" when matched with `Weather.mk.Sun`.", "mode": "fast-check"} {"id": 59823, "name": "unknown", "code": "it(\"are reversible\", () => {\n type Sum = Member\n const Sum = create()\n\n fc.assert(\n fc.property(fc.string(), fc.integer(), (k, v) => {\n const x = create().mk[k](v)\n expect(deserialize(Sum)(serialize(x))).toEqual(x)\n }),\n )\n })", "language": "typescript", "source_file": "./repos/unsplash/sum-types/test/unit/index.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "unsplash/sum-types", "url": "https://github.com/unsplash/sum-types.git", "license": "MIT", "stars": 44, "forks": 2}, "metrics": null, "summary": "Serialized and deserialized `Sum` types should be identical to the original instance.", "mode": "fast-check"} {"id": 59825, "name": "unknown", "code": "it('should reverse a string twice to get the original', () => {\n fc.assert(\n fc.property(fc.string(), (s) => {\n return reverseString(reverseString(s)) === s;\n })\n );\n })", "language": "typescript", "source_file": "./repos/mariogalea/qualitymatters-ts-fastcheck/tests/reverseString.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mariogalea/qualitymatters-ts-fastcheck", "url": "https://github.com/mariogalea/qualitymatters-ts-fastcheck.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Reversing a string twice should yield the original string.", "mode": "fast-check"} {"id": 59857, "name": "unknown", "code": "it('returns the same result with the same config', () => {\n fc.assert(\n fc.property(domainGen.checkConfig(), domainGen.gens(), domainGen.fallibleFunc(), (config, gens, f) => {\n const checkResult0 = dev.check(dev.property(...gens, f), config);\n const checkResult1 = dev.check(dev.property(...gens, f), config);\n\n expect(checkResult0).toEqual(checkResult1);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Property/Property.Repeat.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Calling `dev.check` with the same configuration and generators should return the same result consistently.", "mode": "fast-check"} {"id": 59862, "name": "unknown", "code": "it('returns 0 when n = origin', () => {\n fc.assert(\n fc.property(\n genRangeParams(),\n LocalGen.scaleMode().filter((s) => s === 'constant'),\n ({ min, max, origin }, scaleMode) => {\n const range = Range.createFrom(nativeCalculator, min, max, origin, scaleMode);\n\n const distance = range.getProportionalDistance(origin);\n\n expect(distance).toEqual(0);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Number/Range.test.ts", "start_line": null, "end_line": null, "dependencies": ["genRangeParams"], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Range.getProportionalDistance` returns 0 when the input is equal to the defined origin.", "mode": "fast-check"} {"id": 59865, "name": "unknown", "code": "it.each([\n { min: -10, max: 10, origin: 0, n: 5, expectedDistance: 50 },\n { min: -10, max: 10, origin: 0, n: -5, expectedDistance: 50 },\n { min: -5, max: 15, origin: 5, n: 10, expectedDistance: 50 },\n { min: -15, max: 5, origin: -5, n: -10, expectedDistance: 50 },\n ])('examples', ({ min, max, origin, n, expectedDistance }) => {\n fc.assert(\n fc.property(LocalGen.scaleMode(), (scaleMode) => {\n const range = Range.createFrom(\n nativeCalculator,\n nativeCalculator.loadIntegerUnchecked(min),\n nativeCalculator.loadIntegerUnchecked(max),\n nativeCalculator.loadIntegerUnchecked(origin),\n scaleMode,\n );\n\n const distance = range.getProportionalDistance(nativeCalculator.loadIntegerUnchecked(n));\n\n expect(distance).toEqual(expectedDistance);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Number/Range.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The proportional distance calculated from a given number `n` within a specified range should equal the expected distance, regardless of scale mode.", "mode": "fast-check"} {"id": 59864, "name": "unknown", "code": "it('returns 100 when n = max, and n > origin', () => {\n fc.assert(\n fc.property(\n genRangeParams().filter((x) => x.max > x.origin),\n LocalGen.scaleMode(),\n ({ min, max, origin }, scaleMode) => {\n const range = Range.createFrom(nativeCalculator, min, max, origin, scaleMode);\n\n const distance = range.getProportionalDistance(max);\n\n expect(distance).toEqual(100);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Number/Range.test.ts", "start_line": null, "end_line": null, "dependencies": ["genRangeParams"], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "When `n` equals `max` and is greater than `origin`, `Range.getProportionalDistance(max)` should return 100.", "mode": "fast-check"} {"id": 59867, "name": "unknown", "code": "it('returns [origin,origin] when given size = 0', () => {\n fc.assert(\n fc.property(genRangeParams(), ({ min, max, origin }) => {\n const range = Range.createFrom(nativeCalculator, min, max, origin, 'linear');\n\n const bounds = range.getSizedBounds(nativeCalculator.zero);\n\n const expectedBounds: Bounds = [origin, origin];\n expect(bounds).toMatchObject(expectedBounds);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Number/Range.test.ts", "start_line": null, "end_line": null, "dependencies": ["genRangeParams"], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "When the size is 0, `Range.createFrom` should return bounds `[origin, origin]`.", "mode": "fast-check"} {"id": 59975, "name": "unknown", "code": "it('allow to edit for valid input', async () =>\n await fc.assert(\n fc.asyncProperty(\n integer({ min: 1025, max: 65535 }).map(num => `${num}`),\n async testValue => {\n input!.value = testValue;\n await element.requestUpdate();\n expect(input!.checkValidity()).to.be.true;\n }\n )\n ))", "language": "typescript", "source_file": "./repos/openscd/oscd-official-plugins/packages/plugins/test/unit/wizards/connectedap-pattern.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "openscd/oscd-official-plugins", "url": "https://github.com/openscd/oscd-official-plugins.git", "license": "Apache-2.0", "stars": 0, "forks": 4}, "metrics": null, "summary": "Editing is allowed when the input value is a valid integer string between 1025 and 65535, as it passes validity checks.", "mode": "fast-check"} {"id": 60117, "name": "unknown", "code": "test(\"search step invariant is maintained\", () => {\n const arb = fc.array(fc.nat({ max: 32_768 }), {\n maxLength: 10,\n })\n\n fc.assert(\n fc.property(arb, sizes => {\n const arrs = sizes.map(arrayOfSize)\n const vecs = arrs.map(fromArray)\n const merged = concatMany(vecs)\n\n assertSearchStepInvariant(merged.root)\n }),\n { numRuns: 1000 }\n )\n })", "language": "typescript", "source_file": "./repos/peterhorne/rrb-tree/src/test.ts", "start_line": null, "end_line": null, "dependencies": ["concatMany", "assertSearchStepInvariant"], "repo": {"name": "peterhorne/rrb-tree", "url": "https://github.com/peterhorne/rrb-tree.git", "license": "MIT", "stars": 18, "forks": 0}, "metrics": null, "summary": "The `assertSearchStepInvariant` function verifies that a merged RRB tree maintains its structural invariants after concatenating multiple arrays.", "mode": "fast-check"} {"id": 60216, "name": "unknown", "code": "it('should calculate overlap correctly', () => {\n fc.assert(\n fc.property(\n fc.tuple(domainArbitraries.validTimeSlot, domainArbitraries.validTimeSlot),\n ([slot1, slot2]) => {\n // Property: Overlap calculation should be symmetric and accurate\n const calculateOverlap = (a: typeof slot1, b: typeof slot1): number => {\n const overlapStart = Math.max(a.start.getTime(), b.start.getTime());\n const overlapEnd = Math.min(a.end.getTime(), b.end.getTime());\n\n if (overlapEnd <= overlapStart) {\n return 0; // No overlap\n }\n\n return (overlapEnd - overlapStart) / (1000 * 60); // Minutes of overlap\n };\n\n const overlap1to2 = calculateOverlap(slot1, slot2);\n const overlap2to1 = calculateOverlap(slot2, slot1);\n\n // Symmetry property\n return Math.abs(overlap1to2 - overlap2to1) < 0.001;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/date-time-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The overlap calculation between two time slots should be symmetric and accurate.", "mode": "fast-check"} {"id": 60160, "name": "unknown", "code": "it(\"combines an array of IOs into a single IO returning an array of the results\", () =>\n fc.assert(\n fc.asyncProperty(fc.array(successfulIo), async (actions) => {\n const allResults = await Promise.all(actions.map((io) => io.run()));\n const sequenced = await IO.sequence(actions).run();\n return expect(sequenced).toEqual(allResults);\n })\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/concurrency.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Combining an array of IO operations results in a single IO that returns an array of their outcomes, matching the results of running them independently using `Promise.all`.", "mode": "fast-check"} {"id": 60218, "name": "unknown", "code": "it('should calculate durations consistently', () => {\n fc.assert(\n fc.property(fc.tuple(fc.date(), fc.date()), ([date1, date2]) => {\n // Property: Duration calculation should be commutative in absolute terms\n const duration1to2 = Math.abs(date2.getTime() - date1.getTime());\n const duration2to1 = Math.abs(date1.getTime() - date2.getTime());\n\n return duration1to2 === duration2to1;\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/date-time-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Duration calculations should be commutative in absolute terms between two dates.", "mode": "fast-check"} {"id": 60246, "name": "unknown", "code": "it('should validate curriculum codes correctly', () => {\n fc.assert(\n fc.property(domainArbitraries.curriculumCode, (code) => {\n // Property: Valid codes should pass validation\n return validateCurriculumCode(code) === true;\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/curriculum-expectation-validation.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Valid curriculum codes should pass the `validateCurriculumCode` function.", "mode": "fast-check"} {"id": 60282, "name": "unknown", "code": "it('should test string properties', () => {\n fc.assert(\n fc.property(fc.string(), (s) => {\n // Property: String length is non-negative\n return s.length >= 0;\n }),\n { numRuns: 50 },\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/simple-test.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "String length is always non-negative.", "mode": "fast-check"} {"id": 60281, "name": "unknown", "code": "it('should test basic number properties', () => {\n fc.assert(\n fc.property(fc.integer(), (n) => {\n // Property: Adding zero to any number returns the same number\n return n + 0 === n;\n }),\n { numRuns: 100 },\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/simple-test.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Adding zero to an integer returns the same integer.", "mode": "fast-check"} {"id": 60309, "name": "unknown", "code": "it('should ensure reading complexity progression', () => {\n fc.assert(\n fc.property(\n domainArbitraries.grade,\n fc.string({ minLength: 10, maxLength: 100 }),\n (grade, text) => {\n // Property: Reading materials should match grade reading levels\n const words = text.split(/\\s+/);\n const averageWordLength =\n words.reduce((sum, word) => sum + word.length, 0) / words.length;\n const sentenceCount = text.split(/[.!?]+/).length;\n const averageSentenceLength = words.length / sentenceCount;\n\n // Simplified reading level calculation\n const readingComplexity = (averageWordLength + averageSentenceLength) / 2;\n\n if (grade <= 2) {\n return readingComplexity <= 6; // Simple texts\n } else if (grade <= 4) {\n return readingComplexity <= 8; // Intermediate texts\n } else if (grade <= 6) {\n return readingComplexity <= 10; // Grade-level texts\n } else {\n return readingComplexity <= 12; // More complex texts\n }\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/grade-progression-logic.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Reading materials are expected to align with specified grade levels based on calculated reading complexity.", "mode": "fast-check"} {"id": 60313, "name": "unknown", "code": "it('should progress collaboration complexity with grade', () => {\n fc.assert(\n fc.property(domainArbitraries.grade, domainArbitraries.grouping, (grade, grouping) => {\n // Property: Collaboration complexity should match social development\n const appropriateGroupings = new Map([\n [1, ['whole class', 'pairs']],\n [2, ['whole class', 'pairs', 'small group']],\n [3, ['whole class', 'pairs', 'small group']],\n [4, ['whole class', 'pairs', 'small group', 'flexible grouping']],\n [5, ['whole class', 'pairs', 'small group', 'flexible grouping', 'individual']],\n [6, ['whole class', 'pairs', 'small group', 'flexible grouping', 'individual']],\n [7, ['whole class', 'pairs', 'small group', 'flexible grouping', 'individual']],\n [8, ['whole class', 'pairs', 'small group', 'flexible grouping', 'individual']],\n ]);\n\n const validGroupings = appropriateGroupings.get(grade) || ['whole class'];\n return validGroupings.includes(grouping);\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/grade-progression-logic.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The collaboration complexity should reflect appropriate social development by ensuring the grouping matches valid options for each grade level.", "mode": "fast-check"} {"id": 60416, "name": "unknown", "code": "it(\"should fail to cast neither foo nor bar\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(fc.record({ baz: fc.boolean() }), (input) => {\n expect(castFooBar(input)).toStrictEqual({\n status: \"failure\",\n expected: \"union\",\n variants: [\n {\n status: \"failure\",\n expected: \"object\",\n properties: {\n foo: {\n status: \"failure\",\n expected: \"string\",\n actual: undefined\n }\n },\n actual: input\n },\n {\n status: \"failure\",\n expected: \"object\",\n properties: {\n bar: {\n status: \"failure\",\n expected: \"number\",\n actual: undefined\n }\n },\n actual: input\n }\n ]\n });\n })\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`castFooBar` returns a failure status with expected types when input lacks required `foo` (string) and `bar` (number) properties.", "mode": "fast-check"} {"id": 60420, "name": "unknown", "code": "it(\"should successfully cast strings to length\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(fc.string(), (input) => {\n expect(castLength(input)).toStrictEqual({\n status: \"success\",\n value: input.length,\n values: []\n });\n })\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`castLength` returns an object with status \"success\", the length of the input string as `value`, and an empty array as `values`.", "mode": "fast-check"} {"id": 60424, "name": "unknown", "code": "it('should respect identity', () => {\n return fc.assert(\n fc.asyncProperty(arbExecutableQuery(fc.anything()), async (query) => {\n const result = await query.map(id).run(fakeClient);\n const expected = await query.run(fakeClient);\n expect(result).toStrictEqual(expected);\n })\n );\n })", "language": "typescript", "source_file": "./repos/blemoine/posigrade/src/query/executable-query.spec.ts", "start_line": null, "end_line": null, "dependencies": ["arbExecutableQuery"], "repo": {"name": "blemoine/posigrade", "url": "https://github.com/blemoine/posigrade.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Mapping an `ExecutableQuery` with the identity function should produce the same result as the original query when executed.", "mode": "fast-check"} {"id": 60417, "name": "unknown", "code": "it(\"should successfully cast foo and bar\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(\n fc.record({ foo: fc.string(), bar: fc.double() }),\n (input) => {\n const { foo, bar } = input;\n expect(castFooBar(input)).toStrictEqual({\n status: \"success\",\n value: [{ foo }, { bar }],\n values: []\n });\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`castFooBar` should transform an object with properties `foo` and `bar` into a structured format with a \"success\" status and corresponding values.", "mode": "fast-check"} {"id": 60463, "name": "unknown", "code": "test('decode string', () => {\n fc.assert(\n fc.property(fc.string(), (s) => {\n expect(string(s)).toBe(s);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/tskj/typescript-json-decoder/tests/property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tskj/typescript-json-decoder", "url": "https://github.com/tskj/typescript-json-decoder.git", "license": "MIT", "stars": 59, "forks": 7}, "metrics": null, "summary": "The `string` function should return the input string unchanged.", "mode": "fast-check"} {"id": 60459, "name": "unknown", "code": "it(\"should handle invalid JSON parsing gracefully\", async () => {\n await fc.assert(\n fc.asyncProperty(snakeCaseKeyArb, async (key) => {\n const kv = mockKVNamespace();\n await kv.put(key, \"not-valid-json\");\n const result = await kv.get(key, { type: \"json\" });\n expect(result).toBeNull();\n })\n );\n })", "language": "typescript", "source_file": "./repos/variablesoftware/mock-kv/tests/mockKVNamespace/json.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "variablesoftware/mock-kv", "url": "https://github.com/variablesoftware/mock-kv.git", "license": "MIT", "stars": 3, "forks": 0}, "metrics": null, "summary": "Invalid JSON stored in `mockKVNamespace` should result in `null` when retrieved as JSON.", "mode": "fast-check"} {"id": 60480, "name": "unknown", "code": "it('should correctly test for equality', () => {\n fc.assert(\n fc.property(fc.integer(), fc.integer(), (a, b) => {\n return isNotEqual(a)(b) === (a !== b);\n }),\n {\n verbose: 2,\n // manual cases\n examples: [\n [50, 50],\n [50, 100],\n ],\n },\n );\n})", "language": "typescript", "source_file": "./repos/gohypergiant/standard-toolkit/packages/predicates/src/is-not-equal/index.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "gohypergiant/standard-toolkit", "url": "https://github.com/gohypergiant/standard-toolkit.git", "license": "Apache-2.0", "stars": 13, "forks": 2}, "metrics": null, "summary": "`isNotEqual` should return true if and only if two integers are not equal.", "mode": "fast-check"} {"id": 60493, "name": "unknown", "code": "it('should always find the value when cloned inside the array', () => {\n fc.assert(\n fc.property(\n fc.array(fc.anything(anythingSettings)),\n fc.array(fc.anything(anythingSettings)),\n fc.clone(fc.anything(anythingSettings), 2),\n (startValues, endValues, [a, b]) => {\n // Given: startValues, endValues arrays\n // and [a, b] identical values\n expect([...startValues, a, ...endValues]).toContainEqual(b);\n },\n ),\n assertSettings,\n );\n })", "language": "typescript", "source_file": "./repos/Saghen/expect-fp/src/__tests__/matchers-toContainEqual.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Saghen/expect-fp", "url": "https://github.com/Saghen/expect-fp.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Arrays containing a cloned value should always satisfy `toContainEqual` for that value.", "mode": "fast-check"} {"id": 60500, "name": "unknown", "code": "it('test hard domain name', () => {\n const _url = toArbitrary(() => `${ faker.internet.domainWord() }.${ faker.internet.domainName() }`);\n\n fc.assert(\n fc.property(_url, (url) => {\n expect(validation.Validators.website(url)).toEqual(ValidationErrors.None);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/Zajno/common-utils/packages/common/src/validation/__tests__/validator.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Zajno/common-utils", "url": "https://github.com/Zajno/common-utils.git", "license": "MIT", "stars": 5, "forks": 2}, "metrics": null, "summary": "The `website` validator should return `ValidationErrors.None` for generated domain names.", "mode": "fast-check"} {"id": 60502, "name": "unknown", "code": "it('test domainWord with dot', () => {\n const _url = toArbitrary(() => `${ faker.internet.domainWord() }.`);\n\n fc.assert(\n fc.property(_url, (url) => {\n expect(validation.Validators.website(url)).toEqual(ValidationErrors.Website);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/Zajno/common-utils/packages/common/src/validation/__tests__/validator.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Zajno/common-utils", "url": "https://github.com/Zajno/common-utils.git", "license": "MIT", "stars": 5, "forks": 2}, "metrics": null, "summary": "Testing that `Validators.website` returns `ValidationErrors.Website` for strings formed by `faker.internet.domainWord()` followed by a dot.", "mode": "fast-check"} {"id": 60513, "name": "unknown", "code": "test('should verify mobile phone numbers', () =>\n fc.assert(\n fc.property(mobilePhone(), (phone) => isMobilePhoneNumber(phone))\n ))", "language": "typescript", "source_file": "./repos/jonathanpalma/sivar-utils/src/lib/__tests__/telephones.test.ts", "start_line": null, "end_line": null, "dependencies": ["mobilePhone"], "repo": {"name": "jonathanpalma/sivar-utils", "url": "https://github.com/jonathanpalma/sivar-utils.git", "license": "MIT", "stars": 37, "forks": 9}, "metrics": null, "summary": "`isMobilePhoneNumber` correctly identifies mobile phone numbers generated within the specified range.", "mode": "fast-check"} {"id": 60506, "name": "unknown", "code": "it('use logger without mode (default logger)', () => {\n const _textToLog = toArbitrary(() => faker.internet.url());\n let iteration = 0;\n\n const consoleMocks = createConsoleMocks();\n\n fc.assert(\n fc.property(_textToLog, (textToLog) => {\n const methodName = loggerMethods[iteration];\n logger[methodName](textToLog);\n\n expect(getMode()).toBe(false);\n expect(consoleMocks[methodName]).not.toHaveBeenCalled();\n\n ++iteration;\n }), {\n numRuns: loggerMethods.length,\n });\n\n clearMocks(consoleMocks);\n })", "language": "typescript", "source_file": "./repos/Zajno/common-utils/packages/common/src/logger/__tests__/logger.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Zajno/common-utils", "url": "https://github.com/Zajno/common-utils.git", "license": "MIT", "stars": 5, "forks": 2}, "metrics": null, "summary": "Using the default logger without specifying a mode should not invoke any console methods, and the mode should be false.", "mode": "fast-check"} {"id": 60510, "name": "unknown", "code": "it('use logger with custom mode', () => {\n const loggerName = `[${faker.lorem.word()}]`;\n const _textToLog: fc.Arbitrary = toArbitrary(() => faker.lorem.word());\n\n const customLogger = createCustomLogger();\n const customLoggerGetter = () => customLogger;\n\n let iteration = 0;\n fc.assert(\n fc.property(_textToLog, (textToLog) => {\n if (iteration % 2 === 0) {\n setMode(customLoggerGetter);\n }\n const logger = createLogger(loggerName);\n if (iteration % 2 === 1) {\n setMode(customLoggerGetter);\n }\n\n const methodName = loggerMethods[iteration % 3];\n logger[methodName](textToLog);\n\n const impl = customLogger[methodName];\n\n expect(getMode()).toBe(customLoggerGetter);\n expect(impl).toHaveBeenCalledWith(loggerName, textToLog);\n impl.mockClear();\n ++iteration;\n }), {\n numRuns: loggerMethods.length * 2,\n });\n })", "language": "typescript", "source_file": "./repos/Zajno/common-utils/packages/common/src/logger/__tests__/logger.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Zajno/common-utils", "url": "https://github.com/Zajno/common-utils.git", "license": "MIT", "stars": 5, "forks": 2}, "metrics": null, "summary": "The logger should correctly call the custom logger's method with the specified name and text, maintaining the custom logging mode.", "mode": "fast-check"} {"id": 60514, "name": "unknown", "code": "test('should returns false for everything else', () =>\n fc.assert(\n fc.property(\n fc.oneof(fc.anything(), fc.string(9)),\n (phone) => !isMobilePhoneNumber(phone as any)\n )\n ))", "language": "typescript", "source_file": "./repos/jonathanpalma/sivar-utils/src/lib/__tests__/telephones.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "jonathanpalma/sivar-utils", "url": "https://github.com/jonathanpalma/sivar-utils.git", "license": "MIT", "stars": 37, "forks": 9}, "metrics": null, "summary": "`isMobilePhoneNumber` returns false for inputs that are not valid mobile phone numbers, including any type and strings of length 9.", "mode": "fast-check"} {"id": 60509, "name": "unknown", "code": "it('use logger with \\'console\\' mode', () => {\n const loggerName = `[${faker.lorem.word()}]`;\n const _textToLog: fc.Arbitrary = toArbitrary(() => faker.lorem.word());\n const consoleMocks = createConsoleMocks();\n\n let iteration = 0;\n fc.assert(\n fc.property(_textToLog, (textToLog) => {\n\n if (iteration % 2 === 0) setMode('console');\n const logger = createLogger(loggerName);\n if (iteration % 2 === 1) setMode('console');\n const methodName = loggerMethods[iteration % 3];\n logger[methodName](textToLog);\n\n expect(getMode()).toBe('console');\n expect(consoleMocks[methodName]).toHaveBeenCalledWith(loggerName, textToLog);\n consoleMocks[methodName].mockClear();\n\n ++iteration;\n }), {\n numRuns: loggerMethods.length * 2,\n });\n\n clearMocks(consoleMocks);\n })", "language": "typescript", "source_file": "./repos/Zajno/common-utils/packages/common/src/logger/__tests__/logger.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Zajno/common-utils", "url": "https://github.com/Zajno/common-utils.git", "license": "MIT", "stars": 5, "forks": 2}, "metrics": null, "summary": "The logger should operate in 'console' mode, using various methods to log text with the correct logger name, ensuring the console methods are called as expected.", "mode": "fast-check"} {"id": 60512, "name": "unknown", "code": "it('batches loggers', () => {\n\n const loggerName = `[${faker.lorem.word()}]`;\n const _textToLog: fc.Arbitrary = toArbitrary(() => faker.lorem.word());\n const consoleMocks = createConsoleMocks();\n const customLogger = createCustomLogger();\n const customLoggerGetter = () => customLogger;\n\n setMode(false);\n\n let iteration = 0;\n fc.assert(\n fc.property(_textToLog, (textToLog) => {\n const logger = batchLoggers(\n createLogger(loggerName, 'console'),\n createLogger(loggerName, customLoggerGetter),\n );\n\n const methodName = loggerMethods[iteration % 3];\n logger[methodName](textToLog);\n\n expect(consoleMocks[methodName]).toHaveBeenCalledWith(loggerName, textToLog);\n const impl = customLogger[methodName];\n expect(impl).toHaveBeenCalledWith(loggerName, textToLog);\n impl.mockClear();\n\n ++iteration;\n }), {\n numRuns: loggerMethods.length,\n });\n\n expect(getMode()).toBe(false);\n clearMocks(consoleMocks);\n\n expect(batchLoggers(null, undefined)).toStrictEqual(EMPTY_LOGGER);\n })", "language": "typescript", "source_file": "./repos/Zajno/common-utils/packages/common/src/logger/__tests__/logger.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Zajno/common-utils", "url": "https://github.com/Zajno/common-utils.git", "license": "MIT", "stars": 5, "forks": 2}, "metrics": null, "summary": "`batchLoggers` correctly calls specified logging methods, ensuring both console and custom loggers receive the batched logs with appropriate arguments.", "mode": "fast-check"} {"id": 60515, "name": "unknown", "code": "test('should verify residential phone numbers', () =>\n fc.assert(\n fc.property(residentialPhone(), (phone) =>\n isResidentialPhoneNumber(phone)\n )\n ))", "language": "typescript", "source_file": "./repos/jonathanpalma/sivar-utils/src/lib/__tests__/telephones.test.ts", "start_line": null, "end_line": null, "dependencies": ["residentialPhone"], "repo": {"name": "jonathanpalma/sivar-utils", "url": "https://github.com/jonathanpalma/sivar-utils.git", "license": "MIT", "stars": 37, "forks": 9}, "metrics": null, "summary": "Residential phone numbers should satisfy `isResidentialPhoneNumber`.", "mode": "fast-check"} {"id": 60628, "name": "unknown", "code": "it('should be the number if we just walk in a straight line', () =>\n fc.assert(\n fc.property(\n fc.integer().filter((n) => n > 0),\n (dist) => {\n const instruction = goRight(dist);\n const actual = calcShortestDistance([instruction]);\n expect(actual).to.equal(dist);\n }\n )\n ))", "language": "typescript", "source_file": "./repos/comradevanti-katas/AdventOfCode/2016/day-1/src/domain.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "comradevanti-katas/AdventOfCode", "url": "https://github.com/comradevanti-katas/AdventOfCode.git", "license": "Unlicense", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should hold that when walking a straight line, the shortest distance calculated from a single instruction equals the distance specified by that instruction.", "mode": "fast-check"} {"id": 60631, "name": "unknown", "code": "it('should be able to walk in a circle n times', () =>\n fc.assert(\n fc.property(fc.integer({ min: 1, max: 20 }), (n) => {\n // The input is n times ULDR, ie. walking in a circle\n let input = repeat('ULDR', n).join();\n\n let password = solveBathroomCode(input);\n\n // Which should bring us back to where we started\n expect(password).to.equal(5);\n })\n ))", "language": "typescript", "source_file": "./repos/comradevanti-katas/AdventOfCode/2016/day-2/src/domain.spec.ts", "start_line": null, "end_line": null, "dependencies": ["repeat"], "repo": {"name": "comradevanti-katas/AdventOfCode", "url": "https://github.com/comradevanti-katas/AdventOfCode.git", "license": "Unlicense", "stars": 0, "forks": 0}, "metrics": null, "summary": "Walking in a circle `n` times using the sequence 'ULDR' should result in the `solveBathroomCode` function producing a password equal to 5.", "mode": "fast-check"} {"id": 60630, "name": "unknown", "code": "it('should be able to walk back and forth n times', () =>\n fc.assert(\n fc.property(fc.integer({ min: 1, max: 20 }), (n) => {\n // The input is n times RL, ie. walking back and forth\n let input = repeat('RL', n).join();\n\n let password = solveBathroomCode(input);\n\n // Which should bring us back to where we started\n expect(password).to.equal(5);\n })\n ))", "language": "typescript", "source_file": "./repos/comradevanti-katas/AdventOfCode/2016/day-2/src/domain.spec.ts", "start_line": null, "end_line": null, "dependencies": ["repeat"], "repo": {"name": "comradevanti-katas/AdventOfCode", "url": "https://github.com/comradevanti-katas/AdventOfCode.git", "license": "Unlicense", "stars": 0, "forks": 0}, "metrics": null, "summary": "Walking back and forth 'n' times with input 'RL' should result in the password being 5.", "mode": "fast-check"} {"id": 60632, "name": "unknown", "code": "it('should end up on bottom edge if we go down a bunch', () =>\n fc.assert(\n fc.property(dirSequence, (sequence) => {\n // We go some random sequence and then down a bunch\n let input = sequence + 'DDDD';\n\n let password = solveBathroomCode(input);\n\n // We should be at the bottom edge now\n\n expect(password).to.be.greaterThanOrEqual(7);\n expect(password).to.be.lessThanOrEqual(9);\n })\n ))", "language": "typescript", "source_file": "./repos/comradevanti-katas/AdventOfCode/2016/day-2/src/domain.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "comradevanti-katas/AdventOfCode", "url": "https://github.com/comradevanti-katas/AdventOfCode.git", "license": "Unlicense", "stars": 0, "forks": 0}, "metrics": null, "summary": "Moving down repeatedly results in a final position on the bottom edge, producing a password between 7 and 9.", "mode": "fast-check"} {"id": 60629, "name": "unknown", "code": "it('password length matches line count', () =>\n fc.assert(\n fc.property(fc.integer({ min: 1, max: 20 }), (count) => {\n let input = repeat('U', count).join(EOL);\n let password = solveBathroomCode(input);\n\n expect(password?.toString()).to.have.length(count);\n })\n ))", "language": "typescript", "source_file": "./repos/comradevanti-katas/AdventOfCode/2016/day-2/src/domain.spec.ts", "start_line": null, "end_line": null, "dependencies": ["repeat"], "repo": {"name": "comradevanti-katas/AdventOfCode", "url": "https://github.com/comradevanti-katas/AdventOfCode.git", "license": "Unlicense", "stars": 0, "forks": 0}, "metrics": null, "summary": "The password length should match the number of input lines.", "mode": "fast-check"} {"id": 55532, "name": "unknown", "code": "it(\"returns These Right for only Either Rights\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.anything(), { minLength: 1 }), xs => {\n\t\t\t\t\tconst ys = pipe(\n\t\t\t\t\t\txs as ReadonlyArray as ReadonlyNonEmptyArray,\n\t\t\t\t\t\tRNEA.map(E.right),\n\t\t\t\t\t)\n\n\t\t\t\t\texpect(f(ys)).toEqual(T.right(xs))\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` should return `These Right` when processing an array comprised solely of `Either Right` values.", "mode": "fast-check"} {"id": 55535, "name": "unknown", "code": "it(\"equivaent to stricter separate\", () => {\n\t\t\tconst g = A.separate\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.boolean(), { minLength: 1 }), xs => {\n\t\t\t\t\tconst ys: ReadonlyNonEmptyArray> = pipe(\n\t\t\t\t\t\txs as ReadonlyArray as ReadonlyNonEmptyArray,\n\t\t\t\t\t\tRNEA.map(b => (b ? E.right(b) : E.left(b))),\n\t\t\t\t\t)\n\n\t\t\t\t\tconst nea: ReadonlyNonEmptyArray = pipe(\n\t\t\t\t\t\tys,\n\t\t\t\t\t\tf,\n\t\t\t\t\t\tT.match(identity, identity, (ls, rs) => RNEA.concat(ls)(rs)),\n\t\t\t\t\t)\n\n\t\t\t\t\tconst notNea: ReadonlyArray = pipe(\n\t\t\t\t\t\tys,\n\t\t\t\t\t\tg,\n\t\t\t\t\t\t({ left, right }) => A.concat(left)(right),\n\t\t\t\t\t)\n\n\t\t\t\t\texpect(nea).toEqual(notNea)\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The test checks that transforming and separating a non-empty array of booleans into two categories using a stricter function produces the same result as using a simpler separation function.", "mode": "fast-check"} {"id": 55538, "name": "unknown", "code": "it(\"extracts expected Task from a ReaderTask\", async () => {\n\t\t\ttype Env = { dependency: string }\n\t\t\tconst env: Env = { dependency: \"dependency\" }\n\t\t\tawait fc.assert(\n\t\t\t\tfc.asyncProperty(fc.integer(), async _ => {\n\t\t\t\t\tconst extractedTask = pipe(\n\t\t\t\t\t\tRT.of(_),\n\t\t\t\t\t\trunReaderTask(env),\n\t\t\t\t\t)()\n\t\t\t\t\tawait expect(extractedTask).resolves.toBe(_)\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReaderTask.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "A `ReaderTask` extracts a `Task` which resolves to the expected integer when run with a given environment.", "mode": "fast-check"} {"id": 55541, "name": "unknown", "code": "it(\"extracts expected Either left from a ReaderEither\", () => {\n\t\t\ttype Env = { dependency: string }\n\t\t\tconst env: Env = { dependency: \"dependency\" }\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.integer(), _ => {\n\t\t\t\t\tconst re: RE.ReaderEither = pipe(\n\t\t\t\t\t\tE.left(_),\n\t\t\t\t\t\tRE.fromEither,\n\t\t\t\t\t)\n\t\t\t\t\tconst extractedLeft = pipe(re, runReaderEither(env))\n\t\t\t\t\texpect(extractedLeft).toStrictEqual(E.left(_))\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReaderEither.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Extracts the expected `Either` left value from a `ReaderEither` given an environment.", "mode": "fast-check"} {"id": 55533, "name": "unknown", "code": "it(\"returns These Both for only mixed Eithers\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.anything(), { minLength: 1 }),\n\t\t\t\t\tfc.array(fc.anything(), { minLength: 1 }),\n\t\t\t\t\t(xs, ys) => {\n\t\t\t\t\t\tconst zs = RNEA.concat(\n\t\t\t\t\t\t\tpipe(\n\t\t\t\t\t\t\t\txs as ReadonlyArray as ReadonlyNonEmptyArray,\n\t\t\t\t\t\t\t\tRNEA.map(E.left),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t)(\n\t\t\t\t\t\t\tpipe(\n\t\t\t\t\t\t\t\tys as ReadonlyArray as ReadonlyNonEmptyArray,\n\t\t\t\t\t\t\t\tRNEA.map(E.right),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t)\n\n\t\t\t\t\t\texpect(f(zs)).toEqual(T.both(xs, ys))\n\t\t\t\t\t\texpect(f(RNEA.reverse(zs))).toEqual(\n\t\t\t\t\t\t\tT.both(A.reverse(xs), A.reverse(ys)),\n\t\t\t\t\t\t)\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Ensures that for a concatenated array of mixed `Eithers` (left and right), the function `f` returns `These Both` with the respective arrays, even when reversed.", "mode": "fast-check"} {"id": 55539, "name": "unknown", "code": "it(\"extracts expected IO from a ReaderIO\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.integer(), n => {\n\t\t\t\t\tconst extractedIO = pipe(\n\t\t\t\t\t\tRIO.of(n),\n\t\t\t\t\t\trunReaderIO(\"env\"),\n\t\t\t\t\t)()\n\n\t\t\t\t\texpect(extractedIO).toBe(n)\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReaderIO.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`ReaderIO` extracts the expected IO value when executed with a given environment, matching the initial integer input.", "mode": "fast-check"} {"id": 55542, "name": "unknown", "code": "it(\"returns predictable output on singleton input\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.anything(), x => expect(f([x])()).toEqual([x, []])),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Random.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Function `f` should return a tuple containing the single element followed by an empty array when given a singleton array as input.", "mode": "fast-check"} {"id": 55545, "name": "unknown", "code": "it(\"wraps provied value in Some given a Some containing a different value\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string(), x =>\n\t\t\t\t\texpect(f(x)(O.some(`${x}!`))).toEqual(O.some(x)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "A function wraps the provided string value into `Some`, given an existing `Some` containing a different string.", "mode": "fast-check"} {"id": 56285, "name": "unknown", "code": "it(\"should be equivalent to multiple flatMapFail calls\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), fc.integer({ min: 1 })),\n fc.constant((n: number) => new Fail(collatz(n))),\n flatMapFailUntilEquivalence,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`flatMapFailUntilEquivalence` behaves the same as multiple `flatMapFail` calls when applied to a result with a failure-generating function.", "mode": "fast-check"} {"id": 56288, "name": "unknown", "code": "it(\"should agree with isSomeAnd\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), fc.anything()),\n fc.func(fc.boolean()),\n isFailAndDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property asserts consistency between a generated result and the `isSomeAnd` function using a predicate function.", "mode": "fast-check"} {"id": 56291, "name": "unknown", "code": "it(\"should agree with transposeMap\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), fc.anything()),\n fc.func(option(fc.anything())),\n transposeMapOkayDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The output of `result` with a function on options should be consistent with `transposeMapOkayDefinition`.", "mode": "fast-check"} {"id": 56293, "name": "unknown", "code": "it(\"should agree with transposeMap\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(option(fc.anything()), option(fc.anything())),\n transposeDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks if applying `transposeDefinition` to results from `result` using `option(fc.anything())` is consistent with `transposeMap`.", "mode": "fast-check"} {"id": 56295, "name": "unknown", "code": "it(\"should agree with transposeMap\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), option(fc.anything())),\n transposeFailDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Result transposition should align with the `transposeMap` function.", "mode": "fast-check"} {"id": 56298, "name": "unknown", "code": "it(\"should agree with unzipWith\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(\n pair(fc.anything(), fc.anything()),\n pair(fc.anything(), fc.anything()),\n ),\n unzipDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test ensures that the result of a property agrees with the behavior of `unzipWith` applied to pairs of arbitrary values.", "mode": "fast-check"} {"id": 56301, "name": "unknown", "code": "it(\"should agree with collectMapFst\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(\n pair(fc.anything(), fc.anything()),\n pair(fc.anything(), fc.anything()),\n ),\n collectFstDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property tests that applying `collectMapFst` to random pairs agrees with the `collectFstDefinition` function.", "mode": "fast-check"} {"id": 55582, "name": "unknown", "code": "it(\"maintains newtype contract\", () => {\n\t\t\tfc.assert(fc.property(fc.string(), arb, (x, y) => pipe(y, f(x), isValid)))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/NonEmptyString.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The property ensures that the transformation of a string `y` using function `f` on input `x` results in a valid newtype.", "mode": "fast-check"} {"id": 55585, "name": "unknown", "code": "it(\"is equivalent to lifted Str.surround\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.string(),\n\t\t\t\t\tarb,\n\t\t\t\t\t(x, y) =>\n\t\t\t\t\t\tStr.surround(x)(unNonEmptyString(y)) === unNonEmptyString(f(x)(y)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/NonEmptyString.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Verifies that applying `Str.surround` matches the result of a function `f` when both are used with a non-empty string.", "mode": "fast-check"} {"id": 55583, "name": "unknown", "code": "it(\"is equivalent to lifted Str.prepend\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.string(),\n\t\t\t\t\tarb,\n\t\t\t\t\t(x, y) =>\n\t\t\t\t\t\tStr.prepend(x)(unNonEmptyString(y)) === unNonEmptyString(f(x)(y)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/NonEmptyString.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`Str.prepend` applied to a string and then unwrapped should be equivalent to the operation when unwrapping after applying `f` to `NonEmptyString`.", "mode": "fast-check"} {"id": 55586, "name": "unknown", "code": "it(\"maintains newtype contract\", () => {\n\t\t\tfc.assert(fc.property(fc.string(), arb, (x, y) => pipe(y, f(x), isValid)))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/NonEmptyString.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` applied to strings `x` and `y` maintains the `isValid` property within the newtype contract.", "mode": "fast-check"} {"id": 55589, "name": "unknown", "code": "it(\"is equivalent to lifted Str.toLowerCase\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tarb,\n\t\t\t\t\tx => _toLowerCase(unNonEmptyString(x)) === unNonEmptyString(f(x)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/NonEmptyString.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`_toLowerCase` applied to a string is equivalent to applying `f` on a non-empty string and then extracting it with `unNonEmptyString`.", "mode": "fast-check"} {"id": 55595, "name": "unknown", "code": "it(\"is equivalent to lifted infallible Str.last\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tarb,\n\t\t\t\t\tx =>\n\t\t\t\t\t\tunsafeUnwrap(Str.last(unNonEmptyString(x))) ===\n\t\t\t\t\t\tunNonEmptyString(f(x)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/NonEmptyString.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The property should hold that the last character of a non-empty string, when accessed through `Str.last` and wrapped using `unsafeUnwrap`, is equivalent to the result of applying `f` to the non-empty string and unwrapping it.", "mode": "fast-check"} {"id": 55599, "name": "unknown", "code": "it(\"is equivalent to lifted Str.split\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.lorem({ mode: \"words\" }).map(unsafeFromString), x =>\n\t\t\t\t\texpect(f(sep)(x)).toEqual(_split(sep)(unNonEmptyString(x))),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/NonEmptyString.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f(sep)(x)` should yield the same result as `_split(sep)(unNonEmptyString(x))` for any non-empty string derived from lorem word data.", "mode": "fast-check"} {"id": 56286, "name": "unknown", "code": "it(\"should be its own inverse\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(result(fc.anything(), fc.anything()), commuteInverse),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should hold that applying `commuteInverse` to a `result` with any values results in the original `result`.", "mode": "fast-check"} {"id": 56289, "name": "unknown", "code": "it(\"should agree with isNoneOr\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), fc.anything()),\n fc.func(fc.boolean()),\n isOkayOrDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `isOkayOrDefinition` should be consistent with the behavior of `isNoneOr` when tested across various inputs.", "mode": "fast-check"} {"id": 56292, "name": "unknown", "code": "it(\"should agree with transposeMap\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), fc.anything()),\n fc.func(option(fc.anything())),\n transposeMapFailDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Agreement between the behavior of a `result` transformed by a function and its mapping through `transposeMapFailDefinition`.", "mode": "fast-check"} {"id": 56297, "name": "unknown", "code": "it(\"should agree with unzipWith\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), fc.anything()),\n fc.func(pair(fc.anything(), fc.anything())),\n unzipWithFailDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "An agreement should occur between the `result` function and `unzipWith`, given any pair transformed by a function.", "mode": "fast-check"} {"id": 56299, "name": "unknown", "code": "it(\"should agree with unzipWith\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(pair(fc.anything(), fc.anything()), fc.anything()),\n unzipOkayDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function being tested agrees with `unzipWith` when handling pairs of arbitrary values.", "mode": "fast-check"} {"id": 56303, "name": "unknown", "code": "it(\"should agree with collectMapOkay\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), fc.anything()),\n fc.func(result(fc.anything(), fc.anything())),\n exchangeMapFailDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function agrees with `collectMapOkay` when applied to the `result` of arbitrary values and a function result.", "mode": "fast-check"} {"id": 56294, "name": "unknown", "code": "it(\"should agree with transposeMap\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(option(fc.anything()), fc.anything()),\n transposeOkayDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function being tested should consistently align with the behavior defined by `transposeMap`, according to the rules in `transposeOkayDefinition`.", "mode": "fast-check"} {"id": 56523, "name": "unknown", "code": "it('is the same as find on the reversed array', () => {\r\n fc.assert(\r\n fc.property(fc.array(fc.integer()), (arr) => {\r\n const pred = (x: number) => x % 2 === 0;\r\n const expected = arr.slice().reverse().find(pred);\r\n const result = findLast(pred)(arr);\r\n assert.strictEqual(result, expected);\r\n }),\r\n );\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`findLast` applied to an array should produce the same result as `find` applied to the reversed array.", "mode": "fast-check"} {"id": 56526, "name": "unknown", "code": "it('should parse a valid value', () => {\r\n fc.assert(\r\n fc.property(fc.anything(), fc.anything(), (input, output) => {\r\n const decoder = define<{ output: unknown }>((_, ok) => ok({ output }));\r\n const handler = new OptionsHandler(decoder);\r\n assert.deepStrictEqual(handler.parse(input), { output });\r\n }),\r\n );\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/opts-handlers.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`OptionsHandler` should correctly parse any input to match the expected output using a defined decoder.", "mode": "fast-check"} {"id": 56529, "name": "unknown", "code": "it('should throw a OptionParseError with a prefixed message on a decoding failure if field present', () => {\r\n fc.assert(\r\n fc.property(fc.anything(), fc.string(), fc.string(), (input, errMsg, field) => {\r\n const decoder = define<{ value: unknown }>((_, __, err) => err(errMsg));\r\n const handler = new OptionsHandler(decoder);\r\n\r\n assert.throws(() => handler.parse(input, field), (err) => {\r\n assert.ok(err instanceof OptionParseError);\r\n assert.ok(err.message.startsWith(`Error parsing '${field}': `));\r\n assert.ok(err.message.includes(errMsg));\r\n return true;\r\n });\r\n }),\r\n );\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/opts-handlers.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "An `OptionParseError` should be thrown with a message prefixed by the field name on decoding failure.", "mode": "fast-check"} {"id": 56302, "name": "unknown", "code": "it(\"should agree with collectMapSnd\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(\n pair(fc.anything(), fc.anything()),\n pair(fc.anything(), fc.anything()),\n ),\n collectSndDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should hold that the `result` function agrees with the behavior defined by `collectMapSnd` when applied to pairs of arbitrary values.", "mode": "fast-check"} {"id": 56525, "name": "unknown", "code": "it('should appear the exact same as string.split()', () => {\r\n fc.assert(\r\n fc.property(fc.string(), fc.string(), (str, sep) => {\r\n if (sep === '') {\r\n return;\r\n }\r\n const expected = str.split(sep);\r\n const result = splitWithIncludesCheck(str, sep);\r\n assert.deepStrictEqual(result, expected);\r\n }),\r\n );\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The function `splitWithIncludesCheck` should produce the same output as `string.split()` for non-empty separator strings.", "mode": "fast-check"} {"id": 56527, "name": "unknown", "code": "it('should parse a valid value within an object', () => {\r\n const objArb = fc.tuple(fc.object({ withNullPrototype: false }), fc.string(), fc.anything())\r\n .filter(([_, field]) => {\r\n return !field.includes('.');\r\n })\r\n .map(([obj, field, value]) => {\r\n obj[field] = value;\r\n return [obj, field, value];\r\n });\r\n\r\n fc.assert(\r\n fc.property(objArb, fc.string(), ([obj, field, value], fieldPrefix) => {\r\n const decoder = define<{ output: unknown }>((input, ok) => ok({ output: input }));\r\n const handler = new OptionsHandler(decoder);\r\n assert.deepStrictEqual(handler.parseWithin(obj, `${fieldPrefix}.${field}`), { output: value });\r\n }),\r\n );\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/opts-handlers.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The `OptionsHandler` should correctly parse a specified field value within an object when accessed with a field prefix.", "mode": "fast-check"} {"id": 56530, "name": "unknown", "code": "it('should rethrow the underlying error if not a decoding error when parsing', () => {\r\n fc.assert(\r\n fc.property(fc.anything(), fc.string(), (input, errMsg) => {\r\n const decoder = define<{ value: unknown }>(() => {\r\n throw new Error(errMsg);\r\n });\r\n const handler = new OptionsHandler(decoder);\r\n\r\n assert.throws(() => handler.parse(input), (err) => {\r\n assert.ok(err instanceof Error);\r\n assert.ok(!(err instanceof OptionParseError));\r\n assert.strictEqual(err.message, errMsg);\r\n return true;\r\n });\r\n }),\r\n );\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/opts-handlers.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "An error that is not an `OptionParseError` should be rethrown with its original message when parsing with `OptionsHandler`.", "mode": "fast-check"} {"id": 56524, "name": "unknown", "code": "it('should set the right state when advanced', () => {\r\n const qs = new QueryState();\r\n\r\n fc.assert(\r\n fc.property(fc.option(fc.anything()), (value) => {\r\n qs.swap(value);\r\n\r\n if (isNullish(value)) {\r\n assert.strictEqual(qs.state, QueryState.NotFound);\r\n assert.strictEqual(qs.unwrap(), null);\r\n } else {\r\n assert.strictEqual(qs.state, QueryState.Found);\r\n assert.strictEqual(qs.unwrap(), value);\r\n }\r\n }),\r\n );\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The state of `QueryState` should be `NotFound` with `null` value when swapped with a nullish input, and `Found` with the input value when swapped with a non-nullish input.", "mode": "fast-check"} {"id": 56528, "name": "unknown", "code": "it('should throw a OptionParseError on a decoding failure', () => {\r\n fc.assert(\r\n fc.property(fc.anything(), fc.string(), (input, errMsg) => {\r\n const decoder = define<{ value: unknown }>((_, __, err) => err(errMsg));\r\n const handler = new OptionsHandler(decoder);\r\n\r\n assert.throws(() => handler.parse(input), (err) => {\r\n assert.ok(err instanceof OptionParseError);\r\n assert.ok(err.message.includes(errMsg));\r\n return true;\r\n });\r\n }),\r\n );\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/opts-handlers.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "An `OptionParseError` is thrown by `OptionsHandler` when the `decoder` fails with a specified error message.", "mode": "fast-check"} {"id": 56531, "name": "unknown", "code": "it('should find the right-most non-undefined value', () => {\r\n fc.assert(\r\n fc.property(fc.array(nonNullArb), (values) => {\r\n const result = monoids.optional().concat(values);\r\n assert.strictEqual(result, values.reverse().find((x) => x !== undefined));\r\n }),\r\n );\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/opts-handlers.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "The test verifies that `monoids.optional().concat(values)` finds the right-most non-undefined value in an array.", "mode": "fast-check"} {"id": 56537, "name": "unknown", "code": "it('should return two headers (access & secret)', () => {\n fc.assert(\n fc.property(fc.string(), fc.string(), (accessKeyId, secretAccessKey) => {\n const provider = new AWSEmbeddingHeadersProvider(accessKeyId, secretAccessKey);\n\n assert.deepStrictEqual(provider.getHeaders(untouchable()), {\n 'x-embedding-access-id': accessKeyId,\n 'x-embedding-secret-id': secretAccessKey,\n });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/headers-providers/embedding/aws-embedding-headers-provider.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`AWSEmbeddingHeadersProvider` returns headers containing the provided access key and secret key.", "mode": "fast-check"} {"id": 56539, "name": "unknown", "code": "it('returns the same value for varargs, arrays, template strings, and other arbitrary iterables', () => {\r\n fc.assert(\r\n fc.property(PathSegmentsArb, (arr) => {\r\n const iterator = (function* () {\r\n yield* arr;\r\n })();\r\n\r\n const control = escapeFieldNames(arr);\r\n\r\n assert.deepStrictEqual(control, escapeFieldNames(...arr));\r\n assert.deepStrictEqual(control, escapeFieldNames(iterator));\r\n\r\n const templateStrArr = ['', ...Array.from({ length: arr.length - 1 }, (_) => `.`) ,''];\r\n (templateStrArr as any).raw = null;\r\n assert.deepStrictEqual(control, escapeFieldNames(templateStrArr as unknown as TemplateStringsArray, ...arr));\r\n }),\r\n );\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/field-escaping.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`escapeFieldNames` produces consistent results when given varargs, arrays, template strings, and other arbitrary iterables.", "mode": "fast-check"} {"id": 56543, "name": "unknown", "code": "it('should error if there is an empty path segment' , () => {\r\n assert.throws(() => unescapeFieldPath('a..b'), { message: `Invalid field path 'a..b'; empty segment found at position 2` });\r\n\r\n const arb = fc.tuple(NEStringPathSegArb, NEStringPathSegArb).map(([s1, s2]) => [s1.length + 1, `${s1}..${s2}`] as const);\r\n\r\n const prop = fc.property(arb, ([errorPos, invalidPath]) => {\r\n assert.throws(() => unescapeFieldPath(invalidPath), { message: `Invalid field path '${invalidPath}'; empty segment found at position ${errorPos}` });\r\n });\r\n fc.assert(prop);\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/field-escaping.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Errors are thrown for field paths containing empty segments, with correct position details in the error message.", "mode": "fast-check"} {"id": 56304, "name": "unknown", "code": "it(\"should agree with collectMapOkay\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), fc.anything()),\n fc.func(result(fc.anything(), fc.anything())),\n associateMapLeftDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`collectMapOkay` should produce results consistent with a predefined association map transformation over arbitrary input results and functions.", "mode": "fast-check"} {"id": 56308, "name": "unknown", "code": "it(\"should agree with collectMapOkay\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), result(fc.anything(), fc.anything())),\n associateLeftDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`collectMapOkay` should have consistent behavior with `associateLeftDefinition` across multiple inputs.", "mode": "fast-check"} {"id": 56310, "name": "unknown", "code": "it(\"should agree with collectMapFail\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), fc.anything()),\n fc.func(result(fc.anything(), fc.anything())),\n exchangeMapOkayDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function being tested should consistently agree with `collectMapFail` when using a result object and a result-producing function.", "mode": "fast-check"} {"id": 56313, "name": "unknown", "code": "it(\"should agree with collectMapFail\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), result(fc.anything(), fc.anything())),\n exchangeOkayDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function being tested should agree with the behavior of `collectMapFail` when passed through `exchangeOkayDefinition`.", "mode": "fast-check"} {"id": 56305, "name": "unknown", "code": "it(\"should agree with collectMapOkay\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(\n result(fc.anything(), fc.anything()),\n result(fc.anything(), fc.anything()),\n ),\n collectOkayDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function under test should match the behavior of `collectMapOkay` when applied to nested results.", "mode": "fast-check"} {"id": 56307, "name": "unknown", "code": "it(\"should be its own inverse\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(result(fc.anything(), fc.anything()), fc.anything()),\n exchangeFailInverse,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `exchangeFailInverse` ensures that applying it twice to a result type returns the original value.", "mode": "fast-check"} {"id": 56311, "name": "unknown", "code": "it(\"should agree with collectMapFail\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(fc.anything(), fc.anything()),\n fc.func(result(fc.anything(), fc.anything())),\n associateMapRightDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property ensures that a result generated and transformed by a function agrees with the behavior defined by `collectMapFail` when using `associateMapRightDefinition`.", "mode": "fast-check"} {"id": 56306, "name": "unknown", "code": "it(\"should agree with collectMapOkay\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(result(fc.anything(), fc.anything()), fc.anything()),\n exchangeFailDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property verifies that the behavior of a function or result agrees with the `collectMapOkay` function when using randomly generated results and applying the `exchangeFailDefinition`.", "mode": "fast-check"} {"id": 56309, "name": "unknown", "code": "it(\"should be the inverse of associateRight\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(result(fc.anything(), fc.anything()), fc.anything()),\n associateLeftInverse,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Applying `associateLeftInverse` to the output of `associateRight` should yield the original result structure.", "mode": "fast-check"} {"id": 56312, "name": "unknown", "code": "it(\"should agree with collectMapFail\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(\n result(fc.anything(), fc.anything()),\n result(fc.anything(), fc.anything()),\n ),\n collectFailDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`collectMapFail` should produce results consistent with a certain property defined for nested `result` structures containing arbitrary values.", "mode": "fast-check"} {"id": 56317, "name": "unknown", "code": "it(\"should agree with distribute\", () => {\n expect.assertions(100);\n\n fc.assert(\n fc.property(\n result(\n result(fc.anything(), fc.anything()),\n result(fc.anything(), fc.anything()),\n ),\n distributeMapDefinition,\n ),\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/aang/tests/result.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/aang", "url": "https://github.com/aaditmshah/aang.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The result of the function should agree with the `distribute` function when applying the `distributeMapDefinition` logic.", "mode": "fast-check"} {"id": 56522, "name": "unknown", "code": "it('returns undefined or the fallback if no element matches', () => {\r\n assert.strictEqual(findLast((x) => x === 3)([1, 2, 4, 5]), undefined);\r\n assert.strictEqual(findLast((x) => x === 3, 3)([1, 2, 4, 5]), 3);\r\n\r\n fc.assert(\r\n fc.property(fc.array(fc.anything()), fc.anything(), fc.anything(), (arr, target, fallback) => {\r\n const pred = (x: unknown) => x === target;\r\n fc.pre(arr.every(negate(pred)));\r\n\r\n assert.strictEqual(findLast(pred)(arr), undefined);\r\n assert.strictEqual(findLast(pred, fallback)(arr), fallback);\r\n }),\r\n );\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`findLast` returns `undefined` if no elements match the predicate, or a fallback value if provided, when no element matches.", "mode": "fast-check"} {"id": 56554, "name": "unknown", "code": "it('should return true for any same arrays', () => {\n fc.assert(\n fc.property(fc.clone(arbs.path(), 2), ([arr1, arr2]) => {\n assert.ok(pathArraysEqual(arr1, arr2));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/api/serdes/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`pathArraysEqual` returns true for any two identical arrays.", "mode": "fast-check"} {"id": 56624, "name": "unknown", "code": "it('should create blobs of each type', () => {\n fc.assert(\n fc.property(blobLikeArb, (blobLike) => {\n assert.deepStrictEqual(new DataAPIBlob(blobLike).raw(), blobLike);\n assert.deepStrictEqual(blob(blobLike).raw(), blobLike);\n assert.deepStrictEqual(blob(blob(blobLike)).raw(), blobLike);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/datatypes/blob.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`DataAPIBlob` and `blob` functions should produce blobs that retain their original structure when accessed with `.raw()`.", "mode": "fast-check"} {"id": 56520, "name": "unknown", "code": "it('is the same for positive and negative numbers', () => {\r\n fc.assert(\r\n fc.property(fc.integer(), (n) => {\r\n assert.strictEqual(numDigits(n), numDigits(-n));\r\n }),\r\n );\r\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/lib/utils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`numDigits` returns the same result for both positive and negative integers.", "mode": "fast-check"} {"id": 56761, "name": "unknown", "code": "it(\"should keep all the tasks for the scheduled plan\", () => {\n fc.assert(\n fc.property(tasksArbitrary(), (tasks) => {\n // Arrange / Act\n const schedule = christmasFactorySchedule(tasks);\n\n // Assert\n expect(schedule).toHaveLength(tasks.length);\n const tasksFromSchedule = new Set(schedule.map((t) => t.taskId));\n const tasksFromRequest = new Set(tasks.map((t) => t.taskId));\n expect(tasksFromSchedule).toEqual(tasksFromRequest);\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-24.spec.ts", "start_line": null, "end_line": null, "dependencies": ["tasksArbitrary"], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "All tasks in the scheduled plan should match the original set of tasks, maintaining the same total number and IDs.", "mode": "fast-check"} {"id": 56628, "name": "unknown", "code": "it('should convert between all types on the server', () => {\n fc.assert(\n fc.property(allBlobLikeArb, ([buff, arrBuff, binary]) => {\n const blobs = [blob(buff), blob(arrBuff), blob(binary), blob(blob(buff))];\n\n for (const blb of blobs) {\n assert.strictEqual(blb.asBase64(), binary.$binary);\n assert.deepStrictEqual(blb.asBuffer(), buff);\n assert.deepStrictEqual(blb.asArrayBuffer(), arrBuff);\n }\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/datatypes/blob.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Verifies that the `blob` function correctly converts multiple input types to base64, buffer, and array buffer representations, matching expected values.", "mode": "fast-check"} {"id": 56760, "name": "unknown", "code": "it(\"never deadlocks\", () =>\n fc.assert(\n fc.asyncProperty(\n fc.array(fc.tuple(fc.nat(100), fc.nat(10), fc.nat(10), fc.boolean()), 100),\n (acquires) => {\n const eff = T.chain_(makeSemaphore(100), (sem) =>\n pipe(\n acquires,\n array.traverse(T.effect)(([n, pre, post, int]) =>\n sem.withPermitsN(\n n,\n pipe(\n int ? T.raiseInterrupt : T.after(post),\n T.liftDelay(pre),\n T.fork\n )\n )\n ),\n T.chain(array.traverse(T.effect)((f) => f.wait)),\n (result) => T.applySecond(result, sem.available)\n )\n )\n return expectExit(eff, ex.done(100))\n }\n )\n ))", "language": "typescript", "source_file": "./repos/Matechs-Digital/matechs-effect-legacy/packages/core/test/Semaphore.test.ts", "start_line": null, "end_line": null, "dependencies": ["expectExit"], "repo": {"name": "Matechs-Digital/matechs-effect-legacy", "url": "https://github.com/Matechs-Digital/matechs-effect-legacy.git", "license": "MIT", "stars": 5, "forks": 1}, "metrics": null, "summary": "A semaphore with 100 permits should never result in a deadlock, ensuring that all executions complete and the semaphore reports 100 permits available afterward.", "mode": "fast-check"} {"id": 56763, "name": "unknown", "code": "it(\"should not start any task before all its dependencies ended\", () => {\n fc.assert(\n fc.property(tasksArbitrary(), (tasks) => {\n // Arrange / Act\n const schedule = christmasFactorySchedule(tasks);\n\n // Assert\n for (const scheduledTask of schedule) {\n const dependencies = tasks.find(\n (t) => t.taskId === scheduledTask.taskId\n )!.dependsOnTasks;\n for (const depTaskId of dependencies) {\n const depScheduledTask = schedule.find((s) => s.taskId === depTaskId);\n expect(scheduledTask.start).toBeGreaterThanOrEqual(\n depScheduledTask.finish\n );\n }\n }\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-24.spec.ts", "start_line": null, "end_line": null, "dependencies": ["tasksArbitrary"], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "A task should only begin after all its dependencies have been completed, as verified by the task schedule generated by `christmasFactorySchedule`.", "mode": "fast-check"} {"id": 56785, "name": "unknown", "code": "it(\"should detect any valid palindrome having odd number of characters\", () => {\n fc.assert(\n fc.property(fc.fullUnicodeString(), fc.fullUnicode(), (start, c) => {\n // Arrange\n const reversedStart = [...start].reverse().join(\"\");\n const palindrome = `${start}${c}${reversedStart}`;\n\n // Act / Assert\n expect(isPalindrome(palindrome)).toBe(true);\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-18.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Palindromes with an odd character count should be recognized as valid by `isPalindrome`.", "mode": "fast-check"} {"id": 56813, "name": "unknown", "code": "it(\"should request source.length changes to move from source to empty\", () => {\n fc.assert(\n fc.property(fc.fullUnicodeString(), (source) => {\n // Arrange / Act\n const numChanges = minimalNumberOfChangesToBeOther(source, \"\");\n\n // Assert\n expect(numChanges).toBe([...source].length);\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-10.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`minimalNumberOfChangesToBeOther` returns the length of the source string when changing it to an empty string.", "mode": "fast-check"} {"id": 56801, "name": "unknown", "code": "it(\"should respect the constraints when filling the grid\", () => {\n fc.assert(\n fc.property(\n fc\n .record({\n numRows: fc.integer({ min: 1, max: 10 }),\n numColumns: fc.integer({ min: 1, max: 10 }),\n })\n .chain(({ numRows, numColumns }) =>\n fc.array(\n fc.array(fc.constantFrom(\".\", \"x\"), {\n minLength: numColumns,\n maxLength: numColumns,\n }),\n { minLength: numRows, maxLength: numRows }\n )\n ),\n (initialGrid) => {\n // Arrange\n const constraints = gridToConstraints(initialGrid);\n\n // Act\n const solution = nonogramSolver(constraints.rows, constraints.columns);\n\n // Assert\n const gridSolution = solution.split(\"\\n\").map((line) => line.split(\"\"));\n expect(gridToConstraints(gridSolution)).toEqual(constraints);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-13.spec.ts", "start_line": null, "end_line": null, "dependencies": ["gridToConstraints"], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "When filling a grid based on given constraints, the resulting solution should match the initial constraints derived from the input grid.", "mode": "fast-check"} {"id": 56809, "name": "unknown", "code": "it(\"should move disk on top of a larger disk or empty pillar\", () => {\n fc.assert(\n fc.property(\n fc.constantFrom(0, 1, 2),\n fc.constantFrom(0, 1, 2),\n fc.integer({ min: 0, max: 10 }),\n (startPosition, endPosition, towerHeight) => {\n // Arrange\n const stacks = buildInitialStacks(startPosition, towerHeight);\n\n // Act / Assert\n const move = (from: number, to: number) => {\n expect(stacks[from]).not.toEqual([]); // we need to move something\n const head = stacks[from].pop()!;\n if (stacks[to].length !== 0) {\n const headTo = stacks[to][stacks[to].length - 1];\n expect(head).toBeLessThan(headTo); // we need to move it on larger disks\n } // or empty pillar\n stacks[to].push(head);\n };\n hanoiTower(towerHeight, startPosition, endPosition, move);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-11.spec.ts", "start_line": null, "end_line": null, "dependencies": ["buildInitialStacks"], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "A disk can only be moved to an empty pillar or on top of a larger disk during the hanoiTower operation.", "mode": "fast-check"} {"id": 56812, "name": "unknown", "code": "it(\"should request target.length changes to move from empty to target\", () => {\n fc.assert(\n fc.property(fc.fullUnicodeString(), (target) => {\n // Arrange / Act\n const numChanges = minimalNumberOfChangesToBeOther(\"\", target);\n\n // Assert\n expect(numChanges).toBe([...target].length);\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-10.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`minimalNumberOfChangesToBeOther` calculates a number of changes equal to the length of the target string to transform an empty string into the target.", "mode": "fast-check"} {"id": 56814, "name": "unknown", "code": "it(\"should request {start+end}.length changes to move from {start}{mid}{end} to {mid}\", () => {\n fc.assert(\n fc.property(\n fc.fullUnicodeString(),\n fc.fullUnicodeString(),\n fc.fullUnicodeString(),\n (start, mid, end) => {\n // Arrange / Act\n const numChanges = minimalNumberOfChangesToBeOther(\n start + mid + end,\n mid\n );\n\n // Assert\n expect(numChanges).toBe([...(start + end)].length);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-10.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The function `minimalNumberOfChangesToBeOther` should return a number of changes equal to the combined length of `start` and `end` when transforming the string `{start}{mid}{end}` to `{mid}`.", "mode": "fast-check"} {"id": 56819, "name": "unknown", "code": "it(\"should produce an ordered array\", () => {\n fc.assert(\n fc.property(fc.array(fc.integer()), (data) => {\n const sortedData = sorted(data);\n for (let idx = 1; idx < sortedData.length; ++idx) {\n expect(sortedData[idx - 1]).toBeLessThanOrEqual(sortedData[idx]);\n }\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-09.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The property checks that the `sorted` function returns an array with elements in non-decreasing order.", "mode": "fast-check"} {"id": 57189, "name": "unknown", "code": "it('should serialize and deserialize an array of internal messages', () => {\n fc.assert(\n fc.property(fc.bigInt({ min: 0n, max: 1000n }), fc.boolean(), cellArbitrary, (value, bounce, body) => {\n const messageRelaxed = internal({\n value,\n to: wallet.address,\n bounce,\n body,\n })\n const messageRelaxed2 = internal({\n value,\n to: wallet.address,\n bounce,\n body,\n })\n\n const serialized = serializeMessagesRelaxed([messageRelaxed, messageRelaxed2])\n const deserialized = deserializeMessagesRelaxed(serialized)\n\n // FIXME Jest comparison operators don't work well with message objects\n // so a workaround expectation is used\n //\n // See https://github.com/ton-core/ton-core/blob/e0ed819973daf0484dfbacd0c30a0dcfe4714f8d/src/types/MessageRelaxed.spec.ts\n const serializedData = serialized.split(',')\n expect(\n Cell.fromBase64(serializedData[0]!).equals(messageRelaxedToCell(messageRelaxed))\n ).toBeTruthy()\n expect(\n Cell.fromBase64(serializedData[1]!).equals(messageRelaxedToCell(messageRelaxed2))\n ).toBeTruthy()\n\n const reserialized = serializeMessagesRelaxed(deserialized)\n expect(reserialized).toEqual(serialized)\n })\n )\n })", "language": "typescript", "source_file": "./repos/RiftLend/contracts-v1/lib/devtools/packages/devtools-ton/test/transactions/serde.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "RiftLend/contracts-v1", "url": "https://github.com/RiftLend/contracts-v1.git", "license": "MIT", "stars": 12, "forks": 6}, "metrics": null, "summary": "Serialization and deserialization of an array of internal messages should preserve the original structure when re-serialized, confirming that both the serialization and deserialization processes are consistent and correct.", "mode": "fast-check"} {"id": 57350, "name": "unknown", "code": "it('filters', async () => {\n await fc.assert(fc.asyncProperty(fc.array(fc.integer()), async (xs) => {\n await assert.becomes(\n PromiseUtils.filterMap(xs, (x) => x > 5 ? PromiseUtils.succeed(x) : PromiseUtils.fail(x)),\n xs.filter((x) => x > 5)\n );\n }));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/utils/PromiseUtilsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "`PromiseUtils.filterMap` should process an array of integers, asynchronously filtering and retaining only those greater than 5, matching the behavior of the synchronous filter function.", "mode": "fast-check"} {"id": 57353, "name": "unknown", "code": "it('returns single-key object for single-element array', () => {\n fc.assert(fc.property(fc.string(), fc.nat(), (k, v) => {\n if (k === '__proto__') {\n assert.deepEqual(ObjUtils.fromPairs([[ k, v ]]), {});\n } else {\n assert.deepEqual(ObjUtils.fromPairs([[ k, v ]]), { [k]: v });\n }\n }));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/utils/ObjUtilsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "`ObjUtils.fromPairs` returns an empty object for key `'__proto__'`, otherwise it creates a single-key object from a single-element array of pairs.", "mode": "fast-check"} {"id": 57351, "name": "unknown", "code": "it('is identity when all elements are some', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (xs) => {\n assert.deepEqual(\n OptionUtils.somes(xs.map(O.some)),\n xs\n );\n }));\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/utils/OptionUtilsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "The function `OptionUtils.somes` should return the original array when all elements are wrapped in `O.some`.", "mode": "fast-check"} {"id": 57354, "name": "unknown", "code": "it('reads the written content', async () => {\n await fc.assert(fc.asyncProperty(fc.string(), async (contents) => {\n const { name } = tmp.fileSync();\n fs.unlinkSync(name);\n await Files.writeFile(name, contents);\n const actual = await Files.readFileAsString(name);\n assert.deepEqual(actual, contents);\n\n const actualBuffer = await Files.readFile(name);\n assert.deepEqual(actualBuffer.toString(), contents);\n }), { numRuns: 3 });\n })", "language": "typescript", "source_file": "./repos/tinymce/beehive-flow/src/test/ts/utils/FilesTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tinymce/beehive-flow", "url": "https://github.com/tinymce/beehive-flow.git", "license": "Apache-2.0", "stars": 1, "forks": 4}, "metrics": null, "summary": "Verifies that content written to a file can be accurately read back both as a string and as a buffer.", "mode": "fast-check"} {"id": 58190, "name": "unknown", "code": "it('should parse string', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, fc.string(), async (eid, message) => {\n const errorParser = await createContractErrorParser({ contract, eid })\n const parsedError = await errorParser(message)\n\n expect(parsedError).toEqual(new UnknownError(`Unknown error: ${message}`))\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/tests/devtools-evm-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that the error parser returns an `UnknownError` with the original message when parsing a string message.", "mode": "fast-check"} {"id": 58201, "name": "unknown", "code": "it('should return an address if peers() returns a non-null bytes', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n evmEndpointArbitrary,\n evmAddressArbitrary,\n async (omniContract, peerEid, peer) => {\n fc.pre(!isZero(peer))\n\n omniContract.contract.peers.mockResolvedValue(peer)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.getPeer(peerEid)).resolves.toBe(peer)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`OApp.getPeer` returns a non-null address if `peers()` resolves to a non-null byte array.", "mode": "fast-check"} {"id": 58193, "name": "unknown", "code": "it('should succeed with a valid config', () => {\n fc.assert(\n fc.property(oappNodeConfigArbitrary, (config) => {\n expect(OAppNodeConfigSchema.parse(config)).toEqual(config)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools/test/oapp/schema.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Parsing with `OAppNodeConfigSchema` should preserve valid `oappNodeConfigArbitrary` configurations without modification.", "mode": "fast-check"} {"id": 58367, "name": "unknown", "code": "it('should return false two non-matching UInt8Array instances', () => {\n fc.assert(\n fc.property(\n fc.uint8Array({ minLength: 1, maxLength: 32 }),\n fc.uint8Array({ minLength: 1, maxLength: 32 }),\n (a, b) => {\n fc.pre(a.length !== b.length || a.some((v, i) => v !== b[i]) || b.some((v, i) => v !== a[i]))\n\n expect(areBytes32Equal(a, b)).toBe(false)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`areBytes32Equal` returns false for two non-matching `UInt8Array` instances, whether due to differing lengths or differing values.", "mode": "fast-check"} {"id": 58192, "name": "unknown", "code": "it('should never reject', async () => {\n await fc.assert(\n fc.asyncProperty(endpointArbitrary, fc.anything(), async (eid, error) => {\n const errorParser = await createContractErrorParser({ contract, eid })\n const parsedError = await errorParser(error)\n\n expect(parsedError).toBeInstanceOf(UnknownError)\n expect(parsedError.reason).toBeUndefined()\n expect(parsedError.message).toMatch(/Unknown error: /)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/tests/devtools-evm-test/test/errors/parser.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The asynchronous error parser for a contract should always return an instance of `UnknownError` with undefined reason and a message matching the pattern \"Unknown error: \".", "mode": "fast-check"} {"id": 58195, "name": "unknown", "code": "it('should call owner on the contract', async () => {\n await fc.assert(\n fc.asyncProperty(omniContractArbitrary, evmAddressArbitrary, async (omniContract, owner) => {\n omniContract.contract.owner.mockResolvedValue(owner)\n\n const sdk = new OApp(omniContract)\n const ownable = Object.assign(sdk, OwnableMixin)\n\n expect(await ownable.getOwner()).toBe(owner)\n expect(omniContract.contract.owner).toHaveBeenCalledTimes(1)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools-evm/test/ownable/mixin.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "`getOwner` method should return the owner address, and the contract's `owner` method should be called exactly once.", "mode": "fast-check"} {"id": 58207, "name": "unknown", "code": "it('should return false if peers returns a non-zero address', async () => {\n await fc.assert(\n fc.asyncProperty(\n omniContractArbitrary,\n evmEndpointArbitrary,\n nullishAddressArbitrary,\n evmAddressArbitrary,\n async (omniContract, peerEid, peer, probePeer) => {\n fc.pre(!isZero(probePeer))\n\n omniContract.contract.peers.mockResolvedValue(peer)\n\n const sdk = new OApp(omniContract)\n\n await expect(sdk.hasPeer(peerEid, probePeer)).resolves.toBe(false)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/ua-devtools-evm/test/oapp/sdk.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "If the `peers` method returns a non-zero address, `sdk.hasPeer` should resolve to false.", "mode": "fast-check"} {"id": 58368, "name": "unknown", "code": "it('should return false two a UInt8Array & non-matching hex string', () => {\n fc.assert(\n fc.property(\n fc.uint8Array({ minLength: 1, maxLength: 32 }),\n fc.uint8Array({ minLength: 1, maxLength: 32 }),\n (a, b) => {\n fc.pre(a.length !== b.length || a.some((v, i) => v !== b[i]) || b.some((v, i) => v !== a[i]))\n\n expect(areBytes32Equal(a, makeBytes32(b))).toBe(false)\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/Meshee-Team/vessel-contracts/lib/devtools/packages/devtools/test/bytes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Meshee-Team/vessel-contracts", "url": "https://github.com/Meshee-Team/vessel-contracts.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `areBytes32Equal` function should return false when comparing a `UInt8Array` to a non-matching hex string after transforming the latter with `makeBytes32`.", "mode": "fast-check"} {"id": 59008, "name": "unknown", "code": "UnitTest.test('Num.clamp', () => {\n fc.assert(fc.property(\n fc.nat(1000),\n fc.nat(1000),\n fc.nat(1000),\n (a, b, c) => {\n const low = a;\n const med = low + b;\n const high = med + c;\n // low <= med <= high\n Assert.eq('Number should be unchanged when item is within bounds', med, Num.clamp(med, low, high));\n Assert.eq('Number should snap to min', med, Num.clamp(med, low, high));\n Assert.eq('Number should snap to max', med, Num.clamp(high, low, med));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/num/NumClampTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Num.clamp` should return a number unchanged if it is within bounds and correctly snap to minimum or maximum if out of bounds.", "mode": "fast-check"} {"id": 59024, "name": "unknown", "code": "UnitTest.test('Check that two errors always equal comparison.bothErrors', () => {\n fc.assert(fc.property(\n arbResultError(fc.integer()),\n arbResultError(fc.integer()),\n function (r1, r2) {\n const comparison = Results.compare(r1, r2);\n return comparison.match({\n bothErrors: Fun.constant(true),\n firstError: Fun.constant(false),\n secondError: Fun.constant(false),\n bothValues: Fun.constant(false)\n });\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "When comparing two errors using `Results.compare`, the result should match `comparison.bothErrors`.", "mode": "fast-check"} {"id": 59026, "name": "unknown", "code": "UnitTest.test('Check that value, error always equal comparison.secondError', () => {\n fc.assert(fc.property(\n arbResultValue(fc.integer()),\n arbResultError(fc.string()),\n function (r1, r2) {\n const comparison = Results.compare(r1, r2);\n return comparison.match({\n bothErrors: Fun.constant(false),\n firstError: Fun.constant(false),\n secondError: Fun.constant(true),\n bothValues: Fun.constant(false)\n });\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Results.compare` should return `secondError` as true when comparing any result values and errors.", "mode": "fast-check"} {"id": 59005, "name": "unknown", "code": "UnitTest.test('CycleBy should have an adjustment of delta, or be the min or max', () => {\n fc.assert(fc.property(\n fc.nat(),\n fc.integer(),\n fc.nat(),\n fc.nat(),\n (value, delta, min, range) => {\n const max = min + range;\n const actual = Num.cycleBy(value, delta, min, max);\n return (actual - value) === delta || actual === min || actual === max;\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/num/NumCycleByTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Num.cycleBy` results in a value adjusted by a delta, or at the minimum or maximum boundary.", "mode": "fast-check"} {"id": 59007, "name": "unknown", "code": "UnitTest.test('CycleBy delta is max', () => {\n fc.assert(fc.property(fc.nat(), fc.nat(), (value, delta) => {\n const max = value + delta;\n const actual = Num.cycleBy(value, delta, value, max);\n Assert.eq('eq', max, actual);\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/num/NumCycleByTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `Num.cycleBy` should return a result equal to `max` when cycling a value by a specified delta within a range from `value` to `max`.", "mode": "fast-check"} {"id": 59022, "name": "unknown", "code": "UnitTest.test('Check that errors should be empty and values should be all if we only generate values', () => {\n fc.assert(fc.property(\n fc.array(arbResultValue(fc.integer())),\n function (resValues) {\n const actual = Results.partition(resValues);\n if (actual.errors.length !== 0) {\n Assert.fail('Errors length should be 0');\n } else if (resValues.length !== actual.values.length) {\n Assert.fail('Values length should be ' + resValues.length);\n }\n return true;\n }\n ));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Results.partition` should return an object with no errors and all input values when only values are generated.", "mode": "fast-check"} {"id": 59069, "name": "unknown", "code": "promiseTest('Future: bind', () =>\n fc.assert(fc.asyncProperty(fc.integer(), fc.func(fc.string()), (i, f) => new Promise((resolve, reject) => {\n Future.pure(i).bind(Fun.compose(Future.pure, f)).get((ii) => {\n eqAsync('get', f(i), ii, reject, tString);\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Future.pure(i).bind` followed by composition with `Future.pure, f` retrieves a result from `f(i)` that matches the output obtained asynchronously.", "mode": "fast-check"} {"id": 59072, "name": "unknown", "code": "promiseTest('Future: mapM spec', () =>\n fc.assert(fc.asyncProperty(fc.array(fc.tuple(fc.integer(1, 10), fc.integer())), (tuples) => new Promise((resolve, reject) => {\n Futures.mapM(tuples, ([ timeout, value ]) => Future.nu((cb) => {\n setTimeout(() => {\n cb(value);\n }, timeout);\n })).get((ii) => {\n eqAsync('pars', tuples.map(([ _, i ]) => i), ii, reject, tArray(tNumber));\n resolve();\n });\n })))\n)", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Futures.mapM` applies asynchronous mapping over tuples of integers, verifying the order and values after processing matches expected results.", "mode": "fast-check"} {"id": 59070, "name": "unknown", "code": "promiseTest('Future: anonBind', () =>\n fc.assert(fc.asyncProperty(fc.integer(), fc.string(), (i, s) => new Promise((resolve, reject) => {\n Future.pure(i).anonBind(Future.pure(s)).get((ii) => {\n eqAsync('get', s, ii, reject, tString);\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Future.pure(i).anonBind(Future.pure(s))` should result in `get` returning the string `s`.", "mode": "fast-check"} {"id": 59073, "name": "unknown", "code": "promiseTest('FutureResult: nu', () => fc.assert(fc.asyncProperty(arbResult(fc.integer(), fc.integer()), (r) => new Promise((resolve, reject) => {\n FutureResult.nu((completer) => {\n completer(r);\n }).get((ii) => {\n eqAsync('eq', r, ii, reject, tResult());\n resolve();\n });\n}))))", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should hold that `FutureResult.nu`, when completed with a result, properly retrieves and compares the result using `eqAsync`.", "mode": "fast-check"} {"id": 59076, "name": "unknown", "code": "promiseTest('FutureResult: fromResult get', () => fc.assert(fc.asyncProperty(arbResult(fc.integer(), fc.integer()), (r) => new Promise((resolve, reject) => {\n FutureResult.fromResult(r).get((ii) => {\n eqAsync('eq', r, ii, reject, tResult());\n resolve();\n });\n}))))", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`FutureResult.fromResult` correctly retrieves the value from a result and verifies it using an asynchronous equality check.", "mode": "fast-check"} {"id": 59047, "name": "unknown", "code": "UnitTest.test('Result.error: error.isError === true', () => {\n fc.assert(fc.property(arbResultError(fc.integer()), (res) => {\n Assert.eq('eq', true, res.isError());\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultErrorTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Result.error` should return an object where `isError()` yields true.", "mode": "fast-check"} {"id": 59068, "name": "unknown", "code": "promiseTest('Future: map', () =>\n fc.assert(fc.asyncProperty(fc.integer(), fc.func(fc.string()), (i, f) => new Promise((resolve, reject) => {\n Future.pure(i).map(f).get((ii) => {\n eqAsync('get', f(i), ii, reject, tString);\n resolve();\n });\n }))))", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Future.pure(i).map(f).get(ii => ii)` should apply the function `f` to the integer `i` and produce a result consistent with `f(i)`.", "mode": "fast-check"} {"id": 59075, "name": "unknown", "code": "promiseTest('FutureResult: wrap get', () => fc.assert(fc.asyncProperty(arbResult(fc.integer(), fc.integer()), (r) => new Promise((resolve, reject) => {\n FutureResult.wrap(Future.pure(r)).get((ii) => {\n eqAsync('eq', r, ii, reject, tResult());\n resolve();\n });\n}))))", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`FutureResult.wrap` should correctly retrieve a value from a `Future` containing a `Result`, and ensure it matches the expected result asynchronously.", "mode": "fast-check"} {"id": 59078, "name": "unknown", "code": "promiseTest('FutureResult: value get', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.value(i).get((ii) => {\n eqAsync('eq', Result.value(i), ii, reject, tResult());\n resolve();\n });\n}))))", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`FutureResult.value` retrieves the same integer value, ensuring it matches the expected `Result.value` output.", "mode": "fast-check"} {"id": 59080, "name": "unknown", "code": "promiseTest('FutureResult: value mapResult', () => {\n const f = (x) => x + 3;\n return fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n FutureResult.value(i).mapResult(f).get((ii) => {\n eqAsync('eq', Result.value(f(i)), ii, reject, tResult());\n resolve();\n });\n })));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`FutureResult.value(i).mapResult(f)` correctly applies function `f` to input `i`, resulting in a `FutureResult` equivalent to `Result.value(f(i))`.", "mode": "fast-check"} {"id": 59084, "name": "unknown", "code": "promiseTest('FutureResult: value bindFuture value', () => fc.assert(fc.asyncProperty(fc.integer(), (i) => new Promise((resolve, reject) => {\n const f = (x) => x % 4;\n FutureResult.value(i).bindFuture((x) => FutureResult.value(f(x))).get((actual) => {\n eqAsync('bind result', Result.value(f(i)), actual, reject, tResult(tNumber));\n resolve();\n });\n}))))", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/async/FutureResultTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`FutureResult.value(i).bindFuture` with a function `f` should result in `FutureResult.value(f(i))`.", "mode": "fast-check"} {"id": 59089, "name": "unknown", "code": "UnitTest.test('Arr.reverse: Reversing twice is identity', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (arr) => {\n Assert.eq('reverse twice', arr, Arr.reverse(Arr.reverse(arr)));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ReverseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Reversing an array twice results in the original array.", "mode": "fast-check"} {"id": 59391, "name": "unknown", "code": "UnitTest.test('If predicate is always false, then find is always none', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(), fc.json()),\n function (obj) {\n const value = Obj.find(obj, Fun.never);\n return value.isNone();\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/obj/ObjFindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Finding elements in an object with a perpetually false predicate should always return a 'none' result.", "mode": "fast-check"} {"id": 59406, "name": "unknown", "code": "UnitTest.test('Check that if the filter always returns true, then everything is in \"t\"', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(), fc.string(1, 40)),\n (obj) => {\n const output = Obj.bifilter(obj, Fun.always);\n Assert.eq('eq', 0, Obj.keys(output.f).length);\n Assert.eq('eq', Obj.keys(obj).length, Obj.keys(output.t).length);\n return true;\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/obj/BiFilterTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "If the `bifilter` function uses a filter that always returns true, all keys should be in the \"t\" object with no keys in the \"f\" object.", "mode": "fast-check"} {"id": 59425, "name": "unknown", "code": "UnitTest.test('Checking value.getOrDie() does not throw', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), (res) => {\n res.getOrDie();\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`getOrDie` method of `ResultValue` should not throw an exception when called.", "mode": "fast-check"} {"id": 59093, "name": "unknown", "code": "UnitTest.test('Arr.reverse: \u2200 xs. x \u2208 (reverse xs) <-> x \u2208 xs', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (xs) => {\n const rxs = Arr.reverse(xs);\n Assert.eq('\u2200 xs. x \u2208 (reverse xs) -> x \u2208 xs', true, Arr.forall(rxs, (x) => Arr.contains(xs, x)));\n Assert.eq('\u2200 xs. x \u2208 xs -> x \u2208 (reverse xs)', true, Arr.forall(xs, (x) => Arr.contains(rxs, x)));\n }));\n})", "language": "typescript", "source_file": "./repos/SamS-G/urban-fight/public/bundles/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ReverseTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SamS-G/urban-fight", "url": "https://github.com/SamS-G/urban-fight.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "For any array `xs`, all elements in `reverse(xs)` should also be in `xs` and vice versa.", "mode": "fast-check"} {"id": 59393, "name": "unknown", "code": "UnitTest.test('If predicate is always true, then value is always the some(first), or none if dict is empty', () => {\n fc.assert(fc.property(\n fc.dictionary(fc.asciiString(), fc.json()),\n function (obj) {\n const value = Obj.find(obj, Fun.always);\n // No order is specified, so we cannot know what \"first\" is\n return Obj.keys(obj).length === 0 ? value.isNone() : true;\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/obj/ObjFindTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "When a dictionary is empty, `Obj.find` returns none; otherwise, the predicate being always true should always return some value.", "mode": "fast-check"} {"id": 59416, "name": "unknown", "code": "UnitTest.test('Check that two errors always equal comparison.bothErrors', () => {\n fc.assert(fc.property(\n arbResultError(fc.integer()),\n arbResultError(fc.integer()),\n function (r1, r2) {\n const comparison = Results.compare(r1, r2);\n return comparison.match({\n bothErrors: Fun.always,\n firstError: Fun.never,\n secondError: Fun.never,\n bothValues: Fun.never\n });\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultsTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "When comparing two error results, `Results.compare` should return a match with `bothErrors`.", "mode": "fast-check"} {"id": 59422, "name": "unknown", "code": "UnitTest.test('Checking value.isValue === true', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), (res) => {\n Assert.eq('eq', true, res.isValue());\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`res.isValue()` should always return true for any `arbResultValue` generated from an integer.", "mode": "fast-check"} {"id": 59423, "name": "unknown", "code": "UnitTest.test('Checking value.isError === false', () => {\n fc.assert(fc.property(arbResultValue(fc.integer()), (res) => {\n Assert.eq('eq', false, res.isError());\n }));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/data/ResultValueTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`isError` should return false for all generated `arbResultValue` instances.", "mode": "fast-check"} {"id": 59575, "name": "unknown", "code": "it('should handle password complexity correctly', () => {\n fc.assert(\n fc.property(fc.string({ minLength: 0, maxLength: 20 }), password => {\n const result = validatePasswordStrength(password);\n\n // Check that the logic is consistent\n const hasUpper = /[A-Z]/.test(password);\n const hasLower = /[a-z]/.test(password);\n const hasDigit = /[0-9]/.test(password);\n const hasSpecial = /[^A-Za-z0-9]/.test(password);\n const isLongEnough = password.length >= 8;\n\n const expectedValid =\n hasUpper && hasLower && hasDigit && hasSpecial && isLongEnough;\n\n expect(result.isValid).toBe(expectedValid);\n expect(result.isValid).toBe(result.errors.length === 0);\n })\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/apps/backend-api/test/utils/validators.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "`validatePasswordStrength` function's consistency and correctness in determining password validity based on upper case, lower case, digit, special character presence, and minimum length.", "mode": "fast-check"} {"id": 59581, "name": "unknown", "code": "it('should never return negative total for valid items', () => {\n fc.assert(\n fc.property(\n fc.array(\n fc.record({\n price: fc.float({ min: 0, max: Math.fround(1000), noNaN: true }),\n quantity: fc.integer({ min: 0, max: 100 }),\n })\n ),\n items => {\n const total = calculateTotal(items);\n expect(total).toBeGreaterThanOrEqual(0);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/apps/backend-api/test/utils/calculations.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "The total calculated for an array of items with non-negative prices and quantities should never be negative.", "mode": "fast-check"} {"id": 59586, "name": "unknown", "code": "it('should always be greater than or equal to base total when tax rate is positive', () => {\n fc.assert(\n fc.property(\n fc.array(\n fc.record({\n price: fc.float({ min: 0, max: Math.fround(100), noNaN: true }),\n quantity: fc.integer({ min: 0, max: 10 }),\n })\n ),\n fc.float({ min: 0, max: Math.fround(1), noNaN: true }),\n (items, taxRate) => {\n const baseTotal = calculateTotal(items);\n const totalWithTax = calculateTotalWithTax(items, taxRate);\n expect(totalWithTax).toBeGreaterThanOrEqual(baseTotal);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/apps/backend-api/test/utils/calculations.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "The total including tax should always be greater than or equal to the base total when the tax rate is positive.", "mode": "fast-check"} {"id": 59629, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToNative);\n fc.assert(equivalentToBcoin);\n fc.assert(equivalentToHashJs);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/hash.spec.helper.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": "The properties ensure that the function behaves equivalently to three different reference implementations without throwing errors.", "mode": "fast-check"} {"id": 59472, "name": "unknown", "code": "UnitTest.test('forall of a non-empty array with a predicate that always returns true is true', () => {\n fc.assert(fc.property(\n fc.array(fc.integer(), 1, 30),\n (xs) => {\n const output = Arr.forall(xs, Fun.always);\n Assert.eq('eq', true, output);\n }\n ));\n})", "language": "typescript", "source_file": "./repos/BirWri/CS50BirWri/flaskr/static/tinymce_5.6.2_dev/tinymce/modules/katamari/src/test/ts/atomic/api/arr/ForallTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "BirWri/CS50BirWri", "url": "https://github.com/BirWri/CS50BirWri.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Arr.forall` returns true for non-empty arrays when using a predicate that always returns true.", "mode": "fast-check"} {"id": 59886, "name": "unknown", "code": "test('default(max) = 2,147,483,648 *because* we arbitrarily selected the default range to be int32', () => {\n fc.assert(\n fc.property(domainGen.sampleConfig(), (config) => {\n const genDefault = dev.Gen.integer();\n const genLinear = dev.Gen.integer().lessThanEqual(2_147_483_648);\n\n expect(dev.sample(genDefault, config)).toEqual(dev.sample(genLinear, config));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Gen/Gen.Integer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Gen.integer()` by default generates integers less than or equal to 2,147,483,648, aligning with an arbitrarily selected int32 range.", "mode": "fast-check"} {"id": 59890, "name": "unknown", "code": "test('Gen.integer().greaterThanEqual(x), x \u2209 \u2124 *produces* error; minimum must be an integer', () => {\n fc.assert(\n fc.property(domainGen.sampleConfig(), domainGen.decimalWithAtLeastOneDp(), (config, x) => {\n const gen = dev.Gen.integer().greaterThanEqual(x);\n\n expect(() => dev.sample(gen, config)).toThrow('Minimum must be an integer');\n }),\n );\n })", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Gen/Gen.Integer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `Gen.integer().greaterThanEqual(x)` should produce an error when `x` is not an integer, asserting that the minimum must be an integer.", "mode": "fast-check"} {"id": 59893, "name": "unknown", "code": "test('Gen.integer().between(x, y).origin(z), z \u2209 [x..y] *produces* error; origin must be in range', () => {\n fc.assert(\n fc.property(\n domainGen.sampleConfig(),\n domainGen.setOfSize(domainGen.integer(), 3),\n domainGen.element([-1, 1]),\n (config, [a, b, c], sortOrder) => {\n const [x, y, z] = [a, b, c].sort((a, b) => (a - b) * sortOrder);\n const gen = dev.Gen.integer().between(x, y).origin(z);\n\n expect(() => dev.sample(gen, config)).toThrow('Origin must be in range');\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Gen/Gen.Integer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Gen.integer().between(x, y).origin(z)` should throw an error if `z` is not within the range `[x..y]`.", "mode": "fast-check"} {"id": 59896, "name": "unknown", "code": "test('sample(gen.filter(size > 50)) *produces* values *because* it resizes itself after a failed predicate', () => {\n fc.assert(\n fc.property(domainGen.sampleConfig(), (config) => {\n const gen = dev.Gen.create(\n (_, size) => size,\n dev.Shrink.none(),\n (size) => size,\n );\n const genFiltered = gen.filter((size) => size > 50);\n\n expect(() => dev.sample(genFiltered, config)).not.toThrow();\n }),\n );\n})", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Gen/Gen.Filter.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`gen.filter(size > 50)` produces values because it resizes itself after a failed predicate, ensuring that sampling does not throw an error.", "mode": "fast-check"} {"id": 59578, "name": "unknown", "code": "it('should be monotonic in tax rate', () => {\n fc.assert(\n fc.property(\n fc.tuple(\n fc.float({ min: 0, max: 0.5, noNaN: true }),\n fc.float({ min: 0, max: 0.5, noNaN: true })\n ),\n ([rate1, rate2]) => {\n const [smallerRate, largerRate] = [\n Math.min(rate1, rate2),\n Math.max(rate1, rate2),\n ];\n const items: Item[] = [{ price: 100, quantity: 1 }];\n\n const total1 = calculateTotalWithTax(items, smallerRate);\n const total2 = calculateTotalWithTax(items, largerRate);\n\n expect(total2).toBeGreaterThanOrEqual(total1);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/apps/backend-api/test/utils/enhanced-property-tests.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "Calculating the total with a larger tax rate should result in an amount greater than or equal to that calculated with a smaller tax rate.", "mode": "fast-check"} {"id": 59580, "name": "unknown", "code": "it('should scale proportionally with amount', () => {\n fc.assert(\n fc.property(\n generators.money(),\n generators.percentage(),\n fc.float({ min: 2, max: 10, noNaN: true }),\n (amount, discountPercent, multiplier) => {\n const discount1 = calculateDiscount(amount, discountPercent);\n const discount2 = calculateDiscount(\n amount * multiplier,\n discountPercent\n );\n\n expect(discount2).toBeCloseTo(discount1 * multiplier, 2);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/apps/backend-api/test/utils/enhanced-property-tests.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "Calculating discounts for scaled amounts should yield results proportional to the scaling factor.", "mode": "fast-check"} {"id": 59582, "name": "unknown", "code": "it('should be associative (order of items should not matter)', () => {\n fc.assert(\n fc.property(\n fc.array(\n fc.record({\n price: fc.float({ min: 0, max: Math.fround(100), noNaN: true }),\n quantity: fc.integer({ min: 0, max: 10 }),\n }),\n { minLength: 2 }\n ),\n items => {\n const total1 = calculateTotal(items);\n const shuffled = [...items].reverse(); // Simple shuffle\n const total2 = calculateTotal(shuffled);\n expect(total1).toBeCloseTo(total2, 10);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mkwatson/ai-fastify-template/apps/backend-api/test/utils/calculations.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mkwatson/ai-fastify-template", "url": "https://github.com/mkwatson/ai-fastify-template.git", "license": "MIT", "stars": 18, "forks": 3}, "metrics": null, "summary": "The `calculateTotal` function should be associative, meaning the order of items does not affect the total calculation.", "mode": "fast-check"} {"id": 59628, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToNative);\n fc.assert(equivalentToBcoin);\n fc.assert(equivalentToHashJs);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/hash.spec.helper.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": "The test verifies that three functions (`equivalentToNative`, `equivalentToBcoin`, and `equivalentToHashJs`) execute without throwing exceptions.", "mode": "fast-check"} {"id": 59630, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToNative);\n fc.assert(equivalentToBcoin);\n fc.assert(equivalentToHashJs);\n })", "language": "typescript", "source_file": "./repos/fex-cash/bch-snap/packages/snap/src/lib/libauth/lib/crypto/hash.spec.helper.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fex-cash/bch-snap", "url": "https://github.com/fex-cash/bch-snap.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": "Assertions for `equivalentToNative`, `equivalentToBcoin`, and `equivalentToHashJs` should not throw exceptions.", "mode": "fast-check"} {"id": 59885, "name": "unknown", "code": "test('default(min) = -2,147,483,648 *because* we arbitrarily selected the default range to be int32', () => {\n fc.assert(\n fc.property(domainGen.sampleConfig(), (config) => {\n const genDefault = dev.Gen.integer();\n const genAlt = dev.Gen.integer().greaterThanEqual(-2_147_483_648);\n\n expect(dev.sample(genDefault, config)).toEqual(dev.sample(genAlt, config));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Gen/Gen.Integer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test confirms that generating integers using the default range matches generating integers with a specified minimum of -2,147,483,648, given the default range is set to int32.", "mode": "fast-check"} {"id": 59888, "name": "unknown", "code": "test('Gen.integer().between(x, y) = Gen.integer().greaterThanEqual(x).lessThanEqual(y)', () => {\n fc.assert(\n fc.property(domainGen.sampleConfig(), domainGen.integer(), domainGen.integer(), (config, x, y) => {\n const genBetween = dev.Gen.integer().between(x, y);\n const genBetweenAlt = dev.Gen.integer().greaterThanEqual(x).lessThanEqual(y);\n\n expect(dev.sample(genBetween, config)).toEqual(dev.sample(genBetweenAlt, config));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Gen/Gen.Integer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Gen.integer().between(x, y)` produces the same outputs as combining `Gen.integer().greaterThanEqual(x)` and `lessThanEqual(y)` when sampled with the same configuration.", "mode": "fast-check"} {"id": 59894, "name": "unknown", "code": "test('Gen.integer().origin(z) *produces* values that shrink to z', () => {\n fc.assert(\n fc.property(domainGen.minimalConfig(), domainGen.integer(), (config, z) => {\n const gen = dev.Gen.integer().origin(z);\n\n const min = dev.minimalValue(gen, config);\n\n expect(min).toEqual(z);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Gen/Gen.Integer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Integer values generated with `Gen.integer().origin(z)` should shrink to `z`.", "mode": "fast-check"} {"id": 59897, "name": "unknown", "code": "test('sample(gen.map(f)) *produces* values, x, where f(x) = true', () => {\n fc.assert(\n fc.property(domainGen.sampleConfig(), domainGen.gen(), domainGen.predicate(), (config, gen, f) => {\n const genFiltered = gen.filter(f);\n\n const sample = dev.sampleTrees(genFiltered, config);\n\n for (const tree of sample.values) {\n expect(f(tree.node.value)).toEqual(true);\n for (const shrink of dev.GenTree.traverseGreedy(tree)) {\n expect(f(shrink.value)).toEqual(true);\n }\n }\n }),\n );\n})", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Gen/Gen.Filter.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Sampling from a filtered generator with a predicate should produce values for which the predicate returns true, including all shrink values.", "mode": "fast-check"} {"id": 59903, "name": "unknown", "code": "test('Gen.array(gen).ofMinLength(x).ofMaxLength(y) = Gen.array(gen).betweenLengths(x, y)', () => {\n fc.assert(\n fc.property(\n domainGen.sampleConfig(),\n domainGen.gen(),\n genArrayLength(),\n genArrayLength(),\n (config, elementGen, x, y) => {\n const genArray = dev.Gen.array(elementGen).ofMinLength(x).ofMaxLength(y);\n const genArrayAlt = dev.Gen.array(elementGen).betweenLengths(x, y);\n\n expect(dev.sample(genArray, config)).toEqual(dev.sample(genArrayAlt, config));\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/nth-commit/pbt/packages/pbt/test/Gen/Gen.Array.test.ts", "start_line": null, "end_line": null, "dependencies": ["genArrayLength"], "repo": {"name": "nth-commit/pbt", "url": "https://github.com/nth-commit/pbt.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`Gen.array(gen).ofMinLength(x).ofMaxLength(y)` should produce the same result as `Gen.array(gen).betweenLengths(x, y)` when using the same configuration.", "mode": "fast-check"} {"id": 60170, "name": "unknown", "code": "it(\"Will always call the close function if the open function succeeds\", () =>\n fc.assert(\n fc.asyncProperty(\n fc.anything(),\n arbitraries.io,\n async (a, ioWithAnyOutcome) => {\n const close = jest.fn(() => IO.void);\n\n const bracketed = IO.bracket(\n IO.wrap(a),\n close\n )(() => ioWithAnyOutcome);\n\n await bracketed.runSafe();\n\n expect(close).toHaveBeenCalledWith(a);\n }\n )\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/bracket.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "If the `open` function succeeds, the `close` function should always be called with the opened resource as its argument.", "mode": "fast-check"} {"id": 60173, "name": "unknown", "code": "it(\"creates an IO which rejects when run if the side-effect throws\", () =>\n fc.assert(\n fc.asyncProperty(fc.anything(), (thrownValue) => {\n const io = IO.cancelable(() => {\n throw thrownValue;\n });\n return expect(io.run()).rejects.toBe(thrownValue);\n })\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/cancellation.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "An `IO` created with a side-effect that throws a value should reject with that thrown value when run.", "mode": "fast-check"} {"id": 60175, "name": "unknown", "code": "test(\"encoded, decode pairing AnnouncePresence\", () => {\n fc.assert(\n fc.property(\n fc.uint8Array({ minLength: 16, maxLength: 16 }),\n fc.array(\n fc.tuple(\n fc.uint8Array({ minLength: 16, maxLength: 16 }),\n fc.tuple(fc.bigIntN(64), fc.integer({ min: 0 }))\n )\n ),\n fc.string(),\n fc.bigIntN(64),\n (sender, lastSeens, schemaName, schemaVersion) => {\n const msg: AnnouncePresence = {\n _tag: tags.AnnouncePresence,\n sender,\n lastSeens,\n schemaName,\n schemaVersion,\n } as const;\n const encoded = encode(msg);\n const decoded = decode(encoded);\n expect(decoded).toEqual(msg);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/vlcn-io/js/packages/ws-common/src/__tests__/encodeDecode.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "vlcn-io/js", "url": "https://github.com/vlcn-io/js.git", "license": "MIT", "stars": 67, "forks": 8}, "metrics": null, "summary": "Encoding and decoding an `AnnouncePresence` message should result in the original message being preserved.", "mode": "fast-check"} {"id": 60171, "name": "unknown", "code": "it(\"Will always give the same outcome as the use function if open and close succeed\", () =>\n fc.assert(\n fc.asyncProperty(arbitraries.io, async (ioWithAnyOutcome) => {\n const bracketed = IO.bracket(\n IO.void,\n () => IO.void\n )(() => ioWithAnyOutcome);\n\n expect(await bracketed.runSafe()).toEqual(\n await ioWithAnyOutcome.runSafe()\n );\n })\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/bracket.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The function `IO.bracket` produces an outcome identical to the original `ioWithAnyOutcome` if both open and close operations succeed.", "mode": "fast-check"} {"id": 60174, "name": "unknown", "code": "it(\"makes no difference to the outcome of the action if it succeeds\", () =>\n fc.assert(\n fc.asyncProperty(arbitraries.io, async (io) => {\n const withOnCancel = io.onCancel(IO.void);\n expect(await withOnCancel.runSafe()).toEqual(await io.runSafe());\n })\n ))", "language": "typescript", "source_file": "./repos/DavidTimms/effective.ts/tests/cancellation.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/effective.ts", "url": "https://github.com/DavidTimms/effective.ts.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The test checks whether attaching an `onCancel` handler to an input/output action does not affect the outcome if the action succeeds.", "mode": "fast-check"} {"id": 60177, "name": "unknown", "code": "test(\"encoded, decode pairing RejectChanges\", () => {\n fc.assert(\n fc.property(\n fc.uint8Array({ minLength: 16, maxLength: 16 }),\n fc.tuple(fc.bigIntN(64), fc.integer({ min: 0 })),\n (whose, since) => {\n const msg = {\n _tag: tags.RejectChanges,\n whose,\n since,\n } as const;\n const encoded = encode(msg);\n const decoded = decode(encoded);\n expect(decoded).toEqual(msg);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/vlcn-io/js/packages/ws-common/src/__tests__/encodeDecode.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "vlcn-io/js", "url": "https://github.com/vlcn-io/js.git", "license": "MIT", "stars": 67, "forks": 8}, "metrics": null, "summary": "Encoding and decoding a `RejectChanges` message should result in the original message being preserved.", "mode": "fast-check"} {"id": 60192, "name": "unknown", "code": "test(\"UploadSchemaMsg\", () => {\n fc.assert(\n fc.property(\n fc.string(),\n fc.bigIntN(64),\n fc.string(),\n fc.boolean(),\n (name, version, content, activate) => {\n const serializer = new JsonSerializer();\n const msg = {\n _tag: tags.uploadSchema,\n name,\n version,\n content,\n activate,\n } as const;\n const encoded = JSON.stringify(serializer.encode(msg));\n const decoded = serializer.decode(JSON.parse(encoded));\n expect(decoded).toEqual(msg);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/vlcn-io/js/packages/direct-connect-common/src/msg/__tests__/JsonSerializer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "vlcn-io/js", "url": "https://github.com/vlcn-io/js.git", "license": "MIT", "stars": 67, "forks": 8}, "metrics": null, "summary": "Serializing and then deserializing an `UploadSchemaMsg` using `JsonSerializer` should produce an object identical to the original message.", "mode": "fast-check"} {"id": 60322, "name": "unknown", "code": "it('should maintain email uniqueness constraint', () => {\n fc.assert(\n fc.property(\n fc.array(domainArbitraries.email, { minLength: 5, maxLength: 20 }),\n (emails) => {\n // Invariant: All emails in a system should be unique\n const uniqueEmails = new Set(emails);\n\n // In a real system, duplicate emails would be rejected\n // This tests the uniqueness constraint logic\n const wouldViolateConstraint = emails.length > uniqueEmails.size;\n\n // Property: We can detect uniqueness violations\n return typeof wouldViolateConstraint === 'boolean';\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/invariants/data-model-invariants.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks whether the uniqueness constraint for emails is violated by detecting if the number of emails exceeds the number of unique entries.", "mode": "fast-check"} {"id": 60212, "name": "unknown", "code": "it('should handle academic year boundaries', () => {\n fc.assert(\n fc.property(domainArbitraries.academicYear, (academicYear) => {\n // Property: Academic year should span two consecutive calendar years\n const [startYear, endYear] = academicYear.split('-').map(Number);\n\n return endYear === startYear + 1;\n }),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/date-time-calculations.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Academic year boundaries should span two consecutive calendar years, with the end year being exactly one year after the start year.", "mode": "fast-check"} {"id": 60321, "name": "unknown", "code": "it('should maintain user data integrity', () => {\n fc.assert(\n fc.property(\n fc.record({\n id: fc.integer({ min: 1, max: 1000000 }),\n email: domainArbitraries.email,\n name: domainArbitraries.teacherName,\n role: domainArbitraries.userRole,\n preferredLanguage: domainArbitraries.language,\n createdAt: fc.date({ min: new Date('2020-01-01') }),\n updatedAt: fc.date({ min: new Date('2020-01-01') }),\n }),\n (user) => {\n // Invariant: User must have valid required fields\n const hasValidId = user.id > 0;\n const hasValidEmail = user.email.includes('@') && user.email.includes('.');\n const hasValidName = user.name.trim().length > 0;\n const hasValidRole = ['teacher', 'administrator', 'substitute'].includes(user.role);\n const hasValidLanguage = ['en', 'fr'].includes(user.preferredLanguage);\n const hasValidTimestamps = user.createdAt <= user.updatedAt;\n\n return (\n hasValidId &&\n hasValidEmail &&\n hasValidName &&\n hasValidRole &&\n hasValidLanguage &&\n hasValidTimestamps\n );\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/invariants/data-model-invariants.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "User data integrity is preserved by ensuring the validity of required fields, including ID, email, name, role, preferred language, and consistent timestamps.", "mode": "fast-check"} {"id": 54421, "name": "unknown", "code": "it('should handle concurrent calls to \"inc\" on multiple \"Counter\"', async () => {\n await fc.assert(\n fc.asyncProperty(fc.scheduler(), fc.array(fc.nat(64)), async (s, numCallsByCounter) => {\n // Arrange\n let dbValue = 0;\n const db = {\n read: s.scheduleFunction(async function read() {\n return dbValue;\n }),\n write: s.scheduleFunction(async function write(newValue: number, oldValue?: number) {\n if (oldValue !== undefined && dbValue !== oldValue) return false;\n dbValue = newValue;\n return true;\n }),\n };\n\n // Act\n let expectedNumCalls = 0;\n for (let counterId = 0; counterId < numCallsByCounter.length; ++counterId) {\n const counter = new Counter(db);\n const numCalls = numCallsByCounter[counterId];\n expectedNumCalls += numCalls;\n for (let callId = 0; callId < numCalls; ++callId) {\n s.schedule(Promise.resolve(`counter[${counterId}].inc${callId + 1}`)).then(() => counter.inc());\n }\n }\n await s.waitAll();\n\n // Assert\n expect(dbValue).toBe(expectedNumCalls);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/005-race/counter/main.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Concurrent calls to \"inc\" on multiple \"Counter\" instances should result in the database value equaling the total number of inc calls across all instances.", "mode": "fast-check"} {"id": 54423, "name": "unknown", "code": "it('should be able to call multiple /drop-deactivated at the same time (no supertest)', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.uniqueArray(\n fc.record({\n id: fc.uuid({ version: 4 }),\n name: fc.string(),\n deactivated: fc.boolean(),\n }),\n { selector: (u) => u.id },\n ),\n fc.integer({ min: 1, max: 5 }),\n fc.scheduler(),\n async (allUsers, num, s) => {\n // Arrange\n let knownUsers = allUsers;\n const getAllUsers = DbMock.getAllUsers as MockedFunction;\n const removeUsers = DbMock.removeUsers as MockedFunction;\n getAllUsers.mockImplementation(\n s.scheduleFunction(async function getAllUsers() {\n return knownUsers;\n }),\n );\n removeUsers.mockImplementation(\n s.scheduleFunction(async function removeUsers(ids) {\n const sizeBefore = knownUsers.length;\n knownUsers = knownUsers.filter((u) => !ids.includes(u.id));\n return sizeBefore - knownUsers.length;\n }),\n );\n\n // Act\n const queries = [];\n for (let index = 0; index !== num; ++index) {\n queries.push(dropDeactivatedInternal());\n }\n const out = await s.waitFor(Promise.all(queries));\n\n // Assert\n for (const outQuery of out) {\n expect(outQuery.status).toBe('success');\n }\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/005-race/supertest/app.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Simultaneous calls to `/drop-deactivated` should result in successful removal of deactivated users without errors, even when performed concurrently with various user datasets.", "mode": "fast-check"} {"id": 54427, "name": "unknown", "code": "it('should detect invalid search trees whenever tree traversal produces unordered arrays (2)', () => {\n fc.assert(\n fc.property(binaryTreeWithoutMaxDepth(), (tree) => {\n fc.pre(!isSorted(traversal(tree, (t) => t.value)));\n return !isSearchTree(tree);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/002-recursive/isSearchTree/main.spec.ts", "start_line": null, "end_line": null, "dependencies": ["isSorted", "traversal"], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Traversing a binary tree that produces an unordered array results in `isSearchTree` returning false.", "mode": "fast-check"} {"id": 54428, "name": "unknown", "code": "it('should detect invalid search trees whenever one node in the tree has an invalid direct child', () => {\n fc.assert(\n fc.property(binaryTreeWithMaxDepth(3), (tree) => {\n fc.pre(\n traversal(tree, (t) => t).some(\n (t) => (t.left && t.left.value > t.value) || (t.right && t.right.value <= t.value),\n ),\n );\n return !isSearchTree(tree);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/002-recursive/isSearchTree/main.spec.ts", "start_line": null, "end_line": null, "dependencies": ["traversal"], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The test verifies that a binary tree with at least one node having an invalid child relationship results in `isSearchTree` returning false.", "mode": "fast-check"} {"id": 54432, "name": "unknown", "code": "it('should start negative romans with a minus sign', () => {\n fc.assert(\n fc.property(fc.integer({ min: -MaxRoman, max: -1 }), (n) => {\n expect(toRoman(n)[0]).toBe('-');\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/003-misc/roman/main.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Negative Roman numerals should begin with a minus sign.", "mode": "fast-check"} {"id": 54441, "name": "unknown", "code": "it('should not have any path loops', () => {\n fc.assert(\n fc.property(seedArb, inputsArb, (seed, ins) => {\n const maze = mazeGenerator(seed, ins.dim, ins.startPt, ins.endPt);\n const alreadyVisited = new Set();\n const ptsToVisit = [{ pt: ins.startPt, src: ins.startPt }];\n while (ptsToVisit.length > 0) {\n const [{ pt, src }] = ptsToVisit.splice(ptsToVisit.length - 1);\n const ptString = `x:${pt.x},y:${pt.y}`;\n if (alreadyVisited.has(ptString)) {\n // We already got to this cell from another path\n // There is an unexpected loop in the generated maze\n return false;\n }\n alreadyVisited.add(ptString);\n ptsToVisit.push(\n ...neighboorsFor(pt)\n // We do not go back on our tracks\n .filter((nPt) => nPt.x !== src.x || nPt.y !== src.y)\n .filter((nPt) => {\n const cell = cellTypeAt(maze, nPt);\n return cell !== null && cell !== CellType.Wall;\n })\n // Keep the src aka source point in order not to go back on our tracks\n .map((nPt) => ({ pt: nPt, src: pt })),\n );\n }\n return true;\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/003-misc/mazeGenerator/main.spec.ts", "start_line": null, "end_line": null, "dependencies": ["neighboorsFor", "cellTypeAt"], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "A generated maze should contain paths without loops, ensuring that no cell is revisited from a different path.", "mode": "fast-check"} {"id": 54451, "name": "unknown", "code": "it('should be able to decompose a product of two numbers', () => {\n fc.assert(\n fc.property(fc.integer({ min: 2, max: MAX_INPUT }), fc.integer({ min: 2, max: MAX_INPUT }), (a, b) => {\n const n = a * b;\n const factors = decompPrime(n);\n return factors.length >= 2;\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/001-simple/decompPrime/main.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The function `decompPrime` should output at least two factors for a product of two integers greater than or equal to 2.", "mode": "fast-check"} {"id": 54452, "name": "unknown", "code": "it('should compute the same factors as to the concatenation of the one of a and b for a times b', () => {\n fc.assert(\n fc.property(fc.integer({ min: 2, max: MAX_INPUT }), fc.integer({ min: 2, max: MAX_INPUT }), (a, b) => {\n const factorsA = decompPrime(a);\n const factorsB = decompPrime(b);\n const factorsAB = decompPrime(a * b);\n const reorder = (arr: number[]) => [...arr].sort((a, b) => a - b);\n expect(reorder(factorsAB)).toEqual(reorder([...factorsA, ...factorsB]));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/001-simple/decompPrime/main.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The factors of the product of two integers \\(a\\) and \\(b\\) should match the concatenated and sorted factors of \\(a\\) and \\(b\\).", "mode": "fast-check"} {"id": 54454, "name": "unknown", "code": "it('should return the starting position of the pattern within text if any', () => {\n fc.assert(\n fc.property(fc.string(), fc.string(), fc.string(), (a, b, c) => {\n const text = a + b + c;\n const pattern = b;\n const index = indexOf(text, pattern);\n return index === -1 || text.substr(index, pattern.length) === pattern;\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/001-simple/indexOf/main.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`indexOf` returns the starting position of a pattern within a text, or -1 if the pattern is not found.", "mode": "fast-check"} {"id": 54455, "name": "unknown", "code": "it('should always use the same size value for all its sub-arbitraries (except webAuthority when using its own)', () => {\n fc.assert(\n fc.property(sizeRelatedGlobalConfigArb, webUrlConstraintsBuilder(), (config, constraints) => {\n // Arrange\n const { instance } = fakeArbitrary();\n const webAuthority = vi.spyOn(WebAuthorityMock, 'webAuthority');\n webAuthority.mockReturnValue(instance);\n const webFragments = vi.spyOn(WebFragmentsMock, 'webFragments');\n webFragments.mockReturnValue(instance);\n const webQueryParameters = vi.spyOn(WebQueryParametersMock, 'webQueryParameters');\n webQueryParameters.mockReturnValue(instance);\n const webPath = vi.spyOn(WebPathMock, 'webPath');\n webPath.mockReturnValue(instance);\n\n // Act\n withConfiguredGlobal(config, () => webUrl(constraints));\n\n // Assert\n expect(webPath).toHaveBeenCalledTimes(1); // always used\n expect(webAuthority).toHaveBeenCalledTimes(1); // always used\n const resolvedSizeForPath = webPath.mock.calls[0][0]!.size;\n if (constraints.authoritySettings === undefined || constraints.authoritySettings === undefined) {\n expect(webAuthority.mock.calls[0][0]!.size).toBe(resolvedSizeForPath);\n }\n if (constraints.withFragments) {\n expect(webFragments.mock.calls[0][0]!.size).toBe(resolvedSizeForPath);\n }\n if (constraints.withQueryParameters) {\n expect(webQueryParameters.mock.calls[0][0]!.size).toBe(resolvedSizeForPath);\n }\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/webUrl.spec.ts", "start_line": null, "end_line": null, "dependencies": ["webUrlConstraintsBuilder"], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The size used for sub-arbitraries within `webUrl` should remain consistent, except for `webAuthority` when it uses its own size.", "mode": "fast-check"} {"id": 54456, "name": "unknown", "code": "it('should call buildPartialRecordArbitrary with keys=undefined when no constraints on keys', () =>\n fc.assert(\n fc.property(\n fc.uniqueArray(keyArb, { minLength: 1 }),\n fc.constantFrom(...([undefined, {}, { noNullPrototype: false }, { noNullPrototype: true }] as const)),\n (keys, constraints) => {\n // Arrange\n const recordModel: Record> = {};\n for (const k of keys) {\n const { instance } = fakeArbitrary();\n recordModel[k] = instance;\n }\n const { instance } = fakeArbitrary();\n const buildPartialRecordArbitrary = vi.spyOn(\n PartialRecordArbitraryBuilderMock,\n 'buildPartialRecordArbitrary',\n );\n buildPartialRecordArbitrary.mockReturnValue(instance);\n const noNullPrototype = constraints !== undefined && constraints.noNullPrototype;\n\n // Act\n const arb = constraints !== undefined ? record(recordModel, constraints) : record(recordModel);\n\n // Assert\n expect(arb).toBe(instance);\n expect(buildPartialRecordArbitrary).toHaveBeenCalledTimes(1);\n expect(buildPartialRecordArbitrary).toHaveBeenCalledWith(recordModel, undefined, !!noNullPrototype);\n },\n ),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/record.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`buildPartialRecordArbitrary` is called with `keys=undefined` when there are no constraints provided on the keys, confirming the correct handling of optional constraints.", "mode": "fast-check"} {"id": 54457, "name": "unknown", "code": "it('should call buildPartialRecordArbitrary with keys=requiredKeys when constraints defines valid requiredKeys', () =>\n fc.assert(\n fc.property(\n fc.uniqueArray(keyArb, { minLength: 1 }),\n fc.func(fc.boolean()),\n fc.option(fc.boolean(), { nil: undefined }),\n (keys, isRequired, noNullPrototype) => {\n // Arrange\n const recordModel: Record> = {};\n const requiredKeys: any[] = [];\n for (const k of keys) {\n const { instance } = fakeArbitrary();\n Object.defineProperty(recordModel, k, {\n value: instance,\n configurable: true,\n enumerable: true,\n writable: true,\n });\n if (isRequired(k)) {\n requiredKeys.push(k);\n }\n }\n const { instance } = fakeArbitrary();\n const buildPartialRecordArbitrary = vi.spyOn(\n PartialRecordArbitraryBuilderMock,\n 'buildPartialRecordArbitrary',\n );\n buildPartialRecordArbitrary.mockReturnValue(instance);\n\n // Act\n const arb = record(recordModel, { requiredKeys, noNullPrototype });\n\n // Assert\n expect(arb).toBe(instance);\n expect(buildPartialRecordArbitrary).toHaveBeenCalledTimes(1);\n expect(buildPartialRecordArbitrary).toHaveBeenCalledWith(recordModel, requiredKeys, !!noNullPrototype);\n },\n ),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/record.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`buildPartialRecordArbitrary` is called with keys set to `requiredKeys` when constraints specify valid `requiredKeys`.", "mode": "fast-check"} {"id": 54462, "name": "unknown", "code": "it('should reject any negative or zero maxCount whatever the mode', () =>\n fc.assert(\n fc.property(\n fc.integer({ max: 0 }),\n fc.constantFrom(...([undefined, 'words', 'sentences'] as const)),\n (maxCount, mode) => {\n // Arrange / Act / Assert\n expect(() => lorem({ maxCount, mode })).toThrowError();\n },\n ),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/lorem.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Rejects negative or zero `maxCount` values for any mode in the `lorem` function.", "mode": "fast-check"} {"id": 54463, "name": "unknown", "code": "it('should map on the output of an integer and specify mapper and unmapper', () =>\n fc.assert(\n fc.property(constraintsArb(), (constraints) => {\n // Arrange\n const { instance, map } = fakeArbitrary();\n const { instance: mappedInstance } = fakeArbitrary();\n const integer = vi.spyOn(IntegerMock, 'integer');\n integer.mockReturnValue(instance);\n map.mockReturnValue(mappedInstance);\n\n // Act\n const arb = date(constraints);\n\n // Assert\n expect(arb).toBe(mappedInstance);\n expect(integer).toHaveBeenCalledTimes(1);\n expect(map).toHaveBeenCalledTimes(1);\n expect(map).toHaveBeenCalledWith(expect.any(Function), expect.any(Function));\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/date.spec.ts", "start_line": null, "end_line": null, "dependencies": ["constraintsArb"], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Verifies that the `date` function returns a mapped `Date` instance from an integer input, by checking calls to integer generation and transformation functions.", "mode": "fast-check"} {"id": 54464, "name": "unknown", "code": "it('should always map the minimal value of the internal integer to the requested minimal date', () =>\n fc.assert(\n fc.property(constraintsArb(), (constraints) => {\n // Arrange\n const { instance, map } = fakeArbitrary();\n const { instance: mappedInstance } = fakeArbitrary();\n const integer = vi.spyOn(IntegerMock, 'integer');\n integer.mockReturnValue(instance);\n map.mockReturnValue(mappedInstance);\n\n // Act\n date(constraints);\n const { min: rangeMin } = integer.mock.calls[0][0]!;\n const [mapper] = map.mock.calls[0];\n const minDate = mapper(rangeMin!) as Date;\n\n // Assert\n if (constraints.min !== undefined) {\n // If min was specified,\n // the lowest value of the range requested to integer should map to it\n expect(minDate).toEqual(constraints.min);\n } else {\n // If min was not specified,\n // the lowest value of the range requested to integer should map to the smallest possible Date\n expect(minDate.getTime()).not.toBe(Number.NaN);\n expect(new Date(minDate.getTime() - 1).getTime()).toBe(Number.NaN);\n }\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/date.spec.ts", "start_line": null, "end_line": null, "dependencies": ["constraintsArb"], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The test ensures that the minimal internal integer value maps to the specified minimal date or the smallest possible Date if no minimum is specified.", "mode": "fast-check"} {"id": 54465, "name": "unknown", "code": "it('should always map the maximal value (minus one if NaN accepted) of the internal integer to the requested maximal date', () =>\n fc.assert(\n fc.property(constraintsArb(), (constraints) => {\n // Arrange\n const withInvalidDates = !constraints.noInvalidDate;\n const { instance, map } = fakeArbitrary();\n const { instance: mappedInstance } = fakeArbitrary();\n const integer = vi.spyOn(IntegerMock, 'integer');\n integer.mockReturnValue(instance);\n map.mockReturnValue(mappedInstance);\n\n // Act\n date(constraints);\n const { max: rangeMax } = integer.mock.calls[0][0]!;\n const [mapper] = map.mock.calls[0];\n const maxDate = mapper(withInvalidDates ? rangeMax! - 1 : rangeMax!) as Date;\n\n // Assert\n if (constraints.max !== undefined) {\n // If max was specified,\n // the highest value of the range requested to integer should map to it\n expect(maxDate).toEqual(constraints.max);\n } else {\n // If max was not specified,\n // the highest value of the range requested to integer should map to the highest possible Date\n expect(maxDate.getTime()).not.toBe(Number.NaN);\n expect(new Date(maxDate.getTime() + 1).getTime()).toBe(Number.NaN);\n }\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/date.spec.ts", "start_line": null, "end_line": null, "dependencies": ["constraintsArb"], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The test verifies that the internal integer's maximum value maps correctly to the specified maximal Date, adjusting for the acceptance of NaN if applicable. If a max date is defined in `constraints`, the highest integer value should map directly to it; otherwise, it should map to the highest possible Date value.", "mode": "fast-check"} {"id": 54466, "name": "unknown", "code": "it('should always generate dates between min and max (or invalid ones when accepted) given the range and the mapper', () =>\n fc.assert(\n fc.property(constraintsArb(), fc.maxSafeNat(), (constraints, mod) => {\n // Arrange\n const { instance, map } = fakeArbitrary();\n const { instance: mappedInstance } = fakeArbitrary();\n const integer = vi.spyOn(IntegerMock, 'integer');\n integer.mockReturnValue(instance);\n map.mockReturnValue(mappedInstance);\n\n // Act\n date(constraints);\n const { min: rangeMin, max: rangeMax } = integer.mock.calls[0][0]!;\n const [mapper] = map.mock.calls[0];\n const d = mapper(rangeMin! + (mod % (rangeMax! - rangeMin! + 1))) as Date;\n\n // Assert\n if (constraints.noInvalidDate || !Number.isNaN(d.getTime())) {\n expect(d.getTime()).not.toBe(Number.NaN);\n if (constraints.min) expect(d.getTime()).toBeGreaterThanOrEqual(constraints.min.getTime());\n if (constraints.max) expect(d.getTime()).toBeLessThanOrEqual(constraints.max.getTime());\n }\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/date.spec.ts", "start_line": null, "end_line": null, "dependencies": ["constraintsArb"], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Generated dates should fall within the specified min and max range, or be valid if invalid dates are not accepted.", "mode": "fast-check"} {"id": 54467, "name": "unknown", "code": "it('should throw whenever min is an invalid date', () =>\n fc.assert(\n fc.property(invalidMinConstraintsArb(), (constraints) => {\n // Act / Assert\n expect(() => date(constraints)).toThrowError();\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/date.spec.ts", "start_line": null, "end_line": null, "dependencies": ["invalidMinConstraintsArb"], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The test ensures that passing a constraint with an invalid date for `min` to the `date` function results in an error being thrown.", "mode": "fast-check"} {"id": 54469, "name": "unknown", "code": "it('should throw whenever min is greater than max', () =>\n fc.assert(\n fc.property(invalidRangeConstraintsArb(), (constraints) => {\n // Act / Assert\n expect(() => date(constraints)).toThrowError();\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/date.spec.ts", "start_line": null, "end_line": null, "dependencies": ["invalidRangeConstraintsArb"], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "An exception is thrown when the `min` date is greater than the `max` date in the date constraints.", "mode": "fast-check"} {"id": 54470, "name": "unknown", "code": "it('should directly pass the values not needing any adaptation', () => {\n fc.assert(\n fc.property(\n fc.option(fc.integer({ min: 2 }), { nil: undefined }),\n fc.anything(),\n fc.anything(),\n (biasFactor, v, c) => {\n // Arrange\n const value = new Value(v, c);\n const { instance, generate, shrink, canShrinkWithoutContext } = fakeArbitrary();\n generate.mockReturnValueOnce(value);\n const { instance: mrng } = fakeRandom();\n const adapterFunction = vi\n .fn<(arg0: any) => AdapterOutput>()\n .mockImplementation((v) => ({ adapted: false, value: v }));\n\n // Act\n const arb = adapter(instance, adapterFunction);\n const g = arb.generate(mrng, biasFactor);\n\n // Assert\n expect(g).toBe(value);\n expect(generate).toHaveBeenCalledWith(mrng, biasFactor);\n expect(adapterFunction).toHaveBeenCalledWith(v);\n expect(shrink).not.toHaveBeenCalled();\n expect(canShrinkWithoutContext).not.toHaveBeenCalled();\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/AdapterArbitrary.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Values that do not require adaptation should pass through unchanged when processed by the `adapter` function.", "mode": "fast-check"} {"id": 54471, "name": "unknown", "code": "it('should return an adapted value when needing adaptations', () => {\n fc.assert(\n fc.property(\n fc.option(fc.integer({ min: 2 }), { nil: undefined }),\n fc.anything(),\n fc.anything(),\n fc.anything(),\n (biasFactor, v, c, vAdapted) => {\n // Arrange\n const value = new Value(v, c);\n const { instance, generate, shrink, canShrinkWithoutContext } = fakeArbitrary();\n generate.mockReturnValueOnce(value);\n const { instance: mrng } = fakeRandom();\n const adapterFunction = vi\n .fn<(arg0: any) => AdapterOutput>()\n .mockImplementation(() => ({ adapted: true, value: vAdapted }));\n\n // Act\n const arb = adapter(instance, adapterFunction);\n const g = arb.generate(mrng, biasFactor);\n\n // Assert\n expect(g).not.toBe(value);\n expect(g.value_).toBe(vAdapted);\n expect(generate).toHaveBeenCalledWith(mrng, biasFactor);\n expect(adapterFunction).toHaveBeenCalledWith(v);\n expect(shrink).not.toHaveBeenCalled();\n expect(canShrinkWithoutContext).not.toHaveBeenCalled();\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/AdapterArbitrary.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`adapter` modifies the generated value using an adapter function, confirming that the result differs from the original and matches the adapted value.", "mode": "fast-check"} {"id": 54472, "name": "unknown", "code": "it('should be able to shrink any value it generated if not adapted or shrinkable adapted', () => {\n fc.assert(\n fc.property(\n fc.option(fc.integer({ min: 2 }), { nil: undefined }),\n fc.anything(),\n fc.anything(),\n fc.record({ adapted: fc.boolean(), value: fc.anything() }),\n fc.anything(),\n fc.anything(),\n fc.record({ adapted: fc.boolean(), value: fc.anything() }),\n fc.anything(),\n fc.anything(),\n fc.record({ adapted: fc.boolean(), value: fc.anything() }),\n fc.boolean(),\n (biasFactor, vA, cA, adaptedA, vAA, cAA, adaptedAA, vAB, cAB, adaptedAB, canShrinkIfAdapted) => {\n // Arrange\n fc.pre(allUniques(vA, vAA, vAB)); // check for adapterFunction\n const valueA = new Value(vA, cA);\n const valueAA = new Value(vAA, cAA);\n const valueAB = new Value(vAB, cAB);\n const { instance, generate, shrink, canShrinkWithoutContext } = fakeArbitrary();\n generate.mockReturnValueOnce(valueA);\n shrink.mockReturnValueOnce(Stream.of(valueAA, valueAB));\n canShrinkWithoutContext.mockReturnValue(canShrinkIfAdapted);\n const { instance: mrng } = fakeRandom();\n const adapterFunction = vi\n .fn<(arg0: any) => AdapterOutput>()\n .mockImplementation((v) => (Object.is(v, vA) ? adaptedA : Object.is(v, vAA) ? adaptedAA : adaptedAB));\n\n // Act\n const arb = adapter(instance, adapterFunction);\n const g = arb.generate(mrng, biasFactor);\n const shrinks = [...arb.shrink(g.value, g.context)];\n\n // Assert\n expect(generate).toHaveBeenCalledWith(mrng, biasFactor);\n if (!adaptedA.adapted || canShrinkIfAdapted) {\n expect(shrinks).toHaveLength(2);\n if (adaptedAA.adapted) {\n expect(shrinks[0].value_).toBe(adaptedAA.value);\n } else {\n expect(shrinks[0]).toBe(valueAA);\n }\n if (adaptedAB.adapted) {\n expect(shrinks[1].value_).toBe(adaptedAB.value);\n } else {\n expect(shrinks[1]).toBe(valueAB);\n }\n if (adaptedA.adapted) {\n expect(shrink).toHaveBeenCalledWith(adaptedA.value, undefined);\n expect(canShrinkWithoutContext).toHaveBeenCalledWith(adaptedA.value);\n } else {\n expect(shrink).toHaveBeenCalledWith(vA, cA);\n expect(canShrinkWithoutContext).not.toHaveBeenCalled();\n }\n } else {\n expect(shrinks).toHaveLength(0);\n expect(shrink).not.toHaveBeenCalled();\n expect(canShrinkWithoutContext).toHaveBeenCalledWith(adaptedA.value); // returned false\n }\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/AdapterArbitrary.spec.ts", "start_line": null, "end_line": null, "dependencies": ["allUniques"], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The test checks that values generated by an arbitrary can be correctly shrunk, especially when they are not adapted or are shrinkable if adapted.", "mode": "fast-check"} {"id": 54474, "name": "unknown", "code": "it('should forward missing context as-is to the underlying arbitrary', () => {\n fc.assert(\n fc.property(\n fc.anything(),\n fc.anything(),\n fc.anything(),\n fc.record({ adapted: fc.boolean(), value: fc.anything() }),\n fc.anything(),\n fc.anything(),\n fc.record({ adapted: fc.boolean(), value: fc.anything() }),\n (toShrinkvalue, vAA, cAA, adaptedAA, vAB, cAB, adaptedAB) => {\n // Arrange\n fc.pre(allUniques(vAA, vAB)); // check for adapterFunction\n const valueAA = new Value(vAA, cAA);\n const valueAB = new Value(vAB, cAB);\n const { instance, generate, shrink, canShrinkWithoutContext } = fakeArbitrary();\n shrink.mockReturnValueOnce(Stream.of(valueAA, valueAB));\n const adapterFunction = vi\n .fn<(arg0: any) => AdapterOutput>()\n .mockImplementation((v) => (Object.is(v, vAA) ? adaptedAA : adaptedAB));\n\n // Act\n const arb = adapter(instance, adapterFunction);\n const shrinks = [...arb.shrink(toShrinkvalue, undefined)];\n\n // Assert\n expect(shrinks).toHaveLength(2);\n if (adaptedAA.adapted) {\n expect(shrinks[0].value_).toBe(adaptedAA.value);\n } else {\n expect(shrinks[0]).toBe(valueAA);\n }\n if (adaptedAB.adapted) {\n expect(shrinks[1].value_).toBe(adaptedAB.value);\n } else {\n expect(shrinks[1]).toBe(valueAB);\n }\n expect(generate).not.toHaveBeenCalled();\n expect(shrink).toHaveBeenCalledWith(toShrinkvalue, undefined);\n expect(canShrinkWithoutContext).not.toHaveBeenCalled();\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/AdapterArbitrary.spec.ts", "start_line": null, "end_line": null, "dependencies": ["allUniques"], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Forwards missing context to the underlying arbitrary and verifies that the shrink method is called with the undefined context, ensuring the adapter function correctly adapts values based on uniqueness and specified adaptation.", "mode": "fast-check"} {"id": 54475, "name": "unknown", "code": "it('should always check against the arbitrary of string with raw when no untoggleAll', () => {\n fc.assert(\n fc.property(fc.string(), fc.boolean(), fc.func(fc.string()), (rawValue, isShrinkable, toggleCase) => {\n // Arrange\n const { instance, canShrinkWithoutContext } = fakeArbitrary();\n canShrinkWithoutContext.mockReturnValueOnce(isShrinkable);\n\n // Act\n const arb = new MixedCaseArbitrary(instance, toggleCase, undefined);\n const out = arb.canShrinkWithoutContext(rawValue);\n\n // Assert\n expect(out).toBe(isShrinkable);\n expect(canShrinkWithoutContext).toHaveBeenCalledTimes(1);\n expect(canShrinkWithoutContext).toHaveBeenCalledWith(rawValue);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/MixedCaseArbitrary.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`MixedCaseArbitrary` should match the shrinkability of a string's arbitrary when no `untoggleAll` is specified, verifying the `canShrinkWithoutContext` method.", "mode": "fast-check"} {"id": 54476, "name": "unknown", "code": "it('should always check against the arbitrary of string with untoggled when untoggleAll', () => {\n fc.assert(\n fc.property(\n fc.string(),\n fc.string(),\n fc.boolean(),\n fc.func(fc.string()),\n (rawValue, untoggledValue, isShrinkable, toggleCase) => {\n // Arrange\n const { instance, canShrinkWithoutContext } = fakeArbitrary();\n canShrinkWithoutContext.mockReturnValueOnce(isShrinkable);\n const untoggleAll = vi.fn();\n untoggleAll.mockReturnValue(untoggledValue);\n\n // Act\n const arb = new MixedCaseArbitrary(instance, toggleCase, untoggleAll);\n const out = arb.canShrinkWithoutContext(rawValue);\n\n // Assert\n expect(out).toBe(isShrinkable);\n expect(canShrinkWithoutContext).toHaveBeenCalledTimes(1);\n expect(canShrinkWithoutContext).toHaveBeenCalledWith(untoggledValue);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/MixedCaseArbitrary.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`canShrinkWithoutContext` should return a boolean indicating if a `rawValue` can be shrunk after being processed by `untoggleAll`, which provides the `untoggledValue`.", "mode": "fast-check"} {"id": 54477, "name": "unknown", "code": "it('should only use the first arbitrary to generate values', () => {\n fc.assert(\n fc.property(\n fc.option(fc.integer({ min: 2 }), { nil: undefined }),\n fc.anything(),\n fc.anything(),\n (biasFactor, vA, cA) => {\n // Arrange\n const {\n instance: generatorArbitrary,\n generate: generateA,\n shrink: shrinkA,\n canShrinkWithoutContext: canShrinkWithoutContextA,\n } = fakeArbitrary();\n const {\n instance: shrinkerArbitrary,\n generate: generateB,\n shrink: shrinkB,\n canShrinkWithoutContext: canShrinkWithoutContextB,\n } = fakeArbitrary();\n generateA.mockReturnValueOnce(new Value(vA, cA));\n const { instance: mrng } = fakeRandom();\n\n // Act\n const arb = new WithShrinkFromOtherArbitrary(generatorArbitrary, shrinkerArbitrary);\n const g = arb.generate(mrng, biasFactor);\n\n // Assert\n expect(g.value).toBe(vA);\n expect(generateA).toHaveBeenCalledWith(mrng, biasFactor);\n expect(shrinkA).not.toHaveBeenCalled();\n expect(canShrinkWithoutContextA).not.toHaveBeenCalled();\n expect(generateB).not.toHaveBeenCalled();\n expect(shrinkB).not.toHaveBeenCalled();\n expect(canShrinkWithoutContextB).not.toHaveBeenCalled();\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/WithShrinkFromOtherArbitrary.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Only the first arbitrary is used to generate values when `WithShrinkFromOtherArbitrary` is invoked, without calling any methods on the second arbitrary.", "mode": "fast-check"} {"id": 54478, "name": "unknown", "code": "it('should only use the first arbitrary for values it generated (coming with the context)', () => {\n fc.assert(\n fc.property(\n fc.option(fc.integer({ min: 2 }), { nil: undefined }),\n fc.anything(),\n fc.anything(),\n fc.anything(),\n fc.anything(),\n fc.anything(),\n fc.anything(),\n (biasFactor, vA, cA, vAA, cAA, vAB, cAB) => {\n // Arrange\n const {\n instance: generatorArbitrary,\n generate: generateA,\n shrink: shrinkA,\n canShrinkWithoutContext: canShrinkWithoutContextA,\n } = fakeArbitrary();\n const {\n instance: shrinkerArbitrary,\n generate: generateB,\n shrink: shrinkB,\n canShrinkWithoutContext: canShrinkWithoutContextB,\n } = fakeArbitrary();\n generateA.mockReturnValueOnce(new Value(vA, cA));\n shrinkA.mockReturnValueOnce(Stream.of(new Value(vAA, cAA), new Value(vAB, cAB)));\n const { instance: mrng } = fakeRandom();\n\n // Act\n const arb = new WithShrinkFromOtherArbitrary(generatorArbitrary, shrinkerArbitrary);\n const g = arb.generate(mrng, biasFactor);\n const shrinks = [...arb.shrink(g.value, g.context)];\n\n // Assert\n expect(shrinks).toHaveLength(2);\n expect(shrinks[0].value).toBe(vAA);\n expect(shrinks[1].value).toBe(vAB);\n expect(generateA).toHaveBeenCalledWith(mrng, biasFactor);\n expect(shrinkA).toHaveBeenCalledWith(vA, cA);\n expect(canShrinkWithoutContextA).not.toHaveBeenCalled();\n expect(generateB).not.toHaveBeenCalled();\n expect(shrinkB).not.toHaveBeenCalled();\n expect(canShrinkWithoutContextB).not.toHaveBeenCalled();\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/WithShrinkFromOtherArbitrary.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The arbitrary should utilize only the first arbitrary for generating and shrinking values it originally generated, while the second arbitrary should remain unused in these operations.", "mode": "fast-check"} {"id": 54479, "name": "unknown", "code": "it('should only use the first arbitrary for values it shrunk (coming with the context)', () => {\n fc.assert(\n fc.property(\n fc.option(fc.integer({ min: 2 }), { nil: undefined }),\n fc.anything(),\n fc.anything(),\n fc.anything(),\n fc.anything(),\n fc.anything(),\n fc.anything(),\n fc.anything(),\n fc.anything(),\n fc.anything(),\n fc.anything(),\n (biasFactor, vA, cA, vAA, cAA, vAB, cAB, vAC, cAC, vABA, cABA) => {\n // Arrange\n const {\n instance: generatorArbitrary,\n generate: generateA,\n shrink: shrinkA,\n canShrinkWithoutContext: canShrinkWithoutContextA,\n } = fakeArbitrary();\n const {\n instance: shrinkerArbitrary,\n generate: generateB,\n shrink: shrinkB,\n canShrinkWithoutContext: canShrinkWithoutContextB,\n } = fakeArbitrary();\n generateA.mockReturnValueOnce(new Value(vA, cA));\n shrinkA.mockReturnValueOnce(Stream.of(new Value(vAA, cAA), new Value(vAB, cAB), new Value(vAC, cAC)));\n shrinkA.mockReturnValueOnce(Stream.of(new Value(vABA, cABA)));\n const { instance: mrng } = fakeRandom();\n\n // Act\n const arb = new WithShrinkFromOtherArbitrary(generatorArbitrary, shrinkerArbitrary);\n const g = arb.generate(mrng, biasFactor);\n const g2 = [...arb.shrink(g.value, g.context)][1];\n const shrinks = [...arb.shrink(g2.value, g2.context)];\n\n // Assert\n expect(shrinks).toHaveLength(1);\n expect(shrinks[0].value).toBe(vABA);\n expect(generateA).toHaveBeenCalledWith(mrng, biasFactor);\n expect(shrinkA).toHaveBeenCalledWith(vA, cA);\n expect(shrinkA).toHaveBeenCalledWith(vAB, cAB);\n expect(canShrinkWithoutContextA).not.toHaveBeenCalled();\n expect(generateB).not.toHaveBeenCalled();\n expect(shrinkB).not.toHaveBeenCalled();\n expect(canShrinkWithoutContextB).not.toHaveBeenCalled();\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/WithShrinkFromOtherArbitrary.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`WithShrinkFromOtherArbitrary` uses only the first arbitrary to shrink values, confirmed by checking the shrinking logic and ensuring the second arbitrary is not utilized.", "mode": "fast-check"} {"id": 54480, "name": "unknown", "code": "it('should only use the second arbitrary for values coming without any context', () => {\n fc.assert(\n fc.property(\n fc.anything(),\n fc.anything(),\n fc.anything(),\n fc.anything(),\n fc.anything(),\n (vA, vAA, cAA, vAB, cAB) => {\n // Arrange\n const {\n instance: generatorArbitrary,\n generate: generateA,\n shrink: shrinkA,\n canShrinkWithoutContext: canShrinkWithoutContextA,\n } = fakeArbitrary();\n const {\n instance: shrinkerArbitrary,\n generate: generateB,\n shrink: shrinkB,\n canShrinkWithoutContext: canShrinkWithoutContextB,\n } = fakeArbitrary();\n shrinkB.mockReturnValueOnce(Stream.of(new Value(vAA, cAA), new Value(vAB, cAB)));\n\n // Act\n const arb = new WithShrinkFromOtherArbitrary(generatorArbitrary, shrinkerArbitrary);\n const shrinks = [...arb.shrink(vA, undefined)];\n\n // Assert\n expect(shrinks).toHaveLength(2);\n expect(shrinks[0].value).toBe(vAA);\n expect(shrinks[1].value).toBe(vAB);\n expect(generateA).not.toHaveBeenCalled();\n expect(shrinkA).not.toHaveBeenCalled();\n expect(canShrinkWithoutContextA).not.toHaveBeenCalled();\n expect(generateB).not.toHaveBeenCalled();\n expect(shrinkB).toHaveBeenCalledWith(vA, undefined);\n expect(canShrinkWithoutContextB).not.toHaveBeenCalled();\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/WithShrinkFromOtherArbitrary.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`WithShrinkFromOtherArbitrary` uses only the second arbitrary's shrink method for values that have no context, ensuring the first arbitrary's methods are not called.", "mode": "fast-check"} {"id": 54481, "name": "unknown", "code": "it('should only use the second arbitrary for values shrunk by it (coming with the context)', () => {\n fc.assert(\n fc.property(\n fc.option(fc.integer({ min: 2 }), { nil: undefined }),\n fc.anything(),\n fc.anything(),\n fc.anything(),\n fc.anything(),\n fc.anything(),\n fc.anything(),\n fc.anything(),\n fc.anything(),\n fc.anything(),\n (biasFactor, vA, vAA, cAA, vAB, cAB, vAC, cAC, vABA, cABA) => {\n // Arrange\n const {\n instance: generatorArbitrary,\n generate: generateA,\n shrink: shrinkA,\n canShrinkWithoutContext: canShrinkWithoutContextA,\n } = fakeArbitrary();\n const {\n instance: shrinkerArbitrary,\n generate: generateB,\n shrink: shrinkB,\n canShrinkWithoutContext: canShrinkWithoutContextB,\n } = fakeArbitrary();\n shrinkB.mockReturnValueOnce(Stream.of(new Value(vAA, cAA), new Value(vAB, cAB), new Value(vAC, cAC)));\n shrinkB.mockReturnValueOnce(Stream.of(new Value(vABA, cABA)));\n\n // Act\n const arb = new WithShrinkFromOtherArbitrary(generatorArbitrary, shrinkerArbitrary);\n const g2 = [...arb.shrink(vA, undefined)][1];\n const shrinks = [...arb.shrink(g2.value, g2.context)];\n\n // Assert\n expect(shrinks).toHaveLength(1);\n expect(shrinks[0].value).toBe(vABA);\n expect(generateA).not.toHaveBeenCalled();\n expect(shrinkA).not.toHaveBeenCalled();\n expect(canShrinkWithoutContextA).not.toHaveBeenCalled();\n expect(generateB).not.toHaveBeenCalled();\n expect(shrinkB).toHaveBeenCalledWith(vA, undefined);\n expect(shrinkB).toHaveBeenCalledWith(vAB, cAB);\n expect(canShrinkWithoutContextB).not.toHaveBeenCalled();\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/WithShrinkFromOtherArbitrary.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`WithShrinkFromOtherArbitrary` uses the second arbitrary only for shrinking values it already provided, ensuring the main arbitrary methods are not called during this process.", "mode": "fast-check"} {"id": 54482, "name": "unknown", "code": "it('should wrap waitAll call using act whenever specified', async () =>\n fc.assert(\n fc.asyncProperty(fc.infiniteStream(fc.nat()), async (seeds) => {\n // Arrange\n let actCount = 0;\n const act = (f: () => Promise) => {\n ++actCount;\n return f();\n };\n const nextTaskIndexLengths: number[] = [];\n const nextTaskIndex = buildSeededNextTaskIndex(seeds, nextTaskIndexLengths);\n const taskSelector: TaskSelector = { clone: vi.fn(), nextTaskIndex };\n\n // Act\n const s = new SchedulerImplem(act, taskSelector);\n s.schedule(Promise.resolve(1));\n s.schedule(Promise.resolve(8));\n s.schedule(Promise.resolve(42));\n\n // Assert\n expect(actCount).toBe(0);\n expect(nextTaskIndex).not.toHaveBeenCalled();\n await s.waitAll();\n expect(actCount).toBe(3);\n expect(nextTaskIndex).toHaveBeenCalledTimes(3);\n expect(nextTaskIndexLengths).toEqual([3, 2, 1]);\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/implementations/SchedulerImplem.spec.ts", "start_line": null, "end_line": null, "dependencies": ["buildSeededNextTaskIndex"], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`SchedulerImplem` correctly wraps `waitAll` calls with `act`, incrementing the `actCount` and verifying that `nextTaskIndex` is called the expected number of times, matching the decreasing `nextTaskIndexLengths`.", "mode": "fast-check"} {"id": 54485, "name": "unknown", "code": "it('should only release the requested number of scheduled promises', async () => {\n const scheduledCount = 10;\n await fc.assert(\n fc.asyncProperty(fc.nat({ max: scheduledCount }), fc.gen(), async (n, g) => {\n // Arrange\n const nextTaskIndex = vi.fn((tasks: ScheduledTask[]) => g(fc.nat, { max: tasks.length - 1 }));\n const taskSelector: TaskSelector = { clone: vi.fn(), nextTaskIndex };\n\n // Act\n const s = new SchedulerImplem((f) => f(), taskSelector);\n for (let i = 0; i !== scheduledCount; ++i) {\n s.schedule(Promise.resolve(i));\n }\n\n // Assert\n await s.waitNext(n);\n expect(s.count()).toBe(scheduledCount - n); // Still (10 - n) pending scheduled tasks\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/implementations/SchedulerImplem.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`SchedulerImplem` manages the release of only the specified number of scheduled promises, ensuring that the count of remaining tasks is `scheduledCount - n` after processing `n` promises.", "mode": "fast-check"} {"id": 54486, "name": "unknown", "code": "it('should wait for more tasks if tasks are not all ready at invocation time', async () => {\n const scheduledCount = 10;\n await fc.assert(\n fc.asyncProperty(fc.nat({ max: scheduledCount }), fc.gen(), async (n, g) => {\n // Arrange\n const seenValues: number[] = [];\n const nextTaskIndex = vi.fn((tasks: ScheduledTask[]) => g(fc.nat, { max: tasks.length - 1 }));\n const taskSelector: TaskSelector = { clone: vi.fn(), nextTaskIndex };\n\n // Act\n let queue = delay(-1);\n const s = new SchedulerImplem((f) => f(), taskSelector);\n for (let i = 0; i !== scheduledCount; ++i) {\n queue = queue\n .then(() => delay(0))\n .then(() => s.schedule(Promise.resolve(i)))\n .then((v) => seenValues.push(v));\n }\n\n // Assert\n await s.waitNext(n);\n expect(seenValues).toEqual([...Array(n)].map((_, i) => i));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/implementations/SchedulerImplem.spec.ts", "start_line": null, "end_line": null, "dependencies": ["delay"], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`SchedulerImplem` ensures that it waits for pending tasks to be ready before processing, even when all tasks are not initialized at the start.", "mode": "fast-check"} {"id": 54487, "name": "unknown", "code": "it('should be able to waitAll promises scheduling others', async () =>\n fc.assert(\n fc.asyncProperty(fc.infiniteStream(fc.nat()), async (seeds) => {\n // Arrange\n const status = { done: false };\n const nothingResolved = {\n 1: false,\n 2: false,\n 3: false,\n 4: false,\n 5: false,\n };\n const everythingResolved = {\n 1: true,\n 2: true,\n 3: true,\n 4: true,\n 5: true,\n };\n const resolved = { ...nothingResolved };\n const act = (f: () => Promise) => f();\n const nextTaskIndex = buildSeededNextTaskIndex(seeds);\n const taskSelector: TaskSelector = { clone: vi.fn(), nextTaskIndex };\n const order: number[] = [];\n\n // Act\n const s = new SchedulerImplem(act, taskSelector);\n s.schedule(Promise.resolve(1)).then(() => {\n order.push(1);\n resolved[1] = true;\n Promise.all([\n s.schedule(Promise.resolve(2)).then(() => {\n order.push(2);\n resolved[2] = true;\n }),\n s.schedule(Promise.resolve(3)).then(() => {\n order.push(3);\n resolved[3] = true;\n s.schedule(Promise.resolve(4)).then(() => {\n order.push(4);\n resolved[4] = true;\n });\n }),\n ]).then(() => {\n s.schedule(Promise.resolve(5)).then(() => {\n order.push(5);\n resolved[5] = true;\n status.done = true;\n });\n });\n });\n\n // Assert\n expect(status.done).toBe(false);\n expect(resolved).toEqual(nothingResolved);\n await s.waitAll();\n if (status.done) {\n // There are only a few cases that could make 5 resolved via waitAll. Scheduling 5 is the consequence of Promise.all([2, 3]) being resolved.\n // Promise.all is nasty as it costs an extra await. Meaning that if 3 and 4 (a task scheduled when 3 succeeds) have already been resolved,\n // resolving 2 would not be enought to schedule 5 in a visible way for waitAll.\n expect([\n // The following orders should work to include 5 within the waitAll:\n [1, 2, 3, 4, 5],\n [1, 3, 2, 4, 5],\n ]).toContainEqual(order);\n } else {\n expect([\n // But these ones will not work:\n [1, 3, 4, 2],\n ]).toContainEqual(order);\n\n expect(resolved).toEqual({ ...everythingResolved, 5: false });\n expect(s.count()).toBe(0); // Well, Promise.all just received the last completion it was waiting for...\n await 'just awaiting to get the proper count'; // It needs one extra await to move forward and schedule the item 5\n expect(s.count()).not.toBe(0);\n await s.waitAll(); // extra waitAll should make it pass\n }\n expect(status.done).toBe(true);\n expect(resolved).toEqual(everythingResolved);\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/implementations/SchedulerImplem.spec.ts", "start_line": null, "end_line": null, "dependencies": ["buildSeededNextTaskIndex"], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The function verifies that the `SchedulerImplem` can correctly manage and resolve scheduled promises, even when tasks are added dynamically, by ensuring that all tasks complete in the expected order or require an additional wait for certain sequences.", "mode": "fast-check"} {"id": 54488, "name": "unknown", "code": "it('should be able to schedule new tasks from other tasks and wait them all with waitAll', async () =>\n fc.assert(\n fc.asyncProperty(\n fc.array(\n fc.letrec((tie) => ({\n self: fc.record({\n name: fc.noBias(fc.string({ minLength: 4, maxLength: 4 })),\n children: fc.oneof(\n fc.constant([]),\n fc.array(tie('self') as fc.Arbitrary),\n ),\n }),\n })).self,\n { minLength: 1 },\n ),\n fc.infiniteStream(fc.nat()),\n async (plan, seeds) => {\n // Arrange\n const act = (f: () => Promise) => f();\n const nextTaskIndex = buildSeededNextTaskIndex(seeds);\n const taskSelector: TaskSelector = { clone: vi.fn(), nextTaskIndex };\n const computeTasksInPlan = (tasks: ExecutionPlan[]) => {\n let count = 0;\n for (const t of tasks) {\n count += 1 + computeTasksInPlan(t.children);\n }\n return count;\n };\n const schedulePlan = (s: Scheduler, tasks: ExecutionPlan[]) => {\n for (const t of tasks) {\n s.schedule(Promise.resolve(t.name), t.name).then(() => schedulePlan(s, t.children));\n }\n };\n\n // Act\n const s = new SchedulerImplem(act, taskSelector);\n schedulePlan(s, plan);\n\n // Assert\n await s.waitAll();\n expect(s.count()).toBe(0);\n expect(s.report()).toHaveLength(computeTasksInPlan(plan));\n },\n ),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/implementations/SchedulerImplem.spec.ts", "start_line": null, "end_line": null, "dependencies": ["buildSeededNextTaskIndex"], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The test checks that when scheduling tasks based on a hierarchical execution plan, where tasks can spawn additional tasks, all tasks can be successfully completed and waited upon using `waitAll`, ensuring that the scheduler's task count is zero and the report length matches the number of tasks in the execution plan.", "mode": "fast-check"} {"id": 54489, "name": "unknown", "code": "it('should take one of the provided slices and return it item by item', () => {\n fc.assert(\n fc.property(\n fc.array(fc.array(fc.anything(), { minLength: 1 }), { minLength: 1 }),\n fc.nat(),\n fc.nat(),\n fc.integer({ min: 2 }),\n (slices, targetLengthMod, selectOneMod, biasFactor) => {\n // Arrange\n const { instance: arb } = fakeArbitrary();\n const { instance: mrng, nextInt } = fakeRandom();\n nextInt\n .mockReturnValueOnce(1) // 1 to go for \"value from slices\"\n .mockImplementationOnce((min, max) => (selectOneMod % (max - min + 1)) + min);\n const targetLength = slices[targetLengthMod % slices.length].length;\n\n // Act\n const generator = new SlicedBasedGenerator(arb, mrng, slices, biasFactor);\n const readFromGenerator: unknown[] = [];\n generator.attemptExact(targetLength);\n for (let index = 0; index !== targetLength; ++index) {\n readFromGenerator.push(generator.next().value);\n }\n\n // Assert\n expect(nextInt).toHaveBeenCalledTimes(2); // only called twice: 1/ to bias to one of the slices 2/ to select which one\n expect(nextInt).toHaveBeenCalledWith(1, biasFactor);\n expect(slices).toContainEqual(readFromGenerator);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/implementations/SlicedBasedGenerator.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The test ensures that a `SlicedBasedGenerator` selects one of the provided slices and yields its elements sequentially.", "mode": "fast-check"} {"id": 54490, "name": "unknown", "code": "it('should only go for values coming from the source arbitrary when tossing for unbias', () => {\n fc.assert(\n fc.property(\n fc.array(fc.array(fc.anything(), { minLength: 1 }), { minLength: 1 }),\n fc.infiniteStream(fc.anything()),\n fc.nat({ max: 10 }),\n fc.integer({ min: 2 }),\n (slices, streamValues, targetLength, biasFactor) => {\n // Arrange\n const producedValues: unknown[] = [];\n const { instance: arb, generate } = fakeArbitrary();\n generate.mockImplementation(() => {\n const value = streamValues.next().value;\n const context = streamValues.next().value;\n producedValues.push(value);\n return new Value(value, context);\n });\n const { instance: mrng, nextInt } = fakeRandom();\n nextInt.mockImplementation((_min, max) => max); // >min ie in [min+1,max] corresponds to unbiased\n\n // Act\n const generator = new SlicedBasedGenerator(arb, mrng, slices, biasFactor);\n const readFromGenerator: unknown[] = [];\n generator.attemptExact(targetLength);\n for (let index = 0; index !== targetLength; ++index) {\n readFromGenerator.push(generator.next().value);\n }\n\n // Assert\n expect(generate).toHaveBeenCalledTimes(targetLength);\n expect(readFromGenerator).toEqual(producedValues);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/implementations/SlicedBasedGenerator.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The `SlicedBasedGenerator` only uses values from the source arbitrary when generating an unbiased sequence of a specified length.", "mode": "fast-check"} {"id": 54491, "name": "unknown", "code": "it('should only go for values coming from the slices when tossing for bias', () => {\n fc.assert(\n fc.property(\n fc.array(fc.array(fc.anything(), { minLength: 1 }), { minLength: 1 }),\n fc.infiniteStream(fc.nat()),\n fc.nat({ max: 10 }),\n fc.integer({ min: 2 }),\n fc.boolean(),\n (slices, streamModValues, targetLength, biasFactor, withAttemptExact) => {\n // Arrange\n const { instance: arb, generate } = fakeArbitrary();\n const { instance: mrng, nextInt } = fakeRandom();\n const allValuesFromSlices = slices.flat();\n\n // Act\n const generator = new SlicedBasedGenerator(arb, mrng, slices, biasFactor);\n const readFromGenerator: unknown[] = [];\n if (withAttemptExact) {\n nextInt.mockImplementation((_min, max) => max); // no bias for attemptExact\n generator.attemptExact(targetLength);\n }\n for (let index = 0; index !== targetLength; ++index) {\n let returnedBias = false;\n nextInt.mockImplementation((min, max) => {\n if (!returnedBias) {\n returnedBias = true;\n return min; // ask for bias, to make sure we use slices\n }\n return (streamModValues.next().value % (max - min + 1)) + min; // pure random for next calls\n });\n const value = generator.next().value;\n expect(allValuesFromSlices).toContainEqual(value); // should only produce values coming from slices\n readFromGenerator.push(value);\n }\n\n // Assert\n expect(generate).not.toHaveBeenCalled();\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/implementations/SlicedBasedGenerator.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The `SlicedBasedGenerator` should only produce values from the provided slices when bias is requested and should not call the `generate` method.", "mode": "fast-check"} {"id": 54494, "name": "unknown", "code": "it('should properly extract all parts of an url', () =>\n fc.assert(\n fc.property(\n fc.webUrl({\n authoritySettings: {\n withIPv4: true,\n withIPv4Extended: true,\n withIPv6: true,\n withPort: true,\n withUserInfo: true,\n },\n withFragments: true,\n withQueryParameters: true,\n }),\n (url) => {\n // Arrange\n const parsed = new URL(url);\n\n // Act\n const [scheme, authority, , query, fragments] = partsToUrlUnmapper(url);\n\n // Assert\n expect(scheme).toBe(url.split('://')[0]);\n expect(decodeURIComponent(authority)).toContain(decodeURIComponent(parsed.username));\n expect(decodeURIComponent(authority)).toContain(decodeURIComponent(parsed.password));\n // Cannot assert on hostname: ips are sanitized\n // Cannot assert on pathname: paths are sanitized (eg.: .., .)\n if (parsed.search.length !== 0) {\n expect(decodeURIComponent(query!)).toBe(decodeURIComponent(parsed.search.substring(1)));\n } else {\n expect([null, '']).toContain(query);\n }\n if (parsed.hash.length !== 0) {\n expect(decodeURIComponent(fragments!)).toBe(decodeURIComponent(parsed.hash.substring(1)));\n } else {\n expect([null, '']).toContain(fragments);\n }\n },\n ),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/mappers/PartsToUrl.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`partsToUrlUnmapper` correctly extracts the scheme, authority, query, and fragment components from a given URL.", "mode": "fast-check"} {"id": 54497, "name": "unknown", "code": "it('should be able to unmap any mapped value', () =>\n fc.assert(\n fc.property(fc.array(fc.webSegment()), (segments) => {\n // Arrange\n const mapped = segmentsToPathMapper(segments);\n\n // Act\n const out = segmentsToPathUnmapper(mapped);\n\n // Assert\n expect(out).toEqual(segments);\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/mappers/SegmentsToPath.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The function `segmentsToPathUnmapper` should return the original array of segments when applied to a value mapped by `segmentsToPathMapper`.", "mode": "fast-check"} {"id": 54498, "name": "unknown", "code": "it('should be able to unmap any mapped value', () =>\n fc.assert(\n fc.property(\n fc.string({ unit: hexa(), minLength: 8, maxLength: 8 }),\n fc.string({ unit: hexa(), minLength: 8, maxLength: 8 }),\n fc.string({ unit: hexa(), minLength: 8, maxLength: 8 }),\n fc.string({ unit: hexa(), minLength: 8, maxLength: 8 }),\n (a, b, c, d) => {\n // Arrange\n const ins: [string, string, string, string] = [a, b, c, d];\n const mapped = paddedEightsToUuidMapper(ins);\n\n // Act\n const out = paddedEightsToUuidUnmapper(mapped);\n\n // Assert\n expect(out).toEqual(ins);\n },\n ),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/mappers/PaddedEightsToUuid.spec.ts", "start_line": null, "end_line": null, "dependencies": ["hexa"], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`paddedEightsToUuidUnmapper` reverses the transformation on any string array mapped by `paddedEightsToUuidMapper`, returning the original array.", "mode": "fast-check"} {"id": 54500, "name": "unknown", "code": "it('should be able to generate any of the requested values', () =>\n fc.assert(\n fc.property(\n fc.array(fc.anything(), { minLength: 2 }),\n fc.option(fc.integer({ min: 2 }), { nil: undefined }),\n (values, biasFactor) => {\n // Arrange\n const { instance: mrng, nextInt } = fakeRandom();\n\n // Act / Assert\n const arb = new ConstantArbitrary(values);\n const notSeenValues = [...values];\n for (let idx = 0; idx !== values.length; ++idx) {\n nextInt.mockImplementationOnce((a, _b) => a + idx);\n const g = arb.generate(mrng, biasFactor);\n const index = notSeenValues.findIndex((v) => Object.is(g.value, v));\n expect(index).not.toBe(-1);\n notSeenValues.splice(index, 1);\n }\n expect(notSeenValues).toEqual([]);\n },\n ),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/ConstantArbitrary.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`ConstantArbitrary` can generate each value from a given set of requested values.", "mode": "fast-check"} {"id": 54502, "name": "unknown", "code": "it(\"should not mark value as 'canShrinkWithoutContext' if none of the original values is equal regarding Object.is\", () => {\n fc.assert(\n fc.property(fc.uniqueArray(fc.anything(), { minLength: 2, comparator: 'SameValue' }), (values) => {\n // Arrange\n const [selectedValue, ...acceptedValues] = values;\n\n // Act\n const arb = new ConstantArbitrary(acceptedValues);\n const out = arb.canShrinkWithoutContext(selectedValue); // selectedValue is unique for SameValue comparison (Object.is)\n\n // Assert\n expect(out).toBe(false);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/ConstantArbitrary.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "A value is not marked as 'canShrinkWithoutContext' if it does not match any original values using `Object.is`.", "mode": "fast-check"} {"id": 54503, "name": "unknown", "code": "it('should shrink towards the first value if it was not already this one and to nil otherwise', () =>\n fc.assert(\n fc.property(fc.array(fc.anything(), { minLength: 1 }), fc.nat(), (values, mod) => {\n // Arrange\n const { instance: mrng, nextInt } = fakeRandom();\n nextInt.mockImplementation((a, b) => a + (mod % (b - a + 1)));\n\n // Act\n const arb = new ConstantArbitrary(values);\n const value = arb.generate(mrng, undefined);\n const shrinks = [...arb.shrink(value.value, value.context)];\n\n // Assert\n if (Object.is(value.value, values[0])) {\n expect(shrinks.map((v) => v.value)).toEqual([]);\n } else {\n expect(shrinks.map((v) => v.value)).toEqual([values[0]]);\n }\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/ConstantArbitrary.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`ConstantArbitrary` shrinks towards the first value of the array if the generated value is not the initial one, and shrinks to an empty array if it is already the first value.", "mode": "fast-check"} {"id": 54508, "name": "unknown", "code": "it('should be able to unmap any mapped value', () =>\n fc.assert(\n fc.property(\n fc.uniqueArray(fc.nat({ max: 15 }), { minLength: 1 }),\n fc.nat(),\n fc.string({ unit: hexa() }),\n (versions, diceIndex, tail) => {\n // Arrange\n const index = diceIndex % versions.length;\n const source = index.toString(16) + tail;\n const { versionsApplierMapper, versionsApplierUnmapper } = buildVersionsAppliersForUuid(versions);\n const mapped = versionsApplierMapper(source);\n\n // Act\n const out = versionsApplierUnmapper(mapped);\n\n // Assert\n expect(out).toEqual(source);\n },\n ),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/mappers/VersionsApplierForUuid.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`VersionsApplierUnmapper` restores any mapped value back to the original source value.", "mode": "fast-check"} {"id": 54510, "name": "unknown", "code": "it('should be able to unmap any mapped value', () =>\n fc.assert(\n fc.property(fc.nat({ max: 0xffffffff }), (n) => {\n // Arrange\n const mapped = numberToPaddedEightMapper(n);\n\n // Act\n const out = numberToPaddedEightUnmapper(mapped);\n\n // Assert\n expect(out).toBe(n);\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/mappers/NumberToPaddedEight.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The `numberToPaddedEightUnmapper` should correctly reverse the mapping performed by `numberToPaddedEightMapper`, restoring the original value.", "mode": "fast-check"} {"id": 54513, "name": "unknown", "code": "it('should only consider the received size when set to Size', () => {\n fc.assert(\n fc.property(\n sizeRelatedGlobalConfigArb,\n sizeArb,\n fc.integer({ min: 0, max: MaxLengthUpperBound }),\n fc.integer({ min: 0, max: MaxLengthUpperBound }),\n fc.boolean(),\n (config, size, lengthA, lengthB, specifiedMaxLength) => {\n // Arrange\n const [minLength, maxLength] = lengthA < lengthB ? [lengthA, lengthB] : [lengthB, lengthA];\n\n // Act\n const computedLength = withConfiguredGlobal(config, () =>\n maxGeneratedLengthFromSizeForArbitrary(size, minLength, maxLength, specifiedMaxLength),\n );\n const expectedLength = Math.min(maxLengthFromMinLength(minLength, size), maxLength);\n\n // Assert\n expect(computedLength).toBe(expectedLength);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/helpers/MaxLengthFromMinLength.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "When set to Size, the function should compute the length considering only the specified size, ensuring the computed length equals the minimum of the maximum length from the size and the maximum length.", "mode": "fast-check"} {"id": 54514, "name": "unknown", "code": "it('should behave as its equivalent Size taking into account global settings when receiving a RelativeSize', () => {\n fc.assert(\n fc.property(\n sizeRelatedGlobalConfigArb,\n relativeSizeArb,\n fc.integer({ min: 0, max: MaxLengthUpperBound }),\n fc.integer({ min: 0, max: MaxLengthUpperBound }),\n fc.boolean(),\n (config, size, lengthA, lengthB, specifiedMaxLength) => {\n // Arrange\n const { baseSize: defaultSize = DefaultSize } = config;\n const equivalentSize = relativeSizeToSize(size, defaultSize);\n const [minLength, maxLength] = lengthA < lengthB ? [lengthA, lengthB] : [lengthB, lengthA];\n\n // Act\n const computedLength = withConfiguredGlobal(config, () =>\n maxGeneratedLengthFromSizeForArbitrary(size, minLength, maxLength, specifiedMaxLength),\n );\n const expectedLength = maxGeneratedLengthFromSizeForArbitrary(\n equivalentSize,\n minLength,\n maxLength,\n specifiedMaxLength,\n );\n\n // Assert\n expect(computedLength).toBe(expectedLength);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/helpers/MaxLengthFromMinLength.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`maxGeneratedLengthFromSizeForArbitrary` should compute the same length as when using an equivalent size derived from `relativeSizeToSize`, accounting for global settings.", "mode": "fast-check"} {"id": 60342, "name": "unknown", "code": "it('should limit collection sizes appropriately', () => {\n fc.assert(\n fc.property(\n fc.array(domainArbitraries.curriculumCode, { minLength: 1, maxLength: 100 }),\n (expectations) => {\n // Invariant: Collections should have reasonable size limits\n const maxExpectationsPerLesson = 5;\n\n // In a real lesson, shouldn't have too many expectations\n return expectations.length <= maxExpectationsPerLesson * 20; // Allow for testing\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/invariants/data-model-invariants.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Collection sizes should not exceed a reasonable limit within the specified constraints of the lesson expectations.", "mode": "fast-check"} {"id": 54515, "name": "unknown", "code": "it('should behave as its resolved Size when in unspecified max mode', () => {\n fc.assert(\n fc.property(\n sizeRelatedGlobalConfigArb,\n fc.oneof(sizeArb, relativeSizeArb),\n fc.integer({ min: 0, max: MaxLengthUpperBound }),\n fc.integer({ min: 0, max: MaxLengthUpperBound }),\n (config, size, lengthA, lengthB) => {\n // Arrange\n const resolvedSize = withConfiguredGlobal(config, () => resolveSize(size));\n const [minLength, maxLength] = lengthA < lengthB ? [lengthA, lengthB] : [lengthB, lengthA];\n\n // Act\n const computedLength = withConfiguredGlobal(config, () =>\n maxGeneratedLengthFromSizeForArbitrary(size, minLength, maxLength, false),\n );\n const expectedLength = withConfiguredGlobal(config, () =>\n maxGeneratedLengthFromSizeForArbitrary(resolvedSize, minLength, maxLength, false),\n );\n\n // Assert\n expect(computedLength).toBe(expectedLength);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/helpers/MaxLengthFromMinLength.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The resolved size should determine the computed length when max mode is unspecified, ensuring it matches the expected length with the resolved size applied.", "mode": "fast-check"} {"id": 54517, "name": "unknown", "code": "it('should ignore specifiedMaxLength whenever size specified', () => {\n fc.assert(\n fc.property(\n sizeRelatedGlobalConfigArb,\n sizeForArbitraryArb,\n fc.integer({ min: 0, max: MaxLengthUpperBound }),\n fc.integer({ min: 0, max: MaxLengthUpperBound }),\n (config, size, lengthA, lengthB) => {\n // Arrange\n const [minLength, maxLength] = lengthA < lengthB ? [lengthA, lengthB] : [lengthB, lengthA];\n\n // Act\n const computedLength = withConfiguredGlobal(config, () =>\n maxGeneratedLengthFromSizeForArbitrary(size, minLength, maxLength, false),\n );\n const expectedLength = withConfiguredGlobal(config, () =>\n maxGeneratedLengthFromSizeForArbitrary(size, minLength, maxLength, true),\n );\n\n // Assert\n expect(computedLength).toBe(expectedLength);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/helpers/MaxLengthFromMinLength.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The computed length should equal the expected length when a size is specified, regardless of `specifiedMaxLength`.", "mode": "fast-check"} {"id": 54518, "name": "unknown", "code": "it('should fallback to \"max\" whenever no size specified but maxLength specified when defaultSizeToMaxWhenMaxSpecified true or unset', () => {\n fc.assert(\n fc.property(\n sizeRelatedGlobalConfigArb,\n fc.integer({ min: 0, max: MaxLengthUpperBound }),\n fc.integer({ min: 0, max: MaxLengthUpperBound }),\n (incompleteConfig, lengthA, lengthB) => {\n // Arrange\n const config = { ...incompleteConfig, defaultSizeToMaxWhenMaxSpecified: true };\n const [minLength, maxLength] = lengthA < lengthB ? [lengthA, lengthB] : [lengthB, lengthA];\n\n // Act\n const computedLength = withConfiguredGlobal(config, () =>\n maxGeneratedLengthFromSizeForArbitrary(undefined, minLength, maxLength, true),\n );\n const expectedLength = withConfiguredGlobal(config, () =>\n maxGeneratedLengthFromSizeForArbitrary('max', minLength, maxLength, true),\n );\n\n // Assert\n expect(computedLength).toBe(expectedLength);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/helpers/MaxLengthFromMinLength.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The test checks whether, in the absence of a specified size but with `maxLength` provided, the generated maximum length defaults to `max` when `defaultSizeToMaxWhenMaxSpecified` is set to true or left unset.", "mode": "fast-check"} {"id": 54519, "name": "unknown", "code": "it('should fallback to baseSize (or default) whenever no size specified and no maxLength specified', () => {\n fc.assert(\n fc.property(\n sizeRelatedGlobalConfigArb,\n fc.integer({ min: 0, max: MaxLengthUpperBound }),\n fc.integer({ min: 0, max: MaxLengthUpperBound }),\n (config, lengthA, lengthB) => {\n // Arrange\n const [minLength, maxLength] = lengthA < lengthB ? [lengthA, lengthB] : [lengthB, lengthA];\n const { baseSize: defaultSize = DefaultSize } = config;\n\n // Act\n const computedLength = withConfiguredGlobal(config, () =>\n maxGeneratedLengthFromSizeForArbitrary(undefined, minLength, maxLength, false),\n );\n const expectedLength = maxGeneratedLengthFromSizeForArbitrary(defaultSize, minLength, maxLength, false);\n\n // Assert\n expect(computedLength).toBe(expectedLength);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/helpers/MaxLengthFromMinLength.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "When no size and no maxLength are specified, the function defaults to using baseSize (or a default size) to compute the maximum generated length.", "mode": "fast-check"} {"id": 54520, "name": "unknown", "code": "it('should always return a length being between minLength and maxLength', () => {\n fc.assert(\n fc.property(\n sizeRelatedGlobalConfigArb,\n fc.option(sizeForArbitraryArb, { nil: undefined }),\n fc.integer({ min: 0, max: MaxLengthUpperBound }),\n fc.integer({ min: 0, max: MaxLengthUpperBound }),\n fc.boolean(),\n (config, size, lengthA, lengthB, specifiedMaxLength) => {\n // Arrange\n const [minLength, maxLength] = lengthA < lengthB ? [lengthA, lengthB] : [lengthB, lengthA];\n\n // Act\n const computedLength = withConfiguredGlobal(config, () =>\n maxGeneratedLengthFromSizeForArbitrary(size, minLength, maxLength, specifiedMaxLength),\n );\n\n // Assert\n expect(computedLength).toBeGreaterThanOrEqual(minLength);\n expect(computedLength).toBeLessThanOrEqual(maxLength);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/helpers/MaxLengthFromMinLength.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The computed length from `maxGeneratedLengthFromSizeForArbitrary` should always be between `minLength` and `maxLength`.", "mode": "fast-check"} {"id": 54523, "name": "unknown", "code": "it('should behave as its equivalent Size taking into account global settings when receiving a RelativeSize', () => {\n fc.assert(\n fc.property(sizeRelatedGlobalConfigArb, relativeSizeArb, fc.boolean(), (config, size, specifiedMaxDepth) => {\n // Arrange\n const { baseSize: defaultSize = DefaultSize } = config;\n const equivalentSize = relativeSizeToSize(size, defaultSize);\n\n // Act\n const computedDepthBias = withConfiguredGlobal(config, () =>\n depthBiasFromSizeForArbitrary(size, specifiedMaxDepth),\n );\n const expectedDepthBias = depthBiasFromSizeForArbitrary(equivalentSize, false);\n\n // Assert\n expect(computedDepthBias).toBe(expectedDepthBias);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/helpers/MaxLengthFromMinLength.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`depthBiasFromSizeForArbitrary` should produce the same result whether using `RelativeSize` with global settings or its equivalent `Size`.", "mode": "fast-check"} {"id": 54525, "name": "unknown", "code": "it('should always return 0 if both specifiedMaxDepth and defaultSizeToMaxWhenMaxSpecified are true and size unset', () => {\n fc.assert(\n fc.property(sizeRelatedGlobalConfigArb, (config) => {\n // Arrange / Act\n const computedDepthBias = withConfiguredGlobal({ ...config, defaultSizeToMaxWhenMaxSpecified: true }, () =>\n depthBiasFromSizeForArbitrary(undefined, true),\n );\n\n // Assert\n expect(computedDepthBias).toBe(0);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/helpers/MaxLengthFromMinLength.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Returns 0 for computed depth bias when both specifiedMaxDepth and defaultSizeToMaxWhenMaxSpecified are true, and size is unset.", "mode": "fast-check"} {"id": 54527, "name": "unknown", "code": "it('should always starts stream with target when try asap is requested (when current not target)', () =>\n fc.assert(\n fc.property(fc.maxSafeInteger(), fc.maxSafeInteger(), (current, target) => {\n // Arrange\n fc.pre(current !== target);\n\n // Act\n const shrinks = [...shrinkInteger(current, target, true)];\n\n // Assert\n expect(shrinks).not.toHaveLength(0);\n expect(shrinks[0].value).toBe(target);\n expect(shrinks[0].context).toBe(undefined);\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/helpers/ShrinkInteger.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The property should ensure that when shrinking integers with `try asap` requested and the current value is not the target, the resulting shrink sequence begins with the target integer.", "mode": "fast-check"} {"id": 54530, "name": "unknown", "code": "it('should never include target in the stream when try asap is not requested', () =>\n fc.assert(\n fc.property(fc.maxSafeInteger(), fc.maxSafeInteger(), (current, target) => {\n // Arrange / Act\n const shrinks = [...shrinkInteger(current, target, false)];\n const values = shrinks.map((v) => v.value);\n\n // Assert\n expect(values).not.toContain(target);\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/helpers/ShrinkInteger.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Shrinking an integer from a current to a target value should not include the target in the results when \"try asap\" is false.", "mode": "fast-check"} {"id": 54531, "name": "unknown", "code": "it('should always set context to be the value of previous entry in the stream', () =>\n fc.assert(\n fc.property(fc.maxSafeInteger(), fc.maxSafeInteger(), fc.boolean(), (current, target, tryAsap) => {\n // Arrange / Act\n const shrinks = [...shrinkInteger(current, target, tryAsap)];\n\n // Assert\n for (let idx = 1; idx < shrinks.length; ++idx) {\n expect(shrinks[idx].context).toBe(shrinks[idx - 1].value);\n }\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/helpers/ShrinkInteger.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Each entry in the `shrinkInteger` stream should set its context to the value of the previous entry.", "mode": "fast-check"} {"id": 54532, "name": "unknown", "code": "it('should specify first context of the stream to target if and only if no try asap, undefined otherwise', () =>\n fc.assert(\n fc.property(fc.maxSafeInteger(), fc.maxSafeInteger(), fc.boolean(), (current, target, tryAsap) => {\n // Arrange\n const expectedFirstContext = tryAsap ? undefined : target;\n\n // Act\n const first = shrinkInteger(current, target, tryAsap).getNthOrLast(0);\n\n // Assert\n if (first !== null) {\n expect(first.context).toBe(expectedFirstContext);\n }\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/helpers/ShrinkInteger.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The test ensures that the first context of a stream from `shrinkInteger` is set to the target value only if `tryAsap` is false; otherwise, it should be undefined.", "mode": "fast-check"} {"id": 54534, "name": "unknown", "code": "it('should always return empty stream when current equals target', () =>\n fc.assert(\n fc.property(fc.bigInt(), fc.boolean(), (value, tryAsap) => {\n // Arrange / Act\n const shrinks = [...shrinkBigInt(value, value, tryAsap)];\n\n // Assert\n expect(shrinks).toHaveLength(0);\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/helpers/ShrinkBigInt.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The function `shrinkBigInt` returns an empty stream when the `current` equals the `target`.", "mode": "fast-check"} {"id": 54535, "name": "unknown", "code": "it('should always starts stream with target when try asap is requested (when current not target)', () =>\n fc.assert(\n fc.property(fc.bigInt(), fc.bigInt(), (current, target) => {\n // Arrange\n fc.pre(current !== target);\n\n // Act\n const shrinks = [...shrinkBigInt(current, target, true)];\n\n // Assert\n expect(shrinks).not.toHaveLength(0);\n expect(shrinks[0].value).toBe(target);\n expect(shrinks[0].context).toBe(undefined);\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/helpers/ShrinkBigInt.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The test verifies that when shrinking a `bigInt` with a different `current` and `target`, and \"try asap\" is requested, the shrink stream always starts with the `target`.", "mode": "fast-check"} {"id": 54536, "name": "unknown", "code": "it('should only include values between current and target in the stream', () =>\n fc.assert(\n fc.property(fc.bigInt(), fc.bigInt(), fc.boolean(), (current, target, tryAsap) => {\n // Arrange / Act\n const shrinks = [...shrinkBigInt(current, target, tryAsap)];\n const values = shrinks.map((v) => v.value);\n const min = (a: bigint, b: bigint) => (a < b ? a : b);\n const max = (a: bigint, b: bigint) => (a < b ? b : a);\n\n // Assert\n for (const v of values) {\n expect(v).toBeGreaterThanOrEqual(min(current, target));\n expect(v).toBeLessThanOrEqual(max(current, target));\n }\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/helpers/ShrinkBigInt.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`shrinkBigInt` generates values between the current and target, inclusive, in the shrink stream.", "mode": "fast-check"} {"id": 54539, "name": "unknown", "code": "it('should always set context to be the value of previous entry in the stream', () =>\n fc.assert(\n fc.property(fc.bigInt(), fc.bigInt(), fc.boolean(), (current, target, tryAsap) => {\n // Arrange / Act\n const shrinks = [...shrinkBigInt(current, target, tryAsap)];\n\n // Assert\n for (let idx = 1; idx < shrinks.length; ++idx) {\n expect(shrinks[idx].context).toBe(shrinks[idx - 1].value);\n }\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/helpers/ShrinkBigInt.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The context of each entry in the `shrinkBigInt` stream should be set to the value of the previous entry.", "mode": "fast-check"} {"id": 54540, "name": "unknown", "code": "it('should specify first context of the stream to target if and only if no try asap, undefined otherwise', () =>\n fc.assert(\n fc.property(fc.bigInt(), fc.bigInt(), fc.boolean(), (current, target, tryAsap) => {\n // Arrange\n const expectedFirstContext = tryAsap ? undefined : target;\n\n // Act\n const first = shrinkBigInt(current, target, tryAsap).getNthOrLast(0);\n\n // Assert\n if (first !== null) {\n expect(first.context).toBe(expectedFirstContext);\n }\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/helpers/ShrinkBigInt.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The first context of the stream produced by `shrinkBigInt` should be set to the target when `tryAsap` is false, and undefined otherwise.", "mode": "fast-check"} {"id": 54541, "name": "unknown", "code": "it('should always strictly increase distance from target as we move in the stream', () =>\n fc.assert(\n fc.property(fc.bigInt(), fc.bigInt(), fc.boolean(), (current, target, tryAsap) => {\n // Arrange / Act\n const shrinks = [...shrinkBigInt(current, target, tryAsap)];\n const absDiff = (a: bigint, b: bigint): bigint => {\n const result = a - b;\n return result >= 0 ? result : -result;\n };\n\n // Assert\n for (let idx = 1; idx < shrinks.length; ++idx) {\n const previousDistance = absDiff(shrinks[idx - 1].value, target);\n const currentDistance = absDiff(shrinks[idx].value, target);\n expect(currentDistance).toBeGreaterThan(previousDistance);\n }\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/helpers/ShrinkBigInt.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The distance from the target should strictly increase with each subsequent element in the `shrinkBigInt` stream.", "mode": "fast-check"} {"id": 54544, "name": "unknown", "code": "it('should be able to split strings built out of chunks into chunks', () =>\n fc.assert(\n fc.property(\n // Defining chunks, we allow \"\" to be part of the chunks as we do not request any minimal length for the 'split into chunks'\n fc.array(fc.string({ unit: 'binary' }), { minLength: 1 }),\n // Array of random natural numbers to help building the source string\n fc.array(fc.nat()),\n (sourceChunks, sourceMods) => {\n // Arrange\n const sourceChunksSet = new Set(sourceChunks);\n const { instance, canShrinkWithoutContext } = fakeArbitrary();\n canShrinkWithoutContext.mockImplementation((value): value is string => sourceChunksSet.has(value as string));\n const source = sourceMods.map((mod) => sourceChunks[mod % sourceChunks.length]).join('');\n\n // Act\n const unmapper = patternsToStringUnmapperFor(instance, {});\n const chunks = unmapper(source);\n\n // Assert\n expect(chunks.join('')).toBe(source);\n // Remark: Found chunks may differ from the one we used to build the source\n // For instance:\n // > sourceChunks = [\"ToTo\", \"To\"]\n // > sourceMods = [0]\n // > chunks might be [\"To\", \"To\"] or [\"ToTo\"] and both are valid ones\n },\n ),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/mappers/PatternsToString.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The property should allow splitting a string built from multiple chunks into chunks such that concatenating the chunks results in the original string, even though the chunks may differ from the original ones used to build the string.", "mode": "fast-check"} {"id": 54545, "name": "unknown", "code": "it('should be able to split strings built out of chunks into chunks while respecting constraints in size', () =>\n fc.assert(\n fc.property(\n fc.array(fc.string({ unit: 'binary', minLength: 1 }), { minLength: 1 }),\n fc.array(fc.nat()),\n fc.nat(),\n fc.nat(),\n (sourceChunks, sourceMods, constraintsMinOffset, constraintsMaxOffset) => {\n // Arrange\n const sourceChunksSet = new Set(sourceChunks);\n const { instance, canShrinkWithoutContext } = fakeArbitrary();\n canShrinkWithoutContext.mockImplementation((value): value is string => sourceChunksSet.has(value as string));\n const source = sourceMods.map((mod) => sourceChunks[mod % sourceChunks.length]).join('');\n const constraints = {\n minLength: Math.max(0, sourceMods.length - constraintsMinOffset),\n maxLength: sourceMods.length + constraintsMaxOffset,\n };\n\n // Act\n const unmapper = patternsToStringUnmapperFor(instance, constraints);\n const chunks = unmapper(source);\n\n // Assert\n expect(chunks.join('')).toBe(source);\n expect(chunks.length).toBeGreaterThanOrEqual(constraints.minLength);\n expect(chunks.length).toBeLessThanOrEqual(constraints.maxLength);\n },\n ),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/mappers/PatternsToString.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Splits a string built from chunks into chunks that adhere to specified size constraints, ensuring the joined chunks reconstruct the original string.", "mode": "fast-check"} {"id": 54546, "name": "unknown", "code": "it('should return false if passed value does not have the right length', () =>\n fc.assert(\n fc.property(fc.nat({ max: 1000 }), fc.nat({ max: 1000 }), (numValues, numRequestedValues) => {\n // Arrange\n fc.pre(numValues !== numRequestedValues);\n const { instance: sourceArb, canShrinkWithoutContext } = fakeArbitrary();\n\n // Act\n const arb = new CloneArbitrary(sourceArb, numValues);\n const out = arb.canShrinkWithoutContext([...Array(numRequestedValues)]);\n\n // Assert\n expect(out).toBe(false);\n expect(canShrinkWithoutContext).not.toHaveBeenCalled();\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/CloneArbitrary.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`CloneArbitrary.canShrinkWithoutContext` returns false when the length of the provided array does not match the expected number of values.", "mode": "fast-check"} {"id": 54547, "name": "unknown", "code": "it('should be able to unmap any mapped value', () =>\n fc.assert(\n fc.property(fc.maxSafeNat(), fc.integer({ min: 6, max: 20 }), (input, length) => {\n // Arrange\n const mapped = paddedUintToBase32StringMapper(length)(input);\n // Act\n const out = uintToBase32StringUnmapper(mapped);\n // Assert\n expect(out).toEqual(input);\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/mappers/UintToBase32String.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The property ensures that mapping an integer to a base32 string and then unmapping it returns the original integer, verifying the inverse relationship between `paddedUintToBase32StringMapper` and `uintToBase32StringUnmapper`.", "mode": "fast-check"} {"id": 54548, "name": "unknown", "code": "it('should concat all the generated values together when no set constraints ', () => {\n fc.assert(\n fc.property(\n fc.array(fc.tuple(fc.anything(), fc.anything())),\n fc.nat(),\n fc.nat(MaxLengthUpperBound),\n fc.nat(MaxLengthUpperBound),\n fc.anything(),\n (generatedValues, seed, aLength, bLength, integerContext) => {\n // Arrange\n const { acceptedValues, instance, generate } = prepareSetBuilderData(generatedValues, false);\n const { minLength, maxGeneratedLength, maxLength } = extractLengths(seed, aLength, bLength, acceptedValues);\n const { instance: integerInstance, generate: generateInteger } = fakeArbitrary();\n generateInteger.mockReturnValue(new Value(acceptedValues.size, integerContext));\n const integer = vi.spyOn(IntegerMock, 'integer');\n integer.mockReturnValue(integerInstance);\n const { instance: mrng } = fakeRandom();\n\n // Act\n const arb = new ArrayArbitrary(\n instance,\n minLength,\n maxGeneratedLength,\n maxLength,\n undefined,\n undefined,\n [],\n );\n const g = arb.generate(mrng, undefined);\n\n // Assert\n expect(g.hasToBeCloned).toBe(false);\n expect(g.value).toEqual([...acceptedValues].map((v) => v.value));\n expect(integer).toHaveBeenCalledTimes(1);\n expect(integer).toHaveBeenCalledWith({ min: minLength, max: maxGeneratedLength });\n expect(generateInteger).toHaveBeenCalledTimes(1);\n expect(generateInteger).toHaveBeenCalledWith(mrng, undefined);\n expect(generate).toHaveBeenCalledTimes(acceptedValues.size);\n for (const call of generate.mock.calls) {\n expect(call).toEqual([mrng, undefined]);\n }\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/ArrayArbitrary.spec.ts", "start_line": null, "end_line": null, "dependencies": ["prepareSetBuilderData", "extractLengths"], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Concatenation of generated values occurs when there are no set constraints, matching the values against the accepted set and ensuring the length constraints are respected.", "mode": "fast-check"} {"id": 54549, "name": "unknown", "code": "it(\"should not concat all the values together in case they don't follow set contraints\", () => {\n fc.assert(\n fc.property(\n fc.array(fc.tuple(fc.anything(), fc.anything(), fc.boolean())),\n fc.nat(),\n fc.nat(MaxLengthUpperBound),\n fc.nat(MaxLengthUpperBound),\n fc.anything(),\n (generatedValues, seed, aLength, bLength, integerContext) => {\n // Arrange\n const { acceptedValues, instance, generate, setBuilder } = prepareSetBuilderData(generatedValues, false);\n const { minLength, maxGeneratedLength, maxLength } = extractLengths(seed, aLength, bLength, acceptedValues);\n const { instance: integerInstance, generate: generateInteger } = fakeArbitrary();\n generateInteger.mockReturnValue(new Value(acceptedValues.size, integerContext));\n const integer = vi.spyOn(IntegerMock, 'integer');\n integer.mockReturnValue(integerInstance);\n const { instance: mrng } = fakeRandom();\n\n // Act\n const arb = new ArrayArbitrary(\n instance,\n minLength,\n maxGeneratedLength,\n maxLength,\n undefined,\n setBuilder,\n [],\n );\n const g = arb.generate(mrng, undefined);\n\n // Assert\n expect(g.hasToBeCloned).toBe(false);\n // In the case of set the generated value might be smaller\n // The generator is allowed to stop whenever it considers at already tried to many times (maxGeneratedLength times)\n expect(g.value).toEqual([...acceptedValues].map((v) => v.value).slice(0, g.value.length));\n expect(integer).toHaveBeenCalledTimes(1);\n expect(integer).toHaveBeenCalledWith({ min: minLength, max: maxGeneratedLength });\n expect(generateInteger).toHaveBeenCalledTimes(1);\n expect(generateInteger).toHaveBeenCalledWith(mrng, undefined);\n expect(setBuilder).toHaveBeenCalledTimes(1);\n for (const call of generate.mock.calls) {\n expect(call).toEqual([mrng, undefined]);\n }\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/ArrayArbitrary.spec.ts", "start_line": null, "end_line": null, "dependencies": ["prepareSetBuilderData", "extractLengths"], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Generated values that do not conform to set constraints are not concatenated together, ensuring only valid values are used in the array.", "mode": "fast-check"} {"id": 54551, "name": "unknown", "code": "it('should bias depth the same way for any child and reset it at the end', () => {\n fc.assert(\n fc.property(\n fc.array(fc.tuple(fc.anything(), fc.anything(), fc.boolean())),\n fc.nat(),\n fc.nat(MaxLengthUpperBound),\n fc.nat(MaxLengthUpperBound),\n fc.anything(),\n fc.integer({ min: 2 }),\n fc.boolean(),\n (generatedValues, seed, aLength, bLength, integerContext, biasFactor, withSetBuilder) => {\n // Arrange\n const getDepthContextFor = vi.spyOn(DepthContextMock, 'getDepthContextFor');\n const depthContext = { depth: 0 };\n getDepthContextFor.mockReturnValue(depthContext);\n const seenDepths = new Set();\n const { acceptedValues, instance, generate, setBuilder } = prepareSetBuilderData(\n generatedValues,\n !withSetBuilder,\n () => {\n seenDepths.add(depthContext.depth);\n },\n );\n const { minLength, maxGeneratedLength, maxLength } = extractLengths(seed, aLength, bLength, acceptedValues);\n const { instance: integerInstance, generate: generateInteger } = fakeArbitrary();\n generateInteger.mockReturnValue(new Value(minLength, integerContext));\n const integer = vi.spyOn(IntegerMock, 'integer');\n integer.mockReturnValue(integerInstance);\n const { instance: mrng } = fakeRandom();\n\n // Act\n const arb = new ArrayArbitrary(\n instance,\n minLength,\n maxGeneratedLength,\n maxLength,\n undefined,\n withSetBuilder ? setBuilder : undefined,\n [],\n );\n arb.generate(mrng, biasFactor);\n\n // Assert\n expect(getDepthContextFor).toHaveBeenCalledTimes(1); // only array calls it in the test\n expect(depthContext.depth).toBe(0); // properly reset\n if (generate.mock.calls.length !== 0) {\n expect([...seenDepths]).toHaveLength(1); // always called with same depth\n } else {\n expect([...seenDepths]).toHaveLength(0); // never called on items\n }\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/ArrayArbitrary.spec.ts", "start_line": null, "end_line": null, "dependencies": ["prepareSetBuilderData", "extractLengths"], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The `ArrayArbitrary` should consistently manage depth for each generated child and reset the depth at the end of array generation.", "mode": "fast-check"} {"id": 54552, "name": "unknown", "code": "it('should reject any array not matching the requirements on length', () => {\n fc.assert(\n fc.property(\n fc.array(fc.anything()),\n fc.boolean(),\n fc.nat(MaxLengthUpperBound),\n fc.nat(MaxLengthUpperBound),\n fc.nat(MaxLengthUpperBound),\n (value, withSetBuilder, aLength, bLength, cLength) => {\n // Arrange\n const [minLength, maxGeneratedLength, maxLength] = [aLength, bLength, cLength].sort((a, b) => a - b);\n fc.pre(value.length < minLength || value.length > maxLength);\n const { instance, canShrinkWithoutContext } = fakeArbitrary();\n const data: any[] = [];\n const customSet: CustomSet> = {\n size: () => data.length,\n getData: () => data,\n tryAdd: (vTest) => {\n data.push(vTest.value_);\n return true;\n },\n };\n const setBuilder = vi.fn();\n setBuilder.mockReturnValue(customSet);\n\n // Act\n const arb = new ArrayArbitrary(\n instance,\n minLength,\n maxGeneratedLength,\n maxLength,\n undefined,\n withSetBuilder ? setBuilder : undefined,\n [],\n );\n const out = arb.canShrinkWithoutContext(value);\n\n // Assert\n expect(out).toBe(false);\n expect(canShrinkWithoutContext).not.toHaveBeenCalled();\n expect(setBuilder).not.toHaveBeenCalled();\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/ArrayArbitrary.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Arrays that do not meet specified length requirements should be rejected by returning false from `canShrinkWithoutContext`.", "mode": "fast-check"} {"id": 54553, "name": "unknown", "code": "it('should reject any array with at least one entry rejected by the sub-arbitrary', () => {\n fc.assert(\n fc.property(\n fc.uniqueArray(fc.tuple(fc.anything(), fc.boolean()), {\n minLength: 1,\n selector: (v) => v[0],\n comparator: 'SameValue',\n }),\n fc.boolean(),\n fc.nat(MaxLengthUpperBound),\n fc.nat(MaxLengthUpperBound),\n fc.nat(MaxLengthUpperBound),\n (value, withSetBuilder, offsetMin, offsetMax, maxGeneratedLength) => {\n // Arrange\n fc.pre(value.some((v) => !v[1]));\n const minLength = Math.min(Math.max(0, value.length - offsetMin), maxGeneratedLength);\n const maxLength = Math.max(Math.min(MaxLengthUpperBound, value.length + offsetMax), maxGeneratedLength);\n const { instance, canShrinkWithoutContext } = fakeArbitrary();\n canShrinkWithoutContext.mockImplementation(\n (vTest): vTest is any => value.find((v) => Object.is(v[0], vTest))![1],\n );\n const data: any[] = [];\n const customSet: CustomSet> = {\n size: () => data.length,\n getData: () => data,\n tryAdd: (vTest) => {\n data.push(vTest.value_);\n return true;\n },\n };\n const setBuilder = vi.fn();\n setBuilder.mockReturnValue(customSet);\n\n // Act\n const arb = new ArrayArbitrary(\n instance,\n minLength,\n maxGeneratedLength,\n maxLength,\n undefined,\n withSetBuilder ? setBuilder : undefined,\n [],\n );\n const out = arb.canShrinkWithoutContext(value.map((v) => v[0]));\n\n // Assert\n expect(out).toBe(false);\n expect(canShrinkWithoutContext).toHaveBeenCalled();\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/ArrayArbitrary.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Arrays containing at least one element rejected by the sub-arbitrary should not shrink without context.", "mode": "fast-check"} {"id": 54554, "name": "unknown", "code": "it('should reject any array not matching requirements for set constraints', () => {\n fc.assert(\n fc.property(\n fc.uniqueArray(fc.tuple(fc.anything(), fc.boolean()), {\n minLength: 1,\n selector: (v) => v[0],\n comparator: 'SameValue',\n }),\n fc.nat(MaxLengthUpperBound),\n fc.nat(MaxLengthUpperBound),\n fc.nat(MaxLengthUpperBound),\n (value, offsetMin, offsetMax, maxGeneratedLength) => {\n // Arrange\n fc.pre(value.some((v) => !v[1]));\n const minLength = Math.min(Math.max(0, value.length - offsetMin), maxGeneratedLength);\n const maxLength = Math.max(Math.min(MaxLengthUpperBound, value.length + offsetMax), maxGeneratedLength);\n const { instance, canShrinkWithoutContext } = fakeArbitrary();\n canShrinkWithoutContext.mockReturnValue(true);\n const data: any[] = [];\n const customSet: CustomSet> = {\n size: () => data.length,\n getData: () => data,\n tryAdd: (vTest) => {\n if (value.find((v) => Object.is(v[0], vTest.value_))![1]) {\n data.push(vTest.value_);\n return true;\n }\n return false;\n },\n };\n const setBuilder = vi.fn();\n setBuilder.mockReturnValue(customSet);\n\n // Act\n const arb = new ArrayArbitrary(\n instance,\n minLength,\n maxGeneratedLength,\n maxLength,\n undefined,\n setBuilder,\n [],\n );\n const out = arb.canShrinkWithoutContext(value.map((v) => v[0]));\n\n // Assert\n expect(out).toBe(false);\n expect(canShrinkWithoutContext).toHaveBeenCalled();\n expect(setBuilder).toHaveBeenCalled();\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/ArrayArbitrary.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The test ensures that any array not fulfilling specific set constraints results in `ArrayArbitrary` being unable to shrink the array without context, thus returning false.", "mode": "fast-check"} {"id": 54555, "name": "unknown", "code": "it('should reject any sparse array', () => {\n fc.assert(\n fc.property(\n fc.sparseArray(fc.anything()),\n fc.boolean(),\n fc.nat(MaxLengthUpperBound),\n fc.nat(MaxLengthUpperBound),\n fc.nat(MaxLengthUpperBound),\n (value, withSetBuilder, offsetMin, offsetMax, maxGeneratedLength) => {\n // Arrange\n fc.pre(value.length !== Object.keys(value).length);\n const minLength = Math.min(Math.max(0, value.length - offsetMin), maxGeneratedLength);\n const maxLength = Math.max(Math.min(MaxLengthUpperBound, value.length + offsetMax), maxGeneratedLength);\n const { instance, canShrinkWithoutContext } = fakeArbitrary();\n canShrinkWithoutContext.mockReturnValue(true);\n const data: any[] = [];\n const customSet: CustomSet> = {\n size: () => data.length,\n getData: () => data,\n tryAdd: (vTest) => {\n data.push(vTest.value_);\n return true;\n },\n };\n const setBuilder = vi.fn();\n setBuilder.mockReturnValue(customSet);\n\n // Act\n const arb = new ArrayArbitrary(\n instance,\n minLength,\n maxGeneratedLength,\n maxLength,\n undefined,\n withSetBuilder ? setBuilder : undefined,\n [],\n );\n const out = arb.canShrinkWithoutContext(value);\n\n // Assert\n expect(out).toBe(false);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/ArrayArbitrary.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Rejection of sparse arrays occurs when the array's length does not match the number of defined keys, resulting in `canShrinkWithoutContext` returning false.", "mode": "fast-check"} {"id": 54556, "name": "unknown", "code": "it('should accept all other arrays', () => {\n fc.assert(\n fc.property(\n fc.array(fc.anything()),\n fc.boolean(),\n fc.nat(MaxLengthUpperBound),\n fc.nat(MaxLengthUpperBound),\n fc.nat(MaxLengthUpperBound),\n (value, withSetBuilder, offsetMin, offsetMax, maxGeneratedLength) => {\n // Arrange\n const minLength = Math.min(Math.max(0, value.length - offsetMin), maxGeneratedLength);\n const maxLength = Math.max(Math.min(MaxLengthUpperBound, value.length + offsetMax), maxGeneratedLength);\n const { instance, canShrinkWithoutContext } = fakeArbitrary();\n canShrinkWithoutContext.mockReturnValue(true);\n const data: any[] = [];\n const customSet: CustomSet> = {\n size: () => data.length,\n getData: () => data,\n tryAdd: (vTest) => {\n data.push(vTest.value_);\n return true;\n },\n };\n const setBuilder = vi.fn();\n setBuilder.mockReturnValue(customSet);\n\n // Act\n const arb = new ArrayArbitrary(\n instance,\n minLength,\n maxGeneratedLength,\n maxLength,\n undefined,\n withSetBuilder ? setBuilder : undefined,\n [],\n );\n const out = arb.canShrinkWithoutContext(value);\n\n // Assert\n expect(out).toBe(true);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/ArrayArbitrary.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`ArrayArbitrary` can successfully handle any array input, ensuring that the output maintains the ability to shrink without context.", "mode": "fast-check"} {"id": 54558, "name": "unknown", "code": "it('should reject any subdomain with strictly more than 63 characters', () =>\n fc.assert(\n fc.property(fc.string({ unit: alphaChar(), minLength: 64 }), (subdomainLabel) => {\n expect(filterInvalidSubdomainLabel(subdomainLabel)).toBe(false);\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/helpers/InvalidSubdomainLabelFiIter.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`filterInvalidSubdomainLabel` returns false for subdomain labels exceeding 63 characters.", "mode": "fast-check"} {"id": 54559, "name": "unknown", "code": "it('should reject any subdomain starting by \"xn--\"', () =>\n fc.assert(\n fc.property(fc.string({ unit: alphaChar(), maxLength: 63 - 'xn--'.length }), (subdomainLabelEnd) => {\n const subdomainLabel = `xn--${subdomainLabelEnd}`;\n expect(filterInvalidSubdomainLabel(subdomainLabel)).toBe(false);\n }),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/helpers/InvalidSubdomainLabelFiIter.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Subdomains starting with \"xn--\" should be rejected by `filterInvalidSubdomainLabel`.", "mode": "fast-check"} {"id": 54560, "name": "unknown", "code": "it('should not reject subdomains if they start by a substring of \"xn--\"', () =>\n fc.assert(\n fc.property(\n fc.string({ unit: alphaChar(), maxLength: 63 - 'xn--'.length }),\n fc.nat('xn--'.length - 1),\n (subdomainLabelEnd, keep) => {\n const subdomainLabel = `${'xn--'.substring(0, keep)}${subdomainLabelEnd}`;\n expect(filterInvalidSubdomainLabel(subdomainLabel)).toBe(true);\n },\n ),\n ))", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/arbitrary/_internals/helpers/InvalidSubdomainLabelFiIter.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "Subdomains starting with a substring of \"xn--\" should not be rejected by `filterInvalidSubdomainLabel`.", "mode": "fast-check"} {"id": 54563, "name": "unknown", "code": "it('should fulfill fibo(2p-1) = fibo\u00b2(p-1)+fibo\u00b2(p)', () => {\n // Special case of the property above\n fc.assert(\n fc.property(fc.integer({ min: 1, max: MaxN }), (p) => {\n expect(fibo(2 * p - 1)).toBe(fibo(p - 1) * fibo(p - 1) + fibo(p) * fibo(p));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/001-simple/fibonacci/main.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "`fibo(2p-1)` should equal `fibo(p-1)\u00b2 + fibo(p)\u00b2` for integers `p`.", "mode": "fast-check"} {"id": 54567, "name": "unknown", "code": "it('should fulfill gcd(fibo(a), fibo(b)) = fibo(gcd(a,b))', () => {\n fc.assert(\n fc.property(fc.integer({ min: 1, max: MaxN }), fc.integer({ min: 1, max: MaxN }), (a, b) => {\n const gcd = (a: T, b: T, zero: T): T => {\n a = a < zero ? (-a as T) : a;\n b = b < zero ? (-b as T) : b;\n if (b > a) {\n const temp = a;\n a = b;\n b = temp;\n }\n // eslint-disable-next-line no-constant-condition\n while (true) {\n if (b == zero) return a;\n a = (a % b) as T;\n if (a == zero) return b;\n b = (b % a) as T;\n }\n };\n expect(gcd(fibo(a), fibo(b), 0n)).toBe(fibo(gcd(a, b, 0)));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/examples/001-simple/fibonacci/main.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The greatest common divisor of Fibonacci numbers at positions `a` and `b` should equal the Fibonacci number at the position of the greatest common divisor of `a` and `b`.", "mode": "fast-check"} {"id": 54568, "name": "unknown", "code": "it('Should fail if predicate throws anything', () => {\n fc.assert(\n fc.property(fc.anything(), (stuff) => {\n // Arrange\n fc.pre(stuff === null || typeof stuff !== 'object' || !('toString' in stuff));\n const p = property(stubArb.single(8), (_arg: number) => {\n throw stuff;\n });\n\n // Act\n p.runBeforeEach();\n const out = p.run(p.generate(stubRng.mutable.nocall()).value);\n p.runAfterEach();\n\n // Assert\n expect(out).toEqual({ error: stuff });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/check/property/Property.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "A predicate throwing an error should result in a failure with the specific error captured in the output.", "mode": "fast-check"} {"id": 54569, "name": "unknown", "code": "it('Should fail if predicate throws anything', () => {\n fc.assert(\n fc.asyncProperty(fc.anything(), async (stuff) => {\n // Arrange\n fc.pre(stuff === null || typeof stuff !== 'object' || !('toString' in stuff));\n const p = asyncProperty(stubArb.single(8), (_arg: number) => {\n throw stuff;\n });\n\n // Act\n await p.runBeforeEach();\n const out = await p.run(p.generate(stubRng.mutable.nocall()).value);\n await p.runAfterEach();\n\n // Assert\n expect(out).toEqual({ error: stuff });\n }),\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/fast-check/packages/fast-check/test/unit/check/property/AsyncProperty.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/fast-check", "url": "https://github.com/dubzzz/fast-check.git", "license": "MIT", "stars": 4563, "forks": 192}, "metrics": null, "summary": "The test ensures that if a predicate throws an exception, the output captures the thrown value as an error.", "mode": "fast-check"} {"id": 54570, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\tawait handler(event, context);\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/ws-response/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": "The function `handler` should handle any object passed as an `event` parameter without errors.", "mode": "fast-check"} {"id": 54573, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\ttry {\n\t\t\t\tawait handler(event, context);\n\t\t\t} catch (e) {\n\t\t\t\tif (e.cause?.package !== \"@middy/ws-json-body-parser\") {\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/ws-json-body-parser/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": "The `handler` function should process varied `event` objects without throwing errors related to `@middy/ws-json-body-parser`.", "mode": "fast-check"} {"id": 54574, "name": "unknown", "code": "test(\"fuzz `event` w/ `record`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(\n\t\t\tfc.record({\n\t\t\t\tbody: fc.string(),\n\t\t\t}),\n\t\t\tasync (event) => {\n\t\t\t\ttry {\n\t\t\t\t\tawait handler(event, context);\n\t\t\t\t} catch (e) {\n\t\t\t\t\tif (e.cause?.package !== \"@middy/ws-json-body-parser\") {\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/ws-json-body-parser/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": "The test verifies that the `handler` function handles a wide range of events with a `body` string without throwing exceptions, except for those specifically caused by `@middy/ws-json-body-parser`.", "mode": "fast-check"} {"id": 54575, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\ttry {\n\t\t\t\tawait handler(event, context);\n\t\t\t} catch (e) {\n\t\t\t\tif (e.cause?.package !== \"@middy/ws-router\") {\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/ws-router/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": "`handler` processes an `event` object, and any exception that is not caused by \"@middy/ws-router\" should be thrown.", "mode": "fast-check"} {"id": 54576, "name": "unknown", "code": "test(\"fuzz `event` w/ `record`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(\n\t\t\tfc.record({\n\t\t\t\trequestContext: fc.record({\n\t\t\t\t\trouteKey: fc.string(),\n\t\t\t\t}),\n\t\t\t}),\n\t\t\tasync (event) => {\n\t\t\t\ttry {\n\t\t\t\t\tawait handler(event, context);\n\t\t\t\t} catch (e) {\n\t\t\t\t\tif (e.cause?.package !== \"@middy/ws-router\") {\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [[{ requestContext: { routeKey: \"valueOf\" } }]],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/ws-router/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": "The handler should process events with `requestContext.routeKey` without throwing errors caused by packages other than \"@middy/ws-router\".", "mode": "fast-check"} {"id": 54581, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\tawait handler(event, context);\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/ssm/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": "The `handler` function should handle any object passed as an `event` without errors.", "mode": "fast-check"} {"id": 54582, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\tawait handler(event, context);\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/sqs-partial-batch-failure/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": "The function `handler` processes various randomly generated `event` objects without throwing errors.", "mode": "fast-check"} {"id": 54583, "name": "unknown", "code": "test(\"fuzz `event` w/ `record`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(\n\t\t\tfc.record({\n\t\t\t\tRecords: fc.array(fc.object()),\n\t\t\t\tresponse: fc.array(\n\t\t\t\t\tfc.record({\n\t\t\t\t\t\tstatus: fc.constantFrom(\"pending\", \"fulfilled\", \"rejected\"),\n\t\t\t\t\t\treason: fc.string(),\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t}),\n\t\t\tasync (event) => {\n\t\t\t\tawait handler(event, context);\n\t\t\t},\n\t\t),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/sqs-partial-batch-failure/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": "`handler` processes an `event` with an array of `Records` and a `response`, which includes status and reason, across multiple test cases.", "mode": "fast-check"} {"id": 54586, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\ttry {\n\t\t\t\tawait handler(event, context);\n\t\t\t} catch (e) {\n\t\t\t\tif (e.cause?.package !== \"@middy/http-urlencode-body-parser\") {\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/http-urlencode-body-parser/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": "The test ensures that when the `handler` function processes a fuzzed `event` object, any exceptions thrown are from the package `@middy/http-urlencode-body-parser`.", "mode": "fast-check"} {"id": 54587, "name": "unknown", "code": "test(\"fuzz `event` w/ `record`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(\n\t\t\tfc.record({\n\t\t\t\theaders: fc.record({\n\t\t\t\t\t\"content-type\": fc.constant(\"application/x-www-form-urlencoded\"),\n\t\t\t\t}),\n\t\t\t\tbody: fc.string(),\n\t\t\t}),\n\t\t\tasync (event) => {\n\t\t\t\ttry {\n\t\t\t\t\tawait handler(event, context);\n\t\t\t\t} catch (e) {\n\t\t\t\t\tif (e.cause?.package !== \"@middy/http-urlencode-body-parser\") {\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/http-urlencode-body-parser/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": "The test ensures that handling an event with a URL-encoded body does not throw unexpected errors outside the expected parser package.", "mode": "fast-check"} {"id": 54596, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\ttry {\n\t\t\t\tawait handler(event, context);\n\t\t\t} catch (e) {\n\t\t\t\tif (e.cause?.package !== \"@middy/http-router\") {\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/http-router/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": "The handler function should process various object-shaped `event` inputs without throwing errors related to the `@middy/http-router` package.", "mode": "fast-check"} {"id": 54597, "name": "unknown", "code": "test(\"fuzz `event` w/ `record` ({version: '1.0'})\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(\n\t\t\tfc.record({\n\t\t\t\thttpMethod: fc.constantFrom(\n\t\t\t\t\t\"HEAD\",\n\t\t\t\t\t\"OPTIONS\",\n\t\t\t\t\t\"GET\",\n\t\t\t\t\t\"POST\",\n\t\t\t\t\t\"PATCH\",\n\t\t\t\t\t\"DELETE\",\n\t\t\t\t\t\"TRACE\",\n\t\t\t\t\t\"CONNECT\",\n\t\t\t\t),\n\t\t\t\tpath: fc.webPath(),\n\t\t\t}),\n\t\t\tasync (event) => {\n\t\t\t\ttry {\n\t\t\t\t\tawait handler(event, context);\n\t\t\t\t} catch (e) {\n\t\t\t\t\tif (e.cause?.package !== \"@middy/http-router\") {\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [\n\t\t\t\t[{ httpMethod: \"valueOf\", path: \"/\" }],\n\t\t\t\t[{ httpMethod: \"GET\", path: \"valueOf\" }],\n\t\t\t],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/http-router/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": "The handler should correctly process or handle errors for generated HTTP events with specified HTTP methods and paths, ensuring that errors with causes not related to `@middy/http-router` are thrown.", "mode": "fast-check"} {"id": 54598, "name": "unknown", "code": "test(\"fuzz `event` w/ `record` ({version: '2.0'})\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(\n\t\t\tfc.record({\n\t\t\t\tversion: fc.constant(\"2.0\"),\n\t\t\t\trequestContext: fc.record({\n\t\t\t\t\thttp: fc.record({\n\t\t\t\t\t\tmethod: fc.constantFrom(\n\t\t\t\t\t\t\t\"HEAD\",\n\t\t\t\t\t\t\t\"OPTIONS\",\n\t\t\t\t\t\t\t\"GET\",\n\t\t\t\t\t\t\t\"POST\",\n\t\t\t\t\t\t\t\"PATCH\",\n\t\t\t\t\t\t\t\"DELETE\",\n\t\t\t\t\t\t\t\"TRACE\",\n\t\t\t\t\t\t\t\"CONNECT\",\n\t\t\t\t\t\t),\n\t\t\t\t\t\tpath: fc.webPath(),\n\t\t\t\t\t}),\n\t\t\t\t}),\n\t\t\t}),\n\t\t\tasync (event) => {\n\t\t\t\ttry {\n\t\t\t\t\tawait handler(event, context);\n\t\t\t\t} catch (e) {\n\t\t\t\t\tif (e.cause?.package !== \"@middy/http-router\") {\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [\n\t\t\t\t[{ requestContext: { http: { method: \"valueOf\", path: \"/\" } } }],\n\t\t\t\t[{ requestContext: { http: { method: \"GET\", path: \"valueOf\" } } }],\n\t\t\t],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/http-router/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": "The handler should process an event with a version \"2.0\" and various HTTP methods and paths without errors unrelated to the \"@middy/http-router\" package.", "mode": "fast-check"} {"id": 54604, "name": "unknown", "code": "test(\"fuzz `event` w/ `record` ({version: '2.0'})\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(\n\t\t\tfc.record({\n\t\t\t\tversion: fc.constant(\"2.0\"),\n\t\t\t\trequestContext: fc.record({\n\t\t\t\t\thttp: fc.record({\n\t\t\t\t\t\tmethod: fc.constantFrom(\n\t\t\t\t\t\t\t\"HEAD\",\n\t\t\t\t\t\t\t\"OPTIONS\",\n\t\t\t\t\t\t\t\"GET\",\n\t\t\t\t\t\t\t\"POST\",\n\t\t\t\t\t\t\t\"PATCH\",\n\t\t\t\t\t\t\t\"DELETE\",\n\t\t\t\t\t\t\t\"TRACE\",\n\t\t\t\t\t\t\t\"CONNECT\",\n\t\t\t\t\t\t),\n\t\t\t\t\t\tpath: fc.webPath(),\n\t\t\t\t\t}),\n\t\t\t\t}),\n\t\t\t}),\n\t\t\tasync (event) => {\n\t\t\t\ttry {\n\t\t\t\t\tawait handler(event, context);\n\t\t\t\t} catch (e) {\n\t\t\t\t\tif (e.cause?.package !== \"@middy/http-multipart-body-parser\") {\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/http-security-headers/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": "The handler should process events with version \"2.0\" and predefined HTTP methods without incorrectly throwing errors unrelated to `@middy/http-multipart-body-parser`.", "mode": "fast-check"} {"id": 54606, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\ttry {\n\t\t\t\tawait handler(event, context);\n\t\t\t} catch (e) {\n\t\t\t\tif (e.cause?.package !== \"@middy/http-json-body-parser\") {\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/http-json-body-parser/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": "The handler should not throw errors with the cause attributed to `@middy/http-json-body-parser` when processing any object as an `event`.", "mode": "fast-check"} {"id": 54608, "name": "unknown", "code": "test(\"fuzz `event` w/ `object`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.object(), async (event) => {\n\t\t\ttry {\n\t\t\t\tawait handler(event, context);\n\t\t\t} catch (e) {\n\t\t\t\tif (e.cause?.package !== \"@middy/http-multipart-body-parser\") {\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/http-multipart-body-parser/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": "The test ensures that the `handler` function processes various `event` objects without causing unexpected exceptions unrelated to `@middy/http-multipart-body-parser`.", "mode": "fast-check"} {"id": 54609, "name": "unknown", "code": "test(\"fuzz `event` w/ `record`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(\n\t\t\tfc.record({\n\t\t\t\theaders: fc.record({\n\t\t\t\t\t\"content-type\": fc.constant(\"multipart/form-data; boundary=\"),\n\t\t\t\t}),\n\t\t\t\tbody: fc.string(),\n\t\t\t}),\n\t\t\tasync (event) => {\n\t\t\t\ttry {\n\t\t\t\t\tawait handler(event, context);\n\t\t\t\t} catch (e) {\n\t\t\t\t\tif (e.cause?.package !== \"@middy/http-multipart-body-parser\") {\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/http-multipart-body-parser/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": "The handler processes events with multipart form-data content-type, ensuring any exceptions are not from the `@middy/http-multipart-body-parser` package.", "mode": "fast-check"} {"id": 54618, "name": "unknown", "code": "test(\"fuzz `event` w/ `record`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(\n\t\t\tfc.record({\n\t\t\t\tRequestType: fc.string(),\n\t\t\t\tRequestId: fc.string(),\n\t\t\t\tLogicalResourceId: fc.string(),\n\t\t\t\tStackId: fc.string(),\n\t\t\t}),\n\t\t\tasync (event) => {\n\t\t\t\ttry {\n\t\t\t\t\tawait handler(event, context);\n\t\t\t\t} catch (e) {\n\t\t\t\t\tif (e.cause?.package !== \"@middy/cloudformation-router\") {\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [[{ requestContext: { routeKey: \"valueOf\" } }]],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/middyjs/middy/packages/cloudformation-router/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "middyjs/middy", "url": "https://github.com/middyjs/middy.git", "license": "MIT", "stars": 3836, "forks": 387}, "metrics": null, "summary": "The test runs a handler function with randomly generated event records, ensuring any exceptions thrown are related specifically to the `@middy/cloudformation-router` package.", "mode": "fast-check"} {"id": 54626, "name": "unknown", "code": "test('Should replace only elements', () => {\n fc.assert(\n fc.property(fc.array(arb), fc.func(arb), (arr, f) => {\n const obtainedResult = replace(\n f,\n (t): t is any => !Array.isArray(t),\n )(arr);\n const realResult = arr.map((v) => f(v));\n expect(obtainedResult).toStrictEqual(realResult);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/alexrecuenco/typescript-eslint-prettier-jest-example/tests/replace.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "alexrecuenco/typescript-eslint-prettier-jest-example", "url": "https://github.com/alexrecuenco/typescript-eslint-prettier-jest-example.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `replace` function should transform elements of an array using a provided function, ensuring the output matches the result of applying the function directly to each element in a `map` operation.", "mode": "fast-check"} {"id": 54628, "name": "unknown", "code": "test('should leave json objects alone', () => {\n const throwOnReplace = replace(f, (t): t is any => false);\n fc.assert(\n fc.property(fc.json(), (json) => {\n expect(() =>\n expect(throwOnReplace(json)).toStrictEqual(json),\n ).not.toThrow();\n }),\n );\n })", "language": "typescript", "source_file": "./repos/alexrecuenco/typescript-eslint-prettier-jest-example/tests/replace.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "alexrecuenco/typescript-eslint-prettier-jest-example", "url": "https://github.com/alexrecuenco/typescript-eslint-prettier-jest-example.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Replacing within JSON objects does not alter them when the replacement condition is never met.", "mode": "fast-check"} {"id": 54629, "name": "unknown", "code": "test('Should leave numbers unchanged when searching for strings', () => {\n const throwOnReplace = replace(\n f,\n (t): t is string => typeof t === 'string',\n );\n const objectArbitrary = fc.object({\n maxDepth: 4,\n withTypedArray: true,\n values: [fc.integer()],\n });\n fc.assert(\n fc.property(objectArbitrary, (obj) => {\n expect(() => throwOnReplace(obj)).not.toThrow();\n }),\n );\n })", "language": "typescript", "source_file": "./repos/alexrecuenco/typescript-eslint-prettier-jest-example/tests/replace.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "alexrecuenco/typescript-eslint-prettier-jest-example", "url": "https://github.com/alexrecuenco/typescript-eslint-prettier-jest-example.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Ensures that applying `replace` to objects containing numbers does not throw an error when searching for strings.", "mode": "fast-check"} {"id": 54630, "name": "unknown", "code": "test(\"fuzz sessionLookup w/ sid\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (sid) => {\n\t\t\ttry {\n\t\t\t\tawait sessionLookup(sid, {});\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(sid, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/session/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`sessionLookup` should not throw unexpected errors when called with arbitrary session identifiers (`sid`).", "mode": "fast-check"} {"id": 54632, "name": "unknown", "code": "test(\"fuzz sessionSelect w/ sub\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (sub) => {\n\t\t\ttry {\n\t\t\t\tawait sessionSelect(sub, testSession.id);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(sub, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/session/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`sessionSelect` should not throw unexpected errors when provided with any input, allowing only specific error messages like \"400 Bad Request\", \"401 Unauthorized\", \"404 Not Found\", and \"409 Conflict\".", "mode": "fast-check"} {"id": 54634, "name": "unknown", "code": "test(\"fuzz sessionList w/ sub\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (sub) => {\n\t\t\ttry {\n\t\t\t\tawait sessionList(sub);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(sub, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/session/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`sessionList` should either execute without throwing an error or throw one of the expected errors for any input.", "mode": "fast-check"} {"id": 54638, "name": "unknown", "code": "test(\"fuzz sessionCheck w/ value\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (value) => {\n\t\t\ttry {\n\t\t\t\tawait sessionCheck(sub, value);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(value, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/session/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`sessionCheck` should handle various input values without causing errors, where expected errors are \"400 Bad Request\", \"401 Unauthorized\", \"404 Not Found\", or \"409 Conflict\".", "mode": "fast-check"} {"id": 54640, "name": "unknown", "code": "test(\"fuzz sessionExpire w/ id\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (id) => {\n\t\t\ttry {\n\t\t\t\tawait sessionExpire(sub, id);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(id, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/session/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`sessionExpire` should handle various inputs for `id` without throwing unexpected errors.", "mode": "fast-check"} {"id": 54641, "name": "unknown", "code": "test(\"fuzz sessionRemove w/ sub\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (sub) => {\n\t\t\ttry {\n\t\t\t\tawait sessionRemove(sub, testSession.id);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(sub, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/session/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Verifies that `sessionRemove` handles all types of inputs for `sub` without producing unexpected errors.", "mode": "fast-check"} {"id": 60364, "name": "unknown", "code": "it('should maintain backward compatibility', () => {\n fc.assert(\n fc.property(\n fc.constantFrom('v1', 'v2', 'v3'),\n domainArbitraries.fullLessonPlan,\n (apiVersion, lessonPlan) => {\n // Property: API versions should maintain backward compatibility\n const transformForVersion = (data: typeof lessonPlan, version: string) => {\n switch (version) {\n case 'v1':\n // v1 had simpler structure\n return {\n id: data.id,\n title: data.title,\n date: data.date,\n duration: data.duration,\n content: data.action, // Combined content\n };\n\n case 'v2':\n // v2 introduced three-part structure\n return {\n id: data.id,\n title: data.title,\n date: data.date,\n duration: data.duration,\n mindsOn: data.mindsOn,\n action: data.action,\n consolidation: data.consolidation,\n };\n\n case 'v3':\n // v3 is current full structure\n return data;\n\n default:\n return data;\n }\n };\n\n const versionData = transformForVersion(lessonPlan, apiVersion);\n\n // All versions should have core required fields\n return versionData.id && versionData.title && versionData.date && versionData.duration;\n },\n ),\n getPropertyTestConfig('fast'),\n );\n })", "language": "typescript", "source_file": "./repos/mamcisaac/teaching-engine2.0/server/tests/property-based/api/api-contract.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mamcisaac/teaching-engine2.0", "url": "https://github.com/mamcisaac/teaching-engine2.0.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "API versions 'v1', 'v2', and 'v3' should maintain core required fields (`id`, `title`, `date`, `duration`) for backward compatibility.", "mode": "fast-check"} {"id": 54643, "name": "unknown", "code": "test(\"fuzz emailAddressExists w/ `username`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (username) => {\n\t\t\ttry {\n\t\t\t\tawait emailAddressExists(username);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(username, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 10,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/messenger-email-address/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The test checks that the `emailAddressExists` function, when provided any input as `username`, only throws errors that match expected HTTP error messages.", "mode": "fast-check"} {"id": 54646, "name": "unknown", "code": "test(\"fuzz emailAddressSelect w/ `sub`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (sub) => {\n\t\t\ttry {\n\t\t\t\tawait emailAddressSelect(sub, testMessenger.id);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(sub, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 10,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/messenger-email-address/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`emailAddressSelect` with various inputs should not produce uncaught errors outside of specific expected error messages.", "mode": "fast-check"} {"id": 54651, "name": "unknown", "code": "test(\"fuzz emailAddressCreate w/ `values`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (values) => {\n\t\t\ttry {\n\t\t\t\tawait emailAddressCreate(sub, testMessenger.value, { name: values });\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(values, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 10,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/messenger-email-address/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The `emailAddressCreate` function should handle a variety of `values` inputs without causing unexpected errors.", "mode": "fast-check"} {"id": 54652, "name": "unknown", "code": "test(\"fuzz emailAddressRemove w/ `sub`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (sub) => {\n\t\t\ttry {\n\t\t\t\tawait emailAddressRemove(sub, testMessenger.id);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(sub, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 10,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/messenger-email-address/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The `emailAddressRemove` function should handle inputs without throwing unexpected errors, capturing only specific expected error messages.", "mode": "fast-check"} {"id": 54653, "name": "unknown", "code": "test(\"fuzz emailAddressRemove w/ `id`\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (id) => {\n\t\t\ttry {\n\t\t\t\tawait emailAddressRemove(sub, id);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(id, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 10,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/messenger-email-address/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`emailAddressRemove` should handle various inputs for `id` without causing unexpected errors, specifically emitting only recognized errors.", "mode": "fast-check"} {"id": 54654, "name": "unknown", "code": "test(\"fuzz accountExists w/ sub\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (sub) => {\n\t\t\ttry {\n\t\t\t\tawait accountExists(sub);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(sub, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/account/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`accountExists` should handle various inputs without throwing unexpected errors, allowing only specified errors (\"400 Bad Request\", \"401 Unauthorized\", \"404 Not Found\", \"409 Conflict\").", "mode": "fast-check"} {"id": 54656, "name": "unknown", "code": "test(\"fuzz accountCreate w/ values\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.string(), async (values) => {\n\t\t\ttry {\n\t\t\t\tawait accountCreate({ name: values });\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(values, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/account/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The `accountCreate` function should handle inputs without triggering errors other than \"400 Bad Request,\" \"401 Unauthorized,\" \"404 Not Found,\" or \"409 Conflict.\"", "mode": "fast-check"} {"id": 54657, "name": "unknown", "code": "test(\"fuzz accountUpdate w/ sub\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (sub) => {\n\t\t\ttry {\n\t\t\t\tawait accountUpdate(sub);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(sub, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/account/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`accountUpdate` should handle various inputs without throwing unexpected errors, where expected errors are defined as \"400 Bad Request\", \"401 Unauthorized\", \"404 Not Found\", and \"409 Conflict\".", "mode": "fast-check"} {"id": 54659, "name": "unknown", "code": "test(\"fuzz accountExpire w/ sub\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (sub) => {\n\t\t\ttry {\n\t\t\t\tawait accountExpire(sub);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(sub, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/account/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The `accountExpire` function should not throw unexpected errors for arbitrary subscription inputs, with only specific errors being permissible.", "mode": "fast-check"} {"id": 54663, "name": "unknown", "code": "test(\"fuzz accessTokenExists w/ username\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (username) => {\n\t\t\ttry {\n\t\t\t\tawait accessTokenExists(username);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(username, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/authn-access-token/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`accessTokenExists` should not throw unexpected errors when tested with arbitrary input as a username; only specific errors are permissible.", "mode": "fast-check"} {"id": 54664, "name": "unknown", "code": "test(\"fuzz accessTokenCount w/ sub\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (sub) => {\n\t\t\ttry {\n\t\t\t\tawait accessTokenCount(sub);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(sub, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/authn-access-token/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`accessTokenCount` processes various inputs without throwing unexpected errors, as expected errors are handled specifically.", "mode": "fast-check"} {"id": 54666, "name": "unknown", "code": "test(\"fuzz accessTokenSelect w/ sub\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (sub) => {\n\t\t\ttry {\n\t\t\t\tawait accessTokenSelect(sub, testSecret.id);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(sub, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/authn-access-token/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The function `accessTokenSelect` should handle various inputs without producing unexpected errors beyond specified HTTP error messages.", "mode": "fast-check"} {"id": 54668, "name": "unknown", "code": "test(\"fuzz accessTokenList w/ sub\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (sub) => {\n\t\t\ttry {\n\t\t\t\tawait accessTokenList(sub);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(sub, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/authn-access-token/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`accessTokenList` should handle various inputs without throwing errors, except for specific expected errors, which are filtered by `catchError`.", "mode": "fast-check"} {"id": 54671, "name": "unknown", "code": "test(\"fuzz accessTokenExpire w/ sub\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (sub) => {\n\t\t\ttry {\n\t\t\t\tawait accessTokenExpire(sub, testSecret.id);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(sub, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/authn-access-token/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The `accessTokenExpire` function should either complete without throwing an error or only throw specific expected errors when called with arbitrary inputs.", "mode": "fast-check"} {"id": 54672, "name": "unknown", "code": "test(\"fuzz accessTokenExpire w/ id\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (id) => {\n\t\t\ttry {\n\t\t\t\tawait accessTokenExpire(sub, id);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(id, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/authn-access-token/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`accessTokenExpire` should handle any input for `id` either successfully or by throwing one of the expected error messages without crashing.", "mode": "fast-check"} {"id": 54674, "name": "unknown", "code": "test(\"fuzz accessTokenRemove w/ id\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (id) => {\n\t\t\ttry {\n\t\t\t\tawait accessTokenRemove(sub, id);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(id, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/authn-access-token/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The function `accessTokenRemove` should handle a wide range of input IDs, and any exceptions thrown should match expected error messages, otherwise they are logged and rethrown.", "mode": "fast-check"} {"id": 54677, "name": "unknown", "code": "test(\"fuzz webauthnCount w/ sub\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (sub) => {\n\t\t\ttry {\n\t\t\t\tawait webauthnCount(sub);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(sub, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/authn-webauthn/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`webauthnCount` should handle various inputs without throwing unexpected errors, only allowing specified HTTP errors.", "mode": "fast-check"} {"id": 54679, "name": "unknown", "code": "test(\"fuzz webauthnCreate w/ sub\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (sub) => {\n\t\t\ttry {\n\t\t\t\tawait webauthnCreate(sub);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(sub, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/authn-webauthn/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`webauthnCreate` should not throw unexpected errors when called with arbitrary inputs; only specific errors like \"400 Bad Request,\" \"401 Unauthorized,\" \"404 Not Found,\" and \"409 Conflict\" are acceptable.", "mode": "fast-check"} {"id": 54680, "name": "unknown", "code": "test(\"fuzz webauthnUpate w/ sub\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (sub) => {\n\t\t\ttry {\n\t\t\t\tawait webauthnUpdate(sub);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(sub, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/authn-webauthn/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Verifies that the `webauthnUpdate` function handles inputs without causing unexpected errors, catching only specified expected errors.", "mode": "fast-check"} {"id": 54682, "name": "unknown", "code": "test(\"fuzz webauthnRemove w/ id\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (id) => {\n\t\t\ttry {\n\t\t\t\tawait webauthnRemove(sub, id);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(id, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/authn-webauthn/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The `webauthnRemove` function should handle a wide range of inputs without causing unexpected errors, while expected errors are caught and processed correctly.", "mode": "fast-check"} {"id": 54686, "name": "unknown", "code": "test(\"fuzz recoveryCodesList w/ sub\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (sub) => {\n\t\t\ttry {\n\t\t\t\tawait recoveryCodesList(sub);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(sub, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/authn-recovery-codes/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The `recoveryCodesList` function should handle any input for the `sub` parameter without producing errors outside a predefined set of expected error messages.", "mode": "fast-check"} {"id": 54687, "name": "unknown", "code": "test(\"fuzz recoveryCodesCreate w/ sub\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (sub) => {\n\t\t\ttry {\n\t\t\t\tawait recoveryCodesCreate(sub);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(sub, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/authn-recovery-codes/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`recoveryCodesCreate` should handle any input without throwing unexpected errors, logging only inputs that cause errors not included in the predefined set of expected errors.", "mode": "fast-check"} {"id": 54688, "name": "unknown", "code": "test(\"fuzz recoveryCodesUpate w/ sub\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (sub) => {\n\t\t\ttry {\n\t\t\t\tawait recoveryCodesUpdate(sub);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(sub, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/authn-recovery-codes/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The function `recoveryCodesUpdate` should handle all inputs without throwing unexpected errors, with allowed error messages being \"400 Bad Request\", \"401 Unauthorized\", \"404 Not Found\", and \"409 Conflict\".", "mode": "fast-check"} {"id": 54690, "name": "unknown", "code": "test(\"fuzz recoveryCodesRemove w/ id\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (id) => {\n\t\t\ttry {\n\t\t\t\tawait recoveryCodesRemove(sub, id);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(id, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/authn-recovery-codes/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`recoveryCodesRemove` is tested to handle a wide range of inputs for `id`, ensuring any errors thrown are expected (\"400 Bad Request\", \"401 Unauthorized\", \"404 Not Found\", \"409 Conflict\") and handled without crashing.", "mode": "fast-check"} {"id": 60371, "name": "unknown", "code": "it(\"hexToArray -> arrayToHex\", () => {\n fc.assert(\n fc.property(hexaString({ minLength: 2 }), string => {\n fc.pre(string.length % 2 == 0);\n assert.equal(arrayToHex(hexToArray(string)), string);\n })\n );\n })", "language": "typescript", "source_file": "./repos/larsrh/bunnyctl/src/test/util.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "larsrh/bunnyctl", "url": "https://github.com/larsrh/bunnyctl.git", "license": "Apache-2.0", "stars": 1, "forks": 0}, "metrics": null, "summary": "Conversion from hexadecimal string to array and back to hexadecimal should return the original string when the string length is even.", "mode": "fast-check"} {"id": 60373, "name": "unknown", "code": "it(\"parse remote path\", () => {\n fc.assert(\n fc.property(fc.string(), string => {\n const typed = `remote:${string}`;\n assert.deepEqual(parseTypedPath(typed), [\"remote\", string]);\n })\n );\n })", "language": "typescript", "source_file": "./repos/larsrh/bunnyctl/src/test/cli/util.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "larsrh/bunnyctl", "url": "https://github.com/larsrh/bunnyctl.git", "license": "Apache-2.0", "stars": 1, "forks": 0}, "metrics": null, "summary": "`parseTypedPath` splits a typed string into an array containing \"remote\" and the original string.", "mode": "fast-check"} {"id": 60377, "name": "unknown", "code": "it(\"should create the same object\", () => {\n fc.assert(\n fc.property(fc.object(), (obj) => {\n expect(copy(obj)).toEqual(obj);\n })\n );\n })", "language": "typescript", "source_file": "./repos/SocialGouv/archifiltre-docs/tests/integration/renderer/utils/object/object-util.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "SocialGouv/archifiltre-docs", "url": "https://github.com/SocialGouv/archifiltre-docs.git", "license": "Apache-2.0", "stars": 48, "forks": 8}, "metrics": null, "summary": "The test checks that the function `copy` produces an identical object to the input object.", "mode": "fast-check"} {"id": 54693, "name": "unknown", "code": "test(\"fuzz accountUsernameCreate w/ sub\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (sub) => {\n\t\t\ttry {\n\t\t\t\tawait accountUsernameCreate(sub, username);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(sub, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/account-username/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The function `accountUsernameCreate` should either execute without error or only throw specific expected errors when given any input for `sub`.", "mode": "fast-check"} {"id": 54694, "name": "unknown", "code": "test(\"fuzz accountUsernameCreate w/ username\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (username) => {\n\t\t\ttry {\n\t\t\t\tawait accountUsernameCreate(sub, username);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(username, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/account-username/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`accountUsernameCreate` should not throw unexpected errors when called with arbitrary usernames.", "mode": "fast-check"} {"id": 54696, "name": "unknown", "code": "test(\"fuzz accountUsernameUpdate w/ username\", async () => {\n\tawait fc.assert(\n\t\tfc.asyncProperty(fc.anything(), async (username) => {\n\t\t\ttry {\n\t\t\t\tawait accountUsernameUpdate(sub, username);\n\t\t\t} catch (e) {\n\t\t\t\tcatchError(username, e);\n\t\t\t}\n\t\t}),\n\t\t{\n\t\t\tnumRuns: 100_000,\n\t\t\tverbose: 2,\n\t\t\texamples: [],\n\t\t},\n\t);\n})", "language": "typescript", "source_file": "./repos/willfarrell/1auth/packages/account-username/index.fuzz.js", "start_line": null, "end_line": null, "dependencies": ["catchError"], "repo": {"name": "willfarrell/1auth", "url": "https://github.com/willfarrell/1auth.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`accountUsernameUpdate` should handle a variety of inputs for `username`, with expected errors logged and unexpected ones re-thrown.", "mode": "fast-check"} {"id": 54698, "name": "unknown", "code": "test('impl', t => {\n fc.assert(\n fc.property(getArbitrary(getFastChecker()), request => {\n const response = exampleApiImpl(request);\n t.assert(response.messages.length <= request.limit);\n for (const message of response.messages) {\n t.assert(\n isAfter(parseISO(message.date), parseISO(request.after)) ||\n isEqual(parseISO(message.date), parseISO(request.after)),\n );\n }\n }),\n );\n})", "language": "typescript", "source_file": "./repos/hchauvin/reify-ts/packages/example_fast_check/src/__tests__/api.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hchauvin/reify-ts", "url": "https://github.com/hchauvin/reify-ts.git", "license": "MIT", "stars": 10, "forks": 0}, "metrics": null, "summary": "The function `exampleApiImpl` should return messages that are within the specified limit of the request and after or equal to the given `after` date.", "mode": "fast-check"} {"id": 54699, "name": "unknown", "code": "test.only('i/o boundary', t => {\n fc.assert(\n fc.property(\n fc.oneof(fc.anything(), getArbitrary(getFastChecker())),\n requestAny => {\n const isValidRequest = getValidator()\n .getValidator(getTypeName())\n .is(requestAny);\n if (isValidRequest) {\n t.notThrows(() => {\n const responseAny = exampleApi(requestAny);\n const isValidResponse = getValidator()\n .getValidator(getTypeName())\n .is(responseAny);\n t.true(isValidResponse);\n });\n } else {\n t.throws(() => {\n exampleApi(requestAny);\n });\n }\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/hchauvin/reify-ts/packages/example_fast_check/src/__tests__/api.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hchauvin/reify-ts", "url": "https://github.com/hchauvin/reify-ts.git", "license": "MIT", "stars": 10, "forks": 0}, "metrics": null, "summary": "The test ensures that valid `ExampleRequest` inputs to `exampleApi` produce valid `ExampleResponse` outputs without exceptions, and invalid inputs result in exceptions.", "mode": "fast-check"} {"id": 54700, "name": "unknown", "code": "it('should maintain query structure invariants', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.string({ minLength: 1, maxLength: 1000 }),\n fc.option(fc.record({\n maxResults: fc.integer({ min: 1, max: 100 }),\n walletAddress: fc.string({ minLength: 10, maxLength: 50 })\n })),\n async (query, metadata) => {\n // Mock successful response\n mockFetch.mockResolvedValueOnce({\n ok: true,\n json: async () => ({\n success: true,\n data: [],\n metadata: { creditsUsed: 1, queryTime: 100, resultCount: 0, timestamp: Date.now(), queryId: 'prop-test' }\n })\n } as Response);\n\n const result = await adapter.search(query, metadata || undefined)();\n \n // Query should always produce a result (success or failure)\n expect(E.isRight(result)).toBe(true);\n \n if (E.isRight(result)) {\n // Response should always have success field\n expect(typeof result.right.success).toBe('boolean');\n \n // If successful, should have data\n if (result.right.success) {\n expect(result.right.data).toBeDefined();\n }\n }\n }\n ),\n { numRuns: 50 }\n );\n })", "language": "typescript", "source_file": "./repos/Angleito/Seiron/src/agents/adapters/__tests__/HiveIntelligenceAdapter.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Angleito/Seiron", "url": "https://github.com/Angleito/Seiron.git", "license": "MIT", "stars": 2, "forks": 1}, "metrics": null, "summary": "Query operations on `HiveIntelligenceAdapter` should always produce a result with a boolean `success` field and, if successful, include a `data` field.", "mode": "fast-check"} {"id": 54701, "name": "unknown", "code": "it('should handle rate limiting consistently', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.array(fc.string({ minLength: 1, maxLength: 100 }), { minLength: 1, maxLength: 30 }),\n async (queries) => {\n // Mock responses for all queries\n mockFetch.mockImplementation(() =>\n Promise.resolve({\n ok: true,\n json: async () => ({\n success: true,\n data: [],\n metadata: { creditsUsed: 1, queryTime: 100, resultCount: 0, timestamp: Date.now(), queryId: 'rate-test' }\n })\n } as Response)\n );\n\n const results = await Promise.all(\n queries.map(query => adapter.search(query)())\n );\n\n // Should have consistent behavior - either all succeed or some fail due to rate limiting\n const successCount = results.filter(r => \n E.isRight(r) && r.right.success\n ).length;\n \n const rateLimitFailures = results.filter(r => \n E.isLeft(r) && r.left.code === 'RATE_LIMIT_EXCEEDED'\n ).length;\n\n // Total results should equal input queries\n expect(results.length).toBe(queries.length);\n \n // Should have some successful results unless all are rate limited\n expect(successCount + rateLimitFailures).toBeLessThanOrEqual(queries.length);\n }\n ),\n { numRuns: 10 }\n );\n })", "language": "typescript", "source_file": "./repos/Angleito/Seiron/src/agents/adapters/__tests__/HiveIntelligenceAdapter.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Angleito/Seiron", "url": "https://github.com/Angleito/Seiron.git", "license": "MIT", "stars": 2, "forks": 1}, "metrics": null, "summary": "The test ensures consistent handling of rate-limiting when processing an array of string queries, verifying that results either succeed or fail due to rate limiting, with the total results matching the number of input queries.", "mode": "fast-check"} {"id": 54702, "name": "unknown", "code": "it('should maintain query idempotency', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.string({ minLength: 1, maxLength: 100 }),\n async (query) => {\n // Mock consistent response\n const mockResponse = {\n success: true,\n data: [{ id: 'test-result', title: 'Test' }],\n metadata: { creditsUsed: 1, queryTime: 100, resultCount: 1, timestamp: Date.now(), queryId: 'test' }\n };\n\n mockFetch.mockResolvedValue(createMockResponse(mockResponse));\n\n const result1 = await adapter.search(query)();\n const result2 = await adapter.search(query)();\n\n // Idempotency: same query should produce same result structure\n expect(E.isRight(result1)).toBe(E.isRight(result2));\n \n if (E.isRight(result1) && E.isRight(result2)) {\n expect(result1.right.success).toBe(result2.right.success);\n // Note: Due to caching, the actual data might be identical\n // but timestamps in metadata might differ\n }\n }\n ),\n { numRuns: 50 }\n );\n })", "language": "typescript", "source_file": "./repos/Angleito/Seiron/src/agents/adapters/__tests__/HiveIntelligenceAdapter.property.test.ts", "start_line": null, "end_line": null, "dependencies": ["createMockResponse"], "repo": {"name": "Angleito/Seiron", "url": "https://github.com/Angleito/Seiron.git", "license": "MIT", "stars": 2, "forks": 1}, "metrics": null, "summary": "Query idempotency should be maintained, ensuring that repeated searches with the same query produce consistent result structures.", "mode": "fast-check"} {"id": 54703, "name": "unknown", "code": "it('should preserve query structure invariants', async () => {\n await fc.assert(\n fc.asyncProperty(\n validQueryGenerator,\n async (queryData) => {\n // Mock successful response\n mockFetch.mockResolvedValue(createMockResponse({\n success: true,\n data: [],\n metadata: { creditsUsed: 1, queryTime: 100, resultCount: 0, timestamp: Date.now(), queryId: 'prop-test' }\n }));\n\n const result = await adapter.search(queryData.query, queryData.metadata || undefined)();\n\n // Invariant: All queries should produce a result (Either Right or Left)\n expect(E.isRight(result) || E.isLeft(result)).toBe(true);\n \n if (E.isRight(result)) {\n // Invariant: Response should always have success field\n expect(typeof result.right.success).toBe('boolean');\n \n // Invariant: If successful, metadata should exist\n if (result.right.success) {\n expect(result.right.metadata).toBeDefined();\n }\n }\n }\n ),\n { numRuns: 100 }\n );\n })", "language": "typescript", "source_file": "./repos/Angleito/Seiron/src/agents/adapters/__tests__/HiveIntelligenceAdapter.property.test.ts", "start_line": null, "end_line": null, "dependencies": ["createMockResponse"], "repo": {"name": "Angleito/Seiron", "url": "https://github.com/Angleito/Seiron.git", "license": "MIT", "stars": 2, "forks": 1}, "metrics": null, "summary": "The property should maintain that all valid queries yield a result as either a `Right` or `Left`, and if `Right`, the result must contain a success field, with metadata present if successful.", "mode": "fast-check"} {"id": 54704, "name": "unknown", "code": "it('should enforce rate limiting consistently', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.integer({ min: 1, max: 50 }),\n async (numRequests) => {\n // Mock successful responses\n mockFetch.mockResolvedValue({\n ok: true,\n json: async () => ({\n success: true,\n data: [],\n metadata: { creditsUsed: 1, queryTime: 100, resultCount: 0, timestamp: Date.now(), queryId: 'rate-test' }\n })\n } as Response);\n\n const promises = Array(numRequests).fill(null).map((_, i) => \n adapter.search(`test query ${i}`)()\n );\n\n const results = await Promise.all(promises);\n \n // Rate limiting property: should not exceed configured limit\n const successfulResults = results.filter(r => \n E.isRight(r) && r.right.success\n );\n \n const rateLimitedResults = results.filter(r => \n E.isLeft(r) && r.left.code === 'RATE_LIMIT_EXCEEDED'\n );\n\n // If we exceed rate limit, should have failures\n if (numRequests > hiveConfig.rateLimitConfig.maxRequests) {\n expect(rateLimitedResults.length).toBeGreaterThan(0);\n }\n \n // Total results should equal input\n expect(results.length).toBe(numRequests);\n }\n ),\n { numRuns: 20 }\n );\n })", "language": "typescript", "source_file": "./repos/Angleito/Seiron/src/agents/adapters/__tests__/HiveIntelligenceAdapter.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Angleito/Seiron", "url": "https://github.com/Angleito/Seiron.git", "license": "MIT", "stars": 2, "forks": 1}, "metrics": null, "summary": "The property requires that executing multiple asynchronous requests with `adapter.search` enforces rate limiting, resulting in some requests failing with a `RATE_LIMIT_EXCEEDED` error when the number of requests surpasses the configured limit, while ensuring the total number of results equals the number of input requests.", "mode": "fast-check"} {"id": 54705, "name": "unknown", "code": "it('should maintain cache consistency', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.string({ minLength: 1, maxLength: 100 }),\n fc.integer({ min: 2, max: 5 }),\n async (query, repetitions) => {\n let callCount = 0;\n mockFetch.mockImplementation(async () => {\n callCount++;\n return {\n ok: true,\n json: async () => ({\n success: true,\n data: [{ id: `result-${callCount}`, title: `Result ${callCount}` }],\n metadata: { creditsUsed: 1, queryTime: 100, resultCount: 1, timestamp: Date.now(), queryId: `cache-${callCount}` }\n })\n } as Response;\n });\n\n const results = await Promise.all(\n Array(repetitions).fill(null).map(() => adapter.search(query)())\n );\n\n // Cache property: identical queries should return consistent results\n const successfulResults = results.filter(r => E.isRight(r) && r.right.success);\n \n if (successfulResults.length > 1) {\n // If caching is working, should have fewer API calls than requests\n // Note: In a real implementation, we'd need to access cache internals\n // For now, we just verify structural consistency\n expect(successfulResults.length).toBe(repetitions);\n }\n }\n ),\n { numRuns: 20 }\n );\n })", "language": "typescript", "source_file": "./repos/Angleito/Seiron/src/agents/adapters/__tests__/HiveIntelligenceAdapter.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Angleito/Seiron", "url": "https://github.com/Angleito/Seiron.git", "license": "MIT", "stars": 2, "forks": 1}, "metrics": null, "summary": "Identical queries should consistently return the same results, indicating cache consistency, with fewer API calls than requests.", "mode": "fast-check"} {"id": 54707, "name": "unknown", "code": "it('should track credit usage monotonically', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.array(fc.integer({ min: 1, max: 5 }), { minLength: 1, maxLength: 10 }),\n async (creditUsages) => {\n let totalUsed = 0;\n \n for (const creditsUsed of creditUsages) {\n mockFetch.mockResolvedValueOnce({\n ok: true,\n json: async () => ({\n success: true,\n data: [],\n metadata: { creditsUsed, queryTime: 100, resultCount: 0, timestamp: Date.now(), queryId: 'credit-test' }\n })\n } as Response);\n\n const result = await adapter.search(`test query ${totalUsed}`)();\n \n if (E.isRight(result) && result.right.success) {\n totalUsed += creditsUsed;\n \n // Credit usage property: should be monotonically increasing\n expect(result.right.metadata?.creditsUsed).toBe(creditsUsed);\n }\n }\n \n // Total credits used should equal sum of individual usages\n expect(totalUsed).toBe(creditUsages.reduce((sum, credits) => sum + credits, 0));\n }\n ),\n { numRuns: 30 }\n );\n })", "language": "typescript", "source_file": "./repos/Angleito/Seiron/src/agents/adapters/__tests__/HiveIntelligenceAdapter.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Angleito/Seiron", "url": "https://github.com/Angleito/Seiron.git", "license": "MIT", "stars": 2, "forks": 1}, "metrics": null, "summary": "The test asserts that the credit usage tracked by the `HiveIntelligenceAdapter` increases monotonically with each request, ensuring the total credits used equal the sum of individual credits from multiple requests.", "mode": "fast-check"} {"id": 54708, "name": "unknown", "code": "it('should maintain response time consistency', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.integer({ min: 50, max: 500 }),\n async (mockLatency) => {\n mockFetch.mockImplementation(async () => {\n await new Promise(resolve => setTimeout(resolve, mockLatency));\n return {\n ok: true,\n json: async () => ({\n success: true,\n data: [],\n metadata: { creditsUsed: 1, queryTime: mockLatency, resultCount: 0, timestamp: Date.now(), queryId: 'perf-test' }\n })\n } as Response;\n });\n\n const startTime = Date.now();\n const result = await adapter.search('performance test')();\n const endTime = Date.now();\n \n const actualLatency = endTime - startTime;\n \n // Performance property: actual latency should be close to mock latency\n expect(actualLatency).toBeGreaterThanOrEqual(mockLatency);\n expect(actualLatency).toBeLessThan(mockLatency + 1000); // Allow 1s overhead\n \n if (E.isRight(result) && result.right.success) {\n expect(result.right.metadata?.queryTime).toBe(mockLatency);\n }\n }\n ),\n { numRuns: 20 }\n );\n })", "language": "typescript", "source_file": "./repos/Angleito/Seiron/src/agents/adapters/__tests__/HiveIntelligenceAdapter.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Angleito/Seiron", "url": "https://github.com/Angleito/Seiron.git", "license": "MIT", "stars": 2, "forks": 1}, "metrics": null, "summary": "The adapter should maintain response time consistency by ensuring actual latency closely aligns with the mock latency, with a permissible overhead.", "mode": "fast-check"} {"id": 54709, "name": "unknown", "code": "it('should handle concurrent requests without race conditions', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.integer({ min: 2, max: 10 }),\n async (concurrency) => {\n let responseCount = 0;\n \n mockFetch.mockImplementation(async () => {\n responseCount++;\n return {\n ok: true,\n json: async () => ({\n success: true,\n data: [{ id: `result-${responseCount}` }],\n metadata: { creditsUsed: 1, queryTime: 100, resultCount: 1, timestamp: Date.now(), queryId: `concurrent-${responseCount}` }\n })\n } as Response;\n });\n\n const promises = Array(concurrency).fill(null).map((_, i) => \n adapter.search(`concurrent test ${i}`)()\n );\n\n const results = await Promise.all(promises);\n \n // Concurrency property: should handle all requests\n expect(results.length).toBe(concurrency);\n \n // No race conditions: all should be successful or failed consistently\n const successCount = results.filter(r => E.isRight(r) && r.right.success).length;\n const failureCount = results.filter(r => E.isLeft(r)).length;\n \n expect(successCount + failureCount).toBe(concurrency);\n }\n ),\n { numRuns: 15 }\n );\n })", "language": "typescript", "source_file": "./repos/Angleito/Seiron/src/agents/adapters/__tests__/HiveIntelligenceAdapter.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Angleito/Seiron", "url": "https://github.com/Angleito/Seiron.git", "license": "MIT", "stars": 2, "forks": 1}, "metrics": null, "summary": "The test checks that `adapter.search()` handles a specified number of concurrent requests without race conditions, ensuring all requests either succeed or fail consistently.", "mode": "fast-check"} {"id": 54710, "name": "unknown", "code": "it('should satisfy functor laws for response transformations', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.string({ minLength: 1, maxLength: 100 }),\n async (query) => {\n mockFetch.mockResolvedValue({\n ok: true,\n json: async () => ({\n success: true,\n data: [{ id: 'test', title: 'Test Result' }],\n metadata: { creditsUsed: 1, queryTime: 100, resultCount: 1, timestamp: Date.now(), queryId: 'functor-test' }\n })\n } as Response);\n\n const result = await adapter.search(query)();\n \n // Functor law: identity\n const identity = (x: T): T => x;\n const identityMapped = pipe(result, E.map(identity));\n expect(identityMapped).toEqual(result);\n \n // Functor law: composition\n const f = (response: any) => ({ ...response, processed: true });\n const g = (response: any) => ({ ...response, timestamp: Date.now() });\n \n const composed = pipe(result, E.map(response => g(f(response))));\n const chained = pipe(result, E.map(f), E.map(g));\n \n // Should have same structure (can't test exact equality due to timestamps)\n expect(E.isRight(composed)).toBe(E.isRight(chained));\n }\n ),\n { numRuns: 30 }\n );\n })", "language": "typescript", "source_file": "./repos/Angleito/Seiron/src/agents/adapters/__tests__/HiveIntelligenceAdapter.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Angleito/Seiron", "url": "https://github.com/Angleito/Seiron.git", "license": "MIT", "stars": 2, "forks": 1}, "metrics": null, "summary": "The property ensures that response transformations applied by the `search` method adhere to functor laws: identity and composition.", "mode": "fast-check"} {"id": 54712, "name": "unknown", "code": "it('should maintain credit consumption invariants', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.integer({ min: 0, max: 10 }),\n async (creditsUsed) => {\n mockFetch.mockResolvedValue({\n ok: true,\n json: async () => ({\n success: true,\n data: [],\n metadata: { creditsUsed, queryTime: 100, resultCount: 0, timestamp: Date.now(), queryId: 'credit-invariant' }\n })\n } as Response);\n\n const result = await adapter.search('credit test')();\n \n if (E.isRight(result) && result.right.success) {\n // Invariant: Credits used should be non-negative\n expect(result.right.metadata?.creditsUsed).toBeGreaterThanOrEqual(0);\n \n // Invariant: Credits used should not exceed max per query\n expect(result.right.metadata?.creditsUsed).toBeLessThanOrEqual(hiveConfig.creditConfig.maxCreditsPerQuery);\n }\n }\n ),\n { numRuns: 50 }\n );\n })", "language": "typescript", "source_file": "./repos/Angleito/Seiron/src/agents/adapters/__tests__/HiveIntelligenceAdapter.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Angleito/Seiron", "url": "https://github.com/Angleito/Seiron.git", "license": "MIT", "stars": 2, "forks": 1}, "metrics": null, "summary": "The property ensures that credit consumption invariants are maintained by verifying `creditsUsed` is non-negative and does not exceed the maximum allowed per query in successful search results.", "mode": "fast-check"} {"id": 54713, "name": "unknown", "code": "it('should satisfy price impact monotonicity', async () => {\n const priceImpactProperty = fc.property(\n fc.tuple(\n DeFiGenerators.tokenPair(),\n DeFiGenerators.amount(),\n DeFiGenerators.amount()\n ),\n ([tokenPair, amount1, amount2]) => {\n const [tokenIn, tokenOut] = tokenPair;\n const smallerAmount = amount1 < amount2 ? amount1 : amount2;\n const largerAmount = amount1 >= amount2 ? amount1 : amount2;\n \n // Mock responses for different amounts\n const smallSwapImpact = 0.005; // 0.5%\n const largeSwapImpact = 0.02; // 2%\n \n return smallerAmount === largerAmount || smallSwapImpact <= largeSwapImpact;\n }\n );\n\n await fc.assert(priceImpactProperty, { numRuns: 200 });\n })", "language": "typescript", "source_file": "./repos/Angleito/Seiron/src/protocols/sei/__tests__/SymphonyProtocolWrapper.enhanced.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Angleito/Seiron", "url": "https://github.com/Angleito/Seiron.git", "license": "MIT", "stars": 2, "forks": 1}, "metrics": null, "summary": "Price impact should be monotonically non-decreasing with increasing trade amounts between token pairs.", "mode": "fast-check"} {"id": 54715, "name": "unknown", "code": "it('should complete operations within time bounds', async () => {\n const timeoutProperty = fc.property(\n fc.record({\n operationType: fc.oneof(\n fc.constant('getQuote'),\n fc.constant('getRoutes'),\n fc.constant('estimateGas')\n ),\n complexity: fc.nat({ min: 1, max: 5 }),\n networkLatency: fc.nat({ min: 10, max: 1000 })\n }),\n async (data) => {\n const timeoutLimits = {\n getQuote: 2000,\n getRoutes: 3000,\n estimateGas: 1000\n };\n \n const expectedTimeout = timeoutLimits[data.operationType] + data.networkLatency;\n \n // Mock operation with timeout\n const mockOperation = async () => {\n await new Promise(resolve => setTimeout(resolve, data.networkLatency));\n return 'success';\n };\n \n const start = Date.now();\n await mockOperation();\n const duration = Date.now() - start;\n \n return duration <= expectedTimeout * 1.1; // 10% tolerance\n }\n );\n\n await fc.assert(timeoutProperty, { numRuns: 50 });\n })", "language": "typescript", "source_file": "./repos/Angleito/Seiron/src/protocols/sei/__tests__/SymphonyProtocolWrapper.enhanced.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Angleito/Seiron", "url": "https://github.com/Angleito/Seiron.git", "license": "MIT", "stars": 2, "forks": 1}, "metrics": null, "summary": "Operations should complete within time limits based on their type, complexity, and network latency, allowing a 10% tolerance.", "mode": "fast-check"} {"id": 54717, "name": "unknown", "code": "it('should preserve invariants across state transitions', async () => {\n const stateTransitionProperty = fc.property(\n fc.record({\n initialState: fc.record({\n totalLiquidity: DeFiGenerators.amount(),\n activeRoutes: fc.nat({ min: 0, max: 100 }),\n pendingTransactions: fc.nat({ min: 0, max: 50 })\n }),\n action: fc.oneof(\n fc.constant({ type: 'ADD_LIQUIDITY', amount: 1000n }),\n fc.constant({ type: 'REMOVE_LIQUIDITY', amount: 500n }),\n fc.constant({ type: 'EXECUTE_SWAP', routeId: 'route-1' })\n )\n }),\n (data) => {\n // Mock state transition\n let newState = { ...data.initialState };\n \n switch (data.action.type) {\n case 'ADD_LIQUIDITY':\n newState.totalLiquidity += (data.action as any).amount;\n break;\n case 'REMOVE_LIQUIDITY':\n newState.totalLiquidity -= (data.action as any).amount;\n break;\n case 'EXECUTE_SWAP':\n newState.pendingTransactions += 1;\n break;\n }\n \n // Invariants:\n // 1. Total liquidity should never be negative\n // 2. Active routes should not exceed maximum\n // 3. Pending transactions should be reasonable\n \n return newState.totalLiquidity >= 0n &&\n newState.activeRoutes <= 100 &&\n newState.pendingTransactions <= 100;\n }\n );\n\n await fc.assert(stateTransitionProperty, { numRuns: 200 });\n })", "language": "typescript", "source_file": "./repos/Angleito/Seiron/src/protocols/sei/__tests__/SymphonyProtocolWrapper.enhanced.property.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Angleito/Seiron", "url": "https://github.com/Angleito/Seiron.git", "license": "MIT", "stars": 2, "forks": 1}, "metrics": null, "summary": "Preserves invariants across state transitions involving total liquidity, active routes, and pending transactions.", "mode": "fast-check"} {"id": 54718, "name": "unknown", "code": "test('should autocomplete queries (full)', async () => {\n await fc.assert(\n fc\n .asyncProperty(fc.scheduler({ act }), fc.set(fc.string()), fc.string(1, 10), async (s, allResults, userQuery) => {\n // Arrange\n jest.useFakeTimers();\n suggestionsFor.mockImplementation(\n s.scheduleFunction(async (query) => {\n return allResults.filter((r) => r.includes(query)).slice(0, 10);\n })\n );\n const expectedResults = allResults.filter((r) => r.includes(userQuery));\n\n // Act\n const { getByRole, queryAllByRole } = render();\n s.scheduleSequence(\n [...userQuery].map((c, idx) => ({\n label: `Typing \"${c}\"`,\n builder: () => userEvent.type(getByRole('textbox'), userQuery.substr(0, idx + 1), { allAtOnce: true }),\n }))\n );\n await waitAllWithTimers(s);\n\n // Assert\n const displayedSuggestions = queryAllByRole('listitem');\n expect(displayedSuggestions.map((el) => el.textContent)).toEqual(expectedResults);\n })\n .beforeEach(() => {\n jest.clearAllTimers();\n jest.resetAllMocks();\n cleanup();\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/talk-react-europe-2020/autocomplete-case/src/DebouncedAutocomplete.spec.js", "start_line": null, "end_line": null, "dependencies": ["waitAllWithTimers"], "repo": {"name": "dubzzz/talk-react-europe-2020", "url": "https://github.com/dubzzz/talk-react-europe-2020.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "The `DebouncedAutocomplete` component should return suggestions that match the user query, and these suggestions must be displayed as a list after the user inputs characters in quick succession.", "mode": "fast-check"} {"id": 54720, "name": "unknown", "code": "test('should autocomplete queries (full)', async () => {\n await fc.assert(\n fc\n .asyncProperty(fc.scheduler({ act }), fc.set(fc.string()), fc.string(1, 10), async (s, allResults, userQuery) => {\n // Arrange\n suggestionsFor.mockImplementation(\n s.scheduleFunction(async (query) => {\n return allResults.filter((r) => r.includes(query)).slice(0, 10);\n })\n );\n const expectedResults = allResults.filter((r) => r.includes(userQuery));\n\n // Act\n const { getByRole, queryAllByRole } = render();\n s.scheduleSequence(\n [...userQuery].map((c, idx) => ({\n label: `Typing \"${c}\"`,\n builder: () => userEvent.type(getByRole('textbox'), userQuery.substr(0, idx + 1), { allAtOnce: true }),\n }))\n );\n await s.waitAll();\n\n // Assert\n const displayedSuggestions = queryAllByRole('listitem');\n expect(displayedSuggestions.map((el) => el.textContent)).toEqual(expectedResults);\n expect(suggestionsFor).toHaveBeenCalledTimes(userQuery.length);\n })\n .beforeEach(() => {\n jest.resetAllMocks();\n cleanup();\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/talk-react-europe-2020/autocomplete-case/src/Autocomplete.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/talk-react-europe-2020", "url": "https://github.com/dubzzz/talk-react-europe-2020.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Autocompleting user queries should result in displaying the correct suggestions that match and include those queries, and each character typed should trigger a request for suggestions.", "mode": "fast-check"} {"id": 54722, "name": "unknown", "code": "it('queries with `splits: inline` returns only non-parents', async () => {\n await fc.assert(\n fc.asyncProperty(\n arbs.makeTransactionArray({\n splitFreq: 2,\n minLength: 2,\n maxLength: 20\n }),\n async arr => {\n await insertTransactions(arr);\n\n let { data } = await runQuery(\n query('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .options({ splits: 'inline' })\n .serialize()\n );\n\n expect(data.filter(t => t.is_parent).length).toBe(0);\n expect(data.filter(t => t.tombstone).length).toBe(0);\n\n let { data: defaultData } = await runQuery(\n query('transactions')\n .filter({ amount: { $lt: 0 } })\n .select('*')\n .serialize()\n );\n\n // inline should be the default\n expect(defaultData).toEqual(data);\n }\n ),\n { numRuns: 50 }\n );\n })", "language": "typescript", "source_file": "./repos/TomAFrench/temp-actual/packages/loot-core/src/server/aql/schema/executors.test.js", "start_line": null, "end_line": null, "dependencies": ["insertTransactions"], "repo": {"name": "TomAFrench/temp-actual", "url": "https://github.com/TomAFrench/temp-actual.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Queries with `splits: inline` should return transaction data without parent entries and without tombstones, and this behavior should match the default query result when filtering transactions with negative amounts.", "mode": "fast-check"} {"id": 54724, "name": "unknown", "code": "it('aggregate queries work with `splits: grouped`', async () => {\n let payeeIds = ['payee1', 'payee2', 'payee3', 'payee4', 'payee5'];\n\n await fc.assert(\n fc\n .asyncProperty(\n arbs.makeTransactionArray({ splitFreq: 2, payeeIds, maxLength: 100 }),\n async arr => {\n await insertTransactions(arr, payeeIds);\n\n let aggQuery = query('transactions')\n .filter({\n $or: [{ amount: { $lt: -5 } }, { amount: { $gt: -2 } }],\n 'payee.name': { $gt: '' }\n })\n .options({ splits: 'grouped' })\n .calculate({ $sum: '$amount' });\n\n let { data } = await runQuery(aggQuery.serialize());\n\n let sum = arr.reduce((sum, trans) => {\n let amount = trans.amount || 0;\n let matched = (amount < -5 || amount > -2) && trans.payee != null;\n if (!trans.tombstone && !trans.is_parent && matched) {\n return sum + amount;\n }\n return sum;\n }, 0);\n\n expect(data).toBe(sum);\n }\n )\n .beforeEach(() => {\n setClock(null);\n setSyncingMode('import');\n return db.execQuery(`\n DELETE FROM transactions;\n DELETE FROM payees;\n DELETE FROM payee_mapping;\n `);\n })\n );\n })", "language": "typescript", "source_file": "./repos/TomAFrench/temp-actual/packages/loot-core/src/server/aql/schema/executors.test.js", "start_line": null, "end_line": null, "dependencies": ["insertTransactions"], "repo": {"name": "TomAFrench/temp-actual", "url": "https://github.com/TomAFrench/temp-actual.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Aggregate query with `splits: grouped` should accurately calculate the sum of transaction amounts for transactions that meet specified filter conditions.", "mode": "fast-check"} {"id": 54729, "name": "unknown", "code": "test('Integer should concatenate with a string', () => {\n fc.assert(\n fc.property(\n fc.bigInt({ max: Integer.MAX_SAFE_VALUE.toBigInt(), min: Integer.MIN_SAFE_VALUE.toBigInt() }),\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n num => 'string' + int(num) + 'str' === 'string' + int(num).toString() + 'str'\n )\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/integer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Concatenating an `Integer` with strings produces the same result as concatenating its string representation.", "mode": "fast-check"} {"id": 54731, "name": "unknown", "code": "test('Integer should be able to use + operator as bigint', () => {\n fc.assert(\n fc.property(\n fc.bigInt({ max: Integer.MAX_SAFE_VALUE.toBigInt(), min: Integer.MIN_SAFE_VALUE.toBigInt() }),\n fc.bigInt({ max: Integer.MAX_SAFE_VALUE.toBigInt(), min: Integer.MIN_SAFE_VALUE.toBigInt() }),\n (num1, num2) =>\n // @ts-expect-error\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n num1 + int(num2) === num1 + num2 &&\n // @ts-expect-error\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n int(num1) + num2 === num1 + num2 &&\n // @ts-expect-error\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n int(num1) + int(num2) === num1 + num2\n ))\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/integer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Integer addition with the `+` operator should behave identically to `bigint` addition for values within the safe range.", "mode": "fast-check"} {"id": 54732, "name": "unknown", "code": "test('Integer should be able to use - operator as bigint', () => {\n fc.assert(\n fc.property(\n fc.bigInt({ max: Integer.MAX_SAFE_VALUE.toBigInt(), min: Integer.MIN_SAFE_VALUE.toBigInt() }),\n fc.bigInt({ max: Integer.MAX_SAFE_VALUE.toBigInt(), min: Integer.MIN_SAFE_VALUE.toBigInt() }),\n (num1, num2) =>\n // @ts-expect-error\n num1 - int(num2) === num1 - num2 &&\n // @ts-expect-error\n int(num1) - num2 === num1 - num2 &&\n // @ts-expect-error\n int(num1) - int(num2) === num1 - num2\n ))\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/integer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "The `Integer` type should correctly use the minus operator as `bigint`, ensuring consistent subtraction results across combinations of `Integer` and `bigint` values.", "mode": "fast-check"} {"id": 54733, "name": "unknown", "code": "test('Integer should be able to use * operator as bigint', () => {\n fc.assert(\n fc.property(\n fc.bigInt({ max: Integer.MAX_SAFE_VALUE.toBigInt(), min: Integer.MIN_SAFE_VALUE.toBigInt() }),\n fc.bigInt({ max: Integer.MAX_SAFE_VALUE.toBigInt(), min: Integer.MIN_SAFE_VALUE.toBigInt() }),\n (num1, num2) =>\n // @ts-expect-error\n num1 * int(num2) === num1 * num2 &&\n // @ts-expect-error\n int(num1) * num2 === num1 * num2 &&\n // @ts-expect-error\n int(num1) * int(num2) === num1 * num2\n ))\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/integer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "The property checks that using the `*` operator between integers and their `Integer` representations behaves identically to using the operator with regular bigints.", "mode": "fast-check"} {"id": 54736, "name": "unknown", "code": "test('int(number) should be reversed by Integer.toNumber', () => {\n fc.assert(fc.property(fc.integer(), num => num === int(num).toNumber()))\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/integer.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Converting a number to an integer using `int` and then back to a number using `Integer.toNumber` results in the original number.", "mode": "fast-check"} {"id": 54737, "name": "unknown", "code": "test('int(Integer) should be equal Integer', () => {\n fc.assert(fc.property(arbitraryInteger(), integer => integer === int(integer)))\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/integer.test.ts", "start_line": null, "end_line": null, "dependencies": ["arbitraryInteger"], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "`int(Integer)` should return an `Integer` equal to the original input `Integer`.", "mode": "fast-check"} {"id": 54738, "name": "unknown", "code": "test('Integer.add should be Commutative', () => {\n fc.assert(fc.property(arbitraryInteger(), arbitraryInteger(),\n (a, b) => a.add(b).equals(b.add(a))))\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/integer.test.ts", "start_line": null, "end_line": null, "dependencies": ["arbitraryInteger"], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "`Integer.add` operation commutes, meaning `a.add(b)` equals `b.add(a)`.", "mode": "fast-check"} {"id": 54740, "name": "unknown", "code": "test('Integer.add should be Associative', () => {\n fc.assert(fc.property(arbitraryInteger(), arbitraryInteger(), arbitraryInteger(),\n (a, b, c) => a.add(b.add(c)).equals(a.add(b).add(c))))\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/integer.test.ts", "start_line": null, "end_line": null, "dependencies": ["arbitraryInteger"], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "The `add` function of the `Integer` class should be associative.", "mode": "fast-check"} {"id": 54741, "name": "unknown", "code": "test('Integer.multiply should be Associative', () => {\n fc.assert(fc.property(arbitraryInteger(), arbitraryInteger(), arbitraryInteger(),\n (a, b, c) => a.multiply(b.multiply(c)).equals(a.multiply(b).multiply(c))))\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/integer.test.ts", "start_line": null, "end_line": null, "dependencies": ["arbitraryInteger"], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "The multiplication of `Integer` objects should be associative, meaning the result should remain the same regardless of how the operands are grouped.", "mode": "fast-check"} {"id": 54744, "name": "unknown", "code": "test('Integer.add should have 0 as identity', () => {\n fc.assert(fc.property(arbitraryInteger(), (a) => a.add(0).equals(a)))\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/integer.test.ts", "start_line": null, "end_line": null, "dependencies": ["arbitraryInteger"], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Adding 0 to an `Integer` should result in the same `Integer`.", "mode": "fast-check"} {"id": 54745, "name": "unknown", "code": "test('Integer.subtract should have 0 as identity', () => {\n fc.assert(fc.property(arbitraryInteger(), (a) => a.subtract(0).equals(a)))\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/integer.test.ts", "start_line": null, "end_line": null, "dependencies": ["arbitraryInteger"], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "`Integer.subtract` returns the original integer when subtracting zero.", "mode": "fast-check"} {"id": 54748, "name": "unknown", "code": "test('Integer.equals should return true if a - b is ZERO', () => {\n fc.assert(fc.property(arbitraryInteger(), arbitraryInteger(),\n (a, b) => a.subtract(b).isZero() ? a.equals(b) : !a.equals(b)))\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/integer.test.ts", "start_line": null, "end_line": null, "dependencies": ["arbitraryInteger"], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "`Integer.equals` returns true if subtracting one instance from another results in zero.", "mode": "fast-check"} {"id": 54749, "name": "unknown", "code": "test('Integer.greaterThan should return true if a - b is positive', () => {\n fc.assert(fc.property(\n arbitrarySameSignIntegers(),\n ({ a, b }) => a.subtract(b).isPositive() ? a.greaterThan(b) : !a.greaterThan(b)))\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/integer.test.ts", "start_line": null, "end_line": null, "dependencies": ["arbitrarySameSignIntegers"], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "`Integer.greaterThan` returns true if and only if the result of `a.subtract(b)` is positive for integers with the same sign.", "mode": "fast-check"} {"id": 54753, "name": "unknown", "code": "test('Integer.greaterThan should return true if a is positive', () => {\n fc.assert(fc.property(\n arbitraryDiffSignIntegers(),\n ({ a, b }) => a.isPositive() ? a.greaterThan(b) : !a.greaterThan(b)))\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/integer.test.ts", "start_line": null, "end_line": null, "dependencies": ["arbitraryDiffSignIntegers"], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "`Integer.greaterThan` returns true when a positive integer is compared to an integer of opposite sign, otherwise returns false.", "mode": "fast-check"} {"id": 54757, "name": "unknown", "code": "it('should round up sub milliseconds transaction timeouts', async () => {\n return await fc.assert(\n fc.asyncProperty(\n fc.float({ min: 0, noNaN: true }),\n async (timeout: number) => {\n const connection = mockBeginWithSuccess(newFakeConnection())\n\n const { session } = setupSession({\n connection,\n beginTx: false,\n database: 'neo4j'\n })\n\n await session.beginTransaction({ timeout })\n\n expect(connection.seenBeginTransaction[0][0].txConfig.timeout)\n .toEqual(int(Math.ceil(timeout)))\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/session.test.ts", "start_line": null, "end_line": null, "dependencies": ["mockBeginWithSuccess", "newFakeConnection", "setupSession"], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Sub-millisecond transaction timeouts should be rounded up to the nearest whole number.", "mode": "fast-check"} {"id": 54758, "name": "unknown", "code": "it('should log when a timeout is configured with sub milliseconds', async () => {\n return await fc.assert(\n fc.asyncProperty(\n fc\n .float({ min: 0, noNaN: true })\n .filter((timeout: number) => !Number.isInteger(timeout)),\n async (timeout: number) => {\n const connection = mockBeginWithSuccess(newFakeConnection())\n\n const { session, loggerFunction } = setupSession({\n connection,\n beginTx: false,\n database: 'neo4j'\n })\n\n await session.beginTransaction({ timeout })\n\n expect(loggerFunction).toBeCalledWith(\n 'info',\n `Transaction timeout expected to be an integer, got: ${timeout}. The value will be rounded up.`\n )\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/session.test.ts", "start_line": null, "end_line": null, "dependencies": ["mockBeginWithSuccess", "newFakeConnection", "setupSession"], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Logging occurs when a transaction timeout is set with a non-integer sub-millisecond value, indicating it will be rounded up.", "mode": "fast-check"} {"id": 54759, "name": "unknown", "code": "it('should not log a warning for timeout configurations without sub milliseconds', async () => {\n return await fc.assert(\n fc.asyncProperty(\n fc.nat(),\n async (timeout: number) => {\n const connection = mockBeginWithSuccess(newFakeConnection())\n\n const { session, loggerFunction } = setupSession({\n connection,\n beginTx: false,\n database: 'neo4j'\n })\n\n await session.beginTransaction({ timeout })\n\n expect(loggerFunction).not.toBeCalledWith(\n 'info',\n expect.any(String)\n )\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/session.test.ts", "start_line": null, "end_line": null, "dependencies": ["mockBeginWithSuccess", "newFakeConnection", "setupSession"], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "No warning log should be produced when beginning a transaction with a timeout configuration that does not include sub-millisecond precision.", "mode": "fast-check"} {"id": 54760, "name": "unknown", "code": "it('should round up sub milliseconds transaction timeouts', async () => {\n return await fc.assert(\n fc.asyncProperty(\n fc.float({ min: 0, noNaN: true }),\n async (timeout: number) => {\n const connection = mockBeginWithSuccess(newFakeConnection())\n const session = newSessionWithConnection(connection, false, FETCH_ALL)\n // @ts-expect-error\n jest.spyOn(Transaction.prototype, 'run').mockImplementation(async () => await Promise.resolve())\n const query = 'RETURN $a'\n const params = { a: 1 }\n\n await execute(session)(async (tx: ManagedTransaction) => {\n await tx.run(query, params)\n }, { timeout })\n\n expect(connection.seenBeginTransaction[0][0].txConfig.timeout)\n .toEqual(int(Math.ceil(timeout)))\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/session.test.ts", "start_line": null, "end_line": null, "dependencies": ["mockBeginWithSuccess", "newFakeConnection", "newSessionWithConnection"], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Transaction timeout values with sub-millisecond precision are rounded up to the nearest whole number in the configuration.", "mode": "fast-check"} {"id": 54761, "name": "unknown", "code": "it('should log a warning for timeout configurations with sub milliseconds', async () => {\n return await fc.assert(\n fc.asyncProperty(\n fc\n .float({ min: 0, noNaN: true })\n .filter((timeout: number) => !Number.isInteger(timeout)),\n async (timeout: number) => {\n const connection = mockBeginWithSuccess(newFakeConnection())\n const { session, loggerFunction } = setupSession({\n connection,\n beginTx: false,\n fetchSize: FETCH_ALL\n })\n\n // @ts-expect-error\n jest.spyOn(Transaction.prototype, 'run').mockImplementation(async () => await Promise.resolve())\n const query = 'RETURN $a'\n const params = { a: 1 }\n\n await execute(session)(async (tx: ManagedTransaction) => {\n await tx.run(query, params)\n }, { timeout })\n\n expect(loggerFunction).toBeCalledWith(\n 'info',\n `Transaction timeout expected to be an integer, got: ${timeout}. The value will be rounded up.`\n )\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/session.test.ts", "start_line": null, "end_line": null, "dependencies": ["mockBeginWithSuccess", "newFakeConnection", "setupSession"], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Logs a warning message when a transaction timeout is configured with a non-integer value, indicating that the value will be rounded up.", "mode": "fast-check"} {"id": 54762, "name": "unknown", "code": "it('should not log a warning for timeout configurations without sub milliseconds', async () => {\n return await fc.assert(\n fc.asyncProperty(\n fc.nat(),\n async (timeout: number) => {\n const connection = mockBeginWithSuccess(newFakeConnection())\n const { session, loggerFunction } = setupSession({\n connection,\n beginTx: false,\n fetchSize: FETCH_ALL\n })\n\n // @ts-expect-error\n jest.spyOn(Transaction.prototype, 'run').mockImplementation(async () => await Promise.resolve())\n const query = 'RETURN $a'\n const params = { a: 1 }\n\n await execute(session)(async (tx: ManagedTransaction) => {\n await tx.run(query, params)\n }, { timeout })\n\n expect(loggerFunction).not.toBeCalledWith(\n 'info',\n expect.any(String)\n )\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/session.test.ts", "start_line": null, "end_line": null, "dependencies": ["mockBeginWithSuccess", "newFakeConnection", "setupSession"], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "A session should not log an \"info\" level warning for timeout configurations when no sub-millisecond values are present.", "mode": "fast-check"} {"id": 54763, "name": "unknown", "code": "it('should round up sub milliseconds transaction timeouts', async () => {\n return await fc.assert(\n fc.asyncProperty(\n fc.float({ min: 0, noNaN: true }),\n async (timeout: number) => {\n const connection = newFakeConnection()\n\n const { session } = setupSession({\n connection,\n beginTx: false,\n database: 'neo4j'\n })\n\n await session.run('query', {}, { timeout })\n\n expect(connection.seenProtocolOptions[0].txConfig.timeout)\n .toEqual(int(Math.ceil(timeout)))\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/session.test.ts", "start_line": null, "end_line": null, "dependencies": ["newFakeConnection", "setupSession"], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Transaction timeouts with sub-millisecond precision should be rounded up to the nearest millisecond integer when applied in a session.", "mode": "fast-check"} {"id": 54764, "name": "unknown", "code": "it('should log a warning for timeout configurations with sub milliseconds', async () => {\n return await fc.assert(\n fc.asyncProperty(\n fc\n .float({ min: 0, noNaN: true })\n .filter((timeout: number) => !Number.isInteger(timeout)),\n async (timeout: number) => {\n const connection = newFakeConnection()\n\n const { session, loggerFunction } = setupSession({\n connection,\n beginTx: false,\n database: 'neo4j'\n })\n\n await session.run('query', {}, { timeout })\n\n expect(loggerFunction).toBeCalledWith(\n 'info',\n `Transaction timeout expected to be an integer, got: ${timeout}. The value will be rounded up.`\n )\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/session.test.ts", "start_line": null, "end_line": null, "dependencies": ["newFakeConnection", "setupSession"], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "A warning should be logged when a session is run with a timeout configuration that has a sub-millisecond value, indicating it will be rounded up.", "mode": "fast-check"} {"id": 54765, "name": "unknown", "code": "it('should not log a warning for timeout configurations without sub milliseconds', async () => {\n return await fc.assert(\n fc.asyncProperty(\n fc.nat(),\n async (timeout: number) => {\n const connection = newFakeConnection()\n\n const { session, loggerFunction } = setupSession({\n connection,\n beginTx: false,\n database: 'neo4j'\n })\n\n await session.run('query', {}, { timeout })\n\n expect(loggerFunction).not.toBeCalledWith(\n 'info',\n expect.any(String)\n )\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/session.test.ts", "start_line": null, "end_line": null, "dependencies": ["newFakeConnection", "setupSession"], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "No warning should be logged for timeout configurations that do not include sub-millisecond values.", "mode": "fast-check"} {"id": 54770, "name": "unknown", "code": "it('should handle return arbitrary integer as it is', () => {\n return fc.assert(\n fc.property(\n fc.integer(),\n value => {\n const rawProfilePlan = {\n [field]: value\n }\n\n const profilePlan = new ProfiledPlan(rawProfilePlan)\n\n return profilePlan[field] === value\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/result-summary.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "`ProfiledPlan` retains arbitrary integer values as they are in the specified field.", "mode": "fast-check"} {"id": 54775, "name": "unknown", "code": "it('should handle return arbitrary integer as it is', () => {\n return fc.assert(\n fc.property(\n fc.integer(),\n value => {\n const stats = {\n [rawField]: value\n }\n\n const queryStatistics = new QueryStatistics(stats)\n\n return queryStatistics.updates()[field] === value\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/result-summary.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "`QueryStatistics` correctly returns arbitrary integer values as they are from the updates method.", "mode": "fast-check"} {"id": 54777, "name": "unknown", "code": "it('should handle Integer with arbitrary integer', () => {\n return fc.assert(\n fc.property(\n fc.integer().map(value => [int(value), value]),\n ([value, expectedValue]) => {\n const stats = {\n [rawField]: value\n }\n\n const queryStatistics = new QueryStatistics(stats)\n\n return queryStatistics.updates()[field] === expectedValue\n }\n )\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/core/test/result-summary.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "`QueryStatistics` correctly retrieves the original integer value from the statistics object.", "mode": "fast-check"} {"id": 60389, "name": "unknown", "code": "it(\"should fail to cast non-booleans\", () => {\n expect.assertions(100);\n fc.assert(\n fc.property(\n fc.anything().filter((input) => typeof input !== \"boolean\"),\n (input) => {\n expect(castBoolean(input)).toStrictEqual({\n status: \"failure\",\n expected: \"boolean\",\n actual: input\n });\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/aaditmshah/typecraft/src/cast.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "aaditmshah/typecraft", "url": "https://github.com/aaditmshah/typecraft.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Casting non-boolean inputs results in a failure status, indicating the expected type as \"boolean\" and the actual input type.", "mode": "fast-check"} {"id": 54783, "name": "unknown", "code": "it('should pack and unpack DateTimeWithZoneIdAndNoOffset', () => {\n fc.assert(\n fc.property(fc.date(), date => {\n const object = DateTime.fromStandardDate(date)\n const buffer = alloc(256)\n const loggerFunction = jest.fn()\n const protocol = new BoltProtocolV5x6(\n new utils.MessageRecordingConnection(),\n buffer,\n {\n disableLosslessIntegers: true\n },\n undefined,\n new Logger('debug', loggerFunction)\n )\n\n const packable = protocol.packable(object)\n\n expect(packable).not.toThrow()\n\n buffer.reset()\n\n const unpacked = protocol.unpack(buffer)\n\n expect(unpacked.timeZoneOffsetSeconds).toBeDefined()\n\n expect(unpacked).toEqual(object)\n })\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/bolt-connection/test/bolt/bolt-protocol-v5x6.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Packing and unpacking `DateTimeWithZoneIdAndNoOffset` correctly maintains the original object, including a defined `timeZoneOffsetSeconds`.", "mode": "fast-check"} {"id": 54784, "name": "unknown", "code": "it('should pack and unpack DateTimeWithOffset', () => {\n fc.assert(\n fc.property(\n fc.date({\n min: temporalUtil.newDate(utils.MIN_UTC_IN_MS + utils.ONE_DAY_IN_MS),\n max: temporalUtil.newDate(utils.MAX_UTC_IN_MS - utils.ONE_DAY_IN_MS)\n }),\n fc.integer({ min: 0, max: 999_999 }),\n utils.arbitraryTimeZoneId(),\n (date, nanoseconds, timeZoneId) => {\n const object = new DateTime(\n date.getUTCFullYear(),\n date.getUTCMonth() + 1,\n date.getUTCDate(),\n date.getUTCHours(),\n date.getUTCMinutes(),\n date.getUTCSeconds(),\n date.getUTCMilliseconds() * 1_000_000 + nanoseconds,\n undefined,\n timeZoneId\n )\n const buffer = alloc(256)\n const loggerFunction = jest.fn()\n const protocol = new BoltProtocolV5x3(\n new utils.MessageRecordingConnection(),\n buffer,\n {\n disableLosslessIntegers: true\n },\n undefined,\n new Logger('debug', loggerFunction)\n )\n\n const packable = protocol.packable(object)\n\n expect(packable).not.toThrow()\n expect(loggerFunction)\n .toBeCalledWith('warn',\n 'DateTime objects without \"timeZoneOffsetSeconds\" property ' +\n 'are prune to bugs related to ambiguous times. For instance, ' +\n '2022-10-30T2:30:00[Europe/Berlin] could be GMT+1 or GMT+2.')\n\n buffer.reset()\n\n const unpacked = protocol.unpack(buffer)\n\n expect(unpacked.timeZoneOffsetSeconds).toBeDefined()\n\n const unpackedDateTimeWithoutOffset = new DateTime(\n unpacked.year,\n unpacked.month,\n unpacked.day,\n unpacked.hour,\n unpacked.minute,\n unpacked.second,\n unpacked.nanosecond,\n undefined,\n unpacked.timeZoneId\n )\n\n expect(unpackedDateTimeWithoutOffset).toEqual(object)\n })\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/bolt-connection/test/bolt/bolt-protocol-v5x3.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Packing and unpacking of `DateTimeWithOffset` should maintain the integrity of the original date-time object, including the handling of ambiguous times and issuing warnings when the `timeZoneOffsetSeconds` is undefined.", "mode": "fast-check"} {"id": 54785, "name": "unknown", "code": "it('should pack and unpack DateTimeWithZoneIdAndNoOffset', () => {\n fc.assert(\n fc.property(fc.date(), date => {\n const object = DateTime.fromStandardDate(date)\n const buffer = alloc(256)\n const loggerFunction = jest.fn()\n const protocol = new BoltProtocolV5x3(\n new utils.MessageRecordingConnection(),\n buffer,\n {\n disableLosslessIntegers: true\n },\n undefined,\n new Logger('debug', loggerFunction)\n )\n\n const packable = protocol.packable(object)\n\n expect(packable).not.toThrow()\n\n buffer.reset()\n\n const unpacked = protocol.unpack(buffer)\n\n expect(unpacked.timeZoneOffsetSeconds).toBeDefined()\n\n expect(unpacked).toEqual(object)\n })\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/bolt-connection/test/bolt/bolt-protocol-v5x3.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Packing and unpacking `DateTimeWithZoneIdAndNoOffset` should maintain data integrity, ensuring the unpacked object matches the original.", "mode": "fast-check"} {"id": 54786, "name": "unknown", "code": "it('should pack and unpack DateTimeWithOffset', () => {\n fc.assert(\n fc.property(\n fc.date({\n min: temporalUtil.newDate(utils.MIN_UTC_IN_MS + utils.ONE_DAY_IN_MS),\n max: temporalUtil.newDate(utils.MAX_UTC_IN_MS - utils.ONE_DAY_IN_MS)\n }),\n fc.integer({ min: 0, max: 999_999 }),\n utils.arbitraryTimeZoneId(),\n (date, nanoseconds, timeZoneId) => {\n const object = new DateTime(\n date.getUTCFullYear(),\n date.getUTCMonth() + 1,\n date.getUTCDate(),\n date.getUTCHours(),\n date.getUTCMinutes(),\n date.getUTCSeconds(),\n date.getUTCMilliseconds() * 1_000_000 + nanoseconds,\n undefined,\n timeZoneId\n )\n const buffer = alloc(256)\n const loggerFunction = jest.fn()\n const protocol = new BoltProtocolV6x0(\n new utils.MessageRecordingConnection(),\n buffer,\n {\n disableLosslessIntegers: true\n },\n undefined,\n new Logger('debug', loggerFunction)\n )\n\n const packable = protocol.packable(object)\n\n expect(packable).not.toThrow()\n expect(loggerFunction)\n .toBeCalledWith('warn',\n 'DateTime objects without \"timeZoneOffsetSeconds\" property ' +\n 'are prune to bugs related to ambiguous times. For instance, ' +\n '2022-10-30T2:30:00[Europe/Berlin] could be GMT+1 or GMT+2.')\n\n buffer.reset()\n\n const unpacked = protocol.unpack(buffer)\n\n expect(unpacked.timeZoneOffsetSeconds).toBeDefined()\n\n const unpackedDateTimeWithoutOffset = new DateTime(\n unpacked.year,\n unpacked.month,\n unpacked.day,\n unpacked.hour,\n unpacked.minute,\n unpacked.second,\n unpacked.nanosecond,\n undefined,\n unpacked.timeZoneId\n )\n\n expect(unpackedDateTimeWithoutOffset).toEqual(object)\n })\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/bolt-connection/test/bolt/bolt-protocol-v6x0.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Packing and unpacking `DateTimeWithOffset` should correctly produce a `DateTime` object, with a warning for missing `\"timeZoneOffsetSeconds\"` and ensure the unpacked object matches the original.", "mode": "fast-check"} {"id": 54788, "name": "unknown", "code": "it('should pack and unpack DateTimeWithOffset', () => {\n fc.assert(\n fc.property(\n fc.date({\n min: temporalUtil.newDate(utils.MIN_UTC_IN_MS + utils.ONE_DAY_IN_MS),\n max: temporalUtil.newDate(utils.MAX_UTC_IN_MS - utils.ONE_DAY_IN_MS)\n }),\n fc.integer({ min: 0, max: 999_999 }),\n utils.arbitraryTimeZoneId(),\n (date, nanoseconds, timeZoneId) => {\n const object = new DateTime(\n date.getUTCFullYear(),\n date.getUTCMonth() + 1,\n date.getUTCDate(),\n date.getUTCHours(),\n date.getUTCMinutes(),\n date.getUTCSeconds(),\n date.getUTCMilliseconds() * 1_000_000 + nanoseconds,\n undefined,\n timeZoneId\n )\n const buffer = alloc(256)\n const loggerFunction = jest.fn()\n const protocol = new BoltProtocolV5x8(\n new utils.MessageRecordingConnection(),\n buffer,\n {\n disableLosslessIntegers: true\n },\n undefined,\n new Logger('debug', loggerFunction)\n )\n\n const packable = protocol.packable(object)\n\n expect(packable).not.toThrow()\n expect(loggerFunction)\n .toBeCalledWith('warn',\n 'DateTime objects without \"timeZoneOffsetSeconds\" property ' +\n 'are prune to bugs related to ambiguous times. For instance, ' +\n '2022-10-30T2:30:00[Europe/Berlin] could be GMT+1 or GMT+2.')\n\n buffer.reset()\n\n const unpacked = protocol.unpack(buffer)\n\n expect(unpacked.timeZoneOffsetSeconds).toBeDefined()\n\n const unpackedDateTimeWithoutOffset = new DateTime(\n unpacked.year,\n unpacked.month,\n unpacked.day,\n unpacked.hour,\n unpacked.minute,\n unpacked.second,\n unpacked.nanosecond,\n undefined,\n unpacked.timeZoneId\n )\n\n expect(unpackedDateTimeWithoutOffset).toEqual(object)\n })\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/bolt-connection/test/bolt/bolt-protocol-v5x8.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Packing and unpacking of `DateTimeWithOffset` should preserve the original `DateTime` properties, while ensuring a warning is logged for potential ambiguities when the `timeZoneOffsetSeconds` is absent, and correctly restoring it upon unpacking.", "mode": "fast-check"} {"id": 54790, "name": "unknown", "code": "it('should pack and unpack DateTimeWithOffset', () => {\n fc.assert(\n fc.property(\n fc.date({\n min: temporalUtil.newDate(utils.MIN_UTC_IN_MS + utils.ONE_DAY_IN_MS),\n max: temporalUtil.newDate(utils.MAX_UTC_IN_MS - utils.ONE_DAY_IN_MS)\n }),\n fc.integer({ min: 0, max: 999_999 }),\n utils.arbitraryTimeZoneId(),\n (date, nanoseconds, timeZoneId) => {\n const object = new DateTime(\n date.getUTCFullYear(),\n date.getUTCMonth() + 1,\n date.getUTCDate(),\n date.getUTCHours(),\n date.getUTCMinutes(),\n date.getUTCSeconds(),\n date.getUTCMilliseconds() * 1_000_000 + nanoseconds,\n undefined,\n timeZoneId\n )\n const buffer = alloc(256)\n const loggerFunction = jest.fn()\n const protocol = new BoltProtocolV5x2(\n new utils.MessageRecordingConnection(),\n buffer,\n {\n disableLosslessIntegers: true\n },\n undefined,\n new Logger('debug', loggerFunction)\n )\n\n const packable = protocol.packable(object)\n\n expect(packable).not.toThrow()\n expect(loggerFunction)\n .toBeCalledWith('warn',\n 'DateTime objects without \"timeZoneOffsetSeconds\" property ' +\n 'are prune to bugs related to ambiguous times. For instance, ' +\n '2022-10-30T2:30:00[Europe/Berlin] could be GMT+1 or GMT+2.')\n\n buffer.reset()\n\n const unpacked = protocol.unpack(buffer)\n\n expect(unpacked.timeZoneOffsetSeconds).toBeDefined()\n\n const unpackedDateTimeWithoutOffset = new DateTime(\n unpacked.year,\n unpacked.month,\n unpacked.day,\n unpacked.hour,\n unpacked.minute,\n unpacked.second,\n unpacked.nanosecond,\n undefined,\n unpacked.timeZoneId\n )\n\n expect(unpackedDateTimeWithoutOffset).toEqual(object)\n })\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/bolt-connection/test/bolt/bolt-protocol-v5x2.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Packing and unpacking `DateTimeWithOffset` should correctly handle dates within a specified range, generating a warning for missing time zone offsets and ensuring the unpacked object matches the original.", "mode": "fast-check"} {"id": 54791, "name": "unknown", "code": "it('should pack and unpack DateTimeWithZoneIdAndNoOffset', () => {\n fc.assert(\n fc.property(fc.date(), date => {\n const object = DateTime.fromStandardDate(date)\n const buffer = alloc(256)\n const loggerFunction = jest.fn()\n const protocol = new BoltProtocolV5x2(\n new utils.MessageRecordingConnection(),\n buffer,\n {\n disableLosslessIntegers: true\n },\n undefined,\n new Logger('debug', loggerFunction)\n )\n\n const packable = protocol.packable(object)\n\n expect(packable).not.toThrow()\n\n buffer.reset()\n\n const unpacked = protocol.unpack(buffer)\n\n expect(unpacked.timeZoneOffsetSeconds).toBeDefined()\n\n expect(unpacked).toEqual(object)\n })\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/bolt-connection/test/bolt/bolt-protocol-v5x2.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "The test ensures that `BoltProtocolV5x2` can correctly pack and unpack `DateTimeWithZoneIdAndNoOffset`, maintaining the original object's properties, including a defined time zone offset.", "mode": "fast-check"} {"id": 54793, "name": "unknown", "code": "it('should pack and unpack DateTimeWithZoneIdAndNoOffset', () => {\n fc.assert(\n fc.property(fc.date(), date => {\n const object = DateTime.fromStandardDate(date)\n const buffer = alloc(256)\n const loggerFunction = jest.fn()\n const protocol = new BoltProtocolV5x1(\n new utils.MessageRecordingConnection(),\n buffer,\n {\n disableLosslessIntegers: true\n },\n undefined,\n new Logger('debug', loggerFunction)\n )\n\n const packable = protocol.packable(object)\n\n expect(packable).not.toThrow()\n\n buffer.reset()\n\n const unpacked = protocol.unpack(buffer)\n\n expect(unpacked.timeZoneOffsetSeconds).toBeDefined()\n\n expect(unpacked).toEqual(object)\n })\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/bolt-connection/test/bolt/bolt-protocol-v5x1.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Packing and unpacking a `DateTimeWithZoneIdAndNoOffset` should maintain the integrity of the original object and define `timeZoneOffsetSeconds` after unpacking.", "mode": "fast-check"} {"id": 54795, "name": "unknown", "code": "it('should pack and unpack DateTimeWithZoneIdAndNoOffset', () => {\n fc.assert(\n fc.property(fc.date(), date => {\n const object = DateTime.fromStandardDate(date)\n\n buffer.reset()\n\n const packable = protocol.packable(object)\n\n expect(packable).not.toThrow()\n\n buffer.reset()\n\n const unpacked = protocol.unpack(buffer)\n\n expect(unpacked.timeZoneOffsetSeconds).toBeDefined()\n\n expect(unpacked).toEqual(object)\n })\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/bolt-connection/test/bolt/bolt-protocol-v4x3.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Ensures that `DateTime` objects, when packed and unpacked, maintain their integrity and contain defined `timeZoneOffsetSeconds`.", "mode": "fast-check"} {"id": 54796, "name": "unknown", "code": "it('should pack and unpack DateTimeWithOffset', () => {\n fc.assert(\n fc.property(\n fc.date({\n min: temporalUtil.newDate(utils.MIN_UTC_IN_MS + utils.ONE_DAY_IN_MS),\n max: temporalUtil.newDate(utils.MAX_UTC_IN_MS - utils.ONE_DAY_IN_MS)\n }),\n fc.integer({ min: 0, max: 999_999 }),\n utils.arbitraryTimeZoneId(),\n (date, nanoseconds, timeZoneId) => {\n const object = new DateTime(\n date.getUTCFullYear(),\n date.getUTCMonth() + 1,\n date.getUTCDate(),\n date.getUTCHours(),\n date.getUTCMinutes(),\n date.getUTCSeconds(),\n date.getUTCMilliseconds() * 1_000_000 + nanoseconds,\n undefined,\n timeZoneId\n )\n const buffer = alloc(256)\n const loggerFunction = jest.fn()\n const protocol = new BoltProtocolV5x0(\n new utils.MessageRecordingConnection(),\n buffer,\n {\n disableLosslessIntegers: true\n },\n undefined,\n new Logger('debug', loggerFunction)\n )\n\n const packable = protocol.packable(object)\n\n expect(packable).not.toThrow()\n expect(loggerFunction)\n .toBeCalledWith('warn',\n 'DateTime objects without \"timeZoneOffsetSeconds\" property ' +\n 'are prune to bugs related to ambiguous times. For instance, ' +\n '2022-10-30T2:30:00[Europe/Berlin] could be GMT+1 or GMT+2.')\n\n buffer.reset()\n\n const unpacked = protocol.unpack(buffer)\n\n expect(unpacked.timeZoneOffsetSeconds).toBeDefined()\n\n const unpackedDateTimeWithoutOffset = new DateTime(\n unpacked.year,\n unpacked.month,\n unpacked.day,\n unpacked.hour,\n unpacked.minute,\n unpacked.second,\n unpacked.nanosecond,\n undefined,\n unpacked.timeZoneId\n )\n\n expect(unpackedDateTimeWithoutOffset).toEqual(object)\n })\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/bolt-connection/test/bolt/bolt-protocol-v5x0.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Packing and unpacking `DateTimeWithOffset` should preserve all properties, including creating warnings for missing offsets and ensuring the unpacked object matches the original.", "mode": "fast-check"} {"id": 54798, "name": "unknown", "code": "it('should pack and unpack DateTimeWithOffset', () => {\n fc.assert(\n fc.property(\n fc.date({\n min: temporalUtil.newDate(utils.MIN_UTC_IN_MS + utils.ONE_DAY_IN_MS),\n max: temporalUtil.newDate(utils.MAX_UTC_IN_MS - utils.ONE_DAY_IN_MS)\n }),\n fc.integer({ min: 0, max: 999_999 }),\n utils.arbitraryTimeZoneId(),\n (date, nanoseconds, timeZoneId) => {\n const object = new DateTime(\n date.getUTCFullYear(),\n date.getUTCMonth() + 1,\n date.getUTCDate(),\n date.getUTCHours(),\n date.getUTCMinutes(),\n date.getUTCSeconds(),\n date.getUTCMilliseconds() * 1_000_000 + nanoseconds,\n undefined,\n timeZoneId\n )\n const buffer = alloc(256)\n const loggerFunction = jest.fn()\n const protocol = new BoltProtocolV5x5(\n new utils.MessageRecordingConnection(),\n buffer,\n {\n disableLosslessIntegers: true\n },\n undefined,\n new Logger('debug', loggerFunction)\n )\n\n const packable = protocol.packable(object)\n\n expect(packable).not.toThrow()\n expect(loggerFunction)\n .toBeCalledWith('warn',\n 'DateTime objects without \"timeZoneOffsetSeconds\" property ' +\n 'are prune to bugs related to ambiguous times. For instance, ' +\n '2022-10-30T2:30:00[Europe/Berlin] could be GMT+1 or GMT+2.')\n\n buffer.reset()\n\n const unpacked = protocol.unpack(buffer)\n\n expect(unpacked.timeZoneOffsetSeconds).toBeDefined()\n\n const unpackedDateTimeWithoutOffset = new DateTime(\n unpacked.year,\n unpacked.month,\n unpacked.day,\n unpacked.hour,\n unpacked.minute,\n unpacked.second,\n unpacked.nanosecond,\n undefined,\n unpacked.timeZoneId\n )\n\n expect(unpackedDateTimeWithoutOffset).toEqual(object)\n })\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/bolt-connection/test/bolt/bolt-protocol-v5x5.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Ensures that `DateTimeWithOffset` objects are correctly packed and unpacked by `BoltProtocolV5x5`, with a warning issued for missing `timeZoneOffsetSeconds`, and verifies the equality of the original and unpacked objects.", "mode": "fast-check"} {"id": 54799, "name": "unknown", "code": "it('should pack and unpack DateTimeWithZoneIdAndNoOffset', () => {\n fc.assert(\n fc.property(fc.date(), date => {\n const object = DateTime.fromStandardDate(date)\n const buffer = alloc(256)\n const loggerFunction = jest.fn()\n const protocol = new BoltProtocolV5x5(\n new utils.MessageRecordingConnection(),\n buffer,\n {\n disableLosslessIntegers: true\n },\n undefined,\n new Logger('debug', loggerFunction)\n )\n\n const packable = protocol.packable(object)\n\n expect(packable).not.toThrow()\n\n buffer.reset()\n\n const unpacked = protocol.unpack(buffer)\n\n expect(unpacked.timeZoneOffsetSeconds).toBeDefined()\n\n expect(unpacked).toEqual(object)\n })\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/bolt-connection/test/bolt/bolt-protocol-v5x5.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Packing and unpacking a `DateTimeWithZoneIdAndNoOffset` should consistently recreate the original object with the same properties including a defined time zone offset.", "mode": "fast-check"} {"id": 54802, "name": "unknown", "code": "it('should pack and unpack DateTimeWithOffset', () => {\n fc.assert(\n fc.property(\n fc.date({\n min: temporalUtil.newDate(utils.MIN_UTC_IN_MS + utils.ONE_DAY_IN_MS),\n max: temporalUtil.newDate(utils.MAX_UTC_IN_MS - utils.ONE_DAY_IN_MS)\n }),\n fc.integer({ min: 0, max: 999_999 }),\n utils.arbitraryTimeZoneId(),\n (date, nanoseconds, timeZoneId) => {\n const object = new DateTime(\n date.getUTCFullYear(),\n date.getUTCMonth() + 1,\n date.getUTCDate(),\n date.getUTCHours(),\n date.getUTCMinutes(),\n date.getUTCSeconds(),\n date.getUTCMilliseconds() * 1_000_000 + nanoseconds,\n undefined,\n timeZoneId\n )\n const buffer = alloc(256)\n const loggerFunction = jest.fn()\n const protocol = new BoltProtocolV5x4(\n new utils.MessageRecordingConnection(),\n buffer,\n {\n disableLosslessIntegers: true\n },\n undefined,\n new Logger('debug', loggerFunction)\n )\n\n const packable = protocol.packable(object)\n\n expect(packable).not.toThrow()\n expect(loggerFunction)\n .toBeCalledWith('warn',\n 'DateTime objects without \"timeZoneOffsetSeconds\" property ' +\n 'are prune to bugs related to ambiguous times. For instance, ' +\n '2022-10-30T2:30:00[Europe/Berlin] could be GMT+1 or GMT+2.')\n\n buffer.reset()\n\n const unpacked = protocol.unpack(buffer)\n\n expect(unpacked.timeZoneOffsetSeconds).toBeDefined()\n\n const unpackedDateTimeWithoutOffset = new DateTime(\n unpacked.year,\n unpacked.month,\n unpacked.day,\n unpacked.hour,\n unpacked.minute,\n unpacked.second,\n unpacked.nanosecond,\n undefined,\n unpacked.timeZoneId\n )\n\n expect(unpackedDateTimeWithoutOffset).toEqual(object)\n })\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/bolt-connection/test/bolt/bolt-protocol-v5x4.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Packing and unpacking a `DateTime` object with a time zone ID should correctly handle and log warnings for objects without a `timeZoneOffsetSeconds`, ensuring the unpacked object matches the original.", "mode": "fast-check"} {"id": 54803, "name": "unknown", "code": "it('should pack and unpack DateTimeWithZoneIdAndNoOffset', () => {\n fc.assert(\n fc.property(fc.date(), date => {\n const object = DateTime.fromStandardDate(date)\n const buffer = alloc(256)\n const loggerFunction = jest.fn()\n const protocol = new BoltProtocolV5x4(\n new utils.MessageRecordingConnection(),\n buffer,\n {\n disableLosslessIntegers: true\n },\n undefined,\n new Logger('debug', loggerFunction)\n )\n\n const packable = protocol.packable(object)\n\n expect(packable).not.toThrow()\n\n buffer.reset()\n\n const unpacked = protocol.unpack(buffer)\n\n expect(unpacked.timeZoneOffsetSeconds).toBeDefined()\n\n expect(unpacked).toEqual(object)\n })\n )\n })", "language": "typescript", "source_file": "./repos/neo4j/neo4j-javascript-driver/packages/bolt-connection/test/bolt/bolt-protocol-v5x4.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "neo4j/neo4j-javascript-driver", "url": "https://github.com/neo4j/neo4j-javascript-driver.git", "license": "Apache-2.0", "stars": 886, "forks": 153}, "metrics": null, "summary": "Packing and unpacking a `DateTimeWithZoneIdAndNoOffset` must correctly handle date objects, ensuring the original and unpacked values are equal, including a defined `timeZoneOffsetSeconds`.", "mode": "fast-check"} {"id": 54820, "name": "unknown", "code": "t.test('asIntN', t => {\n fc.assert(\n fc.property(fc.bigIntN(N), fc.integer({ min: 0, max: N }), (n, m) => {\n t.equal(t_asIntN(m, n), BigInt.asIntN(m, n));\n }),\n {\n examples: [\n [0n, 0],\n [1n, 0],\n [-1n, 0],\n [1n, 1],\n [-1n, 1]\n ]\n }\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/to-value.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`asIntN` function should return the same result as `BigInt.asIntN` for a given bit-width and big integer, including specific example cases.", "mode": "fast-check"} {"id": 54821, "name": "unknown", "code": "t.test('isqrt', t => {\n fc.assert(\n fc.property(fc.integer({ min: 1 }), n => {\n t.equal(t_sqrt(n), BigIntMath.sqrt(n));\n })\n );\n\n // // Identity\n // fc.assert(\n // fc.property(fc.bigInt(1n, 2n**64n), n => {\n // t.equal(t_sqrt(n**2n), n);\n // })\n // );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/roots.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The `t_sqrt` function should produce the same integer square root as `BigIntMath.sqrt` for integers greater than or equal to 1.", "mode": "fast-check"} {"id": 54825, "name": "unknown", "code": "t.test('log10', t => {\n fc.assert(\n fc.property(fc.bigInt({ min: 1n, max: M }), n => {\n t.equal(t_log10(n), BigIntMath.log(10, n));\n })\n );\n\n // Identity\n fc.assert(\n fc.property(fc.bigInt(1n, 1000n), n => {\n t.equal(t_log10(10n ** n), n);\n })\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/log.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`log10` function produces the expected result when computing the logarithm base 10 of given big integers, and for powers of ten, the logarithm correctly returns the exponent.", "mode": "fast-check"} {"id": 54827, "name": "unknown", "code": "t.test('pow', t => {\n fc.assert(\n fc.property(fc.bigIntN(N), fc.bigInt(0n, 2n ** 4n), (n, m) => {\n t.equal(t_pow(n, m), n ** m);\n }),\n {\n examples: [\n [0n, 0n],\n [1n, 1n],\n [2n, 2n],\n [0xdeadbeefn, 1n]\n ]\n }\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/pow.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The function `t_pow` should correctly compute the power of a big integer `n` raised to another big integer `m`, matching the result of `n ** m`.", "mode": "fast-check"} {"id": 54828, "name": "unknown", "code": "t.test('powMod', t => {\n fc.assert(\n fc.property(\n fc.bigIntN(N),\n fc.bigInt(0n, 2n ** 8n),\n fc.bigInt(0n, 2n ** 256n),\n (x, n, m) => {\n if (m === 0n) m++;\n t.equal(t_powMod(x, n, m), BigIntMath.mod(x ** n, m));\n }\n )\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/pow.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The function `t_powMod` should match the result of `BigIntMath.mod(x ** n, m)` for given big integers `x`, `n`, and `m`, with `m` adjusted to be non-zero when necessary.", "mode": "fast-check"} {"id": 54829, "name": "unknown", "code": "t.test('identites', t => {\n fc.assert(\n fc.property(fc.bigIntN(N), n => {\n t.equal(t_pow(n, 0n), 1n);\n t.equal(t_pow(n, 1n), n);\n })\n );\n\n // a^*(m + n) = a^m * a^n\n // (a^m)^n = a^(m * n)\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/pow.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "For any big integer \\( n \\), raising it to the power of 0 results in 1, and raising it to the power of 1 results in \\( n \\).", "mode": "fast-check"} {"id": 54830, "name": "unknown", "code": "t.test(\"Kunth's Test\", t => {\n const b = 10;\n const bm1 = `9`;\n const bm2 = `8`;\n\n fc.assert(\n fc.property(\n fc.integer({ min: 2, max: 8 }),\n fc.integer({ min: 1, max: 8 }),\n (n, m) => {\n n = n + m; // n > m\n\n const r = [\n bm1.repeat(m - 1),\n bm2,\n bm1.repeat(n - m),\n '0'.repeat(m - 1),\n 1\n ].join('');\n\n const tm = mpz.sub(mpz.pow(from(b), from(m)), from(1));\n const tn = mpz.sub(mpz.pow(from(b), from(n)), from(1));\n\n t.equal(to(mpz.mul(tm, tn)), BigInt(r));\n }\n )\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/pow.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Kunth's test verifies that multiplying the results of two specific mpz operations, based on powers and subtractions with base `b`, matches the expected concatenated string pattern converted to a BigInt.", "mode": "fast-check"} {"id": 54835, "name": "unknown", "code": "t.test('toString(-16)', t => {\n t.equal(t_string('0', -16), '0');\n t.equal(t_string('-0xbeef', -16), '-BEEF');\n t.equal(t_string('0xdeadbeef', -16), 'DEADBEEF');\n\n fc.assert(\n fc.property(fc.bigIntN(N), n => {\n t.equal(t_string(n, -16), n.toString(16).toUpperCase());\n })\n );\n\n t.end();\n })", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/to-string.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The function `t_string` should correctly convert integers to uppercase hexadecimal strings when using a base of -16.", "mode": "fast-check"} {"id": 54836, "name": "unknown", "code": "t.test('toString(2)', t => {\n t.equal(t_string('0', 2), '0');\n t.equal(t_string('-0xbeef', 2), '-1011111011101111');\n t.equal(t_string('0xdeadbeef', 2), '11011110101011011011111011101111');\n t.equal(t_string('-0xdeadbeef', 2), '-11011110101011011011111011101111');\n\n fc.assert(\n fc.property(fc.bigIntN(N), n => {\n t.equal(t_string(n, 2), n.toString(2));\n })\n );\n\n t.end();\n })", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/to-string.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The `t_string` function correctly converts integers, including hexadecimal, to their binary string representation.", "mode": "fast-check"} {"id": 54837, "name": "unknown", "code": "t.test('toHex', t => {\n t.equal(t_hex('0'), '0x0');\n\n t.equal(t_hex('3'), '0x3');\n t.equal(t_hex('0xdeadbeef'), '0xdeadbeef');\n t.equal(t_hex('3735928559'), '0xdeadbeef');\n t.equal(t_hex('0xdeadbeefdeadbeef'), '0xdeadbeefdeadbeef');\n t.equal(\n t_hex('0xdeadbeefdeadbeefdeadbeefdeadbeef'),\n '0xdeadbeefdeadbeefdeadbeefdeadbeef'\n );\n\n t.equal(t_hex(-3), '-0x3');\n t.equal(t_hex('-0xdeadbeef'), '-0xdeadbeef');\n t.equal(t_hex('-3735928559'), '-0xdeadbeef');\n t.equal(t_hex('-0xdeadbeefdeadbeef'), '-0xdeadbeefdeadbeef');\n t.equal(\n t_hex('-0xdeadbeefdeadbeefdeadbeefdeadbeef'),\n '-0xdeadbeefdeadbeefdeadbeefdeadbeef'\n );\n\n t.equal(\n t_hex('3735928559373592855937359285593735928559'),\n '0xafa99ab130406c288189c7f3658ef9aef'\n );\n\n fc.assert(\n fc.property(fc.bigIntN(N), n => {\n t.equal(t_hex(n, 2), BigIntMath.toHex(n));\n })\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/to-string.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The `t_hex` function converts numbers or strings into their hexadecimal representation, optionally verifying the conversion against `BigIntMath.toHex` for large integers.", "mode": "fast-check"} {"id": 54847, "name": "unknown", "code": "t.test('identities', t => {\n fc.assert(\n fc.property(fc.bigIntN(N), n => {\n // identity ~(~x) = x\n t.equal(to(mpz.not(mpz.not(from(n)))), n);\n\n t.equal(t_and(n, n), n);\n t.equal(t_or(n, n), n);\n t.equal(t_xor(n, n), 0n);\n })\n );\n\n fc.assert(\n fc.property(fc.bigIntN(N), fc.bigInt({ min: 1n, max: 4096n }), (n, m) => {\n // a << b >> b = a\n t.equal(to(mpz.shr(mpz.shl(from(n), from(m)), from(m))), n);\n })\n );\n\n fc.assert(\n fc.property(fc.bigIntN(N), fc.bigIntN(N), (x, y) => {\n const X = from(x);\n const Y = from(y);\n\n t.equal(to(mpz.not(mpz.and(X, Y))), ~x | ~y); // ~(x & y) = ~x | ~y\n t.equal(to(mpz.not(mpz.or(X, Y))), ~x & ~y); // ~(x | y) = ~x & ~y\n // TODO: identity x^y == x|y &~ x&y\n })\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/bits.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Verifies identities for bitwise operations with `mpz` functions: double negation returns the original value, bitwise operations with the same operands return consistent results, shifting left then right returns the original, De Morgan's laws for `and` and `or`, and a placeholder for XOR identity.", "mode": "fast-check"} {"id": 54838, "name": "unknown", "code": "t.test('toExponential', t => {\n fc.assert(\n fc.property(fc.bigIntN(N), fc.integer({ min: 0, max: 200 }), (n, m) => {\n t.equal(t_exponential(n, m), BigIntMath.toExponential(n, m));\n }),\n {\n examples: [\n [0, 0],\n [38831928, 8], // causes rounding error if converted to a float\n [-474130365, 7], // causes rounding difference when fp === 0.5\n [474130365, 7], // causes rounding difference when fp === 0.5\n [995163856, 1] // causes carry after rounding\n ]\n }\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/to-string.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The property should ensure that the `t_exponential` function accurately replicates the behavior of `BigIntMath.toExponential` for different combinations of big integers and precision levels.", "mode": "fast-check"} {"id": 54839, "name": "unknown", "code": "t.test('mul_pow2', t => {\n fc.assert(\n fc.property(\n fc.bigIntN(N),\n fc.bigInt({ min: 0n, max: 2n ** 16n }),\n (n, m) => {\n t.equal(t_mul_pow2(n, m), n * 2n ** m);\n }\n ),\n {\n examples: [\n [-1n, 1n],\n [1n, 1n],\n [0xdeadbeefn, 1n],\n [0xdeadbeefn, 8n],\n [0xdeadbeefn, 32n],\n [0xdeadbeefn, 64n],\n [-0xdeadbeefn, 64n]\n ]\n }\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/bits.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`mul_pow2` should compute the product of a given bigint and two raised to the power of another given bigint, matching the expected mathematical result.", "mode": "fast-check"} {"id": 54841, "name": "unknown", "code": "t.test('<<', t => {\n fc.assert(\n fc.property(fc.bigIntN(N), fc.bigIntN(15), (n, m) => {\n t.equal(t_shl(n, m), n << m);\n }),\n {\n examples: [\n [1n, -1n],\n [-1n, 1n],\n [1n, 1n],\n [-1n, -1n],\n [0xdeadbeefn, 1n],\n [0xdeadbeefn, 8n],\n [0xdeadbeefn, 32n],\n [0xdeadbeefn, 64n],\n [-0xdeadbeefn, 64n]\n ]\n }\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/bits.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The property should hold that `t_shl(n, m)` produces the same result as the left shift operator `n << m` for given big integers `n` and `m`.", "mode": "fast-check"} {"id": 54845, "name": "unknown", "code": "t.test('xor', t => {\n fc.assert(\n fc.property(fc.bigIntN(N), fc.bigIntN(N), (n, m) => {\n t.equal(t_xor(n, m), n ^ m);\n })\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/bits.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The `t_xor` function should perform the XOR operation identically to the native XOR operation for big integers of bit length N.", "mode": "fast-check"} {"id": 54852, "name": "unknown", "code": "t.test('addition', t => {\n fc.assert(\n fc.property(fc.bigIntN(N), fc.bigIntN(N), (n, m) => {\n t.equal(t_add(n, m), n + m);\n }),\n {\n examples: [\n // positive\n [0n, 0n],\n [3n, 5n],\n [0xdead0000n, 0x0000beefn],\n [0x00000000deadbeefn, 0xdeadbeef00000000n],\n [0x2950793089775236n, 0x2160715205785584n],\n [0x403105631078710n, 0x3402969886132728n],\n\n // rhs<0\n [8n, -3n],\n [3n, -8n],\n [0xdeadbeefn, -0x0000beefn],\n\n // lhs<0, rhs<0\n [-8n, -3n],\n [-3n, -8n],\n [-0xdead0000n, -0x0000beefn]\n ]\n }\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/add-sub.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Ensures `t_add` correctly performs addition on pairs of big integers, verifying against the native addition operator.", "mode": "fast-check"} {"id": 54854, "name": "unknown", "code": "t.test('subtraction', t => {\n fc.assert(\n fc.property(fc.bigIntN(N), fc.bigIntN(N), (n, m) => {\n t.equal(t_sub(n, m), n - m);\n }),\n {\n examples: [\n // lhs>rhs>0\n [8n, 5n],\n [0xdead0000n, 0x0000beefn],\n [0xdeadbeefn, 0xbeefn],\n [0xdeadbeefdeadbeefn, 0xdeadbeef00000000n],\n // rhs>lhs>0\n [5n, 8n],\n // rhs<0, |lhs|>|rhs|\n [8n, -3n],\n [0xdead0000n, -0x0000beefn],\n [2779068574725052n, -2776491312893844n],\n // rhs<0, |rhs|>|lhs|\n [3n, -8n],\n // lhs {\n fc.assert(\n fc.property(fc.bigIntN(N), n => {\n // -(-n) = n\n t.equal(to(mpz.negate(mpz.negate(from(n)))), n);\n\n // identity\n t.equal(t_add(n, 0n), n);\n t.equal(t_add(0n, n), n);\n t.equal(t_sub(n, 0n), n);\n t.equal(t_sub(0n, n), -n);\n })\n );\n\n fc.assert(\n fc.property(fc.bigIntN(N), fc.bigIntN(N), (n, m) => {\n // (n+m)-m = n\n t.equal(to(mpz.sub(mpz.add(from(n), from(m)), from(m))), n);\n\n // commutative\n t.equal(t_add(n, m), t_add(m, n));\n t.equal(t_sub(n, m), t_add(n, -m));\n })\n );\n\n fc.assert(\n fc.property(fc.bigIntN(N), fc.bigIntN(N), fc.bigIntN(N), (a, b, c) => {\n const A = from(a);\n const B = from(b);\n const C = from(c);\n\n // associative\n // (a+b)+c = a+(b+c)\n t.equal(to(mpz.add(mpz.add(A, B), C)), to(mpz.add(A, mpz.add(B, C))));\n // (a-b)-c = a-(b+c)\n t.equal(to(mpz.sub(mpz.sub(A, B), C)), to(mpz.sub(A, mpz.add(B, C))));\n // (a+b)-c = a+(b-c)\n t.equal(to(mpz.sub(mpz.add(A, B), C)), to(mpz.add(A, mpz.sub(B, C))));\n })\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/add-sub.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Verifies properties of negation, identity, commutativity, and associativity for addition and subtraction of arbitrary large integers.", "mode": "fast-check"} {"id": 54859, "name": "unknown", "code": "t.test('compareTo', async t => {\n fc.assert(\n fc.property(fc.bigIntN(N), fc.bigIntN(N), (n, m) => {\n t.equal(t_cmp(n, m), BigIntMath.cmp(n, m));\n }),\n {\n examples: [\n // positive\n [0n, 0n],\n [3n, 1n],\n [1n, 3n],\n [3n, 3n],\n [3n, 5n],\n [5n, 3n],\n [0xdead0000n, 0x0000beefn],\n [0x0000beefn, 0xdead0000n],\n\n // n<0, m<0\n [-3n, 1n],\n [-1n, 3n],\n [-3n, -3n],\n [-3n, -5n],\n [-5n, -3n],\n [-0xdead0000n, -0x0000beefn],\n [-0x0000beefn, -0xdead0000n],\n\n // n>0, m<0\n [3n, -1n],\n [1n, -3n],\n [3n, -3n],\n [3n, -5n],\n [5n, -3n],\n [0xdead0000n, -0x0000beefn],\n [0x0000beefn, -0xdead0000n],\n\n // n<0, m>0\n [-3n, 1n],\n [-1n, 3n],\n [-3n, 3n],\n [-3n, 5n],\n [-5n, 3n],\n [-0xdead0000n, 0x0000beefn],\n [-0x0000beefn, 0xdead0000n]\n ]\n }\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/compare.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The `t_cmp` function should match the behavior of `BigIntMath.cmp` when comparing pairs of big integers.", "mode": "fast-check"} {"id": 54860, "name": "unknown", "code": "t.test('multiplication', t => {\n fc.assert(\n fc.property(fc.bigIntN(N), fc.bigIntN(N), (n, m) => {\n t.equal(t_mul(n, m), n * m);\n }),\n {\n examples: [\n // positive\n [0n, 0n],\n [1n, 1n],\n [0x10n, 0x10n],\n [0xdead0000n, 0x0000beefn],\n [0xffffn, 0xffffn],\n [0xffffffffn, 0xffffffffn],\n [\n 0x2e75f2aa067132a276c13262e7268d7cecc8190a00000n,\n 0x35f29e388c20bfbac4964bfba000n\n ],\n\n // n<0, m<0\n [-0x10n, -0x10n],\n [-0xffffn, -0xffffn],\n [-0xffffffffn, -0xffffffffn],\n\n // n>0, m<0\n [0x10n, -0x10n],\n [0xffffn, -0xffffn],\n [0xffffffffn, -0xffffffffn],\n\n // n<0, m>0\n [-0x10n, 0x10n],\n [-0xffffn, 0xffffn],\n [-0xffffffffn, 0xffffffffn]\n ]\n }\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/mul-div.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The property should hold that the multiplication function `t_mul` produces the same result as the standard multiplication operation between pairs of big integers.", "mode": "fast-check"} {"id": 54861, "name": "unknown", "code": "t.test('division', t => {\n fc.assert(\n fc.property(fc.bigIntN(N), fc.bigIntN(N), (n, m) => {\n m = m || 1n;\n t.equal(t_div(n, m), n / m);\n }),\n {\n examples: [\n // S(m)=1\n [1n, 1n],\n [2n, 1n],\n [4n, 1n],\n\n // n0xFFFFFFFF, 1m>0xFFFFFFFF\n [0xffffffffffffffffn, 0xfffffffffffffffn],\n [0xffffffffffffffffn, 0xfffffffffffffn],\n [0xffffffffffffffffffffn, 0xfffffffffffffffffffn],\n [0xffffffffffffffffffffn, 0xfffffffffffffffffn],\n [0xdeadbeefdeadbeef00000000n, 0xdeadbeefdeadbeef0000n],\n\n // Special Cases\n [34125305527818743474129076526n, 9580783237862390338n], // requires two D3 correction steps\n [0x100229888f0870594265f617feeb3bb879c7d35ecd04fn, 2n ** 89n - 1n], // Requires D6 correction step\n [\n 0x3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn,\n 2n ** 521n - 1n\n ]\n ]\n }\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/mul-div.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The test ensures that dividing two big integers using `t_div` produces the same result as using the native division operator, across a range of examples and random inputs, with specific handling for zero denominators.", "mode": "fast-check"} {"id": 54862, "name": "unknown", "code": "t.test('mul-div invariants', t => {\n fc.assert(\n fc.property(fc.bigIntN(N), fc.bigIntN(N), (a, b) => {\n const n = mpz.from(a);\n const d = mpz.from(b || 1n);\n\n const q = mpz.div(n, d);\n const m = mpz.rem(n, d);\n const r = mpz.add(mpz.mul(q, d), m);\n t.equal(mpz.toHex(r), mpz.toHex(n));\n\n // commutative\n t.equal(t_mul(a, b), t_mul(b, a));\n })\n );\n\n // distributive\n // a*(b+c) = a*b + a*c\n\n fc.assert(\n fc.property(fc.bigIntN(N), n => {\n // identity\n t.equal(t_mul(n, 1n), n);\n t.equal(t_div(n, 1n), n);\n\n // inverse\n if (n !== 0n) {\n t.equal(t_div(n, n), 1n);\n }\n })\n );\n\n t.end();\n})", "language": "typescript", "source_file": "./repos/Hypercubed/as-mpz/tests/mul-div.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Hypercubed/as-mpz", "url": "https://github.com/Hypercubed/as-mpz.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The properties being tested include the invariant that, given two big integers `a` and `b`, dividing `a` by `b`, multiplying the quotient by `b`, and adding the remainder should reconstruct `a`; multiplication is commutative; multiplication by one is an identity operation; division by one is an identity operation; and division by a number itself results in one, provided the number is not zero.", "mode": "fast-check"} {"id": 54865, "name": "unknown", "code": "it(\"should always return notice\", async () => {\n const file = \"foo.js\";\n const root = await tempFs.create({ [file]: \"\" });\n const wrapper = new ESLintWrapper(\n {\n level: Levels.INFO,\n fix: false,\n root,\n files: [file],\n },\n { rules: { semi: \"error\" } },\n );\n\n await fc.assert(\n fc.asyncProperty(\n fc.string({ unit: \"binary\" }),\n async (content) => {\n await fs.writeFile(file, content);\n\n const notices = await wrapper.lint(file);\n for (const notice of notices) {\n assert.equal(notice.file, file);\n assert.equal(notice.linter, \"eslint\");\n }\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/regseb/metalint/test/fuzz/core/wrapper/eslint.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "regseb/metalint", "url": "https://github.com/regseb/metalint.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The test ensures that for any binary string content written to `foo.js`, the linter `ESLintWrapper` returns notices indicating the file name and the linter used.", "mode": "fast-check"} {"id": 54866, "name": "unknown", "code": "it(\"should always return notice\", async () => {\n const file = \"package.json\";\n const root = await tempFs.create({ [file]: \"\" });\n const wrapper = new NpmCheckUpdatesWrapper(\n {\n level: Levels.INFO,\n fix: false,\n root,\n files: [file],\n },\n {},\n );\n\n await fc.assert(\n fc.asyncProperty(\n fc.string({ unit: \"binary\" }),\n async (content) => {\n await fs.writeFile(file, content);\n\n const notices = await wrapper.lint(file);\n for (const notice of notices) {\n assert.equal(notice.file, file);\n assert.equal(\n notice.linter,\n \"npm-check-updates\",\n );\n }\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/regseb/metalint/test/fuzz/core/wrapper/npm-check-updates.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "regseb/metalint", "url": "https://github.com/regseb/metalint.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The `NpmCheckUpdatesWrapper` should always return notices with the specified file and linter, regardless of the content written to \"package.json\".", "mode": "fast-check"} {"id": 54867, "name": "unknown", "code": "it(\"should always return notice\", async () => {\n const file = \"logo.svg\";\n const root = await tempFs.create({ [file]: \"\" });\n const wrapper = new SVGLintWrapper(\n {\n level: Levels.INFO,\n fix: false,\n root,\n files: [file],\n },\n {},\n );\n\n await fc.assert(\n fc.asyncProperty(\n fc.string({ unit: \"binary\" }),\n async (content) => {\n await fs.writeFile(file, content);\n\n const notices = await wrapper.lint(file);\n for (const notice of notices) {\n assert.equal(notice.file, file);\n assert.equal(notice.linter, \"svglint\");\n }\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/regseb/metalint/test/fuzz/core/wrapper/svglint.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "regseb/metalint", "url": "https://github.com/regseb/metalint.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "SVGLintWrapper should consistently return notices for every content written to \"logo.svg\", verifying the file and linter name in each notice.", "mode": "fast-check"} {"id": 54870, "name": "unknown", "code": "it(\"should always return notice\", async () => {\n const file = \"baz.css\";\n const root = await tempFs.create({\n \"foo.html\": '',\n [file]: \"\",\n });\n const wrapper = new PurgeCSSWrapper(\n {\n level: Levels.ERROR,\n fix: false,\n root,\n files: [\"foo.html\", file],\n },\n { content: \"*.html\" },\n );\n\n await fc.assert(\n fc.asyncProperty(\n fc.string({ unit: \"binary\" }),\n async (content) => {\n await fs.writeFile(file, content);\n\n const notices = await wrapper.lint(file);\n for (const notice of notices) {\n assert.equal(notice.file, file);\n assert.equal(notice.linter, \"purgecss\");\n }\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/regseb/metalint/test/fuzz/core/wrapper/purgecss.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "regseb/metalint", "url": "https://github.com/regseb/metalint.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The purgecss linting process should always return notices with the specified file and linter information, regardless of the file content written in `baz.css`.", "mode": "fast-check"} {"id": 54871, "name": "unknown", "code": "it(\"should always return notice\", async () => {\n const file = \"package.json\";\n const root = await tempFs.create({ [file]: \"\" });\n const wrapper = new NpmPackageJSONLintWrapper(\n {\n level: Levels.INFO,\n fix: false,\n root,\n files: [file],\n },\n { rules: { \"name-format\": \"error\" } },\n );\n\n await fc.assert(\n fc.asyncProperty(\n fc.string({ unit: \"binary\" }),\n async (content) => {\n await fs.writeFile(file, content);\n\n const notices = await wrapper.lint(file);\n for (const notice of notices) {\n assert.equal(notice.file, file);\n assert.equal(\n notice.linter,\n \"npm-package-json-lint\",\n );\n }\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/regseb/metalint/test/fuzz/core/wrapper/npm-package-json-lint.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "regseb/metalint", "url": "https://github.com/regseb/metalint.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The test checks that linting a `package.json` file with any binary string content always returns notices identifying the file and linter as \"npm-package-json-lint\".", "mode": "fast-check"} {"id": 54872, "name": "unknown", "code": "it(\"should always return notice\", async () => {\n const file = \"foo.css\";\n const root = await tempFs.create({ [file]: \"\" });\n const wrapper = new StylelintWrapper(\n {\n level: Levels.INFO,\n fix: false,\n root,\n files: [file],\n },\n { rules: { \"block-no-empty\": true } },\n );\n\n await fc.assert(\n fc.asyncProperty(\n fc.string({ unit: \"binary\" }),\n async (content) => {\n await fs.writeFile(file, content);\n\n const notices = await wrapper.lint(file);\n for (const notice of notices) {\n assert.equal(notice.file, file);\n assert.equal(notice.linter, \"stylelint\");\n }\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/regseb/metalint/test/fuzz/core/wrapper/stylelint.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "regseb/metalint", "url": "https://github.com/regseb/metalint.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "StylelintWrapper should return notices for a file regardless of the binary string content written to it, confirming the file and linter as \"stylelint\".", "mode": "fast-check"} {"id": 54873, "name": "unknown", "code": "it(\"should always return notice\", async () => {\n const file = \"foo.json\";\n const root = await tempFs.create({ [file]: \"\" });\n const wrapper = new PrantlfJSONLintWrapper(\n {\n level: Levels.INFO,\n fix: false,\n root,\n files: [file],\n },\n {},\n );\n\n await fc.assert(\n fc.asyncProperty(\n fc.string({ unit: \"binary\" }),\n async (content) => {\n await fs.writeFile(file, content);\n\n const notices = await wrapper.lint(file);\n for (const notice of notices) {\n assert.equal(notice.file, file);\n assert.equal(\n notice.linter,\n \"prantlf__jsonlint\",\n );\n }\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/regseb/metalint/test/fuzz/core/wrapper/prantlf__jsonlint.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "regseb/metalint", "url": "https://github.com/regseb/metalint.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The `PrantlfJSONLintWrapper` should always return notices with the specified file and linter name \"prantlf__jsonlint\" after linting.", "mode": "fast-check"} {"id": 54875, "name": "unknown", "code": "it(\"should always return notice\", async () => {\n const file = \"foo.json\";\n const root = await tempFs.create({ [file]: \"\" });\n const wrapper = new JSONLintModWrapper(\n {\n level: Levels.INFO,\n fix: false,\n root,\n files: [file],\n },\n {},\n );\n\n await fc.assert(\n fc.asyncProperty(\n fc.string({ unit: \"binary\" }),\n async (content) => {\n await fs.writeFile(file, content);\n\n const notices = await wrapper.lint(file);\n for (const notice of notices) {\n assert.equal(notice.file, file);\n assert.equal(notice.linter, \"jsonlint-mod\");\n }\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/regseb/metalint/test/fuzz/core/wrapper/jsonlint-mod.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "regseb/metalint", "url": "https://github.com/regseb/metalint.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The JSONLintModWrapper should always produce notices identifying the file as `foo.json` and the linter as `jsonlint-mod` irrespective of the binary string content written to the file.", "mode": "fast-check"} {"id": 54876, "name": "unknown", "code": "it(\"should always return notice\", async () => {\n const file = \"package.json\";\n const root = await tempFs.create({ [file]: \"\" });\n const wrapper = new SortPackageJsonWrapper(\n {\n level: Levels.INFO,\n fix: false,\n root,\n files: [file],\n },\n {},\n );\n\n await fc.assert(\n fc.asyncProperty(\n fc.string({ unit: \"binary\" }),\n async (content) => {\n await fs.writeFile(file, content);\n\n const notices = await wrapper.lint(file);\n for (const notice of notices) {\n assert.equal(notice.file, file);\n assert.equal(\n notice.linter,\n \"sort-package-json\",\n );\n }\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/regseb/metalint/test/fuzz/core/wrapper/sort-package-json.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "regseb/metalint", "url": "https://github.com/regseb/metalint.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The `SortPackageJsonWrapper` should always return notices indicating the file and linter name when linting a `package.json` file, regardless of its content.", "mode": "fast-check"} {"id": 54878, "name": "unknown", "code": "it(\"should always return notice\", async () => {\n const file = \"package.json\";\n const root = await tempFs.create({ [file]: \"\" });\n const wrapper = new DepcheckWrapper(\n {\n level: Levels.INFO,\n fix: false,\n root,\n files: [file],\n },\n {},\n );\n\n await fc.assert(\n fc.asyncProperty(\n fc.string({ unit: \"binary\" }),\n async (content) => {\n await fs.writeFile(file, content);\n\n const notices = await wrapper.lint(file);\n for (const notice of notices) {\n assert.equal(notice.file, file);\n assert.equal(notice.linter, \"depcheck\");\n }\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/regseb/metalint/test/fuzz/core/wrapper/depcheck.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "regseb/metalint", "url": "https://github.com/regseb/metalint.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The `DepcheckWrapper` should always return notices for the specified `package.json` file regardless of its content, with each notice linked to the \"depcheck\" linter and the file itself.", "mode": "fast-check"} {"id": 54879, "name": "unknown", "code": "it(\"should always return notice\", async () => {\n const file = \"foo.zip\";\n const root = await tempFs.create({ [file]: \"\" });\n const wrapper = new AddonsLinterWrapper(\n {\n level: Levels.INFO,\n fix: false,\n root,\n files: [file],\n },\n {},\n );\n\n await fc.assert(\n fc.asyncProperty(\n fc.string({ unit: \"binary\" }),\n async (content) => {\n await fs.writeFile(file, content);\n\n const notices = await wrapper.lint(file);\n for (const notice of notices) {\n assert.equal(notice.file, file);\n assert.equal(notice.linter, \"addons-linter\");\n }\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/regseb/metalint/test/fuzz/core/wrapper/addons-linter.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "regseb/metalint", "url": "https://github.com/regseb/metalint.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "`AddonsLinterWrapper.lint` should return notices where each notice is associated with the file being linted and identifies \"addons-linter\" as the linter.", "mode": "fast-check"} {"id": 54881, "name": "unknown", "code": "it(\"should always return notice\", async () => {\n const file = \"package.json\";\n const root = await tempFs.create({ [file]: \"\" });\n const wrapper = new PublintWrapper(\n {\n level: Levels.INFO,\n fix: false,\n root,\n files: [file],\n },\n {},\n );\n\n await fc.assert(\n fc.asyncProperty(\n fc.string({ unit: \"binary\" }),\n async (content) => {\n await fs.writeFile(file, content);\n\n const notices = await wrapper.lint(file);\n for (const notice of notices) {\n assert.equal(notice.file, file);\n assert.equal(notice.linter, \"publint\");\n }\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/regseb/metalint/test/fuzz/core/wrapper/publint.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "regseb/metalint", "url": "https://github.com/regseb/metalint.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "`PublintWrapper` should always return notices specifying the file as \"package.json\" and the linter as \"publint\", regardless of the binary string content written to the file.", "mode": "fast-check"} {"id": 54883, "name": "unknown", "code": "it(\"should always return notice\", async () => {\n const file = \"foo.json\";\n const root = await tempFs.create({ [file]: \"\" });\n const wrapper = new MapboxJSONintLinesPrimitivesWrapper(\n {\n level: Levels.INFO,\n fix: false,\n root,\n files: [file],\n },\n {},\n );\n\n await fc.assert(\n fc.asyncProperty(\n fc.string({ unit: \"binary\" }),\n async (content) => {\n await fs.writeFile(file, content);\n\n const notices = await wrapper.lint(file);\n for (const notice of notices) {\n assert.equal(notice.file, file);\n assert.equal(\n notice.linter,\n \"mapbox__jsonlint-lines-primitives\",\n );\n }\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/regseb/metalint/test/fuzz/core/wrapper/mapbox__jsonlint-lines-primitives.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "regseb/metalint", "url": "https://github.com/regseb/metalint.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "`MapboxJSONintLinesPrimitivesWrapper` should always return notices with the specified file and linter name for any binary string written to the file.", "mode": "fast-check"} {"id": 54884, "name": "unknown", "code": "it(\"should always return notice\", async () => {\n const file = \"foo.js\";\n const root = await tempFs.create({ [file]: \"\" });\n const wrapper = new JSHintWrapper(\n {\n level: Levels.INFO,\n fix: false,\n root,\n files: [file],\n },\n {},\n );\n\n await fc.assert(\n fc.asyncProperty(\n fc.string({ unit: \"binary\" }),\n async (content) => {\n await fs.writeFile(file, content);\n\n const notices = await wrapper.lint(file);\n for (const notice of notices) {\n assert.equal(notice.file, file);\n assert.equal(notice.linter, \"jshint\");\n }\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/regseb/metalint/test/fuzz/core/wrapper/jshint.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "regseb/metalint", "url": "https://github.com/regseb/metalint.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "`JSHintWrapper` should produce notices for all binary string file contents, ensuring the notices are associated with the correct file and linter (\"jshint\").", "mode": "fast-check"} {"id": 54885, "name": "unknown", "code": "it(\"should always return notice\", async () => {\n const file = \"foo.html\";\n const root = await tempFs.create({ [file]: \"\" });\n const wrapper = new HtmllintWrapper(\n {\n level: Levels.INFO,\n fix: false,\n root,\n files: [file],\n },\n {},\n );\n\n await fc.assert(\n fc.asyncProperty(\n fc.string({ unit: \"binary\" }),\n async (content) => {\n await fs.writeFile(file, content);\n\n const notices = await wrapper.lint(file);\n for (const notice of notices) {\n assert.equal(notice.file, file);\n assert.equal(notice.linter, \"htmllint\");\n }\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/regseb/metalint/test/fuzz/core/wrapper/htmllint.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "regseb/metalint", "url": "https://github.com/regseb/metalint.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "`HtmllintWrapper.lint` always returns notices containing the correct file name and \"htmllint\" as the linter for any binary string content written to an HTML file.", "mode": "fast-check"} {"id": 54886, "name": "unknown", "code": "it(\"should always return notice\", async () => {\n const file = \"foo.html\";\n const root = await tempFs.create({ [file]: \"\" });\n const wrapper = new HTMLHintWrapper(\n {\n level: Levels.INFO,\n fix: false,\n root,\n files: [file],\n },\n {},\n );\n\n await fc.assert(\n fc.asyncProperty(\n fc.string({ unit: \"binary\" }),\n async (content) => {\n await fs.writeFile(file, content);\n\n const notices = await wrapper.lint(file);\n for (const notice of notices) {\n assert.equal(notice.file, file);\n assert.equal(notice.linter, \"htmlhint\");\n }\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/regseb/metalint/test/fuzz/core/wrapper/htmlhint.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "regseb/metalint", "url": "https://github.com/regseb/metalint.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "`HTMLHintWrapper` should consistently return notices with the correct file name and linter type \"htmlhint\" for all binary string file contents.", "mode": "fast-check"} {"id": 54887, "name": "unknown", "code": "it(\"should always return notice\", async () => {\n const file = \"foo.md\";\n const root = await tempFs.create({ [file]: \"\" });\n const wrapper = new MarkdownlintWrapper(\n {\n level: Levels.INFO,\n fix: false,\n root,\n files: [file],\n },\n {},\n );\n\n await fc.assert(\n fc.asyncProperty(\n fc.string({ unit: \"binary\" }),\n async (content) => {\n await fs.writeFile(file, content);\n\n const notices = await wrapper.lint(file);\n for (const notice of notices) {\n assert.equal(notice.file, file);\n assert.equal(notice.linter, \"markdownlint\");\n }\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/regseb/metalint/test/fuzz/core/wrapper/markdownlint.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "regseb/metalint", "url": "https://github.com/regseb/metalint.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The test checks that `MarkdownlintWrapper` consistently produces notices with the correct file name and linter type, regardless of the binary content written to the file.", "mode": "fast-check"} {"id": 54888, "name": "unknown", "code": "it(\"add forward pass property: add(a, b).data === a.data + b.data\", () => {\n fc.assert(\n fc.property(valueArbitrary, valueArbitrary, (a, b) => {\n const result = eng.add(a, b);\n // Use closeTo due to potential floating point inaccuracies\n return closeTo(result.data, a.data + b.data);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/ianchanning/neural-network-js/engine.test.js", "start_line": null, "end_line": null, "dependencies": ["closeTo"], "repo": {"name": "ianchanning/neural-network-js", "url": "https://github.com/ianchanning/neural-network-js.git", "license": "MIT", "stars": 9, "forks": 0}, "metrics": null, "summary": "The sum of `a.data` and `b.data` should closely approximate the result of `eng.add(a, b).data` within a specified tolerance.", "mode": "fast-check"} {"id": 54889, "name": "unknown", "code": "it(\"mul forward pass property: mul(a, b).data === a.data * b.data\", () => {\n fc.assert(\n fc.property(valueArbitrary, valueArbitrary, (a, b) => {\n const result = eng.mul(a, b);\n return closeTo(result.data, a.data * b.data);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/ianchanning/neural-network-js/engine.test.js", "start_line": null, "end_line": null, "dependencies": ["closeTo"], "repo": {"name": "ianchanning/neural-network-js", "url": "https://github.com/ianchanning/neural-network-js.git", "license": "MIT", "stars": 9, "forks": 0}, "metrics": null, "summary": "The `mul` function's forward pass ensures that `mul(a, b).data` is approximately equal to `a.data * b.data` within a specified tolerance.", "mode": "fast-check"} {"id": 54892, "name": "unknown", "code": "it(\"mul backward pass gradient property\", () => {\n fc.assert(\n fc.property(valueArbitrary, valueArbitrary, (a, b) => {\n const fresh_a = eng.value(a.data);\n const fresh_b = eng.value(b.data);\n const result = eng.mul(fresh_a, fresh_b);\n eng.backward(result);\n // Check gradients: d(res)/da = b.data, d(res)/db = a.data\n return (\n closeTo(fresh_a.grad, fresh_b.data) &&\n closeTo(fresh_b.grad, fresh_a.data)\n );\n }),\n );\n })", "language": "typescript", "source_file": "./repos/ianchanning/neural-network-js/engine.test.js", "start_line": null, "end_line": null, "dependencies": ["closeTo"], "repo": {"name": "ianchanning/neural-network-js", "url": "https://github.com/ianchanning/neural-network-js.git", "license": "MIT", "stars": 9, "forks": 0}, "metrics": null, "summary": "The gradient of the backward pass of the `mul` operation should match the respective input values when checked with a defined tolerance.", "mode": "fast-check"} {"id": 54893, "name": "unknown", "code": "it(\"tanh backward pass gradient property\", () => {\n const boundedValueArbitrary = fc\n .float({ min: -10, max: 10, noNaN: true })\n .map((n) => eng.value(n));\n fc.assert(\n fc.property(boundedValueArbitrary, (a) => {\n const fresh_a = eng.value(a.data);\n const result = eng.tanh(fresh_a);\n eng.backward(result);\n const expected_grad = 1.0 - result.data * result.data; // 1 - tanh(a.data)^2\n return closeTo(fresh_a.grad, expected_grad);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/ianchanning/neural-network-js/engine.test.js", "start_line": null, "end_line": null, "dependencies": ["closeTo"], "repo": {"name": "ianchanning/neural-network-js", "url": "https://github.com/ianchanning/neural-network-js.git", "license": "MIT", "stars": 9, "forks": 0}, "metrics": null, "summary": "The gradient of the `tanh` function computed in a backward pass should match the expected value of \\(1 - \\text{tanh}(x)^2\\) for inputs within a bounded range.", "mode": "fast-check"} {"id": 54894, "name": "unknown", "code": "it(\"add commutativity property (data only)\", () => {\n fc.assert(\n fc.property(valueArbitrary, valueArbitrary, (a, b) => {\n const res1 = eng.add(a, b);\n const res2 = eng.add(b, a);\n return closeTo(res1.data, res2.data);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/ianchanning/neural-network-js/engine.test.js", "start_line": null, "end_line": null, "dependencies": ["closeTo"], "repo": {"name": "ianchanning/neural-network-js", "url": "https://github.com/ianchanning/neural-network-js.git", "license": "MIT", "stars": 9, "forks": 0}, "metrics": null, "summary": "The commutative property of addition holds for the data elements in the `add` function, ensuring `eng.add(a, b)` produces the same result as `eng.add(b, a)`.", "mode": "fast-check"} {"id": 54898, "name": "unknown", "code": "it('rejects usernames with leading or trailing whitespace', () => {\n\t\tfc.assert(\n\t\t\tfc.property(\n\t\t\t\tfc\n\t\t\t\t\t.string({ minLength: 4, maxLength: 31 })\n\t\t\t\t\t.filter((usernameInput) => usernameInput.trim() !== usernameInput),\n\t\t\t\t(username) => {\n\t\t\t\t\texpect(verifyUsernameInput(username)).toBe(false);\n\t\t\t\t}\n\t\t\t),\n\t\t\t{ numRuns: 200 }\n\t\t);\n\t})", "language": "typescript", "source_file": "./repos/fdnd-agency/toolgankelijk/tests/property/verifyUsernameInput.property.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fdnd-agency/toolgankelijk", "url": "https://github.com/fdnd-agency/toolgankelijk.git", "license": "MIT", "stars": 0, "forks": 5}, "metrics": null, "summary": "Usernames with leading or trailing whitespace should be rejected by `verifyUsernameInput`.", "mode": "fast-check"} {"id": 54900, "name": "unknown", "code": "it('handles all inputs gracefully and returns a result object', async () => {\n\t\tawait fc.assert(\n\t\t\tfc.asyncProperty(account, async (acc) => {\n\t\t\t\t// Simulate the event object as expected by the action\n\t\t\t\tconst event = {\n\t\t\t\t\trequest: {\n\t\t\t\t\t\t// Simulate the form data as expected by the action\n\t\t\t\t\t\tformData: async () => ({\n\t\t\t\t\t\t\tget: (key) =>\n\t\t\t\t\t\t\t\t({\n\t\t\t\t\t\t\t\t\temail: acc.email,\n\t\t\t\t\t\t\t\t\tusername: acc.username,\n\t\t\t\t\t\t\t\t\tpassword: acc.password,\n\t\t\t\t\t\t\t\t\t'confirm-password': acc.confirmPassword\n\t\t\t\t\t\t\t\t}[key])\n\t\t\t\t\t\t})\n\t\t\t\t\t},\n\t\t\t\t\tlocals: { sessie: null, gebruiker: null },\n\t\t\t\t\tcookies: { set: () => {} }\n\t\t\t\t};\n\n\t\t\t\tlet result;\n\t\t\t\ttry {\n\t\t\t\t\t// Call the register action with the simulated event\n\t\t\t\t\tresult = await actions.register(event);\n\t\t\t\t} catch (err) {\n\t\t\t\t\texpect(err).toBeUndefined();\n\t\t\t\t}\n\t\t\t\texpect(typeof result).toBe('object');\n\t\t\t\texpect('status' in result || (result && result.data && 'message' in result.data)).toBe(\n\t\t\t\t\ttrue\n\t\t\t\t);\n\t\t\t}),\n\t\t\t{ numRuns: 200 }\n\t\t);\n\t})", "language": "typescript", "source_file": "./repos/fdnd-agency/toolgankelijk/tests/monkey/createAccount.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fdnd-agency/toolgankelijk", "url": "https://github.com/fdnd-agency/toolgankelijk.git", "license": "MIT", "stars": 0, "forks": 5}, "metrics": null, "summary": "Simulating different account inputs, the test checks that the registration action returns a result object indicating success or failure.", "mode": "fast-check"} {"id": 54902, "name": "unknown", "code": "test('should handle any valid JSON body', () => {\n fc.assert(\n fc.property(\n fc.json(),\n async (jsonData) => {\n fetch.mockResolvedValue({\n ok: true,\n json: async () => ({ success: true })\n });\n\n const result = await apiClient.request('/test', {\n method: 'POST',\n body: JSON.stringify(jsonData)\n });\n\n expect(result).toHaveProperty('success', true);\n \n const [, options] = fetch.mock.calls[0];\n expect(() => JSON.parse(options.body)).not.toThrow();\n }\n ),\n { numRuns: 50 }\n );\n })", "language": "typescript", "source_file": "./repos/rmusser01/tldw_BrowserExtension/Browser-Extension/tests/property/api-client.property.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "rmusser01/tldw_BrowserExtension", "url": "https://github.com/rmusser01/tldw_BrowserExtension.git", "license": "Apache-2.0", "stars": 1, "forks": 0}, "metrics": null, "summary": "`apiClient.request` should successfully process any valid JSON body and return a response with a `success` property set to true.", "mode": "fast-check"} {"id": 54903, "name": "unknown", "code": "test('should retry failed requests up to max retries', () => {\n fc.assert(\n fc.property(\n fc.integer({ min: 0, max: 10 }),\n fc.array(fc.boolean(), { minLength: 1, maxLength: 10 }),\n async (maxRetries, failures) => {\n apiClient.config.maxRetries = maxRetries;\n apiClient.config.retryDelay = 1; // Fast retries for testing\n \n let attemptCount = 0;\n fetch.mockImplementation(() => {\n attemptCount++;\n if (attemptCount <= failures.filter(f => f).length) {\n return Promise.reject(new Error('Network error'));\n }\n return Promise.resolve({\n ok: true,\n json: async () => ({ success: true })\n });\n });\n\n try {\n await apiClient.request('/test');\n // Should succeed if failures < maxRetries\n expect(attemptCount).toBeLessThanOrEqual(maxRetries + 1);\n } catch (error) {\n // Should fail if all retries exhausted\n expect(attemptCount).toBe(Math.min(maxRetries + 1, failures.filter(f => f).length));\n }\n }\n ),\n { numRuns: 50 }\n );\n })", "language": "typescript", "source_file": "./repos/rmusser01/tldw_BrowserExtension/Browser-Extension/tests/property/api-client.property.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "rmusser01/tldw_BrowserExtension", "url": "https://github.com/rmusser01/tldw_BrowserExtension.git", "license": "Apache-2.0", "stars": 1, "forks": 0}, "metrics": null, "summary": "The `apiClient` should retry failed requests up to a specified maximum number of retries, with `attemptCount` reflecting either successful completion or full exhaustion of retries based on simulated failures.", "mode": "fast-check"} {"id": 54904, "name": "unknown", "code": "test('should apply exponential backoff correctly', () => {\n fc.assert(\n fc.property(\n fc.integer({ min: 100, max: 1000 }),\n fc.float({ min: 1.5, max: 3 }),\n fc.integer({ min: 1, max: 5 }),\n async (baseDelay, multiplier, retries) => {\n apiClient.config.retryDelay = baseDelay;\n apiClient.config.retryBackoffMultiplier = multiplier;\n apiClient.config.maxRetries = retries;\n \n let delays = [];\n let lastCallTime = Date.now();\n \n fetch.mockImplementation(() => {\n const now = Date.now();\n delays.push(now - lastCallTime);\n lastCallTime = now;\n return Promise.reject(new Error('Network error'));\n });\n\n try {\n await apiClient.request('/test');\n } catch (error) {\n // Expected to fail\n }\n\n // Check exponential growth\n for (let i = 1; i < delays.length; i++) {\n const expectedMinDelay = baseDelay * Math.pow(multiplier, i - 1);\n expect(delays[i]).toBeGreaterThanOrEqual(expectedMinDelay * 0.9); // Allow 10% variance\n }\n }\n ),\n { numRuns: 20 }\n );\n })", "language": "typescript", "source_file": "./repos/rmusser01/tldw_BrowserExtension/Browser-Extension/tests/property/api-client.property.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "rmusser01/tldw_BrowserExtension", "url": "https://github.com/rmusser01/tldw_BrowserExtension.git", "license": "Apache-2.0", "stars": 1, "forks": 0}, "metrics": null, "summary": "The `apiClient` should implement exponential backoff correctly by ensuring each retry delay is at least 90% of the calculated exponential value based on base delay and multiplier.", "mode": "fast-check"} {"id": 54908, "name": "unknown", "code": "test('should handle malformed stream data', () => {\n fc.assert(\n fc.property(\n fc.array(\n fc.oneof(\n fc.string(),\n fc.constant('data: {invalid json}'),\n fc.constant('not-data-prefix'),\n fc.constant('data:no-space'),\n fc.constant('\\n\\n\\n'),\n fc.constant('data: ')\n ),\n { minLength: 1, maxLength: 20 }\n ),\n async (malformedChunks) => {\n fetch.mockResolvedValue({\n ok: true,\n headers: new Headers({ 'content-type': 'text/event-stream' }),\n body: createMockStream(malformedChunks)\n });\n\n const messages = [];\n const errors = [];\n\n try {\n await apiClient.streamRequest('/chat', {}, \n (message) => messages.push(message),\n (error) => errors.push(error)\n );\n } catch (error) {\n // Expected for some malformed data\n }\n\n // Should not crash on malformed data\n expect(true).toBe(true);\n }\n ),\n { numRuns: 50 }\n );\n })", "language": "typescript", "source_file": "./repos/rmusser01/tldw_BrowserExtension/Browser-Extension/tests/property/api-client.property.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "rmusser01/tldw_BrowserExtension", "url": "https://github.com/rmusser01/tldw_BrowserExtension.git", "license": "Apache-2.0", "stars": 1, "forks": 0}, "metrics": null, "summary": "The test ensures that `apiClient.streamRequest` does not crash when handling malformed stream data.", "mode": "fast-check"} {"id": 54909, "name": "unknown", "code": "test('should correctly construct URLs with any query parameters', () => {\n fc.assert(\n fc.property(\n fc.dictionary(\n fc.string().filter(s => s.length > 0 && !s.includes('&') && !s.includes('=')),\n fc.oneof(\n fc.string(),\n fc.integer(),\n fc.boolean(),\n fc.constant(null),\n fc.constant(undefined)\n )\n ),\n async (params) => {\n fetch.mockResolvedValue({\n ok: true,\n json: async () => ({})\n });\n\n const baseUrl = 'http://test.com';\n apiClient.config.serverUrl = baseUrl;\n\n await apiClient.request('/test', { params });\n\n const [url] = fetch.mock.calls[0];\n const urlObj = new URL(url);\n\n // Check all params are in URL\n Object.entries(params).forEach(([key, value]) => {\n if (value !== null && value !== undefined) {\n expect(urlObj.searchParams.get(key)).toBe(String(value));\n } else {\n expect(urlObj.searchParams.has(key)).toBe(false);\n }\n });\n }\n ),\n { numRuns: 100 }\n );\n })", "language": "typescript", "source_file": "./repos/rmusser01/tldw_BrowserExtension/Browser-Extension/tests/property/api-client.property.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "rmusser01/tldw_BrowserExtension", "url": "https://github.com/rmusser01/tldw_BrowserExtension.git", "license": "Apache-2.0", "stars": 1, "forks": 0}, "metrics": null, "summary": "The test checks that URLs are correctly constructed with query parameters, ensuring keys with non-null and non-undefined values are present, and omitting keys with null or undefined values.", "mode": "fast-check"} {"id": 54910, "name": "unknown", "code": "test('should handle special characters in URLs', () => {\n fc.assert(\n fc.property(\n fc.string().filter(s => s.length > 0),\n fc.dictionary(fc.string(), fc.string()),\n async (path, params) => {\n fetch.mockResolvedValue({\n ok: true,\n json: async () => ({})\n });\n\n // Encode path to handle special characters\n const encodedPath = path.split('/').map(encodeURIComponent).join('/');\n \n try {\n await apiClient.request(`/${encodedPath}`, { params });\n \n const [url] = fetch.mock.calls[0];\n // Should create valid URL\n expect(() => new URL(url)).not.toThrow();\n } catch (error) {\n // Some paths might be invalid\n expect(error.message).toMatch(/Invalid URL|Failed to construct/);\n }\n }\n ),\n { numRuns: 50 }\n );\n })", "language": "typescript", "source_file": "./repos/rmusser01/tldw_BrowserExtension/Browser-Extension/tests/property/api-client.property.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "rmusser01/tldw_BrowserExtension", "url": "https://github.com/rmusser01/tldw_BrowserExtension.git", "license": "Apache-2.0", "stars": 1, "forks": 0}, "metrics": null, "summary": "The API client should handle special characters in URLs by encoding the path correctly, ensuring the URL can be constructed without errors.", "mode": "fast-check"} {"id": 54911, "name": "unknown", "code": "test('should timeout after specified duration', () => {\n fc.assert(\n fc.property(\n fc.integer({ min: 100, max: 5000 }),\n fc.integer({ min: 0, max: 10000 }),\n async (timeout, responseDelay) => {\n apiClient.config.apiTimeout = timeout;\n\n fetch.mockImplementation(() => new Promise((resolve) => {\n setTimeout(() => {\n resolve({\n ok: true,\n json: async () => ({ success: true })\n });\n }, responseDelay);\n }));\n\n const startTime = Date.now();\n\n try {\n await apiClient.request('/test');\n const duration = Date.now() - startTime;\n \n // Should complete before timeout\n expect(duration).toBeLessThan(timeout + 100); // Allow some margin\n expect(responseDelay).toBeLessThan(timeout);\n } catch (error) {\n const duration = Date.now() - startTime;\n \n // Should timeout if response is too slow\n expect(error.message).toContain('timeout');\n expect(duration).toBeGreaterThanOrEqual(timeout - 100); // Allow some margin\n expect(responseDelay).toBeGreaterThanOrEqual(timeout);\n }\n }\n ),\n { numRuns: 20 }\n );\n })", "language": "typescript", "source_file": "./repos/rmusser01/tldw_BrowserExtension/Browser-Extension/tests/property/api-client.property.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "rmusser01/tldw_BrowserExtension", "url": "https://github.com/rmusser01/tldw_BrowserExtension.git", "license": "Apache-2.0", "stars": 1, "forks": 0}, "metrics": null, "summary": "The `apiClient` should timeout if the response delay exceeds the specified timeout duration.", "mode": "fast-check"} {"id": 54912, "name": "unknown", "code": "test('should validate required fields in chat messages', () => {\n fc.assert(\n fc.property(\n fc.record({\n messages: fc.array(\n fc.record({\n role: fc.option(fc.string()),\n content: fc.option(fc.string())\n })\n ),\n model: fc.option(fc.string()),\n temperature: fc.option(fc.float({ min: 0, max: 2 }))\n }),\n async (input) => {\n fetch.mockResolvedValue({\n ok: true,\n json: async () => ({ choices: [{ message: { content: 'response' } }] })\n });\n\n try {\n await apiClient.createChatCompletion(input);\n \n // Should have valid messages\n expect(input.messages).toBeDefined();\n expect(input.messages.every(m => m.role && m.content)).toBe(true);\n } catch (error) {\n // Should fail on invalid input\n const hasInvalidMessages = !input.messages || \n input.messages.some(m => !m.role || !m.content);\n expect(hasInvalidMessages).toBe(true);\n }\n }\n ),\n { numRuns: 100 }\n );\n })", "language": "typescript", "source_file": "./repos/rmusser01/tldw_BrowserExtension/Browser-Extension/tests/property/api-client.property.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "rmusser01/tldw_BrowserExtension", "url": "https://github.com/rmusser01/tldw_BrowserExtension.git", "license": "Apache-2.0", "stars": 1, "forks": 0}, "metrics": null, "summary": "Chat messages must contain defined roles and content fields for successful processing; invalid messages should trigger an error.", "mode": "fast-check"} {"id": 54913, "name": "unknown", "code": "it('applyToValue', ctx => {\n console.log(`Testing ${ctx.task.name}...`)\n type TestParams = {\n privateKeyString: string\n valHex: string\n }\n const toResult = (\n params: TestParams,\n count: bigint | undefined = undefined\n ) => ({\n fromJuce: JSON.parse(\n execTestBin(\n 'apply-to-value',\n JSON.stringify({\n ...params,\n count: count ? count.toString() : ''\n })\n )\n ),\n fromPort: (() => {\n const privateKey = new JuceRSAKey(params.privateKeyString)\n const val = JuceBigInteger.fromHex(params.valHex)\n privateKey.applyToValue(val)\n return {\n appliedValHex: val.toHex()\n }\n })()\n })\n const baseString = `{\"privateKeyString\":\"3,4\",\"valHex\":\"8\"}`\n const baseCase = JSON.parse(baseString)\n const baseResult = toResult(baseCase)\n console.log({ baseCase, baseResult })\n expect(baseResult.fromPort.appliedValHex).toBe(\n baseResult.fromJuce.appliedValHex\n )\n let latest\n fc.assert(\n fc.property(\n fc.record({\n privateKeyPart1Hex: hexArbitrary,\n privateKeyPart2Hex: hexArbitrary,\n valHex: hexArbitrary\n }),\n input => {\n const privateKeyString =\n input.privateKeyPart1Hex +\n ',' +\n input.privateKeyPart2Hex\n const result = toResult({\n privateKeyString,\n valHex: input.valHex\n })\n latest = { input, result }\n return (\n result.fromPort.appliedValHex ===\n result.fromJuce.appliedValHex\n )\n }\n )\n )\n console.log(latest)\n })", "language": "typescript", "source_file": "./repos/ianacaburian/generate-key-file/src/test/JuceRSAKey.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "ianacaburian/generate-key-file", "url": "https://github.com/ianacaburian/generate-key-file.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`applyToValue` produces equivalent results when applying a private key to a hex value using both the `JuceRSAKey` method and the `apply-to-value` binary execution.", "mode": "fast-check"} {"id": 54914, "name": "unknown", "code": "it('fromUTF8MemoryBlock', ctx => {\n console.log(`Testing ${ctx.task.name}...`)\n const toResult = (input: string) => ({\n fromJuce: execTestBin('load-from-memory-block', input),\n fromPort: JuceBigInteger.fromUTF8MemoryBlock(input).toHex()\n })\n const baseCase = '0123'\n const baseResult = toResult(baseCase)\n console.log({ baseCase, baseResult })\n expect(baseResult.fromPort).toBe(baseResult.fromJuce)\n let latest\n fc.assert(\n fc.property(\n fc.string({ minLength: 100, maxLength: 3000 }),\n input => {\n const result = toResult(input)\n latest = { input, result }\n return result.fromPort === result.fromJuce\n }\n )\n )\n console.log(latest)\n })", "language": "typescript", "source_file": "./repos/ianacaburian/generate-key-file/src/test/JuceBigInteger.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "ianacaburian/generate-key-file", "url": "https://github.com/ianacaburian/generate-key-file.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`JuceBigInteger.fromUTF8MemoryBlock` should convert string inputs to hexadecimal representations matching the output of an external execution function, `execTestBin`.", "mode": "fast-check"} {"id": 54918, "name": "unknown", "code": "it('createKeyFileComment', ctx => {\n console.log(`Testing ${ctx.task.name}...`)\n type TestParams = CreateKeyFileCommentParams & {\n created: string\n }\n const toResult = (params: TestParams) => {\n return {\n fromJuce: execTestBin(\n 'create-key-file-comment',\n JSON.stringify({ ...params })\n ),\n fromUtil: JuceKeyFileUtils.createKeyFileComment(\n params,\n params.created\n )\n }\n }\n const baseDate = JuceKeyFileUtils.toString(\n new Date('1970-01-01T00:00:00.000Z')\n )\n const baseString =\n `{\"appName\":\"'\",` +\n `\"userEmail\":\"a@a.a\",` +\n `\"userName\":\"&\",` +\n `\"machineNumbers\":\"\\\\\"\",` +\n `\"created\":\"${baseDate}\"}`\n const baseCase = JSON.parse(baseString)\n const baseResult = toResult(baseCase)\n console.log({ baseCase, baseResult })\n expect(baseResult.fromUtil).toBe(baseResult.fromJuce)\n const createKeyFileCommentParamsArbitrary = ZodFastCheck().inputOf(\n createKeyFileCommentParamsValidator.extend({\n created: z.date()\n })\n )\n let latest\n fc.assert(\n fc.property(createKeyFileCommentParamsArbitrary, input => {\n const result = toResult({\n ...input,\n created: JuceKeyFileUtils.toString(input.created)\n })\n latest = { input, result }\n const parse =\n createKeyFileCommentParamsValidator.safeParse(input)\n return !parse.success || result.fromUtil === result.fromJuce\n })\n )\n console.log(latest)\n })", "language": "typescript", "source_file": "./repos/ianacaburian/generate-key-file/src/test/JuceKeyFileUtils.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "ianacaburian/generate-key-file", "url": "https://github.com/ianacaburian/generate-key-file.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The function `createKeyFileComment` should produce the same output when executed by both `createKeyFileComment` utility and the `execTestBin` command, given valid input parameters.", "mode": "fast-check"} {"id": 54924, "name": "unknown", "code": "it('should assign lastResult correctly and stop retrying when success is obtained', async () => {\n await fc.assert(\n fc.asyncProperty(defaultProps(), async (config) => {\n let callCount = 0;\n\n /**\n * @type {jasmine.Spy<() => Promise<{ success: string } | { error: { message: string } }>>}\n */\n const successfulFunction = jasmine\n .createSpy('successfulFunction', () => {\n callCount += 1;\n // The function fails for the first (n-1) times and succeeds on the last try\n if (callCount === config.maxAttempts) {\n return Promise.resolve({ success: 'Function succeeded' });\n } else {\n return Promise.resolve({ error: { message: 'something went wrong' } });\n }\n })\n .and.callThrough();\n\n const { result, exceptions } = await retry(successfulFunction, config);\n\n // Expect retry to eventually return a successful result\n expect(result).toEqual({ success: 'Function succeeded' });\n\n // should have been called config.maxAttempts times\n expect(successfulFunction.calls.count()).toEqual(config.maxAttempts);\n\n // no exceptions were thrown, so this should be empty\n expect(exceptions).toEqual([]);\n }),\n { numRuns: 10 },\n );\n })", "language": "typescript", "source_file": "./repos/duckduckgo/content-scope-scripts/injected/unit-test/timer-utils.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "duckduckgo/content-scope-scripts", "url": "https://github.com/duckduckgo/content-scope-scripts.git", "license": "Apache-2.0", "stars": 52, "forks": 29}, "metrics": null, "summary": "The function `retry` should correctly assign the last successful result and stop further attempts once a successful outcome is achieved, even if previous attempts failed.", "mode": "fast-check"} {"id": 54925, "name": "unknown", "code": "it('should return last result if a function is never successful', async () => {\n await fc.assert(\n fc.asyncProperty(defaultProps(), async (config) => {\n /**\n * @type {jasmine.Spy<() => Promise<{ success: string } | { error: { message: string } }>>}\n */\n const errorFunction = jasmine\n .createSpy('successfulFunction', () => {\n return Promise.resolve({ error: { message: 'something went wrong' } });\n })\n .and.callThrough();\n\n const { result, exceptions } = await retry(errorFunction, config);\n\n // this line just helps typescript understand that we're expecting 'result.error'\n if (result && !('error' in result)) throw new Error('unreachable');\n\n // should be just the last error as a `result`\n expect(result?.error.message).toEqual('something went wrong');\n\n // should be empty since nothing threw\n expect(exceptions).toEqual([]);\n }),\n { numRuns: 10 },\n );\n })", "language": "typescript", "source_file": "./repos/duckduckgo/content-scope-scripts/injected/unit-test/timer-utils.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "duckduckgo/content-scope-scripts", "url": "https://github.com/duckduckgo/content-scope-scripts.git", "license": "Apache-2.0", "stars": 52, "forks": 29}, "metrics": null, "summary": "The test ensures that when a function never returns a successful result, the `retry` function outputs the last error message as the result, with no exceptions thrown during the process.", "mode": "fast-check"} {"id": 54926, "name": "unknown", "code": "it('property testing isSameName -> boolean', () => {\n fc.assert(\n fc.property(\n fc.string(),\n fc.string(),\n fc.option(fc.string()),\n fc.string(),\n fc.option(fc.string()),\n (fullNameExtracted, userFirstName, userMiddleName, userLastName, userSuffix) => {\n const result = isSameName(fullNameExtracted, userFirstName, userMiddleName, userLastName, userSuffix);\n expect(typeof result).toBe('boolean');\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/duckduckgo/content-scope-scripts/injected/unit-test/broker-protection.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "duckduckgo/content-scope-scripts", "url": "https://github.com/duckduckgo/content-scope-scripts.git", "license": "Apache-2.0", "stars": 52, "forks": 29}, "metrics": null, "summary": "The `isSameName` function should always return a boolean when given various combinations of full name components.", "mode": "fast-check"} {"id": 54927, "name": "unknown", "code": "it('property testing isSameName -> boolean (seed 1)', () => {\n // Got TypeError: object is not iterable (cannot read property Symbol(Symbol.iterator))\n // when doing if (nicknames[name])\n fc.assert(\n fc.property(\n fc.string(),\n fc.string(),\n fc.option(fc.string()),\n fc.string(),\n fc.option(fc.string()),\n (fullNameExtracted, userFirstName, userMiddleName, userLastName, userSuffix) => {\n const result = isSameName(fullNameExtracted, userFirstName, userMiddleName, userLastName, userSuffix);\n expect(typeof result).toBe('boolean');\n },\n ),\n { seed: 203542789, path: '70:1:0:0:1:85:86:85:86:86', endOnFailure: true },\n );\n })", "language": "typescript", "source_file": "./repos/duckduckgo/content-scope-scripts/injected/unit-test/broker-protection.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "duckduckgo/content-scope-scripts", "url": "https://github.com/duckduckgo/content-scope-scripts.git", "license": "Apache-2.0", "stars": 52, "forks": 29}, "metrics": null, "summary": "`isSameName` must return a boolean when called with a combination of extracted full name and optional user name components.", "mode": "fast-check"} {"id": 54928, "name": "unknown", "code": "it('should accept any inputs and not crash', () => {\n fc.assert(\n fc.property(\n fc.oneof(\n fc.anything(),\n fc.record({\n url: fc.anything(),\n }),\n ),\n fc.oneof(fc.anything(), fc.dictionary(fc.string(), fc.oneof(fc.string(), fc.integer(), fc.boolean()))),\n (action, userData) => {\n const result = replaceTemplatedUrl(action, userData);\n expect('url' in result || 'error' in result);\n if ('error' in result) {\n expect(typeof result.error).toEqual('string');\n }\n if ('url' in result) {\n const url = new URL(result.url);\n expect(url).toBeDefined();\n }\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/duckduckgo/content-scope-scripts/injected/unit-test/broker-protection.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "duckduckgo/content-scope-scripts", "url": "https://github.com/duckduckgo/content-scope-scripts.git", "license": "Apache-2.0", "stars": 52, "forks": 29}, "metrics": null, "summary": "The function `replaceTemplatedUrl` should handle any inputs without crashing, producing an object with either a valid URL or an error string.", "mode": "fast-check"} {"id": 54929, "name": "unknown", "code": "it('should template the url with random inputs and produce a valid URL', () => {\n fc.assert(\n fc.property(\n fc.record({\n url: fc.constant(\n // eslint-disable-next-line no-template-curly-in-string\n 'https://example.com/profile/search?fname=${firstName}&lname=${lastName}&state=${state}&city=${city|hyphenated}&fage=${age}',\n ),\n }),\n fc.record({\n firstName: fc.string(),\n lastName: fc.string(),\n city: fc.string(),\n state: fc.string(),\n age: fc.oneof(fc.string(), fc.integer()),\n }),\n (action, userData) => {\n const result = replaceTemplatedUrl(action, userData);\n expect('url' in result || 'error' in result);\n if ('url' in result) {\n const url = new URL(result.url);\n expect(url).toBeDefined();\n }\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/duckduckgo/content-scope-scripts/injected/unit-test/broker-protection.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "duckduckgo/content-scope-scripts", "url": "https://github.com/duckduckgo/content-scope-scripts.git", "license": "Apache-2.0", "stars": 52, "forks": 29}, "metrics": null, "summary": "The function `replaceTemplatedUrl` should replace placeholders in a URL template with provided random user data, resulting in a valid URL or an error.", "mode": "fast-check"} {"id": 54930, "name": "unknown", "code": "it('should test the regex replacer with random values', () => {\n const variable = fc.string().map((randomMiddle) => {\n return '${' + randomMiddle + '}';\n });\n\n const padded = variable.map((randomMiddle) => {\n return '--' + randomMiddle + '--';\n });\n\n fc.assert(\n fc.property(\n padded,\n fc.object(),\n fc.dictionary(fc.string(), fc.oneof(fc.string(), fc.integer())),\n (input, action, userData) => {\n const output = processTemplateStringWithUserData(input, /** @type {any} */ (action), userData);\n expect(typeof output).toEqual('string');\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/duckduckgo/content-scope-scripts/injected/unit-test/broker-protection.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "duckduckgo/content-scope-scripts", "url": "https://github.com/duckduckgo/content-scope-scripts.git", "license": "Apache-2.0", "stars": 52, "forks": 29}, "metrics": null, "summary": "The `processTemplateStringWithUserData` function should return a string when given padded template strings with random variable names, an action object, and a userData dictionary.", "mode": "fast-check"} {"id": 54931, "name": "unknown", "code": "it('generates an integers between the min and max values', () => {\n fc.assert(\n fc.property(fc.integer(), fc.integer(), (a, b) => {\n const min = Math.min(a, b);\n const max = Math.max(a, b);\n\n const result = generateRandomInt(min, max);\n\n return Number.isInteger(result) && result >= min && result <= max;\n }),\n );\n })", "language": "typescript", "source_file": "./repos/duckduckgo/content-scope-scripts/injected/unit-test/broker-protection.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "duckduckgo/content-scope-scripts", "url": "https://github.com/duckduckgo/content-scope-scripts.git", "license": "Apache-2.0", "stars": 52, "forks": 29}, "metrics": null, "summary": "`generateRandomInt` produces an integer within the specified minimum and maximum range.", "mode": "fast-check"} {"id": 54932, "name": "unknown", "code": "it('should extract digits only', () => {\n fc.assert(\n fc.property(fc.array(fc.string()), (s) => {\n const cleanInput = cleanArray(s);\n const numbers = new PhoneExtractor().extract(cleanInput, {});\n const cleanOutput = cleanArray(numbers);\n return cleanOutput.every((num) => num.match(/^\\d+$/));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/duckduckgo/content-scope-scripts/injected/unit-test/broker-protection-extractors.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "duckduckgo/content-scope-scripts", "url": "https://github.com/duckduckgo/content-scope-scripts.git", "license": "Apache-2.0", "stars": 52, "forks": 29}, "metrics": null, "summary": "`PhoneExtractor` extracts only digit characters from cleaned string arrays.", "mode": "fast-check"} {"id": 54934, "name": "unknown", "code": "t.test('should match \\\\p{N}', () => {\n fc.assert(\n fc.property(\n fc.string({ unit: 'grapheme', minLength: 1, maxLength: 1 }),\n // @ts-ignore\n str => {\n let cp = /** @type {number} */ (str.codePointAt(0));\n return isNumeric(cp) === /\\p{N}/u.test(str);\n }\n ),\n );\n })", "language": "typescript", "source_file": "./repos/cometkim/unicode-segmenter/test/general.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "cometkim/unicode-segmenter", "url": "https://github.com/cometkim/unicode-segmenter.git", "license": "MIT", "stars": 77, "forks": 2}, "metrics": null, "summary": "The test verifies that a single grapheme string matches the Unicode property `\\p{N}` when `isNumeric` identifies its code point as numeric.", "mode": "fast-check"} {"id": 54936, "name": "unknown", "code": "t.test('should match [\\\\p{N}\\\\p{Alpha}]', () => {\n fc.assert(\n fc.property(\n fc.string({ unit: 'grapheme', minLength: 1, maxLength: 1 }),\n // @ts-ignore\n str => {\n let cp = /** @type {number} */ (str.codePointAt(0));\n return isAlphanumeric(cp) === /[\\p{N}\\p{Alpha}]/u.test(str);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/cometkim/unicode-segmenter/test/general.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "cometkim/unicode-segmenter", "url": "https://github.com/cometkim/unicode-segmenter.git", "license": "MIT", "stars": 77, "forks": 2}, "metrics": null, "summary": "The property should confirm that the `isAlphanumeric` function correctly identifies single grapheme strings matching the Unicode properties `\\p{N}` and `\\p{Alpha}`.", "mode": "fast-check"} {"id": 54938, "name": "unknown", "code": "test('isBMP', () => {\n fc.assert(\n fc.property(\n fc.integer({ min: 0, max: 0xffff }),\n // @ts-ignore\n cp => isBMP(cp),\n ),\n );\n})", "language": "typescript", "source_file": "./repos/cometkim/unicode-segmenter/test/utils.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "cometkim/unicode-segmenter", "url": "https://github.com/cometkim/unicode-segmenter.git", "license": "MIT", "stars": 77, "forks": 2}, "metrics": null, "summary": "The function `isBMP` should correctly identify integers within the range representing Basic Multilingual Plane (BMP) code points.", "mode": "fast-check"} {"id": 54939, "name": "unknown", "code": "test('isSMP', () => {\n fc.assert(\n fc.property(\n fc.integer({ min: 0x10000, max: 0x1ffff }),\n // @ts-ignore\n cp => isSMP(cp),\n ),\n );\n})", "language": "typescript", "source_file": "./repos/cometkim/unicode-segmenter/test/utils.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "cometkim/unicode-segmenter", "url": "https://github.com/cometkim/unicode-segmenter.git", "license": "MIT", "stars": 77, "forks": 2}, "metrics": null, "summary": "The function `isSMP` should return true for integers representing code points in the Supplementary Multilingual Plane (SMP) range from 0x10000 to 0x1ffff.", "mode": "fast-check"} {"id": 54940, "name": "unknown", "code": "test('isSIP', () => {\n fc.assert(\n fc.property(\n fc.integer({ min: 0x20000, max: 0x2ffff }),\n // @ts-ignore\n cp => isSIP(cp),\n ),\n );\n})", "language": "typescript", "source_file": "./repos/cometkim/unicode-segmenter/test/utils.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "cometkim/unicode-segmenter", "url": "https://github.com/cometkim/unicode-segmenter.git", "license": "MIT", "stars": 77, "forks": 2}, "metrics": null, "summary": "Verifies that the `isSIP` function returns true for integer code points within the range of 0x20000 to 0x2FFFF.", "mode": "fast-check"} {"id": 54941, "name": "unknown", "code": "test('isTIP', () => {\n fc.assert(\n fc.property(\n fc.integer({ min: 0x30000, max: 0x3ffff }),\n // @ts-ignore\n cp => isTIP(cp),\n ),\n );\n})", "language": "typescript", "source_file": "./repos/cometkim/unicode-segmenter/test/utils.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "cometkim/unicode-segmenter", "url": "https://github.com/cometkim/unicode-segmenter.git", "license": "MIT", "stars": 77, "forks": 2}, "metrics": null, "summary": "`isTIP` should correctly identify code points within the specified range from `0x30000` to `0x3ffff`.", "mode": "fast-check"} {"id": 54942, "name": "unknown", "code": "test('isSSP', () => {\n fc.assert(\n fc.property(\n fc.integer({ min: 0xe0000, max: 0xeffff }),\n // @ts-ignore\n cp => isSSP(cp),\n ),\n );\n})", "language": "typescript", "source_file": "./repos/cometkim/unicode-segmenter/test/utils.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "cometkim/unicode-segmenter", "url": "https://github.com/cometkim/unicode-segmenter.git", "license": "MIT", "stars": 77, "forks": 2}, "metrics": null, "summary": "`isSSP` returns true for integers within the range 0xe0000 to 0xeffff.", "mode": "fast-check"} {"id": 54943, "name": "unknown", "code": "t.test('any string', () => {\n fc.assert(\n fc.property(\n fc.string({ unit: 'binary' }),\n // @ts-ignore\n str => {\n assertObjectContaining(\n [...graphemeSegments(str)],\n [...intlSegmenter.segment(str)],\n );\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/cometkim/unicode-segmenter/test/grapheme.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "cometkim/unicode-segmenter", "url": "https://github.com/cometkim/unicode-segmenter.git", "license": "MIT", "stars": 77, "forks": 2}, "metrics": null, "summary": "`graphemeSegments` and `intlSegmenter.segment` should produce similar segmentations for any binary string input.", "mode": "fast-check"} {"id": 54944, "name": "unknown", "code": "t.test('binary', () => {\n fc.assert(\n fc.property(\n fc.string({ unit: 'binary' }),\n // @ts-ignore\n str => {\n assertObjectContaining(\n [...graphemeSegments(str)],\n [...intlSegmenter.segment(str)],\n );\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/cometkim/unicode-segmenter/test/grapheme.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "cometkim/unicode-segmenter", "url": "https://github.com/cometkim/unicode-segmenter.git", "license": "MIT", "stars": 77, "forks": 2}, "metrics": null, "summary": "`graphemeSegments` and `intlSegmenter.segment` should produce equivalent segments for binary strings.", "mode": "fast-check"} {"id": 54945, "name": "unknown", "code": "t.test('binary (ascii)', () => {\n fc.assert(\n fc.property(\n fc.string({ unit: 'binary-ascii' }),\n // @ts-ignore\n str => {\n assertObjectContaining(\n [...graphemeSegments(str)],\n [...intlSegmenter.segment(str)],\n );\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/cometkim/unicode-segmenter/test/grapheme.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "cometkim/unicode-segmenter", "url": "https://github.com/cometkim/unicode-segmenter.git", "license": "MIT", "stars": 77, "forks": 2}, "metrics": null, "summary": "The property should hold that the grapheme segments of a binary ASCII string match the segments produced by `intlSegmenter`.", "mode": "fast-check"} {"id": 54946, "name": "unknown", "code": "t.test('grapheme', () => {\n fc.assert(\n fc.property(\n fc.string({ unit: 'grapheme' }),\n // @ts-ignore\n str => {\n assertObjectContaining(\n [...graphemeSegments(str)],\n [...intlSegmenter.segment(str)],\n );\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/cometkim/unicode-segmenter/test/grapheme.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "cometkim/unicode-segmenter", "url": "https://github.com/cometkim/unicode-segmenter.git", "license": "MIT", "stars": 77, "forks": 2}, "metrics": null, "summary": "`graphemeSegments` should produce the same segments as `intlSegmenter.segment` for a given grapheme string.", "mode": "fast-check"} {"id": 54947, "name": "unknown", "code": "t.test('grapheme (ascii)', () => {\n fc.assert(\n fc.property(\n fc.string({ unit: 'grapheme-ascii' }),\n // @ts-ignore\n str => {\n assertObjectContaining(\n [...graphemeSegments(str)],\n [...intlSegmenter.segment(str)],\n );\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/cometkim/unicode-segmenter/test/grapheme.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "cometkim/unicode-segmenter", "url": "https://github.com/cometkim/unicode-segmenter.git", "license": "MIT", "stars": 77, "forks": 2}, "metrics": null, "summary": "The grapheme segmentation of ASCII strings should match the segments produced by `intlSegmenter`.", "mode": "fast-check"} {"id": 54950, "name": "unknown", "code": "t.test('should match \\\\p{Extended_Pictographic}', () => {\n fc.assert(\n fc.property(\n fc.string({ unit: 'grapheme', minLength: 1, maxLength: 1 }),\n // @ts-ignore\n str => {\n let cp = /** @type {number} */ (str.codePointAt(0));\n return isEmojiPresentation(cp) === /\\p{Emoji_Presentation}/u.test(str);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/cometkim/unicode-segmenter/test/emoji.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "cometkim/unicode-segmenter", "url": "https://github.com/cometkim/unicode-segmenter.git", "license": "MIT", "stars": 77, "forks": 2}, "metrics": null, "summary": "Matching a single character string against the `Emoji_Presentation` Unicode property should equate to evaluating `isEmojiPresentation` for its code point.", "mode": "fast-check"} {"id": 54952, "name": "unknown", "code": "t.test('locale as-is', () => {\n fc.assert(\n fc.property(\n fc.string({ unit: 'binary-ascii', minLength: 2 }),\n // @ts-ignore\n (inputLocale) => {\n let segmenter = new Segmenter(inputLocale);\n let { locale } = segmenter.resolvedOptions();\n return locale === inputLocale;\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/cometkim/unicode-segmenter/test/intl-adapter.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "cometkim/unicode-segmenter", "url": "https://github.com/cometkim/unicode-segmenter.git", "license": "MIT", "stars": 77, "forks": 2}, "metrics": null, "summary": "The `Segmenter` preserves the input locale as provided in the resolved options.", "mode": "fast-check"} {"id": 54953, "name": "unknown", "code": "it('almostEqual on numbers', () => {\n\n const debugOptions = {};\n\n fc.assert(\n fc.property(\n fc.double({ noDefaultInfinity: true, noNaN: true }),\n fc.double({ min: 0, noDefaultInfinity: true, noNaN: true }),\n (value, tolerance) => {\n\n assert(almostEqual(value, value, tolerance),\n `Same value must be equal for any tolerance: value: ${value}, tolerance: ${tolerance}`\n );\n\n // tolerance must sum all possible computation errors\n const range = Math.max(Math.abs(value), Math.abs(tolerance));\n\n assert(almostEqual(value, value + Math.sign(value) * tolerance, 2 * tolerance),\n `Absolute tolerance too strict: value: ${value}, tolerance: ${tolerance}, range: ${range}`\n );\n\n assert(almostEqual(value, value * range, 2 * range),\n `Relative tolerance too strict: value: ${value}, tolerance: ${tolerance}, range: ${range}`\n );\n\n const differentValue = Math.sign(value) * Math.max(\n Math.abs(value + Math.sign(value) * range),\n Math.abs(value * range),\n );\n if (value !== differentValue\n && Math.abs(differentValue) !== Infinity\n ) {\n assert(!almostEqual(value, differentValue, 0.5 * range),\n `Tolerance too relaxed: value: ${value}, tolerance: ${tolerance}, range: ${range}`\n );\n }\n\n }), {\n ...debugOptions,\n },\n );\n\n })", "language": "typescript", "source_file": "./repos/ircam-ismm/sc-utils/tests/almostEqual.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "ircam-ismm/sc-utils", "url": "https://github.com/ircam-ismm/sc-utils.git", "license": "BSD-3-Clause", "stars": 2, "forks": 1}, "metrics": null, "summary": "`almostEqual` should return true for values within a specified tolerance, considering both absolute and relative errors, and false for distinctly different values.", "mode": "fast-check"} {"id": 54954, "name": "unknown", "code": "it('almostEqualArray on arrays of numbers', () => {\n\n const debugOptions = {};\n\n fc.assert(\n fc.property(\n fc.array(fc.double({ noNaN: true, noDefaultInfinity: true })), fc.double({ noNaN: true, noDefaultInfinity: true, min: 0 }),\n (value, tolerance) => {\n\n // tolerance should sum all possible computation errors\n const range = Math.max(Math.abs(tolerance),\n value.reduce((max, v) => Math.max(max, Math.abs(v)), 0),\n );\n\n assert(almostEqualArray(value, value.map(v => v + Math.sign(v) * tolerance), 2 * tolerance),\n `Absolute tolerance too strict: value: ${value}, tolerance: ${tolerance}, range: ${range}`\n );\n\n assert(almostEqualArray(value, value.map(v => v * range), 2 * range),\n `Relative tolerance too strict: value: ${value}, tolerance: ${tolerance}, range: ${range}`\n );\n\n\n }), {\n ...debugOptions,\n },\n );\n\n })", "language": "typescript", "source_file": "./repos/ircam-ismm/sc-utils/tests/almostEqual.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "ircam-ismm/sc-utils", "url": "https://github.com/ircam-ismm/sc-utils.git", "license": "BSD-3-Clause", "stars": 2, "forks": 1}, "metrics": null, "summary": "`almostEqualArray` ensures numerical arrays are considered almost equal when elements vary by a specified absolute or relative tolerance.", "mode": "fast-check"} {"id": 54957, "name": "unknown", "code": "test('KtRecord', () => {\n fc.assert(\n fc.property(\n fc.commands(commandArb, {maxCommands: 5_000, size: 'max'}),\n function (cmds) {\n const initial = {\n model: {...recordDefaults},\n real: {record: new TestRecord()},\n };\n fc.modelRun(() => ({...initial}), cmds);\n },\n ),\n {numRuns: 10, endOnFailure: true, verbose: true},\n );\n})", "language": "typescript", "source_file": "./repos/mwiencek/killer-trees/test/monkey/Record.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mwiencek/killer-trees", "url": "https://github.com/mwiencek/killer-trees.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`KtRecord` operates correctly as established by a large number of commands executed against both a model and a real instance, ensuring consistency between them.", "mode": "fast-check"} {"id": 54960, "name": "unknown", "code": "it('isJust/isNothing handle Just instances', () => {\n fc.assert(\n fc.property(fc.anything().filter(isDefined), (x) => {\n const justX = Just.of(x)\n verify(Maybe.isJust(justX)).is(true)\n verify(Maybe.isNothing(justX)).is(false)\n })\n )\n })", "language": "typescript", "source_file": "./repos/shahabkhalvati/funktx/__tests__/types/maybe.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "shahabkhalvati/funktx", "url": "https://github.com/shahabkhalvati/funktx.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "`isJust` returns true and `isNothing` returns false for `Just` instances created with defined values.", "mode": "fast-check"} {"id": 54961, "name": "unknown", "code": "it('Maybe.from correctly uses Just', () => {\n fc.assert(\n fc.property(fc.anything().filter(isDefined), (x) => {\n const justX = Maybe.from(x)\n\n verify(Maybe.isJust(justX)).is(true)\n verify(Maybe.isNothing(justX)).is(false)\n })\n )\n })", "language": "typescript", "source_file": "./repos/shahabkhalvati/funktx/__tests__/types/maybe.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "shahabkhalvati/funktx", "url": "https://github.com/shahabkhalvati/funktx.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "`Maybe.from` creates a `Just` instance for defined values, ensuring `Maybe.isJust` returns true and `Maybe.isNothing` returns false.", "mode": "fast-check"} {"id": 54963, "name": "unknown", "code": "it('Converts correctly from Either', () => {\n fc.assert(\n fc.property(fc.anything().filter(isDefined), (x) => {\n const left = Left.of('default')\n verify(Maybe.fromEither(left).isNothing).is(true)\n\n const right = Right.of(123)\n verify(Maybe.fromEither(right).isJust).is(true)\n })\n )\n })", "language": "typescript", "source_file": "./repos/shahabkhalvati/funktx/__tests__/types/maybe.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "shahabkhalvati/funktx", "url": "https://github.com/shahabkhalvati/funktx.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "`Maybe.fromEither` converts a `Left` to `Nothing` and a `Right` to `Just`.", "mode": "fast-check"} {"id": 54965, "name": "unknown", "code": "it('works with anything', () => {\n fc.assert(\n fc.property(fc.anything(), (x) => {\n const increment = (x) => x + 1\n const result = map(increment)(Nothing.of(x))\n\n const onJust = jest.fn()\n const onNothing = jest.fn()\n\n verify(result).is(Nothing.of())\n verify(result.fold(onNothing)(onJust)).is(undefined)\n verify(onNothing).isCalledWith()\n verify(onJust).isNotCalled()\n })\n )\n })", "language": "typescript", "source_file": "./repos/shahabkhalvati/funktx/__tests__/types/maybe.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "shahabkhalvati/funktx", "url": "https://github.com/shahabkhalvati/funktx.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The `map` function applied to `Nothing.of(x)` should result in `Nothing.of()` and trigger actions for `onNothing` without calling `onJust`.", "mode": "fast-check"} {"id": 54967, "name": "unknown", "code": "it('works with anything', () => {\n fc.assert(\n fc.property(fc.anything().filter(isDefined), (x) => {\n const increment = (x) => x + 1\n const result = map(increment)(Left.of(x))\n\n const onRight = jest.fn()\n const onLeft = jest.fn(identity)\n\n verify(result.fold(onLeft)(onRight)).is(x)\n verify(onRight).isNotCalled()\n verify(result).is(Left.of(x))\n verify(onLeft).isCalledWith(x)\n })\n )\n })", "language": "typescript", "source_file": "./repos/shahabkhalvati/funktx/__tests__/types/either.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "shahabkhalvati/funktx", "url": "https://github.com/shahabkhalvati/funktx.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The function `map` applied to `Left.of(x)` with an increment operation should return `Left.of(x)`, confirming that the `fold` method calls `onLeft` with `x` and does not call `onRight`.", "mode": "fast-check"} {"id": 54968, "name": "unknown", "code": "it('Converts correctly to Maybe', () => {\n fc.assert(\n fc.property(fc.anything().filter(isDefined), (x) => {\n verify(Left.of(x).toMaybe()).is(Nothing.of())\n verify(Right.of(x).toMaybe()).is(Just.of(x))\n })\n )\n })", "language": "typescript", "source_file": "./repos/shahabkhalvati/funktx/__tests__/types/either.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "shahabkhalvati/funktx", "url": "https://github.com/shahabkhalvati/funktx.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "`Left.of(x).toMaybe()` results in `Nothing.of()`, and `Right.of(x).toMaybe()` results in `Just.of(x)` for defined values `x`.", "mode": "fast-check"} {"id": 54970, "name": "unknown", "code": "it ( 'works with fc-generated codepoints', t => {\n\n const assert = str => t.is ( Base128.decodeStr ( Base128.encodeStr ( str ) ), str );\n const property = fc.property ( fc.fullUnicode (), assert );\n\n fc.assert ( property, { numRuns: 1000000 } );\n\n })", "language": "typescript", "source_file": "./repos/fabiospampinato/base128-encoding/test/index.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fabiospampinato/base128-encoding", "url": "https://github.com/fabiospampinato/base128-encoding.git", "license": "MIT", "stars": 15, "forks": 0}, "metrics": null, "summary": "Encoding and then decoding a string of full Unicode codepoints should return the original string.", "mode": "fast-check"} {"id": 54971, "name": "unknown", "code": "it ( 'works with fc-generated strings', t => {\n\n const assert = str => t.is ( Base128.decodeStr ( Base128.encodeStr ( str ) ), str );\n const property = fc.property ( fc.fullUnicodeString (), assert );\n\n fc.assert ( property, { numRuns: 1000000 } );\n\n })", "language": "typescript", "source_file": "./repos/fabiospampinato/base128-encoding/test/index.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fabiospampinato/base128-encoding", "url": "https://github.com/fabiospampinato/base128-encoding.git", "license": "MIT", "stars": 15, "forks": 0}, "metrics": null, "summary": "Encoding and then decoding a full Unicode string with `Base128` should yield the original string.", "mode": "fast-check"} {"id": 54980, "name": "unknown", "code": "it ( 'works with fc-generated codepoints', t => {\n\n const assert = str => t.is ( U8.decode ( U8.encode ( str ) ), str );\n const property = fc.property ( fc.fullUnicode (), assert );\n\n fc.assert ( property, { numRuns: 1000000 } );\n\n })", "language": "typescript", "source_file": "./repos/fabiospampinato/uint8-encoding/test/index.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fabiospampinato/uint8-encoding", "url": "https://github.com/fabiospampinato/uint8-encoding.git", "license": "MIT", "stars": 4, "forks": 1}, "metrics": null, "summary": "Encoding and then decoding any given full Unicode string should return the original string.", "mode": "fast-check"} {"id": 55001, "name": "unknown", "code": "it('should calculate the duration of two dates in seconds', async () => {\n fc.assert(\n fc.asyncProperty(\n fc.date(),\n fc.date(),\n async (start, end) => {\n const duration = await durationCalculate({ start, end });\n expect(duration).to.eq((end - start) / 1000);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/collinmcneese/github-actions-metrics/webhook-collector/__test__/opensearch.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "collinmcneese/github-actions-metrics", "url": "https://github.com/collinmcneese/github-actions-metrics.git", "license": "ISC", "stars": 5, "forks": 0}, "metrics": null, "summary": "`durationCalculate` computes the difference between two dates in seconds.", "mode": "fast-check"} {"id": 55002, "name": "unknown", "code": "it('preserves property: left subtree < node < right subtree for all nodes in tree', () => {\n fc.assert(fc.property(fc.array(fc.integer()),\n nums => {\n const tree = nums.reduce(insert, null)\n\n return isBinarySearchTree(tree)\n })\n )\n })", "language": "typescript", "source_file": "./repos/Jamie-Rodriguez/data-structs-and-algos/binary-search-tree.test.js", "start_line": null, "end_line": null, "dependencies": ["isBinarySearchTree"], "repo": {"name": "Jamie-Rodriguez/data-structs-and-algos", "url": "https://github.com/Jamie-Rodriguez/data-structs-and-algos.git", "license": "BSD-2-Clause", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should hold that constructing a tree from an array of integers results in a valid binary search tree where each node's left subtree contains smaller values and the right subtree contains larger values.", "mode": "fast-check"} {"id": 55006, "name": "unknown", "code": "it('preserves other keys', () => {\n fc.assert(fc.property(fc.array(fc.integer()), fc.array(fc.integer()),\n (remaining, removals) => {\n const nums = [...remaining, ...removals]\n const tree = nums.reduce(insert, null)\n\n const treePostRemovals = removals.reduce(remove, tree)\n\n // Use Sets to remove duplicates\n const existentKeys = new Set(nums.filter(\n key => search(treePostRemovals, key)\n ))\n\n const originalSet = new Set(nums)\n const removedSet = new Set(removals)\n\n return Array.from(existentKeys).every(\n key => originalSet.has(key) && !removedSet.has(key)\n )\n }),\n { verbose: 0 }\n )\n })", "language": "typescript", "source_file": "./repos/Jamie-Rodriguez/data-structs-and-algos/binary-search-tree.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Jamie-Rodriguez/data-structs-and-algos", "url": "https://github.com/Jamie-Rodriguez/data-structs-and-algos.git", "license": "BSD-2-Clause", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test checks that after removing certain integers from a binary search tree, only the keys that were not removed still exist in the tree.", "mode": "fast-check"} {"id": 55008, "name": "unknown", "code": "it('constructs valid binary search tree', () => {\n fc.assert(fc.property(fc.array(fc.integer()),\n nums => {\n const tree = nums.reduce(insert, null)\n\n return isBinarySearchTree(tree)\n }),\n { verbose: 0 }\n )\n })", "language": "typescript", "source_file": "./repos/Jamie-Rodriguez/data-structs-and-algos/avl-tree.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Jamie-Rodriguez/data-structs-and-algos", "url": "https://github.com/Jamie-Rodriguez/data-structs-and-algos.git", "license": "BSD-2-Clause", "stars": 0, "forks": 0}, "metrics": null, "summary": "Constructing a binary search tree from an array of integers should result in a valid binary search tree.", "mode": "fast-check"} {"id": 55009, "name": "unknown", "code": "it('constructs balanced binary tree', () => {\n fc.assert(fc.property(fc.array(fc.integer()),\n nums => {\n const tree = nums.reduce(insert, null)\n\n return isBalancedBinaryTree(tree)\n }),\n { verbose: 0 }\n )\n })", "language": "typescript", "source_file": "./repos/Jamie-Rodriguez/data-structs-and-algos/avl-tree.test.js", "start_line": null, "end_line": null, "dependencies": ["isBalancedBinaryTree"], "repo": {"name": "Jamie-Rodriguez/data-structs-and-algos", "url": "https://github.com/Jamie-Rodriguez/data-structs-and-algos.git", "license": "BSD-2-Clause", "stars": 0, "forks": 0}, "metrics": null, "summary": "Constructing a tree from an array of integers with `reduce(insert, null)` should result in a balanced binary tree according to `isBalancedBinaryTree`.", "mode": "fast-check"} {"id": 55011, "name": "unknown", "code": "it('preserves binary search tree property', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()), fc.array(fc.integer()),\n (remaining, removals) => {\n const nums = [...remaining, ...removals]\n const tree = nums.reduce(insert, null)\n\n const treePostRemovals = removals.reduce(remove, tree)\n\n return isBinarySearchTree(treePostRemovals)\n }),\n { verbose: 0 }\n )\n })", "language": "typescript", "source_file": "./repos/Jamie-Rodriguez/data-structs-and-algos/avl-tree.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Jamie-Rodriguez/data-structs-and-algos", "url": "https://github.com/Jamie-Rodriguez/data-structs-and-algos.git", "license": "BSD-2-Clause", "stars": 0, "forks": 0}, "metrics": null, "summary": "`insert` and `remove` operations on an AVL tree should result in a structure that maintains the binary search tree property.", "mode": "fast-check"} {"id": 55012, "name": "unknown", "code": "it('preserves balanced binary tree', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()), fc.array(fc.integer()),\n (remaining, removals) => {\n const nums = [...remaining, ...removals]\n const tree = nums.reduce(insert, null)\n\n const treePostRemovals = removals.reduce(remove, tree)\n\n return isBalancedBinaryTree(treePostRemovals)\n }),\n { verbose: 0 }\n )\n })", "language": "typescript", "source_file": "./repos/Jamie-Rodriguez/data-structs-and-algos/avl-tree.test.js", "start_line": null, "end_line": null, "dependencies": ["isBalancedBinaryTree"], "repo": {"name": "Jamie-Rodriguez/data-structs-and-algos", "url": "https://github.com/Jamie-Rodriguez/data-structs-and-algos.git", "license": "BSD-2-Clause", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property should hold that inserting and then removing elements from a tree maintains it as a balanced binary tree.", "mode": "fast-check"} {"id": 55013, "name": "unknown", "code": "it('removes element from tree', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()), fc.array(fc.integer()),\n (remaining, removals) => {\n const nums = [...remaining, ...removals]\n const tree = nums.reduce(insert, null)\n\n const treePostRemovals = removals.reduce(remove, tree)\n\n return !removals.filter(\n key => search(treePostRemovals, key)\n ).length\n }),\n { verbose: 0 }\n )\n })", "language": "typescript", "source_file": "./repos/Jamie-Rodriguez/data-structs-and-algos/avl-tree.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Jamie-Rodriguez/data-structs-and-algos", "url": "https://github.com/Jamie-Rodriguez/data-structs-and-algos.git", "license": "BSD-2-Clause", "stars": 0, "forks": 0}, "metrics": null, "summary": "Removing elements from an AVL tree results in those elements no longer being found in the tree.", "mode": "fast-check"} {"id": 55014, "name": "unknown", "code": "it('preserves other keys', () => {\n fc.assert(fc.property(\n fc.array(fc.integer()), fc.array(fc.integer()),\n (remaining, removals) => {\n const nums = [...remaining, ...removals]\n const tree = nums.reduce(insert, null)\n\n const treePostRemovals = removals.reduce(remove, tree)\n\n // Use Sets to remove duplicates\n const existentKeys = new Set(nums.filter(\n key => search(treePostRemovals, key)\n ))\n\n const originalSet = new Set(nums)\n const removedSet = new Set(removals)\n\n return Array.from(existentKeys).every(\n key => originalSet.has(key) && !removedSet.has(key)\n )\n }),\n { verbose: 0 }\n )\n })", "language": "typescript", "source_file": "./repos/Jamie-Rodriguez/data-structs-and-algos/avl-tree.test.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Jamie-Rodriguez/data-structs-and-algos", "url": "https://github.com/Jamie-Rodriguez/data-structs-and-algos.git", "license": "BSD-2-Clause", "stars": 0, "forks": 0}, "metrics": null, "summary": "AVl tree preserves keys not included in the list of removals after performing removal operations.", "mode": "fast-check"} {"id": 55016, "name": "unknown", "code": "it ( 'works with fc-generated strings', t => {\n\n const assert = str => t.true ( !Hex.is ( str ) || ( Hex.decodeStr ( Hex.encodeStr ( str ) ) === str ) );\n const property = fc.property ( fc.fullUnicodeString (), assert );\n\n fc.assert ( property, { numRuns: 1000000 } );\n\n })", "language": "typescript", "source_file": "./repos/fabiospampinato/hex-encoding/test/index.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fabiospampinato/hex-encoding", "url": "https://github.com/fabiospampinato/hex-encoding.git", "license": "MIT", "stars": 6, "forks": 0}, "metrics": null, "summary": "Encoding and then decoding full Unicode strings should return the original string, unless the string is not in hex format.", "mode": "fast-check"} {"id": 55017, "name": "unknown", "code": "it ( 'works like Buffer', t => {\n\n const assert = str => Hex.is ( str ) ? t.deepEqual ( Hex.encodeStr ( str ), Buffer.from ( str ).toString ( 'hex' ) ) : t.pass ();\n const property = fc.property ( fc.fullUnicodeString (), assert );\n\n fc.assert ( property, { numRuns: 1000000 } );\n\n })", "language": "typescript", "source_file": "./repos/fabiospampinato/hex-encoding/test/index.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fabiospampinato/hex-encoding", "url": "https://github.com/fabiospampinato/hex-encoding.git", "license": "MIT", "stars": 6, "forks": 0}, "metrics": null, "summary": "The test ensures that `Hex.encodeStr` produces the same hexadecimal output as `Buffer.from(str).toString('hex')` for valid string inputs, while passing for non-hexadecimal inputs.", "mode": "fast-check"} {"id": 55018, "name": "unknown", "code": "test('Passwords which length is less than 8 should be rejected', () => {\r\n fc.assert(\r\n fc.property(fc.string(0,7),(password:string) => {\r\n /// console.log(password);\r\n expect(validate(password)).toBe(false);\r\n })\r\n );\r\n })", "language": "typescript", "source_file": "./repos/freddiefujiwara/fast-check-password-validator-example/__tests__/password_validator.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "freddiefujiwara/fast-check-password-validator-example", "url": "https://github.com/freddiefujiwara/fast-check-password-validator-example.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Passwords shorter than 8 characters should be rejected by the `validate` function.", "mode": "fast-check"} {"id": 55020, "name": "unknown", "code": "test('Passwords only consisting numbers{8,20} should be rejected', () => {\r\n fc.assert(\r\n fc.property(numberStrings(8,20),(password:string) => {\r\n // console.log(password);\r\n expect(validate(password)).toBe(false);\r\n })\r\n );\r\n })", "language": "typescript", "source_file": "./repos/freddiefujiwara/fast-check-password-validator-example/__tests__/password_validator.spec.ts", "start_line": null, "end_line": null, "dependencies": ["numberStrings"], "repo": {"name": "freddiefujiwara/fast-check-password-validator-example", "url": "https://github.com/freddiefujiwara/fast-check-password-validator-example.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Passwords consisting only of numbers with lengths between 8 and 20 characters should be rejected.", "mode": "fast-check"} {"id": 55021, "name": "unknown", "code": "test('Passwords only consisting alphabets{8,20} should be rejected', () => {\r\n fc.assert(\r\n fc.property(alphabetStrings(8,20),(password:string) => {\r\n // console.log(password);\r\n expect(validate(password)).toBe(false);\r\n })\r\n );\r\n })", "language": "typescript", "source_file": "./repos/freddiefujiwara/fast-check-password-validator-example/__tests__/password_validator.spec.ts", "start_line": null, "end_line": null, "dependencies": ["alphabetStrings"], "repo": {"name": "freddiefujiwara/fast-check-password-validator-example", "url": "https://github.com/freddiefujiwara/fast-check-password-validator-example.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Passwords consisting solely of alphabetic characters between 8 and 20 characters should be rejected by the `validate` function.", "mode": "fast-check"} {"id": 55022, "name": "unknown", "code": "test('Passwords only consisting printable symbols{8,20} should be rejected', () => {\r\n fc.assert(\r\n fc.property(symbolStrings(8,20),(password:string) => {\r\n // console.log(password);\r\n expect(validate(password)).toBe(false);\r\n })\r\n );\r\n })", "language": "typescript", "source_file": "./repos/freddiefujiwara/fast-check-password-validator-example/__tests__/password_validator.spec.ts", "start_line": null, "end_line": null, "dependencies": ["symbolStrings"], "repo": {"name": "freddiefujiwara/fast-check-password-validator-example", "url": "https://github.com/freddiefujiwara/fast-check-password-validator-example.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Passwords composed solely of printable symbols with lengths between 8 and 20 characters should be rejected by the `validate` function.", "mode": "fast-check"} {"id": 55023, "name": "unknown", "code": "test('Passwords only consisting proper characters{8,20} should be accepted', () => {\r\n fc.assert(\r\n fc.property(properString(8,20),(password:string) => {\r\n // console.log(password);\r\n expect(validate(password)).toBe(true);\r\n })\r\n );\r\n })", "language": "typescript", "source_file": "./repos/freddiefujiwara/fast-check-password-validator-example/__tests__/password_validator.spec.ts", "start_line": null, "end_line": null, "dependencies": ["properString"], "repo": {"name": "freddiefujiwara/fast-check-password-validator-example", "url": "https://github.com/freddiefujiwara/fast-check-password-validator-example.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Passwords composed of proper characters within lengths of 8 to 20 should be validated as acceptable.", "mode": "fast-check"} {"id": 55025, "name": "unknown", "code": "test('store and retrieve preserves data integrity', () => {\n fc.assert(\n fc.asyncProperty(\n fc.string(), // Key\n fc.jsonObject(), // Value\n fc.array(fc.string()), // Tags\n async (key, value, tags) => {\n // Store the value\n await memorySystem.store(key, value, { tags });\n \n // Retrieve the value\n const entry = await memorySystem.retrieve(key);\n \n // Assert data integrity\n expect(entry).not.toBeNull();\n expect(entry.value).toEqual(value);\n expect(entry.key).toBe(key);\n expect(entry.tags).toEqual(expect.arrayContaining(tags));\n }\n ),\n { numRuns: 50 } // Number of random test cases to run\n );\n })", "language": "typescript", "source_file": "./repos/sethdford/flowx/tests/property/memory-system.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sethdford/flowx", "url": "https://github.com/sethdford/flowx.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Storing and retrieving data in `memorySystem` should preserve the integrity of the key, value, and tags.", "mode": "fast-check"} {"id": 55026, "name": "unknown", "code": "test('update maintains version increments', () => {\n fc.assert(\n fc.asyncProperty(\n fc.string(), // Key\n fc.array(fc.jsonObject(), { minLength: 2, maxLength: 10 }), // Series of updates\n async (key, updates) => {\n // Store initial value\n await memorySystem.store(key, updates[0]);\n \n // Apply a series of updates\n for (let i = 1; i < updates.length; i++) {\n await memorySystem.update(key, updates[i]);\n }\n \n // Retrieve final state\n const entry = await memorySystem.retrieve(key);\n \n // Version should match number of updates + 1 (initial store)\n expect(entry.version).toBe(updates.length);\n \n // Final value should match last update\n expect(entry.value).toEqual(updates[updates.length - 1]);\n }\n ),\n { numRuns: 25 } // Number of random test cases to run\n );\n })", "language": "typescript", "source_file": "./repos/sethdford/flowx/tests/property/memory-system.spec.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "sethdford/flowx", "url": "https://github.com/sethdford/flowx.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "Updating a key in `memorySystem` should increment the version to match the number of updates, with the final value being the last update.", "mode": "fast-check"} {"id": 55027, "name": "unknown", "code": "it ( 'works with fc-generated codepoints', t => {\n\n const assert = str => t.deepEqual ( UTF16le.decode ( UTF16le.encode ( evenize ( U8.encode ( str ) ) ) ), evenize ( U8.encode ( str ) ) );\n const property = fc.property ( fc.fullUnicode (), assert );\n\n fc.assert ( property, { numRuns: 1000000 } );\n\n })", "language": "typescript", "source_file": "./repos/fabiospampinato/utf16le-encoding/test/index.js", "start_line": null, "end_line": null, "dependencies": ["evenize"], "repo": {"name": "fabiospampinato/utf16le-encoding", "url": "https://github.com/fabiospampinato/utf16le-encoding.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "Encoding and then decoding strings with `UTF16le` should return the even-length `uint8` array obtained from encoding the original string with `U8`.", "mode": "fast-check"} {"id": 55028, "name": "unknown", "code": "it ( 'works with fc-generated strings', t => {\n\n const assert = str => t.deepEqual ( UTF16le.decode ( UTF16le.encode ( evenize ( U8.encode ( str ) ) ) ), evenize ( U8.encode ( str ) ) );\n const property = fc.property ( fc.fullUnicodeString (), assert );\n\n fc.assert ( property, { numRuns: 1000000 } );\n\n })", "language": "typescript", "source_file": "./repos/fabiospampinato/utf16le-encoding/test/index.js", "start_line": null, "end_line": null, "dependencies": ["evenize"], "repo": {"name": "fabiospampinato/utf16le-encoding", "url": "https://github.com/fabiospampinato/utf16le-encoding.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "Encoding and decoding a fully Unicode string should result in a byte array that, when evenized, matches the evenized version of the original UTF-8 encoded string.", "mode": "fast-check"} {"id": 55029, "name": "unknown", "code": "it ( 'works like Buffer', t => {\n\n const assert = str => t.is ( UTF16le.encode ( evenize ( U8.encode ( str ) ) ), Buffer.from ( evenize ( U8.encode ( str ) ) ).toString ( 'utf16le' ) );\n const property = fc.property ( fc.fullUnicodeString (), assert );\n\n fc.assert ( property, { numRuns: 1000000 } );\n\n })", "language": "typescript", "source_file": "./repos/fabiospampinato/utf16le-encoding/test/index.js", "start_line": null, "end_line": null, "dependencies": ["evenize"], "repo": {"name": "fabiospampinato/utf16le-encoding", "url": "https://github.com/fabiospampinato/utf16le-encoding.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "`UTF16le.encode` produces the same result as converting even-length byte arrays to UTF-16LE strings using `Buffer`.", "mode": "fast-check"} {"id": 55030, "name": "unknown", "code": "test('weight-balanced-tree', () => {\n fc.assert(\n fc.property(\n fc.commands(commandArb, {maxCommands: 5_000, size: 'max'}),\n function (cmds) {\n const initial = {\n model: {array: []},\n real: {tree: wbt.empty},\n };\n fc.modelRun(() => ({...initial}), cmds);\n },\n ),\n {numRuns: 10, endOnFailure: true, verbose: true},\n );\n})", "language": "typescript", "source_file": "./repos/mwiencek/weight-balanced-tree/test/monkey.js", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mwiencek/weight-balanced-tree", "url": "https://github.com/mwiencek/weight-balanced-tree.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The test runs a series of commands on a model with an array and a real weight-balanced tree, verifying consistency between the two over multiple iterations.", "mode": "fast-check"} {"id": 55034, "name": "unknown", "code": "test(\"number to string transformer\", () => {\n const targetSchema = z.string().refine((s) => !isNaN(+s));\n const schema = z.number().transform(String);\n\n const arbitrary = ZodFastCheck().outputOf(schema);\n\n return fc.assert(\n fc.property(arbitrary, (value) => {\n targetSchema.parse(value);\n })\n );\n })", "language": "typescript", "source_file": "./repos/DavidTimms/zod-fast-check/tests/zod-fast-check.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/zod-fast-check", "url": "https://github.com/DavidTimms/zod-fast-check.git", "license": "MIT", "stars": 118, "forks": 12}, "metrics": null, "summary": "Transforming a number to a string should result in a string that can be parsed as a number.", "mode": "fast-check"} {"id": 55042, "name": "unknown", "code": "test(\"string to number pipeline\", () => {\n const targetSchema = z.number().min(5).int();\n const schema = z\n .string()\n .transform((s) => s.length)\n .pipe(z.number().min(5));\n\n const arbitrary = ZodFastCheck().outputOf(schema);\n\n return fc.assert(\n fc.property(arbitrary, (value) => {\n targetSchema.parse(value);\n })\n );\n })", "language": "typescript", "source_file": "./repos/DavidTimms/zod-fast-check/tests/zod-fast-check.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/zod-fast-check", "url": "https://github.com/DavidTimms/zod-fast-check.git", "license": "MIT", "stars": 118, "forks": 12}, "metrics": null, "summary": "The test ensures that the transformation of a string to its length, piped through a schema requiring a minimum value of 5 as an integer, always results in a valid number according to the target schema restrictions.", "mode": "fast-check"} {"id": 55035, "name": "unknown", "code": "test(\"deeply nested transformer\", () => {\n const targetSchema = z.array(z.number());\n const schema = z.array(z.boolean().transform(Number));\n\n const arbitrary = ZodFastCheck().outputOf(schema);\n\n return fc.assert(\n fc.asyncProperty(arbitrary, async (value) => {\n await targetSchema.parse(value);\n })\n );\n })", "language": "typescript", "source_file": "./repos/DavidTimms/zod-fast-check/tests/zod-fast-check.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/zod-fast-check", "url": "https://github.com/DavidTimms/zod-fast-check.git", "license": "MIT", "stars": 118, "forks": 12}, "metrics": null, "summary": "Deeply nested boolean values transformed to numbers should match the target schema of an array of numbers.", "mode": "fast-check"} {"id": 55036, "name": "unknown", "code": "test(\"transformer within a transformer\", () => {\n // This schema accepts an array of booleans and converts them\n // to strings with exclamation marks then concatenates them.\n const targetSchema = z.string().regex(/(true\\!|false\\!)*/);\n const schema = z\n .array(z.boolean().transform((bool) => `${bool}!`))\n .transform((array) => array.join(\"\"));\n\n const arbitrary = ZodFastCheck().outputOf(schema);\n\n return fc.assert(\n fc.asyncProperty(arbitrary, async (value) => {\n await targetSchema.parse(value);\n })\n );\n })", "language": "typescript", "source_file": "./repos/DavidTimms/zod-fast-check/tests/zod-fast-check.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/zod-fast-check", "url": "https://github.com/DavidTimms/zod-fast-check.git", "license": "MIT", "stars": 118, "forks": 12}, "metrics": null, "summary": "Transforms an array of booleans into a concatenated string with each boolean converted to `\"true!\"` or `\"false!\"`, ensuring the result matches the specified regex pattern.", "mode": "fast-check"} {"id": 55039, "name": "unknown", "code": "test(\"string with catch\", () => {\n const targetSchema = z.string();\n const schema = z.string().catch(\"fallback\");\n\n const arbitrary = ZodFastCheck().outputOf(schema);\n\n return fc.assert(\n fc.property(arbitrary, (value) => {\n targetSchema.parse(value);\n })\n );\n })", "language": "typescript", "source_file": "./repos/DavidTimms/zod-fast-check/tests/zod-fast-check.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/zod-fast-check", "url": "https://github.com/DavidTimms/zod-fast-check.git", "license": "MIT", "stars": 118, "forks": 12}, "metrics": null, "summary": "Parsing a string with a catch fallback should not throw an error when using the `string` schema.", "mode": "fast-check"} {"id": 55040, "name": "unknown", "code": "test(\"trimmed string\", () => {\n const schema = z.string().trim();\n\n const arbitrary = ZodFastCheck().outputOf(schema);\n\n return fc.assert(\n fc.property(arbitrary, (value) => {\n value.match(/^\\s/) === null && value.match(/\\s$/) === null;\n })\n );\n })", "language": "typescript", "source_file": "./repos/DavidTimms/zod-fast-check/tests/zod-fast-check.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/zod-fast-check", "url": "https://github.com/DavidTimms/zod-fast-check.git", "license": "MIT", "stars": 118, "forks": 12}, "metrics": null, "summary": "Strings generated by `ZodFastCheck` for a trimmed schema should have no leading or trailing whitespace.", "mode": "fast-check"} {"id": 55041, "name": "unknown", "code": "test(\"a branded type schema uses an arbitrary for the underlying schema\", () => {\n const schema = z.string().brand<\"brand\">();\n type BrandedString = z.output;\n\n const arbitrary = ZodFastCheck().outputOf(schema);\n\n return fc.assert(\n fc.property(arbitrary, (value: BrandedString) => {\n expect(typeof value).toBe(\"string\");\n })\n );\n })", "language": "typescript", "source_file": "./repos/DavidTimms/zod-fast-check/tests/zod-fast-check.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/zod-fast-check", "url": "https://github.com/DavidTimms/zod-fast-check.git", "license": "MIT", "stars": 118, "forks": 12}, "metrics": null, "summary": "A branded type schema generates values from an arbitrary, ensuring the output type is a string.", "mode": "fast-check"} {"id": 55044, "name": "unknown", "code": "test(\"using custom UUID arbitrary in nested schema\", () => {\n const schema = z.object({ ids: z.array(UUID) });\n\n const arbitrary = ZodFastCheck().override(UUID, fc.uuid()).inputOf(schema);\n\n return fc.assert(\n fc.property(arbitrary, (value) => {\n schema.parse(value);\n })\n );\n })", "language": "typescript", "source_file": "./repos/DavidTimms/zod-fast-check/tests/zod-fast-check.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/zod-fast-check", "url": "https://github.com/DavidTimms/zod-fast-check.git", "license": "MIT", "stars": 118, "forks": 12}, "metrics": null, "summary": "Custom UUID arbitrary values should be valid according to the nested schema.", "mode": "fast-check"} {"id": 55050, "name": "unknown", "code": "expect(() => fc.assert(fc.property(arbitrary, () => true)))", "language": "typescript", "source_file": "./repos/DavidTimms/zod-fast-check/tests/zod-fast-check.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "DavidTimms/zod-fast-check", "url": "https://github.com/DavidTimms/zod-fast-check.git", "license": "MIT", "stars": 118, "forks": 12}, "metrics": null, "summary": "The test expects that running `fc.assert` with a trivial property (always returning true) does not throw an error.", "mode": "fast-check"} {"id": 55054, "name": "unknown", "code": "it('should work after reset', () =>\n\t\tfc.assert(\n\t\t\tfc.asyncProperty(\n\t\t\t\tfc.nat({ max: 100 }),\n\t\t\t\tfc.nat({ max: 100 }),\n\t\t\t\tfc.nat({ max: 100 }),\n\t\t\t\tasync (errs1, errs2, succs2) => {\n\t\t\t\t\tconst waiter = new MutableWaiter();\n\t\t\t\t\tconst errors1 = new Array(errs1).fill(new Error());\n\t\t\t\t\terrors1.forEach((err) => waiter.wait(Promise.reject(err)));\n\t\t\t\t\tawait expect(waiter.isCompleted()).resolves.toStrictEqual(errors1);\n\t\t\t\t\twaiter.reset();\n\t\t\t\t\tconst errors2 = new Array(errs2).fill(new Error());\n\t\t\t\t\terrors2.forEach((err) => waiter.wait(Promise.reject(err)));\n\t\t\t\t\tnew Array(succs2).fill(waiter.wait(Promise.resolve()));\n\t\t\t\t\treturn expect(waiter.isCompleted()).resolves.toStrictEqual(errors2);\n\t\t\t\t}\n\t\t\t)\n\t\t))", "language": "typescript", "source_file": "./repos/proti-iac/proti/proti-core/test/mutable-waiter.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "proti-iac/proti", "url": "https://github.com/proti-iac/proti.git", "license": "Apache-2.0", "stars": 9, "forks": 0}, "metrics": null, "summary": "The property ensures that after resetting a `MutableWaiter`, it correctly handles subsequent promises, resolving with the appropriate errors from the new set of rejected promises.", "mode": "fast-check"} {"id": 55062, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(isEquivalentToDeriveUncompressedThenCompress);\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": "The test ensures no assertion errors are thrown for the properties `isEquivalentToDeriveUncompressedThenCompress`, `equivalentToSecp256k1Node`, and `equivalentToElliptic`.", "mode": "fast-check"} {"id": 55065, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(isEquivalentToDeriveCompressedThenUncompress);\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": "The code asserts that certain cryptographic properties or operations related to secp256k1 do not throw exceptions when checked for equivalence with different implementations or processes like derivation, compression, and uncompression.", "mode": "fast-check"} {"id": 55079, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSecp256k1Node);\n fc.assert(equivalentToElliptic);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": "The test confirms that the functions `equivalentToSecp256k1Node` and `equivalentToElliptic` do not throw any exceptions during their execution.", "mode": "fast-check"} {"id": 55084, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(reversesCompress);\n fc.assert(equivalentToSecp256k1Node);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": "Assertions check that `reversesCompress` and `equivalentToSecp256k1Node` properties do not throw errors during their evaluation.", "mode": "fast-check"} {"id": 55095, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(createsValidSignatures);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/secp256k1.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": "Verifies that `createsValidSignatures` does not throw an error, ensuring it consistently produces valid signatures.", "mode": "fast-check"} {"id": 55096, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToNative);\n fc.assert(equivalentToHashJs);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/hash.spec.helper.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": "The test ensures that the assertions `equivalentToNative` and `equivalentToHashJs` do not throw any exceptions.", "mode": "fast-check"} {"id": 55098, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(equivalentToSinglePass);\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/crypto/hash.spec.helper.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": "Ensures that the `equivalentToSinglePass` function executes without throwing an error.", "mode": "fast-check"} {"id": 55099, "name": "unknown", "code": "t.notThrows(() => {\n fc.assert(roundTripWithPayloadLength(20));\n fc.assert(roundTripWithPayloadLength(24));\n fc.assert(roundTripWithPayloadLength(28));\n fc.assert(roundTripWithPayloadLength(32));\n fc.assert(roundTripWithPayloadLength(40));\n fc.assert(roundTripWithPayloadLength(48));\n fc.assert(roundTripWithPayloadLength(56));\n fc.assert(roundTripWithPayloadLength(64));\n })", "language": "typescript", "source_file": "./repos/bitauth/libauth/src/lib/address/cash-address.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "bitauth/libauth", "url": "https://github.com/bitauth/libauth.git", "license": "MIT", "stars": 282, "forks": 57}, "metrics": null, "summary": "The function does not throw an error when validating that round-tripping with specified payload lengths succeeds.", "mode": "fast-check"} {"id": 55131, "name": "unknown", "code": "describe(\"epoch serialization\", () => {\n it(\"Round trip\", async function () {\n await fc.assert(\n fc.asyncProperty(fc.integer({ min: 0 }), async (date) => {\n const bytes = epochIntToBytes(date);\n const _date = epochBytesToInt(bytes);\n\n expect(_date.valueOf()).to.eq(date.valueOf());\n })\n );\n });\n})", "language": "typescript", "source_file": "./repos/waku-org/js-waku/packages/rln/src/utils/epoch.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "waku-org/js-waku", "url": "https://github.com/waku-org/js-waku.git", "license": "Apache-2.0", "stars": 179, "forks": 45}, "metrics": null, "summary": "Converting an integer to bytes and back using `epochIntToBytes` and `epochBytesToInt` should return the original integer value.", "mode": "fast-check"} {"id": 55132, "name": "unknown", "code": "it(\"should correctly encode and decode relay shards using rs format (Index List)\", () => {\n fc.assert(\n fc.property(\n fc.nat(65535), // cluster\n fc\n .array(fc.nat(1023), { minLength: 1, maxLength: 63 }) // indexList\n .map((arr) => [...new Set(arr)].sort((a, b) => a - b)),\n (clusterId, shards) => {\n const shardInfo = { clusterId, shards };\n const encoded = encodeRelayShard(shardInfo);\n const decoded = decodeRelayShard(encoded);\n\n expect(decoded).to.deep.equal(\n shardInfo,\n \"Decoded shard info does not match the original for rs format\"\n );\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/waku-org/js-waku/packages/utils/src/common/relay_shard_codec.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "waku-org/js-waku", "url": "https://github.com/waku-org/js-waku.git", "license": "Apache-2.0", "stars": 179, "forks": 45}, "metrics": null, "summary": "Encoding and decoding relay shards using the rs format should preserve the original shard information.", "mode": "fast-check"} {"id": 55133, "name": "unknown", "code": "it(\"should correctly encode and decode relay shards using rsv format (Bit Vector)\", () => {\n fc.assert(\n fc.property(\n fc.nat(65535), // cluster\n fc\n .array(fc.nat(1023), { minLength: 64, maxLength: 1024 }) // indexList\n .map((arr) => [...new Set(arr)].sort((a, b) => a - b)),\n (clusterId, shards) => {\n const shardInfo = { clusterId, shards };\n const encoded = encodeRelayShard(shardInfo);\n const decoded = decodeRelayShard(encoded);\n\n expect(decoded).to.deep.equal(\n shardInfo,\n \"Decoded shard info does not match the original for rsv format\"\n );\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/waku-org/js-waku/packages/utils/src/common/relay_shard_codec.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "waku-org/js-waku", "url": "https://github.com/waku-org/js-waku.git", "license": "Apache-2.0", "stars": 179, "forks": 45}, "metrics": null, "summary": "Encoding and decoding of relay shards using the rsv format (Bit Vector) should preserve the original `clusterId` and `shards` information.", "mode": "fast-check"} {"id": 55134, "name": "unknown", "code": "it(\"Accepts a valid Waku Message\", async () => {\n await fc.assert(\n fc.asyncProperty(fc.uint8Array({ minLength: 1 }), async (payload) => {\n const privateKey = await generateKeyPair(\"secp256k1\");\n const peerId = peerIdFromPrivateKey(privateKey);\n\n const encoder = createEncoder({\n contentTopic: TestContentTopic,\n pubsubTopic: TestPubsubTopic\n });\n const bytes = await encoder.toWire({ payload });\n\n const message: UnsignedMessage = {\n type: \"unsigned\",\n topic: TestPubsubTopic,\n data: bytes\n };\n\n const result = messageValidator(peerId, message);\n\n expect(result).to.eq(TopicValidatorResult.Accept);\n })\n );\n })", "language": "typescript", "source_file": "./repos/waku-org/js-waku/packages/relay/src/message_validator.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "waku-org/js-waku", "url": "https://github.com/waku-org/js-waku.git", "license": "Apache-2.0", "stars": 179, "forks": 45}, "metrics": null, "summary": "`messageValidator` should return `TopicValidatorResult.Accept` for valid Waku messages with given payloads.", "mode": "fast-check"} {"id": 55135, "name": "unknown", "code": "it(\"Rejects garbage\", async () => {\n await fc.assert(\n fc.asyncProperty(fc.uint8Array(), async (data) => {\n const peerId =\n await generateKeyPair(\"secp256k1\").then(peerIdFromPrivateKey);\n\n const message: UnsignedMessage = {\n type: \"unsigned\",\n topic: TestPubsubTopic,\n data\n };\n\n const result = messageValidator(peerId, message);\n\n expect(result).to.eq(TopicValidatorResult.Reject);\n })\n );\n })", "language": "typescript", "source_file": "./repos/waku-org/js-waku/packages/relay/src/message_validator.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "waku-org/js-waku", "url": "https://github.com/waku-org/js-waku.git", "license": "Apache-2.0", "stars": 179, "forks": 45}, "metrics": null, "summary": "Message validation rejects messages containing arbitrary byte arrays by returning `TopicValidatorResult.Reject`.", "mode": "fast-check"} {"id": 55148, "name": "unknown", "code": "test(\"should yield non-positive numbers\", () => {\n fc.assert(\n fc.property(NonPositiveArbitrary, (num) => {\n assert.ok(NonPositive.is(num));\n }),\n {\n verbose: true,\n numRuns: 100,\n }\n );\n})", "language": "typescript", "source_file": "./repos/EricCrosson/numbers-ts/packages/fast-check-numbers/test/property/test-non-positive.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "EricCrosson/numbers-ts", "url": "https://github.com/EricCrosson/numbers-ts.git", "license": "ISC", "stars": 3, "forks": 2}, "metrics": null, "summary": "`NonPositiveArbitrary` generates numbers, and `NonPositive.is` checks that these numbers are non-positive.", "mode": "fast-check"} {"id": 55149, "name": "unknown", "code": "test(\"should yield non-positive integers\", () => {\n fc.assert(\n fc.property(NonPositiveIntArbitrary, (num) => {\n assert.ok(NonPositive.is(num));\n assert.ok(Int.is(num));\n assert.ok(NonPositiveInt.is(num));\n }),\n {\n verbose: true,\n numRuns: 100,\n }\n );\n})", "language": "typescript", "source_file": "./repos/EricCrosson/numbers-ts/packages/fast-check-numbers/test/property/test-non-positive-int.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "EricCrosson/numbers-ts", "url": "https://github.com/EricCrosson/numbers-ts.git", "license": "ISC", "stars": 3, "forks": 2}, "metrics": null, "summary": "Generated numbers should be valid non-positive integers according to checks for `NonPositive`, `Int`, and `NonPositiveInt`.", "mode": "fast-check"} {"id": 55150, "name": "unknown", "code": "test(\"should yield non-negative numbers\", () => {\n fc.assert(\n fc.property(NonNegativeArbitrary, (num) => {\n assert.ok(NonNegative.is(num));\n }),\n {\n verbose: true,\n numRuns: 100,\n }\n );\n})", "language": "typescript", "source_file": "./repos/EricCrosson/numbers-ts/packages/fast-check-numbers/test/property/test-non-negative.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "EricCrosson/numbers-ts", "url": "https://github.com/EricCrosson/numbers-ts.git", "license": "ISC", "stars": 3, "forks": 2}, "metrics": null, "summary": "Generated numbers should be non-negative according to `NonNegative.is`.", "mode": "fast-check"} {"id": 55155, "name": "unknown", "code": "test(\"formats should match themselves\", () => {\n fc.assert(\n fc.property(\n fc.oneof(\n arb.saneGeneralNameFormatString(),\n arb.saneFileNameFormatString()\n ),\n (format) => {\n expect(recase(format, parseNamePattern(format))).toBe(format);\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/mausworks/tidier/packages/tidier-core/src/recase.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mausworks/tidier", "url": "https://github.com/mausworks/tidier.git", "license": "ISC", "stars": 202, "forks": 2}, "metrics": null, "summary": "The output of `recase` applied to a format string, parsed with `parseNamePattern`, should match the original format string.", "mode": "fast-check"} {"id": 55159, "name": "unknown", "code": "it(\"combines projects without duplicates\", async () => {\n fc.assert(\n fc.property(\n fc.set(arb.folderPath(true), { minLength: 5, maxLength: 10 }),\n (rootPaths) => {\n const projects = new Projects();\n const moreProjects = new Projects();\n const volume = rootPaths.reduce(\n (vol, path) => ({ ...vol, [path]: null }),\n {}\n );\n\n for (const root of rootPaths) {\n const folder = new TestFolder(root, volume);\n const project = new Project(folder, basicSettings);\n const sameProject = new Project(folder, basicSettings);\n\n projects.add(project);\n moreProjects.add(sameProject);\n }\n\n projects.combine(moreProjects);\n\n expect(projects.count).toBe(rootPaths.length);\n\n const seen = new Set();\n\n for (const project of projects.list()) {\n expect(seen.has(project.folder.path)).toBe(false);\n seen.add(project.folder.path);\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mausworks/tidier/packages/tidier-core/src/projects.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mausworks/tidier", "url": "https://github.com/mausworks/tidier.git", "license": "ISC", "stars": 202, "forks": 2}, "metrics": null, "summary": "Combining projects should result in no duplicate entries, maintaining a count equal to the number of unique root paths.", "mode": "fast-check"} {"id": 55160, "name": "unknown", "code": "it(\"creates a project when the root folder exists, and a config is provided\", async () => {\n await fc.assert(\n fc.asyncProperty(arb.folderPath(true), async (rootPath) => {\n const folder = seedFolder(rootPath, [], []);\n\n expect(() => new Project(folder, basicSettings)).not.toThrow();\n })\n );\n })", "language": "typescript", "source_file": "./repos/mausworks/tidier/packages/tidier-core/src/project.spec.ts", "start_line": null, "end_line": null, "dependencies": ["seedFolder"], "repo": {"name": "mausworks/tidier", "url": "https://github.com/mausworks/tidier.git", "license": "ISC", "stars": 202, "forks": 2}, "metrics": null, "summary": "A `Project` is successfully created when the root folder exists and configuration settings are provided.", "mode": "fast-check"} {"id": 55161, "name": "unknown", "code": "it(\"reads the .gitignore files from the project root when using `load` without any options\", async () => {\n await fc.assert(\n fc.asyncProperty(\n arb.folderPath(true),\n fc.array(fc.oneof(arb.folderPath(), arb.filePath()), { minLength: 1 }),\n async (rootPath, ignore) => {\n const folder = seedFolder(rootPath, [], []);\n const configPath = join(rootPath, TIDIER_CONFIG_NAME);\n folder.volume[configPath] = JSON.stringify(basicJSONConfig);\n folder.volume[join(rootPath, \".gitignore\")] = ignore.join(\"\\n\");\n\n const project = await Project.load(folder);\n\n for (const path of ignore) {\n expect(project.ignores(path)).toBe(true);\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mausworks/tidier/packages/tidier-core/src/project.spec.ts", "start_line": null, "end_line": null, "dependencies": ["seedFolder"], "repo": {"name": "mausworks/tidier", "url": "https://github.com/mausworks/tidier.git", "license": "ISC", "stars": 202, "forks": 2}, "metrics": null, "summary": "When using `load` without options, the project should recognize paths specified in the `.gitignore` file from the project root as ignored.", "mode": "fast-check"} {"id": 55162, "name": "unknown", "code": "it(\"reads the specified ignorefiles on `load`\", async () => {\n await fc.assert(\n fc.asyncProperty(\n arb.folderPath(true),\n fc.array(\n fc.tuple(\n arb.filePath(),\n fc.set(fc.oneof(arb.folderPath(), arb.filePath()), { minLength: 1 })\n ),\n { minLength: 2 }\n ),\n async (rootPath, ignorefiles) => {\n const folder = seedFolder(rootPath, [], []);\n const readFileSpy = jest.spyOn(folder, \"readFile\");\n const configPath = join(rootPath, TIDIER_CONFIG_NAME);\n folder.volume[configPath] = JSON.stringify(basicJSONConfig);\n\n for (const [path, lines] of ignorefiles) {\n folder.volume[join(rootPath, path)] = lines.join(\"\\n\");\n }\n\n const project = await Project.load(folder, {\n ignorefiles: ignorefiles.map(([path]) => path),\n });\n\n for (const [ignorefilePath, lines] of ignorefiles) {\n expect(readFileSpy).toHaveBeenCalledWith(ignorefilePath);\n\n for (const path of lines) {\n expect(project.ignores(path)).toBe(true);\n }\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mausworks/tidier/packages/tidier-core/src/project.spec.ts", "start_line": null, "end_line": null, "dependencies": ["seedFolder"], "repo": {"name": "mausworks/tidier", "url": "https://github.com/mausworks/tidier.git", "license": "ISC", "stars": 202, "forks": 2}, "metrics": null, "summary": "`Project.load` should read specified ignorefiles, ensuring that each ignored path from these files is correctly recognized by the project.", "mode": "fast-check"} {"id": 55164, "name": "unknown", "code": "it(\"lists all folders (except ignored) with '**/*'\", async () => {\n await fc.assert(\n fc.asyncProperty(\n arb.folderPath(true),\n fc.set(arb.folderPath(false, { maxLength: 1 }), {\n minLength: 2,\n maxLength: 2,\n }),\n async (rootPath, folders) => {\n const root = seedFolder(rootPath, [], folders);\n\n const ignore = folders.slice(0, Math.floor(folders.length / 2));\n\n const project = new Project(root, { ...basicSettings, ignore });\n const entries = await project.list(Glob.ANYTHING, \"folder\");\n const paths = entries.map(([path]) => path);\n\n for (const folder of folders) {\n expect(paths.includes(folder)).toBe(!ignore.includes(folder));\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mausworks/tidier/packages/tidier-core/src/project.spec.ts", "start_line": null, "end_line": null, "dependencies": ["seedFolder"], "repo": {"name": "mausworks/tidier", "url": "https://github.com/mausworks/tidier.git", "license": "ISC", "stars": 202, "forks": 2}, "metrics": null, "summary": "Ensures `Project.list` correctly lists all folder paths, excluding those specified in the ignore list when using the '**/*' glob pattern.", "mode": "fast-check"} {"id": 55167, "name": "unknown", "code": "it(\"does not err when an ignorefile doesn't exist\", async () => {\n await fc.assert(\n fc.asyncProperty(\n arb.folderPath(true),\n arb.fileName(),\n async (root, fileName) => {\n const folder = new TestFolder(root);\n await expect(\n Ignorefile.load(folder, fileName)\n ).resolves.not.toThrow();\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mausworks/tidier/packages/tidier-core/src/ignore.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mausworks/tidier", "url": "https://github.com/mausworks/tidier.git", "license": "ISC", "stars": 202, "forks": 2}, "metrics": null, "summary": "Loading an ignorefile in a folder should not throw an error if the ignorefile does not exist.", "mode": "fast-check"} {"id": 55171, "name": "unknown", "code": "it(\"reloads all ignorefiles on reload\", async () => {\n await fc.assert(\n fc.asyncProperty(\n arb.folderPath(true),\n fc.set(arb.fileName(), { minLength: 2, maxLength: 3 }),\n async (root, ignorefileNames) => {\n const ignores = new ProjectIgnore();\n const folder = new TestFolder(root);\n\n for (const name of ignorefileNames) {\n folder.volume[`${root}/${name}`] = \"foo.js\";\n const ignorefile = await Ignorefile.load(folder, name);\n\n ignores.useIgnorefile(ignorefile);\n }\n\n const readFileSpy = jest.spyOn(folder, \"readFile\");\n ignores.reload();\n\n for (const name of ignorefileNames) {\n expect(readFileSpy).toHaveBeenCalledWith(name);\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mausworks/tidier/packages/tidier-core/src/ignore.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mausworks/tidier", "url": "https://github.com/mausworks/tidier.git", "license": "ISC", "stars": 202, "forks": 2}, "metrics": null, "summary": "All ignorefiles should be reloaded when the `reload` method is called on the `ProjectIgnore` instance, verified by checking that `readFile` is called for each ignorefile.", "mode": "fast-check"} {"id": 55174, "name": "unknown", "code": "it(\"appends the prefix to the path\", () => {\n fc.assert(\n fc.property(\n arb.folderPath(),\n fc.array(fc.oneof(arb.folderPath(), arb.filePath())),\n (prefix, paths) => {\n for (const path of paths) {\n const glob = Glob.within(prefix, path);\n\n expect(glob.pattern).toBe(join(prefix, path));\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mausworks/tidier/packages/tidier-core/src/glob.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mausworks/tidier", "url": "https://github.com/mausworks/tidier.git", "license": "ISC", "stars": 202, "forks": 2}, "metrics": null, "summary": "`Glob.within` appends a prefix to a given path, ensuring the resulting pattern matches the joined path.", "mode": "fast-check"} {"id": 55175, "name": "unknown", "code": "it('preserves the \"!\" at the start for negating patterns', () => {\n fc.assert(\n fc.property(\n arb.folderPath(),\n fc.array(fc.oneof(arb.folderPath(), arb.filePath())),\n (prefix, paths) => {\n for (const path of paths) {\n const glob = Glob.within(prefix, \"!\" + path);\n\n expect(glob.pattern).toBe(\"!\" + join(prefix, path));\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mausworks/tidier/packages/tidier-core/src/glob.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mausworks/tidier", "url": "https://github.com/mausworks/tidier.git", "license": "ISC", "stars": 202, "forks": 2}, "metrics": null, "summary": "`Glob.within` ensures that a negation symbol \"!\" at the start of a pattern is preserved when combining with a prefix.", "mode": "fast-check"} {"id": 55179, "name": "unknown", "code": "it(\"parses general formats\", () => {\n fc.assert(\n fc.property(arb.generalNameFormat(), (casings) => {\n expect(parseNamePattern(casings.join(\".\"))).toEqual(casings);\n })\n );\n })", "language": "typescript", "source_file": "./repos/mausworks/tidier/packages/tidier-core/src/config.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mausworks/tidier", "url": "https://github.com/mausworks/tidier.git", "license": "ISC", "stars": 202, "forks": 2}, "metrics": null, "summary": "Parsing a general name format results in a list of casings that matches the input.", "mode": "fast-check"} {"id": 55180, "name": "unknown", "code": "it(\"parses file formats\", () => {\n fc.assert(\n fc.property(arb.fileNameFormat(), (casings) => {\n expect(parseNamePattern(casings.join(\".\"))).toEqual(casings);\n })\n );\n })", "language": "typescript", "source_file": "./repos/mausworks/tidier/packages/tidier-core/src/config.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mausworks/tidier", "url": "https://github.com/mausworks/tidier.git", "license": "ISC", "stars": 202, "forks": 2}, "metrics": null, "summary": "The property should hold that `parseNamePattern` correctly splits joined file format strings to match the original casings array.", "mode": "fast-check"} {"id": 55181, "name": "unknown", "code": "it(\"fails to parse invalid formats\", () => {\n fc.assert(\n fc.property(\n fc.array(fc.string({ minLength: 1 }), { minLength: 2 }),\n (casings) => {\n expect(() => parseNamePattern(casings.join(\".\"))).toThrow();\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mausworks/tidier/packages/tidier-core/src/config.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mausworks/tidier", "url": "https://github.com/mausworks/tidier.git", "license": "ISC", "stars": 202, "forks": 2}, "metrics": null, "summary": "`parseNamePattern` throws an error when attempting to parse a joined string from an array of non-empty strings.", "mode": "fast-check"} {"id": 55182, "name": "unknown", "code": "it(\"throws if extension format is not last\", () => {\n fc.assert(\n fc.property(\n fc.array(arb.generalCasing(), { minLength: 0 }),\n arb.extensionCasing(),\n fc.array(arb.generalCasing(), { minLength: 1 }),\n (head, extension, tail) => {\n expect(() =>\n parseNamePattern([...head, extension, ...tail].join(\".\"))\n ).toThrowError(\n /the extension must be the last fragment of the pattern./i\n );\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mausworks/tidier/packages/tidier-core/src/config.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mausworks/tidier", "url": "https://github.com/mausworks/tidier.git", "license": "ISC", "stars": 202, "forks": 2}, "metrics": null, "summary": "Parsing a name pattern throws an error if the extension is not the last segment in the pattern.", "mode": "fast-check"} {"id": 55183, "name": "unknown", "code": "it(\"fails to create when the root does not exist\", async () => {\n await fc.assert(\n fc.asyncProperty(arb.folderPath(true), async (root) => {\n await expect(FileDirectory.resolve(root)).rejects.toThrow();\n })\n );\n })", "language": "typescript", "source_file": "./repos/mausworks/tidier/packages/tidier-cli/src/directory.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "mausworks/tidier", "url": "https://github.com/mausworks/tidier.git", "license": "ISC", "stars": 202, "forks": 2}, "metrics": null, "summary": "`FileDirectory.resolve` throws an error when attempting to create a directory with a non-existent root path.", "mode": "fast-check"} {"id": 55185, "name": "unknown", "code": "it(\"returns null if the file or folder does not exist\", async () => {\n await fc.assert(\n fc.asyncProperty(\n arb.folderPath(true),\n arb.folderPath(),\n arb.fileName(),\n async (rootPath, filePath, folderPath) => {\n seedVolume(rootPath, [], []);\n const root = await FileDirectory.resolve(rootPath);\n\n await expect(root.entryType(filePath)).resolves.toEqual(null);\n await expect(root.entryType(folderPath)).resolves.toEqual(null);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mausworks/tidier/packages/tidier-cli/src/directory.spec.ts", "start_line": null, "end_line": null, "dependencies": ["seedVolume"], "repo": {"name": "mausworks/tidier", "url": "https://github.com/mausworks/tidier.git", "license": "ISC", "stars": 202, "forks": 2}, "metrics": null, "summary": "Calling `entryType` on a path that does not exist should resolve to `null`.", "mode": "fast-check"} {"id": 55186, "name": "unknown", "code": "it(\"lists files and folders within a directory\", async () => {\n await fc.assert(\n fc.asyncProperty(\n arb.folderPath(true),\n fc.set(arb.fileName(3), { minLength: 5, maxLength: 10 }),\n async (rootPath, names) => {\n const mid = Math.min(names.length / 2);\n const folders = names.slice(0, mid);\n const files = names.slice(mid, names.length);\n seedVolume(rootPath, files, folders);\n\n const root = await FileDirectory.resolve(rootPath);\n\n for (const [name, type] of await root.list(\"./\")) {\n if (type === \"file\") {\n expect(files.includes(name)).toBe(true);\n } else if (type === \"folder\") {\n expect(folders.includes(name)).toBe(true);\n }\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/mausworks/tidier/packages/tidier-cli/src/directory.spec.ts", "start_line": null, "end_line": null, "dependencies": ["seedVolume"], "repo": {"name": "mausworks/tidier", "url": "https://github.com/mausworks/tidier.git", "license": "ISC", "stars": 202, "forks": 2}, "metrics": null, "summary": "`FileDirectory.resolve(rootPath).list(\"./\")` correctly identifies and lists files and folders within the seeded directory.", "mode": "fast-check"} {"id": 55188, "name": "unknown", "code": "test('incrementRandom increments', () => {\n\tfunction uint8ArrayToNumber(arr: Uint8Array) {\n\t\tlet num = 0n\n\t\tfor (const i of arr) {\n\t\t\tnum = num * 256n + BigInt(i)\n\t\t}\n\t\treturn num\n\t}\n\tfc.assert(\n\t\tfc.property(\n\t\t\tfc.record({\n\t\t\t\tepoch: fc.integer({\n\t\t\t\t\tmin: 0,\n\t\t\t\t\tmax: epochMax,\n\t\t\t\t}),\n\t\t\t\tid: fc.uint8Array({\n\t\t\t\t\tminLength: idLength,\n\t\t\t\t\tmaxLength: idLength,\n\t\t\t\t}),\n\t\t\t}),\n\t\t\t({ epoch, id }) => {\n\t\t\t\tprefixEpochToArray(epoch, id)\n\t\t\t\tconst randomArrayA = id.slice(epochLength)\n\t\t\t\tincrementRandom(id)\n\t\t\t\tconst randomArrayB = id.slice(epochLength)\n\t\t\t\tconst actualEpoch = idToEpoch(id)\n\t\t\t\tassert.equal(actualEpoch, epoch)\n\t\t\t\tassert.equal(\n\t\t\t\t\tuint8ArrayToNumber(randomArrayA) + 1n,\n\t\t\t\t\tuint8ArrayToNumber(randomArrayB),\n\t\t\t\t)\n\t\t\t},\n\t\t),\n\t)\n})", "language": "typescript", "source_file": "./repos/AlexErrant/Pentive/shared/tests/binary.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "AlexErrant/Pentive", "url": "https://github.com/AlexErrant/Pentive.git", "license": "Apache-2.0", "stars": 42, "forks": 3}, "metrics": null, "summary": "`incrementRandom` ensures the numeric value derived from a portion of a Uint8Array increases by one, while the epoch portion remains unchanged.", "mode": "fast-check"} {"id": 55191, "name": "unknown", "code": "test('cursor/keyset pagination works for getNotes', async () => {\n\tconst sortState = fc\n\t\t.tuple(\n\t\t\tfc.boolean().map((desc) => ({\n\t\t\t\tid: 'note.id' as const,\n\t\t\t\tdesc: desc ? ('desc' as const) : undefined,\n\t\t\t})),\n\t\t\tfc.boolean().map((desc) => ({\n\t\t\t\tid: 'noteEdited' as const,\n\t\t\t\tdesc: desc ? ('desc' as const) : undefined,\n\t\t\t})),\n\t\t)\n\t\t.chain((x) => fc.shuffledSubarray(x, { minLength: 1, maxLength: 1 }))\n\tconst arbNum = fc.integer({ min: 0, max: 5 })\n\tconst createdEditeds = fc.uniqueArray(\n\t\tfc\n\t\t\t.record({\n\t\t\t\tcreated: arbNum,\n\t\t\t\tedited: arbNum,\n\t\t\t\trawId: fc.uint8Array({ maxLength: idLength, minLength: idLength }),\n\t\t\t})\n\t\t\t.map((x) => {\n\t\t\t\tconst id = new Uint8Array(x.rawId)\n\t\t\t\tprefixEpochToArray(x.created, id)\n\t\t\t\treturn {\n\t\t\t\t\t...x,\n\t\t\t\t\trawId: id,\n\t\t\t\t}\n\t\t\t}),\n\t\t{\n\t\t\tminLength: 1,\n\t\t\tmaxLength: 100,\n\t\t\tselector: (x) => x.rawId,\n\t\t\tcomparator: uint8comparator,\n\t\t},\n\t)\n\tlet lastDb: Database.Database | undefined\n\tawait fc.assert(\n\t\tfc.asyncProperty(\n\t\t\tfc.record({\n\t\t\t\tcreatedEditeds,\n\t\t\t\tsortState,\n\t\t\t}),\n\t\t\tasync ({ createdEditeds, sortState }) => {\n\t\t\t\t_kysely.resetSqlLog()\n\t\t\t\tconst { database, remoteTemplateId } = await setupDb()\n\t\t\t\tconst jsSorted: SimplifiedNote[] = []\n\t\t\t\tfor (const { created, edited, rawId } of createdEditeds) {\n\t\t\t\t\t_binary.setRawId(() => rawId)\n\t\t\t\t\tconst noteResponse = await insertNotes(userId, [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlocalId: base64urlId(),\n\t\t\t\t\t\t\tfieldValues: {},\n\t\t\t\t\t\t\ttags: [],\n\t\t\t\t\t\t\tremoteTemplateIds: [remoteTemplateId],\n\t\t\t\t\t\t},\n\t\t\t\t\t])\n\t\t\t\t\tconst remoteNoteId = Array.from(noteResponse.values())[0]![0]\n\t\t\t\t\tconst rawRemoteNoteId = base64urlToArray(remoteNoteId)\n\t\t\t\t\tjsSorted.push({ created, edited, remoteNoteId: rawRemoteNoteId })\n\t\t\t\t\tconst hexNoteId = base16.encode(rawRemoteNoteId)\n\t\t\t\t\tdatabase.exec(\n\t\t\t\t\t\t`UPDATE note SET edited = ${edited} WHERE id = x'${hexNoteId}'`,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tjsSorted.sort((a, b) => sort(a, b, sortState))\n\n\t\t\t\t_kysely.setPageSize(100_000_000)\n\t\t\t\tconst sqlSorted = await getNotes(\n\t\t\t\t\t{\n\t\t\t\t\t\tnook,\n\t\t\t\t\t\tsortState,\n\t\t\t\t\t\tcursor: undefined,\n\t\t\t\t\t},\n\t\t\t\t\tuserId,\n\t\t\t\t).then((x) => x.map(simplifyNote))\n\n\t\t\t\t// Act\n\t\t\t\t_kysely.setPageSize(3)\n\t\t\t\tconst paginatedNotes = await getAllNotes(sortState)\n\n\t\t\t\t// Assert\n\t\t\t\tconst actualNotes = paginatedNotes.map(simplifyNote)\n\t\t\t\ttry {\n\t\t\t\t\tassert.sameDeepOrderedMembers(actualNotes, jsSorted)\n\t\t\t\t\tassert.sameDeepOrderedMembers(actualNotes, sqlSorted)\n\t\t\t\t} catch (e) {\n\t\t\t\t\tconsole.log('=================================================')\n\t\t\t\t\tconsole.log('sortState', sortState)\n\t\t\t\t\tconsole.log('actualNotes', actualNotes.map(prettier))\n\t\t\t\t\tconsole.log('jsSorted', jsSorted.map(prettier))\n\t\t\t\t\tconsole.log('sqlLog', _kysely.sqlLog.map(_kysely.prettierSqlLog))\n\t\t\t\t\tlastDb = database\n\t\t\t\t\tthrow e\n\t\t\t\t}\n\t\t\t},\n\t\t),\n\t)\n\tif (lastDb != null) {\n\t\t// fs.writeFileSync('shrunken.db', lastDb.serialize())\n\t}\n})", "language": "typescript", "source_file": "./repos/AlexErrant/Pentive/shared-edge/tests/getNotes.test.ts", "start_line": null, "end_line": null, "dependencies": ["setupDb", "sort", "getAllNotes"], "repo": {"name": "AlexErrant/Pentive", "url": "https://github.com/AlexErrant/Pentive.git", "license": "Apache-2.0", "stars": 42, "forks": 3}, "metrics": null, "summary": "Cursor/keyset pagination in `getNotes` should produce results equivalent to sorting done in JavaScript and SQL orders.", "mode": "fast-check"} {"id": 55192, "name": "unknown", "code": "test('created can be derived from id', async () => {\n\tconst arbNum = fc.integer({ min: 0, max: 281474976710655 })\n\tconst createdIds = fc.uniqueArray(\n\t\tfc\n\t\t\t.record({\n\t\t\t\tcreated: arbNum,\n\t\t\t\trawId: fc.uint8Array({ maxLength: idLength, minLength: idLength }),\n\t\t\t})\n\t\t\t.map((x) => {\n\t\t\t\tconst id = new Uint8Array(x.rawId)\n\t\t\t\tprefixEpochToArray(x.created, id)\n\t\t\t\treturn {\n\t\t\t\t\t...x,\n\t\t\t\t\trawId: id,\n\t\t\t\t}\n\t\t\t}),\n\t\t{\n\t\t\tminLength: 1,\n\t\t\tmaxLength: 100,\n\t\t\tselector: (x) => x.rawId,\n\t\t\tcomparator: uint8comparator,\n\t\t},\n\t)\n\tawait fc.assert(\n\t\tfc.asyncProperty(\n\t\t\tfc.record({\n\t\t\t\tcreatedIds,\n\t\t\t}),\n\t\t\tasync ({ createdIds }) => {\n\t\t\t\tconst { database, remoteTemplateId } = await setupDb()\n\t\t\t\tfor (const { created, rawId } of createdIds) {\n\t\t\t\t\t_binary.setRawId(() => rawId)\n\t\t\t\t\tconst noteResponse = await insertNotes(userId, [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlocalId: base64urlId(),\n\t\t\t\t\t\t\tfieldValues: {},\n\t\t\t\t\t\t\ttags: [],\n\t\t\t\t\t\t\tremoteTemplateIds: [remoteTemplateId],\n\t\t\t\t\t\t},\n\t\t\t\t\t])\n\t\t\t\t\tconst remoteNoteId = Array.from(noteResponse.values())[0]![0]\n\t\t\t\t\tconst rawRemoteNoteId = base64urlToArray(remoteNoteId)\n\n\t\t\t\t\tconst apiNote = await getNote(remoteNoteId, userId)\n\t\t\t\t\tconst sqlNote = database\n\t\t\t\t\t\t.prepare(`SELECT created FROM note WHERE id = ?`)\n\t\t\t\t\t\t.get(rawRemoteNoteId) as { created: number }\n\n\t\t\t\t\tassert.equal(idToEpoch(rawRemoteNoteId), created)\n\t\t\t\t\tassert.equal(apiNote!.created.getTime(), created)\n\t\t\t\t\tassert.equal(sqlNote.created, created)\n\t\t\t\t}\n\t\t\t},\n\t\t),\n\t)\n})", "language": "typescript", "source_file": "./repos/AlexErrant/Pentive/shared-edge/tests/getNotes.test.ts", "start_line": null, "end_line": null, "dependencies": ["setupDb"], "repo": {"name": "AlexErrant/Pentive", "url": "https://github.com/AlexErrant/Pentive.git", "license": "Apache-2.0", "stars": 42, "forks": 3}, "metrics": null, "summary": "`created` timestamps should be correctly derived from IDs, verified by ensuring inserted notes reflect the expected creation time across API, database, and decoded ID values.", "mode": "fast-check"} {"id": 55193, "name": "unknown", "code": "it(\"should parse CSV\", () =>\n fc.assert(\n fc.asyncProperty(\n fc.gen().map((g) => {\n const header = g(FC.header, {\n // TextEncoderStream can't handle utf-16 string.\n fieldConstraints: {\n kindExcludes: [\"string16bits\"],\n },\n });\n const EOL = g(FC.eol);\n const csvData = g(FC.csvData, {\n // TextEncoderStream can't handle utf-16 string.\n fieldConstraints: {\n kindExcludes: [\"string16bits\"],\n },\n columnsConstraints: {\n minLength: header.length,\n maxLength: header.length,\n },\n });\n const EOF = g(fc.boolean);\n const csv = [\n header.map((v) => escapeField(v, { quote: true })).join(\",\"),\n ...csvData.map((row) =>\n row.map((v) => escapeField(v, { quote: true })).join(\",\"),\n ),\n ...(EOF ? [\"\"] : []),\n ].join(EOL);\n const data =\n csvData.length >= 1\n ? csvData.map((row) =>\n Object.fromEntries(row.map((v, i) => [header[i], v])),\n )\n : [];\n return {\n data,\n csv: new SingleValueReadableStream(csv).pipeThrough(\n new TextEncoderStream(),\n ),\n };\n }),\n async ({ data, csv }) => {\n let i = 0;\n for await (const row of parseUint8ArrayStream(csv)) {\n expect(data[i++]).toStrictEqual(row);\n }\n },\n ),\n ))", "language": "typescript", "source_file": "./repos/kamiazya/web-csv-toolbox/src/parseUint8ArrayStream.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "kamiazya/web-csv-toolbox", "url": "https://github.com/kamiazya/web-csv-toolbox.git", "license": "MIT", "stars": 15, "forks": 4}, "metrics": null, "summary": "The function parses a CSV from a `Uint8Array` stream and verifies that the parsed rows match the expected data objects constructed from CSV inputs.", "mode": "fast-check"} {"id": 55195, "name": "unknown", "code": "it(\"should parse CSV string to record of arrays\", async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.gen().map((g) => {\n const header = g(FC.header, {\n fieldConstraints: {\n kindExcludes: [\"string16bits\"],\n },\n });\n const EOL = g(FC.eol);\n const csvData = g(FC.csvData, {\n fieldConstraints: {\n kindExcludes: [\"string16bits\"],\n },\n columnsConstraints: {\n minLength: header.length,\n maxLength: header.length,\n },\n });\n const EOF = g(fc.boolean);\n const csv = [\n header.map((v) => escapeField(v, { quote: true })).join(\",\"),\n ...csvData.map((row) =>\n row.map((v) => escapeField(v, { quote: true })).join(\",\"),\n ),\n ...(EOF ? [\"\"] : []),\n ].join(EOL);\n const data =\n csvData.length >= 1\n ? csvData.map((row) =>\n Object.fromEntries(row.map((v, i) => [header[i], v])),\n )\n : [];\n return { data, csv, header };\n }),\n async ({ data, csv }) => {\n let i = 0;\n const result = parseStringToArraySyncWASM(csv);\n expect(result.length).toEqual(data.length);\n for (const record of result) {\n expect(data[i++]).toEqual(record);\n }\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/kamiazya/web-csv-toolbox/src/parseStringToArraySyncWASM.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "kamiazya/web-csv-toolbox", "url": "https://github.com/kamiazya/web-csv-toolbox.git", "license": "MIT", "stars": 15, "forks": 4}, "metrics": null, "summary": "Parsing a CSV string into a record of arrays should match the expected data length and content.", "mode": "fast-check"} {"id": 55196, "name": "unknown", "code": "it(\"should parse CSV\", () =>\n fc.assert(\n fc.asyncProperty(\n fc.gen().map((g) => {\n const header = g(FC.header);\n const EOL = g(FC.eol);\n const csvData = g(FC.csvData, {\n columnsConstraints: {\n minLength: header.length,\n maxLength: header.length,\n },\n });\n const EOF = g(fc.boolean);\n const csv = [\n header.map((v) => escapeField(v, { quote: true })).join(\",\"),\n ...csvData.map((row) =>\n row.map((v) => escapeField(v, { quote: true })).join(\",\"),\n ),\n ...(EOF ? [\"\"] : []),\n ].join(EOL);\n const data =\n csvData.length >= 1\n ? csvData.map((row) =>\n Object.fromEntries(row.map((v, i) => [header[i], v])),\n )\n : [];\n return { data, csv: new SingleValueReadableStream(csv), header };\n }),\n async ({ data, csv }) => {\n let i = 0;\n for await (const row of parseStringStream(csv)) {\n expect(data[i++]).toEqual(row);\n }\n },\n ),\n ))", "language": "typescript", "source_file": "./repos/kamiazya/web-csv-toolbox/src/parseStringStream.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "kamiazya/web-csv-toolbox", "url": "https://github.com/kamiazya/web-csv-toolbox.git", "license": "MIT", "stars": 15, "forks": 4}, "metrics": null, "summary": "The `parseStringStream` function should correctly parse CSV data from a stream to match an expected data structure derived from the CSV's headers and content.", "mode": "fast-check"} {"id": 55197, "name": "unknown", "code": "it(\"should parse CSV\", () =>\n fc.assert(\n fc.asyncProperty(\n fc.gen().map((g) => {\n const header = g(FC.header);\n const EOL = g(FC.eol);\n const csvData = g(FC.csvData, {\n columnsConstraints: {\n minLength: header.length,\n maxLength: header.length,\n },\n });\n const EOF = g(fc.boolean);\n const csv = [\n header.map((v) => escapeField(v, { quote: true })).join(\",\"),\n ...csvData.map((row) =>\n row.map((v) => escapeField(v, { quote: true })).join(\",\"),\n ),\n ...(EOF ? [\"\"] : []),\n ].join(EOL);\n const data =\n csvData.length >= 1\n ? csvData.map((row) =>\n Object.fromEntries(row.map((v, i) => [header[i], v])),\n )\n : [];\n return { data, csv, header };\n }),\n async ({ data, csv }) => {\n let i = 0;\n for await (const record of parseString(csv)) {\n expect(data[i++]).toEqual(record);\n }\n },\n ),\n ))", "language": "typescript", "source_file": "./repos/kamiazya/web-csv-toolbox/src/parseString.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "kamiazya/web-csv-toolbox", "url": "https://github.com/kamiazya/web-csv-toolbox.git", "license": "MIT", "stars": 15, "forks": 4}, "metrics": null, "summary": "Parsing a CSV string with a specified header and data should produce records that match the expected data structure.", "mode": "fast-check"} {"id": 55198, "name": "unknown", "code": "it(\"should parse CSV\", () =>\n fc.assert(\n fc.asyncProperty(\n fc.gen().map((g) => {\n const header = g(FC.header);\n const EOL = g(FC.eol);\n const csvData = g(FC.csvData, {\n columnsConstraints: {\n minLength: header.length,\n maxLength: header.length,\n },\n });\n const EOF = g(fc.boolean);\n const csv = [\n header.map((v) => escapeField(v, { quote: true })).join(\",\"),\n ...csvData.map((row) =>\n row.map((v) => escapeField(v, { quote: true })).join(\",\"),\n ),\n ...(EOF ? [\"\"] : []),\n ].join(EOL);\n const data =\n csvData.length >= 1\n ? csvData.map((row) =>\n Object.fromEntries(row.map((v, i) => [header[i], v])),\n )\n : [];\n return { data, csv, header };\n }),\n async ({ data, csv }) => {\n let i = 0;\n for (const record of await parseString.toArray(csv)) {\n expect(data[i++]).toEqual(record);\n }\n },\n ),\n ))", "language": "typescript", "source_file": "./repos/kamiazya/web-csv-toolbox/src/parseString.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "kamiazya/web-csv-toolbox", "url": "https://github.com/kamiazya/web-csv-toolbox.git", "license": "MIT", "stars": 15, "forks": 4}, "metrics": null, "summary": "The CSV string generated from headers and data should be accurately parsed into equivalent record objects by `parseString`.", "mode": "fast-check"} {"id": 55202, "name": "unknown", "code": "it(\"should parse CSV\", () =>\n fc.assert(\n fc.asyncProperty(\n fc.gen().map((g) => {\n const header = g(FC.header, {\n // TextEncoderStream can't handle utf-16 string.\n fieldConstraints: {\n kindExcludes: [\"string16bits\"],\n },\n });\n const BOM = g(fc.boolean);\n if (BOM) {\n // Add BOM to the first field.\n header[0] = `\\ufeff${header[0]}`;\n }\n const EOL = g(FC.eol);\n const csvData = g(FC.csvData, {\n // TextEncoderStream can't handle utf-16 string.\n fieldConstraints: {\n kindExcludes: [\"string16bits\"],\n },\n columnsConstraints: {\n minLength: header.length,\n maxLength: header.length,\n },\n });\n const EOF = g(fc.boolean);\n const csv = [\n header.map((v) => escapeField(v, { quote: true })).join(\",\"),\n ...csvData.map((row) =>\n row.map((v) => escapeField(v, { quote: true })).join(\",\"),\n ),\n ...(EOF ? [\"\"] : []),\n ].join(EOL);\n const data =\n csvData.length >= 1\n ? csvData.map((row) =>\n Object.fromEntries(row.map((v, i) => [header[i], v])),\n )\n : [];\n return {\n data,\n // csv:\n response: new Response(\n new SingleValueReadableStream(csv).pipeThrough(\n new TextEncoderStream(),\n ),\n {\n headers: {\n \"content-type\": \"text/csv\",\n },\n },\n ),\n };\n }),\n async ({ data, response }) => {\n let i = 0;\n for await (const row of parseResponse(response)) {\n expect(data[i++]).toStrictEqual(row);\n }\n },\n ),\n ))", "language": "typescript", "source_file": "./repos/kamiazya/web-csv-toolbox/src/parseResponse.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "kamiazya/web-csv-toolbox", "url": "https://github.com/kamiazya/web-csv-toolbox.git", "license": "MIT", "stars": 15, "forks": 4}, "metrics": null, "summary": "The parsed CSV from a streamed response should match the expected structured data.", "mode": "fast-check"} {"id": 55199, "name": "unknown", "code": "it(\"should parse CSV\", () =>\n fc.assert(\n fc.asyncProperty(\n fc.gen().map((g) => {\n const header = g(FC.header);\n const EOL = g(FC.eol);\n const csvData = g(FC.csvData, {\n columnsConstraints: {\n minLength: header.length,\n maxLength: header.length,\n },\n });\n const EOF = g(fc.boolean);\n const csv = [\n header.map((v) => escapeField(v, { quote: true })).join(\",\"),\n ...csvData.map((row) =>\n row.map((v) => escapeField(v, { quote: true })).join(\",\"),\n ),\n ...(EOF ? [\"\"] : []),\n ].join(EOL);\n const data =\n csvData.length >= 1\n ? csvData.map((row) =>\n Object.fromEntries(row.map((v, i) => [header[i], v])),\n )\n : [];\n return { data, csv, header };\n }),\n async ({ data, csv }) => {\n let i = 0;\n for (const record of parseString.toArraySync(csv)) {\n expect(data[i++]).toEqual(record);\n }\n },\n ),\n ))", "language": "typescript", "source_file": "./repos/kamiazya/web-csv-toolbox/src/parseString.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "kamiazya/web-csv-toolbox", "url": "https://github.com/kamiazya/web-csv-toolbox.git", "license": "MIT", "stars": 15, "forks": 4}, "metrics": null, "summary": "`parseString.toArraySync` processes a CSV string and produces records matching the expected data structure derived from CSV headers and content.", "mode": "fast-check"} {"id": 55200, "name": "unknown", "code": "it(\"should parse CSV\", () =>\n fc.assert(\n fc.asyncProperty(\n fc.gen().map((g) => {\n const header = g(FC.header);\n const EOL = g(FC.eol);\n const csvData = g(FC.csvData, {\n columnsConstraints: {\n minLength: header.length,\n maxLength: header.length,\n },\n });\n const EOF = g(fc.boolean);\n const csv = [\n header.map((v) => escapeField(v, { quote: true })).join(\",\"),\n ...csvData.map((row) =>\n row.map((v) => escapeField(v, { quote: true })).join(\",\"),\n ),\n ...(EOF ? [\"\"] : []),\n ].join(EOL);\n const data =\n csvData.length >= 1\n ? csvData.map((row) =>\n Object.fromEntries(row.map((v, i) => [header[i], v])),\n )\n : [];\n return { data, csv, header };\n }),\n async ({ data, csv }) => {\n let i = 0;\n for (const record of parseString.toIterableIterator(csv)) {\n expect(data[i++]).toEqual(record);\n }\n },\n ),\n ))", "language": "typescript", "source_file": "./repos/kamiazya/web-csv-toolbox/src/parseString.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "kamiazya/web-csv-toolbox", "url": "https://github.com/kamiazya/web-csv-toolbox.git", "license": "MIT", "stars": 15, "forks": 4}, "metrics": null, "summary": "Parsing a CSV string with headers should yield an iterable sequence of objects whose keys match the headers and values match the corresponding data entries.", "mode": "fast-check"} {"id": 55201, "name": "unknown", "code": "it(\"should parse CSV\", () =>\n fc.assert(\n fc.asyncProperty(\n fc.gen().map((g) => {\n const header = g(FC.header);\n const EOL = g(FC.eol);\n const csvData = g(FC.csvData, {\n columnsConstraints: {\n minLength: header.length,\n maxLength: header.length,\n },\n });\n const EOF = g(fc.boolean);\n const csv = [\n header.map((v) => escapeField(v, { quote: true })).join(\",\"),\n ...csvData.map((row) =>\n row.map((v) => escapeField(v, { quote: true })).join(\",\"),\n ),\n ...(EOF ? [\"\"] : []),\n ].join(EOL);\n const data =\n csvData.length >= 1\n ? csvData.map((row) =>\n Object.fromEntries(row.map((v, i) => [header[i], v])),\n )\n : [];\n return { data, csv, header };\n }),\n async ({ data, csv }) => {\n let i = 0;\n await parseString.toStream(csv).pipeTo(\n new WritableStream({\n write(record) {\n expect(record).toEqual(data[i++]);\n },\n }),\n );\n },\n ),\n ))", "language": "typescript", "source_file": "./repos/kamiazya/web-csv-toolbox/src/parseString.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "kamiazya/web-csv-toolbox", "url": "https://github.com/kamiazya/web-csv-toolbox.git", "license": "MIT", "stars": 15, "forks": 4}, "metrics": null, "summary": "Parsing a CSV string should correctly yield records that match the expected data structure based on provided headers and data content.", "mode": "fast-check"} {"id": 55204, "name": "unknown", "code": "it(\"should parse CSV\", () =>\n fc.assert(\n fc.asyncProperty(\n fc.gen().map((g) => {\n const header = g(FC.header, {\n // TextEncoderStream can't handle utf-16 string.\n fieldConstraints: {\n kindExcludes: [\"string16bits\"],\n },\n });\n const BOM = g(fc.boolean);\n if (BOM) {\n // Add BOM to the first field.\n header[0] = `\\ufeff${header[0]}`;\n }\n\n const EOL = g(FC.eol);\n const csvData = g(FC.csvData, {\n // TextEncoderStream can't handle utf-16 string.\n fieldConstraints: {\n kindExcludes: [\"string16bits\"],\n },\n columnsConstraints: {\n minLength: header.length,\n maxLength: header.length,\n },\n });\n const EOF = g(fc.boolean);\n const csv = [\n header.map((v) => escapeField(v, { quote: true })).join(\",\"),\n ...csvData.map((row) =>\n row.map((v) => escapeField(v, { quote: true })).join(\",\"),\n ),\n ...(EOF ? [\"\"] : []),\n ].join(EOL);\n const data =\n csvData.length >= 1\n ? csvData.map((row) =>\n Object.fromEntries(row.map((v, i) => [header[i], v])),\n )\n : [];\n return {\n data,\n csv: new TextEncoder().encode(csv),\n };\n }),\n async ({ data, csv }) => {\n let i = 0;\n for await (const row of parseBinary(csv)) {\n expect(data[i++]).toStrictEqual(row);\n }\n },\n ),\n ))", "language": "typescript", "source_file": "./repos/kamiazya/web-csv-toolbox/src/parseBinary.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "kamiazya/web-csv-toolbox", "url": "https://github.com/kamiazya/web-csv-toolbox.git", "license": "MIT", "stars": 15, "forks": 4}, "metrics": null, "summary": "Parsing a CSV with variable headers, BOM, EOL, and EOF configurations should correctly convert byte-encoded CSV data into its structured form, matching the expected data objects.", "mode": "fast-check"} {"id": 55207, "name": "unknown", "code": "it(\"should parse ArrayBuffered CSV\", () =>\n fc.assert(\n fc.asyncProperty(\n fc.gen().map((g) => {\n const header = g(FC.header, {\n fieldConstraints: {\n kindExcludes: [\"string16bits\"],\n },\n });\n const EOL = g(FC.eol);\n const EOF = g(fc.boolean);\n const csvData = [\n ...g(FC.csvData, {\n rowsConstraints: {\n minLength: 1,\n },\n columnsConstraints: {\n minLength: header.length,\n maxLength: header.length,\n },\n fieldConstraints: {\n kindExcludes: [\"string16bits\"],\n },\n }),\n // Last row is not empty for testing.\n g(FC.row, {\n fieldConstraints: {\n minLength: 1,\n kindExcludes: [\"string16bits\"],\n },\n columnsConstraints: {\n minLength: header.length,\n maxLength: header.length,\n },\n }),\n ];\n const csv = [\n header.map((v) => escapeField(v)).join(\",\"),\n EOL,\n ...csvData.flatMap((row, i) => [\n ...row.map((v) => escapeField(v)).join(\",\"),\n ...(EOF || csvData.length - 1 !== i ? [EOL] : []),\n ]),\n ].join(\"\");\n const data = csvData.map((row) =>\n Object.fromEntries(row.map((v, i) => [header[i], v])),\n );\n return {\n data,\n csv: new TextEncoder().encode(csv).buffer,\n };\n }),\n async ({ data, csv }) => {\n let i = 0;\n for await (const row of parse(csv)) {\n expect(row).toEqual(data[i++]);\n }\n },\n ),\n ))", "language": "typescript", "source_file": "./repos/kamiazya/web-csv-toolbox/src/parse.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "kamiazya/web-csv-toolbox", "url": "https://github.com/kamiazya/web-csv-toolbox.git", "license": "MIT", "stars": 15, "forks": 4}, "metrics": null, "summary": "`parse` correctly processes an `ArrayBuffer` representing a CSV, ensuring each parsed row matches the expected data.", "mode": "fast-check"} {"id": 55208, "name": "unknown", "code": "it(\"should parse StringReadableStream CSV\", () =>\n fc.assert(\n fc.asyncProperty(\n fc.gen().map((g) => {\n const header = g(FC.header);\n const EOL = g(FC.eol);\n const EOF = g(fc.boolean);\n const csvData = [\n ...g(FC.csvData, {\n rowsConstraints: {\n minLength: 1,\n },\n columnsConstraints: {\n minLength: header.length,\n maxLength: header.length,\n },\n }),\n // Last row is not empty for testing.\n g(FC.row, {\n fieldConstraints: {\n minLength: 1,\n },\n columnsConstraints: {\n minLength: header.length,\n maxLength: header.length,\n },\n }),\n ];\n const csv = [\n header.map((v) => escapeField(v)).join(\",\"),\n EOL,\n ...csvData.flatMap((row, i) => [\n ...row.map((v) => escapeField(v)).join(\",\"),\n ...(EOF || csvData.length - 1 !== i ? [EOL] : []),\n ]),\n ].join(\"\");\n const data = csvData.map((row) =>\n Object.fromEntries(row.map((v, i) => [header[i], v])),\n );\n return {\n data,\n csv: new SingleValueReadableStream(csv),\n };\n }),\n async ({ data, csv }) => {\n let i = 0;\n for await (const row of parse(csv)) {\n expect(row).toEqual(data[i++]);\n }\n },\n ),\n ))", "language": "typescript", "source_file": "./repos/kamiazya/web-csv-toolbox/src/parse.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "kamiazya/web-csv-toolbox", "url": "https://github.com/kamiazya/web-csv-toolbox.git", "license": "MIT", "stars": 15, "forks": 4}, "metrics": null, "summary": "Ensures that parsing a `StringReadableStream` of CSV data correctly reconstructs the original structured data, maintaining the association between headers and values across each row.", "mode": "fast-check"} {"id": 55209, "name": "unknown", "code": "it(\"should parse Uint8ArrayReadableStream CSV\", () =>\n fc.assert(\n fc.asyncProperty(\n fc.gen().map((g) => {\n const header = g(FC.header, {\n fieldConstraints: {\n kindExcludes: [\"string16bits\"],\n },\n });\n const EOL = g(FC.eol);\n const EOF = g(fc.boolean);\n const csvData = [\n ...g(FC.csvData, {\n rowsConstraints: {\n minLength: 1,\n },\n columnsConstraints: {\n minLength: header.length,\n maxLength: header.length,\n },\n fieldConstraints: {\n kindExcludes: [\"string16bits\"],\n },\n }),\n // Last row is not empty for testing.\n g(FC.row, {\n fieldConstraints: {\n minLength: 1,\n kindExcludes: [\"string16bits\"],\n },\n columnsConstraints: {\n minLength: header.length,\n maxLength: header.length,\n },\n }),\n ];\n const csv = [\n header.map((v) => escapeField(v)).join(\",\"),\n EOL,\n ...csvData.flatMap((row, i) => [\n ...row.map((v) => escapeField(v)).join(\",\"),\n ...(EOF || csvData.length - 1 !== i ? [EOL] : []),\n ]),\n ].join(\"\");\n const data = csvData.map((row) =>\n Object.fromEntries(row.map((v, i) => [header[i], v])),\n );\n return {\n data,\n csv: new SingleValueReadableStream(new TextEncoder().encode(csv)),\n };\n }),\n async ({ data, csv }) => {\n let i = 0;\n for await (const row of parse(csv)) {\n expect(row).toEqual(data[i++]);\n }\n },\n ),\n ))", "language": "typescript", "source_file": "./repos/kamiazya/web-csv-toolbox/src/parse.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "kamiazya/web-csv-toolbox", "url": "https://github.com/kamiazya/web-csv-toolbox.git", "license": "MIT", "stars": 15, "forks": 4}, "metrics": null, "summary": "The property ensures that parsing a `Uint8ArrayReadableStream` of CSV data correctly outputs rows matching the expected objects derived from the input data.", "mode": "fast-check"} {"id": 55212, "name": "unknown", "code": "it(\"should parse a CSV with headers by data\", () =>\n fc.assert(\n fc.asyncProperty(\n fc.gen().map((g) => {\n const header = g(FC.header);\n const rows = g(FC.csvData, {\n columnsConstraints: {\n minLength: header.length,\n maxLength: header.length,\n },\n });\n const tokens: Token[] = [\n // generate header tokens\n ...header.flatMap((field, i) => [\n { type: Field, value: field, location: LOCATION_SHAPE },\n i === header.length - 1\n ? {\n type: RecordDelimiter,\n value: \"\\n\",\n location: LOCATION_SHAPE,\n }\n : {\n type: FieldDelimiter,\n value: \",\",\n location: LOCATION_SHAPE,\n },\n ]),\n // generate rows tokens\n ...rows.flatMap((row) =>\n // generate row tokens\n row.flatMap((field, j) => [\n { type: Field, value: field, location: LOCATION_SHAPE },\n {\n type: FieldDelimiter,\n value: \",\",\n location: LOCATION_SHAPE,\n },\n // generate record delimiter token\n ...((j === row.length - 1\n ? [\n {\n type: RecordDelimiter,\n value: \"\\n\",\n },\n ]\n : []) as Token[]),\n ]),\n ),\n ];\n const expected = rows.map((row) =>\n Object.fromEntries(row.map((field, i) => [header[i], field])),\n );\n return { tokens, expected };\n }),\n async ({ tokens, expected }) => {\n const actual = await transform(new RecordAssemblerTransformer(), [\n tokens,\n ]);\n expect(actual).toEqual(expected);\n },\n ),\n ))", "language": "typescript", "source_file": "./repos/kamiazya/web-csv-toolbox/src/RecordAssemblerTransformer.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "kamiazya/web-csv-toolbox", "url": "https://github.com/kamiazya/web-csv-toolbox.git", "license": "MIT", "stars": 15, "forks": 4}, "metrics": null, "summary": "Parsing a CSV with headers involves generating tokens for headers and rows, processing these tokens using `RecordAssemblerTransformer`, and ensuring the output matches the expected header-to-data mapping.", "mode": "fast-check"} {"id": 55214, "name": "unknown", "code": "it(\"should separate fields by commas by default\", async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.gen().map((g) => {\n const row = g(FC.row);\n const quote = g(FC.quote);\n const chunks = autoChunk(\n g,\n row.map((v) => escapeField(v, { quote })).join(\",\"),\n );\n const expected = [\n ...row.flatMap((value, index) => [\n // If the field is empty or quote is true, add a field.\n ...(quote || value\n ? [{ type: Field, value, location: LOCATION_SHAPE }]\n : []),\n // If the field is not the last field, add a field delimiter.\n ...(index === row.length - 1\n ? []\n : [\n {\n type: FieldDelimiter,\n value: \",\",\n location: LOCATION_SHAPE,\n },\n ]),\n ]),\n ];\n return { row, chunks, expected };\n }),\n async ({ chunks, expected }) => {\n const lexer = new LexerTransformer();\n const actual = (await transform(lexer, chunks)).flat();\n expect(actual).toMatchObject(expected);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/kamiazya/web-csv-toolbox/src/LexerTransformer.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "kamiazya/web-csv-toolbox", "url": "https://github.com/kamiazya/web-csv-toolbox.git", "license": "MIT", "stars": 15, "forks": 4}, "metrics": null, "summary": "Fields should be separated by commas by default, with expected field types and delimiters matching the transformation result from `LexerTransformer`.", "mode": "fast-check"} {"id": 55215, "name": "unknown", "code": "it(\"should treat the field enclosures as double quotes by default\", async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.gen().map((g) => {\n const row = g(FC.row);\n const chunks = autoChunk(\n g,\n row.map((v) => escapeField(v, { quote: true })).join(\",\"),\n );\n const expected = [\n ...row.flatMap((value, index) => [\n { type: Field, value, location: LOCATION_SHAPE },\n ...(index === row.length - 1\n ? []\n : [\n {\n type: FieldDelimiter,\n value: \",\",\n location: LOCATION_SHAPE,\n },\n ]),\n ]),\n ];\n return { expected, chunks };\n }),\n async ({ expected, chunks }) => {\n const lexer = new LexerTransformer();\n const actual = (await transform(lexer, chunks)).flat();\n expect(actual).toMatchObject(expected);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/kamiazya/web-csv-toolbox/src/LexerTransformer.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "kamiazya/web-csv-toolbox", "url": "https://github.com/kamiazya/web-csv-toolbox.git", "license": "MIT", "stars": 15, "forks": 4}, "metrics": null, "summary": "The test checks that by default, `LexerTransformer` treats field enclosures as double quotes, ensuring that the transformed output matches the expected structure of fields and delimiters.", "mode": "fast-check"} {"id": 55216, "name": "unknown", "code": "it(\"should parse csv with user options\", async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.gen().map((g) => {\n const options = g(FC.commonOptions);\n const quote = g(FC.quote);\n const data = g(FC.csvData, {\n fieldConstraints: { minLength: 1 },\n rowsConstraints: { minLength: 1 },\n columnsConstraints: { minLength: 1 },\n });\n const eol = g(FC.eol);\n const EOF = g(fc.boolean);\n const csv =\n data\n .map((row) =>\n row\n .map((value) => escapeField(value, { quote, ...options }))\n .join(options.delimiter),\n )\n .join(eol) + (EOF ? eol : \"\");\n const chunks = autoChunk(g, csv);\n const expected = [\n ...data.flatMap((row, i) => [\n // If row is empty, add a record delimiter.\n ...row.flatMap((value, j) => [\n // If the field is empty or quote is true, add a field.\n ...(quote || value !== \"\" ? [{ type: Field, value }] : []),\n // If the field is not the last field, add a field delimiter.\n ...(row.length - 1 !== j\n ? [\n {\n type: FieldDelimiter,\n value: options.delimiter,\n location: LOCATION_SHAPE,\n },\n ]\n : []),\n ]),\n // If the field is the last field, add a record delimiter.\n ...(data.length - 1 !== i\n ? [\n {\n type: RecordDelimiter,\n value: eol,\n location: LOCATION_SHAPE,\n },\n ]\n : []),\n ]),\n ];\n return { options, chunks, expected };\n }),\n async ({ options, chunks, expected }) => {\n const lexer = new LexerTransformer(options);\n const actual = (await transform(lexer, chunks)).flat();\n expect(actual).toMatchObject(expected);\n },\n ),\n {\n examples: [\n [\n // only EOL is ignored\n {\n options: { delimiter: \",\", quotation: '\"' },\n chunks: [\"\\n\"],\n expected: [],\n },\n ],\n ],\n },\n );\n })", "language": "typescript", "source_file": "./repos/kamiazya/web-csv-toolbox/src/LexerTransformer.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "kamiazya/web-csv-toolbox", "url": "https://github.com/kamiazya/web-csv-toolbox.git", "license": "MIT", "stars": 15, "forks": 4}, "metrics": null, "summary": "Parsing CSV input according to user-defined options results in transformed output that matches the expected structured data representation, considering delimiters, quotations, and end-of-line characters.", "mode": "fast-check"} {"id": 55217, "name": "unknown", "code": "it(\"should lex with comma as a default field delimiter\", () => {\n fc.assert(\n fc.property(\n fc.gen().map((g) => {\n const row = g(FC.row);\n const csv = row.map((field) => escapeField(field)).join(\",\");\n const expected = [\n ...row.flatMap((field, i) => [\n // if field is empty, it should be ignored\n ...(field !== \"\"\n ? [{ type: Field, value: field, location: LOCATION_SHAPE }]\n : []),\n // if field is not last field, it should be followed by a field delimiter\n ...(row.length - 1 !== i\n ? [\n {\n type: FieldDelimiter,\n value: COMMA,\n location: LOCATION_SHAPE,\n },\n ]\n : []),\n ]),\n ];\n return { csv, expected };\n }),\n ({ csv, expected }) => {\n const lexer = new Lexer();\n const actual = [...lexer.lex(csv)];\n expect(actual).toMatchObject(expected);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/kamiazya/web-csv-toolbox/src/Lexer.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "kamiazya/web-csv-toolbox", "url": "https://github.com/kamiazya/web-csv-toolbox.git", "license": "MIT", "stars": 15, "forks": 4}, "metrics": null, "summary": "Lexing a CSV string with comma delimiters should produce expected tokens, ignoring empty fields and adding delimiters appropriately.", "mode": "fast-check"} {"id": 55218, "name": "unknown", "code": "it(\"should lex with double quote as a default field quotation\", () => {\n fc.assert(\n fc.property(\n fc.gen().map((g) => {\n const row = g(FC.row);\n const csv = row\n // field should be escaped with double quote\n .map((field) => escapeField(field, { quote: true, quotation: '\"' }))\n .join(\",\");\n const expected = [\n ...row.flatMap((field, i) => [\n // field should be escaped with double quote,\n // so empty field should be escaped with double quote\n { type: Field, value: field, location: LOCATION_SHAPE },\n // if field is not last field, it should be followed by a field delimiter\n ...(row.length - 1 !== i\n ? [\n {\n type: FieldDelimiter,\n value: COMMA,\n location: LOCATION_SHAPE,\n },\n ]\n : []),\n ]),\n ];\n return { csv, expected };\n }),\n ({ csv, expected }) => {\n const lexer = new Lexer();\n const actual = [...lexer.lex(csv)];\n expect(actual).toMatchObject(expected);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/kamiazya/web-csv-toolbox/src/Lexer.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "kamiazya/web-csv-toolbox", "url": "https://github.com/kamiazya/web-csv-toolbox.git", "license": "MIT", "stars": 15, "forks": 4}, "metrics": null, "summary": "Lexing a CSV string with fields quoted by double quotes should match an array of expected field and delimiter tokens.", "mode": "fast-check"} {"id": 55219, "name": "unknown", "code": "it(\"should lex with with user given delimiter\", () => {\n fc.assert(\n fc.property(\n fc.gen().map((g) => {\n const { delimiter } = g(FC.commonOptions, {\n quotation: DOUBLE_QUOTE,\n });\n\n const row = g(FC.row);\n const csv = row\n .map((field) => escapeField(field, { delimiter }))\n .join(delimiter);\n const expected = [\n ...row.flatMap((field, i) => [\n // if field is empty, it should be ignored\n ...(field !== \"\" || escapeField(field, { delimiter }) !== field\n ? [{ type: Field, value: field, location: LOCATION_SHAPE }]\n : []),\n // if field is not last field, it should be followed by a field delimiter\n ...(row.length - 1 !== i\n ? [\n {\n type: FieldDelimiter,\n value: delimiter,\n location: LOCATION_SHAPE,\n },\n ]\n : []),\n ]),\n ];\n return { delimiter, csv, expected };\n }),\n ({ delimiter, csv, expected }) => {\n const lexer = new Lexer({ delimiter });\n const actual = [...lexer.lex(csv)];\n expect(actual).toMatchObject(expected);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/kamiazya/web-csv-toolbox/src/Lexer.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "kamiazya/web-csv-toolbox", "url": "https://github.com/kamiazya/web-csv-toolbox.git", "license": "MIT", "stars": 15, "forks": 4}, "metrics": null, "summary": "Lexing with a user-defined delimiter should produce tokens, ignoring empty fields unless they are escaped, and include field delimiters for fields that are not the last in a row.", "mode": "fast-check"} {"id": 55220, "name": "unknown", "code": "it(\"should lex with with user given quotation\", () => {\n fc.assert(\n fc.property(\n fc.gen().map((g) => {\n const { quotation } = g(FC.commonOptions, { delimiter: COMMA });\n const row = g(FC.row);\n const csv = row\n .map((field) => escapeField(field, { quotation }))\n .join(\",\");\n const expected = [\n ...row.flatMap((field, i) => [\n // if field is empty, it should be ignored\n ...(field !== \"\"\n ? [{ type: Field, value: field, location: LOCATION_SHAPE }]\n : []),\n // if field is not last field, it should be followed by a field delimiter\n ...(row.length - 1 !== i\n ? [\n {\n type: FieldDelimiter,\n value: COMMA,\n location: LOCATION_SHAPE,\n },\n ]\n : []),\n ]),\n ];\n return { quotation, csv, expected };\n }),\n ({ quotation, csv, expected }) => {\n const lexer = new Lexer({ quotation });\n const actual = [...lexer.lex(csv)];\n expect(actual).toMatchObject(expected);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/kamiazya/web-csv-toolbox/src/Lexer.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "kamiazya/web-csv-toolbox", "url": "https://github.com/kamiazya/web-csv-toolbox.git", "license": "MIT", "stars": 15, "forks": 4}, "metrics": null, "summary": "The lexer processes CSV input with a specified quotation character and produces tokenized output that matches the expected field and delimiter structure, correctly handling empty fields.", "mode": "fast-check"} {"id": 55222, "name": "unknown", "code": "it(\"should detect record delimiter\", () => {\n fc.assert(\n fc.property(\n fc.gen().map((g) => {\n const options = g(FC.commonOptions);\n const eol = g(FC.eol);\n const data = g(FC.csvData, {\n fieldConstraints: { minLength: 1 },\n rowsConstraints: { minLength: 1 },\n columnsConstraints: { minLength: 1 },\n });\n const EOF = g(fc.boolean);\n const quote = g(FC.quote);\n const csv =\n data\n .map((row) =>\n row\n .map((field) => escapeField(field, { ...options, quote }))\n .join(options.delimiter),\n )\n .join(eol) + (EOF ? eol : \"\");\n const expected = [\n ...data.flatMap((row, i) => [\n ...row.flatMap((field, j) => [\n // if quote is false and field is empty, it should be ignored\n ...(quote || field !== \"\"\n ? [{ type: Field, value: field }]\n : []),\n // if field is not last field, it should be followed by a field delimiter\n ...(row.length - 1 !== j\n ? [\n {\n type: FieldDelimiter,\n value: options.delimiter,\n location: LOCATION_SHAPE,\n },\n ]\n : []),\n ]),\n // if row is not last row, it should be followed by a record delimiter.\n ...(data.length - 1 !== i\n ? [\n {\n type: RecordDelimiter,\n value: eol,\n location: LOCATION_SHAPE,\n },\n ]\n : []),\n ]),\n ];\n return { csv, data, options, expected };\n }),\n ({ options, csv, expected }) => {\n const lexer = new Lexer(options);\n const actual = [...lexer.lex(csv)];\n expect(actual).toMatchObject(expected);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/kamiazya/web-csv-toolbox/src/Lexer.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "kamiazya/web-csv-toolbox", "url": "https://github.com/kamiazya/web-csv-toolbox.git", "license": "MIT", "stars": 15, "forks": 4}, "metrics": null, "summary": "Lexer should correctly identify record delimiters in CSV data.", "mode": "fast-check"} {"id": 55223, "name": "unknown", "code": "it(\"it should be a same result when given one CSV at a time and when given chunked CSVs\", () => {\n fc.assert(\n fc.property(\n fc.gen().map((g) => {\n const options = g(FC.commonOptions);\n const eol = g(FC.eol);\n const data = g(FC.csvData);\n const EOF = g(fc.boolean);\n const quote = g(FC.quote);\n const csv =\n data\n .map((row) =>\n row\n .map((field) => escapeField(field, { ...options, quote }))\n .join(options.delimiter),\n )\n .join(eol) + (EOF ? eol : \"\");\n const chunks = autoChunk(g, csv);\n return {\n csv,\n chunks,\n options,\n };\n }),\n ({ options, csv, chunks }) => {\n // lexer1 is used to compare with lexer2\n const lexer1 = new Lexer(options);\n const expected = [...lexer1.lex(csv)];\n\n // lexer2 is used to lex chunked data\n const lexer2 = new Lexer(options);\n const actual = [\n // lex chunked data\n ...chunks.flatMap((chunk) => [...lexer2.lex(chunk, true)]),\n // flush lexer2\n ...lexer2.flush(),\n ];\n expect(actual).toMatchObject(expected);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/kamiazya/web-csv-toolbox/src/Lexer.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "kamiazya/web-csv-toolbox", "url": "https://github.com/kamiazya/web-csv-toolbox.git", "license": "MIT", "stars": 15, "forks": 4}, "metrics": null, "summary": "The lexer should produce the same result whether processing an entire CSV at once or processing it in chunks.", "mode": "fast-check"} {"id": 55224, "name": "unknown", "code": "it(\"should parse a CSV with headers by data\", () => {\n fc.assert(\n fc.asyncProperty(\n fc.gen().map((g) => {\n const EOL = g(FC.eol);\n const header = g(FC.header);\n const rows = g(FC.csvData, {\n columnsConstraints: {\n minLength: header.length,\n maxLength: header.length,\n },\n });\n const tokens = [\n // generate header tokens\n ...header.flatMap((field, i) => [\n { type: Field, value: field, location: LOCATION_SHAPE },\n i === header.length - 1\n ? {\n type: RecordDelimiter,\n value: EOL,\n location: LOCATION_SHAPE,\n }\n : {\n type: FieldDelimiter,\n value: \",\",\n location: LOCATION_SHAPE,\n },\n ]),\n // generate rows tokens\n ...rows.flatMap((row) =>\n // generate row tokens\n row.flatMap((field, j) => [\n { type: Field, value: field, location: LOCATION_SHAPE },\n { type: FieldDelimiter, value: \",\", location: LOCATION_SHAPE },\n // generate record delimiter token\n ...((j === row.length - 1\n ? [\n {\n type: RecordDelimiter,\n value: LF,\n },\n ]\n : []) as Token[]),\n ]),\n ),\n ];\n const expected = rows.map((row) =>\n Object.fromEntries(row.map((field, i) => [header[i], field])),\n );\n return { tokens, expected };\n }),\n async ({ tokens, expected }) => {\n const assembler = new RecordAssembler();\n const actual = [...assembler.assemble(tokens, true)];\n expect(actual).toEqual(expected);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/kamiazya/web-csv-toolbox/src/RecordAssembler.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "kamiazya/web-csv-toolbox", "url": "https://github.com/kamiazya/web-csv-toolbox.git", "license": "MIT", "stars": 15, "forks": 4}, "metrics": null, "summary": "Parsing a CSV with headers should produce data objects matching the expected structure based on the tokens generated from headers and data rows.", "mode": "fast-check"} {"id": 55236, "name": "unknown", "code": "test('Start of week is in the past', () => {\n fc.assert(\n fc.property(\n fcCalendarDate().filter(({ year }) => 1900 < year && year < 2100),\n (date) => {\n const startOfThisWeek = startOfWeek(date);\n expect(areInOrder(startOfThisWeek, date)).toBe(true);\n expect(\n numberOfDaysBetween({ start: startOfThisWeek, end: date }),\n ).toBeLessThan(7);\n expect(dayOfWeek(startOfThisWeek)).toBe('mon');\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/tskj/typescript-calendar-date/specs/index.tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tskj/typescript-calendar-date", "url": "https://github.com/tskj/typescript-calendar-date.git", "license": "MIT", "stars": 9, "forks": 0}, "metrics": null, "summary": "The start of the week for a given date should be prior to or the same as the date, within 7 days before it, and always be a Monday.", "mode": "fast-check"} {"id": 55225, "name": "unknown", "code": "it(\"should parse a CSV with headers by option\", () => {\n fc.assert(\n fc.asyncProperty(\n fc.gen().map((g) => {\n const header = g(FC.header);\n const rows = g(FC.csvData, {\n columnsConstraints: {\n minLength: header.length,\n maxLength: header.length,\n },\n });\n const tokens: Token[] = [\n ...rows.flatMap((row) =>\n row.flatMap((field, j) => [\n { type: Field, value: field, location: LOCATION_SHAPE },\n { type: FieldDelimiter, value: \",\", location: LOCATION_SHAPE },\n ...((j === row.length - 1\n ? [\n {\n type: RecordDelimiter,\n value: LF,\n },\n ]\n : []) as Token[]),\n ]),\n ),\n ];\n const expected = rows.map((row) =>\n Object.fromEntries(row.map((field, i) => [header[i], field])),\n );\n return { header, tokens, expected };\n }),\n async ({ header, tokens, expected }) => {\n const assembler = new RecordAssembler({ header });\n const actual = [...assembler.assemble(tokens, true)];\n expect(actual).toEqual(expected);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/kamiazya/web-csv-toolbox/src/RecordAssembler.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "kamiazya/web-csv-toolbox", "url": "https://github.com/kamiazya/web-csv-toolbox.git", "license": "MIT", "stars": 15, "forks": 4}, "metrics": null, "summary": "The test verifies that `RecordAssembler` correctly parses CSV data with headers into structured records when tokens are provided, ensuring the output matches the expected mapping of header to field.", "mode": "fast-check"} {"id": 55230, "name": "unknown", "code": "test('Number of days in month', () => {\n fc.assert(\n fc.property(fcCalendarDate(), (date) => {\n const startOfMonth: CalendarDate = { ...date, day: 1 };\n const endOfMonth: CalendarDate = {\n ...date,\n day: numberOfDaysInMonth(date),\n };\n const allDaysInMonth = periodOfDates(startOfMonth, endOfMonth);\n const numberOfDays =\n numberOfDaysBetween({\n start: startOfMonth,\n end: endOfMonth,\n }) + 1;\n expect(allDaysInMonth.length).toBe(numberOfDays);\n expect(numberOfDays).toBe(numberOfDaysInMonth(date));\n expect([28, 29, 30, 31]).toContain(numberOfDays);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/tskj/typescript-calendar-date/specs/index.tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tskj/typescript-calendar-date", "url": "https://github.com/tskj/typescript-calendar-date.git", "license": "MIT", "stars": 9, "forks": 0}, "metrics": null, "summary": "The test checks that the number of days calculated in a month corresponds to the days generated by `periodOfDates` and matches the expected values of 28, 29, 30, or 31.", "mode": "fast-check"} {"id": 55231, "name": "unknown", "code": "test('Are-in-order has positive diff', () => {\n fc.assert(\n fc.property(fcCalendarDate(), fcCalendarDate(), (a, b) => {\n const areOrdered = areInOrder(a, b);\n const diff = numberOfDaysBetween({ start: a, end: b });\n const negativeDiff = diff < 0;\n expect(!areOrdered).toBe(negativeDiff);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/tskj/typescript-calendar-date/specs/index.tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tskj/typescript-calendar-date", "url": "https://github.com/tskj/typescript-calendar-date.git", "license": "MIT", "stars": 9, "forks": 0}, "metrics": null, "summary": "Verifies that if two calendar dates are not in order, the difference in days between them is negative.", "mode": "fast-check"} {"id": 55232, "name": "unknown", "code": "test('Normalization works', () => {\n fc.assert(\n fc.property(\n fcCalendarDate(),\n fc.integer(-100 * 365, 100 * 365),\n (date, n) => {\n const otherDate = addDays(date, n);\n const sameOtherDate = addDays({ ...date, day: date.day + n }, 0);\n expect(otherDate).toEqual(sameOtherDate);\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/tskj/typescript-calendar-date/specs/index.tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tskj/typescript-calendar-date", "url": "https://github.com/tskj/typescript-calendar-date.git", "license": "MIT", "stars": 9, "forks": 0}, "metrics": null, "summary": "Adding `n` days to a calendar date should yield the same result whether using the `addDays` function directly or by altering the date's day field before applying `addDays` with zero additional days.", "mode": "fast-check"} {"id": 55234, "name": "unknown", "code": "test('Ordered dates', () => {\n fc.assert(\n fc.property(fc.array(fcCalendarDate()), (dates) => {\n const orderedDates = dates.sort((a, b) =>\n isDateBefore(a, b) ? -1 : datesEqual(a, b) ? 0 : 1,\n );\n expect(areInOrder(...orderedDates)).toBe(true);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/tskj/typescript-calendar-date/specs/index.tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tskj/typescript-calendar-date", "url": "https://github.com/tskj/typescript-calendar-date.git", "license": "MIT", "stars": 9, "forks": 0}, "metrics": null, "summary": "Dates sorted by `isDateBefore` and `datesEqual` should be in order as verified by `areInOrder`.", "mode": "fast-check"} {"id": 55237, "name": "unknown", "code": "test('Start of week is in the past for any start of week', () => {\n fc.assert(\n fc.property(\n fcCalendarDate().filter(({ year }) => 1900 < year && year < 2100),\n fcWeekDay(),\n (date, weekStart) => {\n const startOfThisWeek = startOfWeek(date, {\n firstDayOfWeek: weekStart,\n });\n expect(areInOrder(startOfThisWeek, date)).toBe(true);\n expect(\n numberOfDaysBetween({ start: startOfThisWeek, end: date }),\n ).toBeLessThan(7);\n expect(dayOfWeek(startOfThisWeek)).toBe(weekStart);\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/tskj/typescript-calendar-date/specs/index.tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tskj/typescript-calendar-date", "url": "https://github.com/tskj/typescript-calendar-date.git", "license": "MIT", "stars": 9, "forks": 0}, "metrics": null, "summary": "The start of the week for any given date and weekday must precede or coincide with the date, be less than 7 days apart, and match the specified weekday.", "mode": "fast-check"} {"id": 55247, "name": "unknown", "code": "test('Adding zero months', () => {\n fc.assert(\n fc.property(fcCalendarDate(), (date) => {\n const lastMonth = addMonths(date, 0);\n const lastDate = lastDateInMonth(lastMonth);\n const diffInDays = numberOfDaysBetween({ start: date, end: lastDate });\n\n if (datesEqual(date, lastDateInMonth(date))) {\n expect(diffInDays).toBe(0);\n } else {\n expect(diffInDays).toBeGreaterThan(0);\n }\n\n expect(diffInDays).toBeLessThan(31);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/tskj/typescript-calendar-date/specs/index.tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tskj/typescript-calendar-date", "url": "https://github.com/tskj/typescript-calendar-date.git", "license": "MIT", "stars": 9, "forks": 0}, "metrics": null, "summary": "Adding zero months to a date should result in a difference of fewer than 31 days, with a difference of 0 if the date is the last day of the month.", "mode": "fast-check"} {"id": 55238, "name": "unknown", "code": "test('Serialize and parse', () => {\n fc.assert(\n fc.property(fcCalendarDate(), (date) => {\n const serialized = serializeIso8601String(date);\n const parsed = parseIso8601String(serialized);\n expect(parsed).toEqual(date);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/tskj/typescript-calendar-date/specs/index.tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tskj/typescript-calendar-date", "url": "https://github.com/tskj/typescript-calendar-date.git", "license": "MIT", "stars": 9, "forks": 0}, "metrics": null, "summary": "Serialization of a date to an ISO 8601 string and its subsequent parsing result in the original date.", "mode": "fast-check"} {"id": 55240, "name": "unknown", "code": "test('Parse', () => {\n fc.assert(\n fc.property(\n fcYear(),\n fc.integer(0, 9),\n fc.integer(0, 9),\n fc.integer(0, 9),\n fc.integer(0, 9),\n (yearNumber, monthDigit_1, monthDigit_2, dayDigit_1, dayDigit_2) => {\n const mm = `${monthDigit_1}${monthDigit_2}`;\n const dd = `${dayDigit_1}${dayDigit_2}`;\n\n const yyyymmdd = `${yearNumber}-${mm}-${dd}`;\n const parse = () => parseIso8601String(yyyymmdd);\n\n if (yearNumber < 1000 || yearNumber > 9999) {\n // Won't be zero-padded\n expect(parse).toThrow();\n return;\n }\n\n const month = parseInt(mm, 10);\n const day = parseInt(dd, 10);\n\n if (month === 0 || day === 0 || month > 12 || day > 31) {\n expect(parse).toThrow();\n return;\n }\n\n if (day <= 28) {\n const calendarDate = {\n year: yearNumber,\n month: monthName(month),\n day,\n };\n expect(parseIso8601String(yyyymmdd)).toEqual(calendarDate);\n expect(parseIso8601String(yyyymmdd + 'T00:00Z')).toEqual(\n calendarDate,\n );\n }\n\n if (month < 10 || day < 10) {\n // One of these won't be zero padded, so we expect a failure\n const yyyymd = `${yearNumber}-${month}-${day}`;\n expect(() => parseIso8601String(yyyymd)).toThrow();\n }\n\n // Here we may or may not be legit, depending on the number of days in this month\n // so we test some gibberis for good measure\n expect(() => parseIso8601String('1' + yyyymmdd)).toThrow();\n expect(() =>\n parseIso8601String(yyyymmdd.split('').reverse().join()),\n ).toThrow();\n expect(() => parseIso8601String(yyyymmdd.replace('-', '/'))).toThrow();\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/tskj/typescript-calendar-date/specs/index.tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tskj/typescript-calendar-date", "url": "https://github.com/tskj/typescript-calendar-date.git", "license": "MIT", "stars": 9, "forks": 0}, "metrics": null, "summary": "Verifies `parseIso8601String` correctly parses strings in YYYY-MM-DD format for valid dates, throws for invalid month/day values, non-zero-padded numbers, malformed strings, or unsupported formats.", "mode": "fast-check"} {"id": 55246, "name": "unknown", "code": "test('Adding months', () => {\n fc.assert(\n fc.property(\n fcCalendarDate(),\n fc.integer(-50 * 12, 50 * 12),\n (date, months) => {\n const lastMonth = addMonths(date, months);\n const lastDate = lastDateInMonth(lastMonth);\n const diffInDays = numberOfDaysBetween({ start: date, end: lastDate });\n\n if (months !== 0) {\n expect(Math.sign(diffInDays)).toBe(Math.sign(months));\n }\n },\n ),\n );\n})", "language": "typescript", "source_file": "./repos/tskj/typescript-calendar-date/specs/index.tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tskj/typescript-calendar-date", "url": "https://github.com/tskj/typescript-calendar-date.git", "license": "MIT", "stars": 9, "forks": 0}, "metrics": null, "summary": "Adding or subtracting months from a date should result in a difference in days that matches the sign of the number of months added or subtracted.", "mode": "fast-check"} {"id": 55248, "name": "unknown", "code": "test('Convert from js Date object', () => {\n fc.assert(\n fc.property(fcCalendarDate(), (date) => {\n const { year, month, day } = date;\n const monthIndex = monthNumber(month) - 1;\n\n const jsDate = new Date(year, monthIndex, day);\n const newDate = calendarDateFromJsDateObject(jsDate);\n\n expect(date).toEqual(newDate);\n }),\n );\n})", "language": "typescript", "source_file": "./repos/tskj/typescript-calendar-date/specs/index.tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "tskj/typescript-calendar-date", "url": "https://github.com/tskj/typescript-calendar-date.git", "license": "MIT", "stars": 9, "forks": 0}, "metrics": null, "summary": "Converting a JavaScript `Date` object back into a calendar date should yield an equivalent `CalendarDate` object.", "mode": "fast-check"} {"id": 55251, "name": "unknown", "code": "test('Values correctly converted', () => {\n fc.assert(\n fc.property(propsDescArbitrary, (propsDesc) => {\n const SourceComponent = jest.fn()\n const propsDescPairs = Object.entries(propsDesc)\n const props = Object.fromEntries(propsDescPairs.map(([key, [source]]) => [key, source]))\n const converters = new Map(propsDescPairs.map(([key, [, target]]) => [key, jest.fn().mockReturnValue(target)]))\n const ProxiedComponent = makePropsValueProxy(SourceComponent, converters)\n\n ProxiedComponent(props)\n\n expect(SourceComponent.mock.calls.length).toBe(1)\n expect(SourceComponent.mock.calls[0]).toEqual([\n Object.fromEntries(propsDescPairs.map(([key, [, target]]) => [key, target])),\n ])\n ;[...converters.entries()].forEach(([key, converter]) => {\n expect(converter.mock.calls.length).toBe(1)\n expect(converter.mock.calls[0]).toEqual([props[key]])\n })\n })\n )\n})", "language": "typescript", "source_file": "./repos/best-doctor/ke/src/django-spa/cdk/compatibility/makePropsValueProxy.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "best-doctor/ke", "url": "https://github.com/best-doctor/ke.git", "license": "MIT", "stars": 17, "forks": 7}, "metrics": null, "summary": "`makePropsValueProxy` ensures that each property in `props` is correctly converted using provided converters, and the converted values are passed to the `SourceComponent`.", "mode": "fast-check"} {"id": 55252, "name": "unknown", "code": "test('Keys correctly mapped', () => {\n fc.assert(\n fc.property(propsDescArbitrary, (propsDesc) => {\n const SourceComponent = jest.fn()\n const propsDescPairs = Object.entries(propsDesc)\n const keysMap = new Map(propsDescPairs.map(([sourceKey, [targetKey]]) => [sourceKey, targetKey]))\n const props = Object.fromEntries(propsDescPairs.map(([, [targetKey, targetValue]]) => [targetKey, targetValue]))\n const ProxiedComponent = makePropsKeyProxy(SourceComponent, keysMap)\n\n ProxiedComponent(props)\n\n expect(SourceComponent.mock.calls.length).toBe(1)\n expect(SourceComponent.mock.calls[0]).toEqual([\n Object.fromEntries(propsDescPairs.map(([sourceKey, [, targetValue]]) => [sourceKey, targetValue])),\n ])\n })\n )\n})", "language": "typescript", "source_file": "./repos/best-doctor/ke/src/django-spa/cdk/compatibility/makePropsKeyProxy.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "best-doctor/ke", "url": "https://github.com/best-doctor/ke.git", "license": "MIT", "stars": 17, "forks": 7}, "metrics": null, "summary": "Verifies that `makePropsKeyProxy` correctly maps and calls `SourceComponent` with properties keyed by the original source keys using the provided keys map.", "mode": "fast-check"} {"id": 55253, "name": "unknown", "code": "test('Return component from rootHook', () => {\n fc.assert(\n fc.property(\n fc.dictionary(fc.string(), fc.anything()),\n fc.dictionary(fc.string(), fc.anything()),\n fc.nat({ max: 5 }),\n (value, componentProps, callCount) => {\n const componentSpy = jest.fn()\n const rootHookSpy = jest.fn().mockReturnValue([componentSpy, componentProps])\n\n const { result } = renderHook(() => useRecord(rootHookSpy, value, jest.fn()))\n const [component, props] = result.current\n\n for (let i = 0; i < callCount; i++) {\n component(props)\n }\n\n expect(componentSpy).toBeCalledTimes(callCount)\n expect(componentSpy.mock.calls).toEqual(Array(callCount).fill([componentProps]))\n }\n )\n )\n})", "language": "typescript", "source_file": "./repos/best-doctor/ke/src/django-spa/cdk/Forms/Fields/Record.hook.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "best-doctor/ke", "url": "https://github.com/best-doctor/ke.git", "license": "MIT", "stars": 17, "forks": 7}, "metrics": null, "summary": "`useRecord` hook, when invoked with a `rootHook` that returns a component and props, should return a component that is called the specified number of times with the correct props.", "mode": "fast-check"} {"id": 55254, "name": "unknown", "code": "test('By default all fields untouched, has not errors and not in validating', () => {\n fc.assert(\n fc.property(fc.dictionary(fc.string(), fc.anything()), (value) => {\n const rootHookSpy = jest.fn()\n\n renderHook(() => useRecord(rootHookSpy, value, jest.fn()))\n\n expect((rootHookSpy.mock.calls[0] as unknown[])[0]).toEqual(\n Object.fromEntries(\n Object.entries(value).map(([key, item]) => [\n key,\n {\n value: item,\n isTouched: false,\n relatedRef: null,\n },\n ])\n )\n )\n })\n )\n})", "language": "typescript", "source_file": "./repos/best-doctor/ke/src/django-spa/cdk/Forms/Fields/Record.hook.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "best-doctor/ke", "url": "https://github.com/best-doctor/ke.git", "license": "MIT", "stars": 17, "forks": 7}, "metrics": null, "summary": "All fields should be initially untouched, with no errors and not in the validation state when using `useRecord`.", "mode": "fast-check"} {"id": 55255, "name": "unknown", "code": "test('Passthroughs to recordHook same record for same value on rerender', () => {\n fc.assert(\n fc.property(fc.dictionary(fc.string(), fc.anything()), (value) => {\n const rootHookSpy = jest.fn()\n\n const { rerender } = renderHook(() => useRecord(rootHookSpy, value, jest.fn()))\n rerender()\n\n expect((rootHookSpy.mock.calls[0] as unknown[])[0]).toBe((rootHookSpy.mock.calls[1] as unknown[])[0])\n })\n )\n})", "language": "typescript", "source_file": "./repos/best-doctor/ke/src/django-spa/cdk/Forms/Fields/Record.hook.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "best-doctor/ke", "url": "https://github.com/best-doctor/ke.git", "license": "MIT", "stars": 17, "forks": 7}, "metrics": null, "summary": "`useRecord` ensures the same record is passed to `rootHookSpy` upon re-rendering with the same value.", "mode": "fast-check"} {"id": 55256, "name": "unknown", "code": "test('Return component from rootHook', () => {\n fc.assert(\n fc.property(\n fc.array(fc.anything()),\n fc.dictionary(fc.string(), fc.anything()),\n fc.nat({ max: 5 }),\n (value, componentProps, callCount) => {\n const componentSpy = jest.fn()\n const rootHookSpy = jest.fn().mockReturnValue([componentSpy, componentProps])\n\n const { result } = renderHook(() => useArray(rootHookSpy, value, jest.fn(), getKey))\n const [component, props] = result.current\n\n for (let i = 0; i < callCount; i++) {\n component(props)\n }\n\n expect(componentSpy).toBeCalledTimes(callCount)\n expect(componentSpy.mock.calls).toEqual(Array(callCount).fill([componentProps]))\n }\n )\n )\n})", "language": "typescript", "source_file": "./repos/best-doctor/ke/src/django-spa/cdk/Forms/Fields/Array.hook.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "best-doctor/ke", "url": "https://github.com/best-doctor/ke.git", "license": "MIT", "stars": 17, "forks": 7}, "metrics": null, "summary": "The property ensures that `useArray` returns a component and props from `rootHook`, and that the component, when invoked multiple times, calls the expected spy with the correct props for the specified number of calls.", "mode": "fast-check"} {"id": 55257, "name": "unknown", "code": "test('By default all fields untouched, has not errors and not in validating', () => {\n fc.assert(\n fc.property(fc.array(fc.anything()), (value) => {\n const rootHookSpy = jest.fn()\n\n renderHook(() => useArray(rootHookSpy, value, jest.fn(), getKey))\n\n expect((rootHookSpy.mock.calls[0] as unknown[])[0]).toEqual(\n value.map((item) => ({\n value: item,\n isTouched: false,\n relatedRef: null,\n }))\n )\n })\n )\n})", "language": "typescript", "source_file": "./repos/best-doctor/ke/src/django-spa/cdk/Forms/Fields/Array.hook.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "best-doctor/ke", "url": "https://github.com/best-doctor/ke.git", "license": "MIT", "stars": 17, "forks": 7}, "metrics": null, "summary": "All fields in the `useArray` hook are initially untouched, have no errors, and are not in a validating state.", "mode": "fast-check"} {"id": 55258, "name": "unknown", "code": "test('Passthroughs to recordHook same record for same value on rerender', () => {\n fc.assert(\n fc.property(fc.array(fc.anything()), (value) => {\n const rootHookSpy = jest.fn()\n\n const { rerender } = renderHook(() => useArray(rootHookSpy, value, jest.fn(), getKey))\n rerender()\n\n expect((rootHookSpy.mock.calls[0] as unknown[])[0]).toBe((rootHookSpy.mock.calls[1] as unknown[])[0])\n })\n )\n})", "language": "typescript", "source_file": "./repos/best-doctor/ke/src/django-spa/cdk/Forms/Fields/Array.hook.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "best-doctor/ke", "url": "https://github.com/best-doctor/ke.git", "license": "MIT", "stars": 17, "forks": 7}, "metrics": null, "summary": "The test verifies that the `useArray` hook triggers the `rootHookSpy` with the same record for the same value on rerender.", "mode": "fast-check"} {"id": 55259, "name": "unknown", "code": "test('Getter from context return correct value', () => {\n fc.assert(\n fc.property(recordArbitrary, (record) => {\n const { result } = renderHook(() => useRecordRoot(TestContext, record, jest.fn()))\n const getter = result.current[1].value[0]\n\n const gotValue = Object.fromEntries(Object.keys(record).map((key) => [key, getter(key)]))\n\n expect(gotValue).toEqual(record)\n })\n )\n})", "language": "typescript", "source_file": "./repos/best-doctor/ke/src/django-spa/cdk/ContextTree/RecordRoot.hook.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "best-doctor/ke", "url": "https://github.com/best-doctor/ke.git", "license": "MIT", "stars": 17, "forks": 7}, "metrics": null, "summary": "The getter function from the rendered hook should return values that reconstruct the original record when mapped over its keys.", "mode": "fast-check"} {"id": 55260, "name": "unknown", "code": "test('Getter from context throw error if key not exists in data', () => {\n fc.assert(\n fc.property(recordWithInvalidKeyArbitrary, ([record, invalidKey]) => {\n const { result } = renderHook(() => useRecordRoot(TestContext, record, jest.fn()))\n const getter = result.current[1].value[0]\n\n expect(() => getter(invalidKey)).toThrow(RangeError)\n })\n )\n})", "language": "typescript", "source_file": "./repos/best-doctor/ke/src/django-spa/cdk/ContextTree/RecordRoot.hook.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "best-doctor/ke", "url": "https://github.com/best-doctor/ke.git", "license": "MIT", "stars": 17, "forks": 7}, "metrics": null, "summary": "An error is thrown when attempting to retrieve a non-existent key using a getter from the context.", "mode": "fast-check"} {"id": 55261, "name": "unknown", "code": "test('Updater from context update correct value', () => {\n fc.assert(\n fc.property(recordWithNewValueArbitrary, ([record, value]) => {\n const onChangeSpy = jest.fn().mockImplementation((cb: (prev: Record) => void) => cb(record))\n const { result } = renderHook(() => useRecordRoot(TestContext, record, onChangeSpy))\n const updater = result.current[1].value[1]\n\n Object.keys(record).forEach((key) => {\n const keyUpdaterSpy = jest.fn().mockReturnValue(value)\n updater(key, keyUpdaterSpy)\n\n expect(keyUpdaterSpy.mock.calls[0][0]).toBe(record[key])\n expect(onChangeSpy).toHaveLastReturnedWith({ ...record, [key]: value })\n })\n })\n )\n})", "language": "typescript", "source_file": "./repos/best-doctor/ke/src/django-spa/cdk/ContextTree/RecordRoot.hook.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "best-doctor/ke", "url": "https://github.com/best-doctor/ke.git", "license": "MIT", "stars": 17, "forks": 7}, "metrics": null, "summary": "Updating context using `useRecordRoot` changes the specified key's value in the record and triggers the `onChange` callback with the updated record.", "mode": "fast-check"} {"id": 55262, "name": "unknown", "code": "test('Updater from context throw error if key not exists in data', () => {\n fc.assert(\n fc.property(recordWithInvalidKeyArbitrary, ([record, invalidKey]) => {\n const onChangeSpy = jest.fn().mockImplementation((cb: (prev: Record) => void) => cb(record))\n const { result } = renderHook(() => useRecordRoot(TestContext, record, onChangeSpy))\n const updater = result.current[1].value[1]\n\n expect(() => updater(invalidKey, () => undefined)).toThrow(RangeError)\n })\n )\n})", "language": "typescript", "source_file": "./repos/best-doctor/ke/src/django-spa/cdk/ContextTree/RecordRoot.hook.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "best-doctor/ke", "url": "https://github.com/best-doctor/ke.git", "license": "MIT", "stars": 17, "forks": 7}, "metrics": null, "summary": "Using an updater with a non-existing key in the context data should throw a `RangeError`.", "mode": "fast-check"} {"id": 55265, "name": "unknown", "code": "test('Updater try to set value from context by key', () => {\n fc.assert(\n fc.property(keyArbitrary, (key) => {\n const setterSpy = jest.fn()\n const { result } = renderHook(() => useLeaf(TestContext, key), {\n wrapper: ({ children }) => createElement(TestContext.Provider, { value: [jest.fn(), setterSpy] }, children),\n })\n\n const updateLeaf = result.current[1]\n const updater = (): void => undefined\n updateLeaf(updater)\n\n expect(setterSpy.mock.calls[0]).toEqual([key, updater])\n })\n )\n})", "language": "typescript", "source_file": "./repos/best-doctor/ke/src/django-spa/cdk/ContextTree/Leaf.hook.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "best-doctor/ke", "url": "https://github.com/best-doctor/ke.git", "license": "MIT", "stars": 17, "forks": 7}, "metrics": null, "summary": "`useLeaf` hook correctly calls the context setter function with a key and an updater function.", "mode": "fast-check"} {"id": 55266, "name": "unknown", "code": "test('Getter from context return correct value', () => {\n fc.assert(\n fc.property(arrayArbitrary, (array) => {\n const { result } = renderHook(() => useArrayRoot(TestContext, array, jest.fn(), getKeyIndex))\n const getter = result.current[1].value[0]\n\n const gotValue = array.map((_, index) => getter(index))\n\n expect(gotValue).toEqual(array)\n })\n )\n})", "language": "typescript", "source_file": "./repos/best-doctor/ke/src/django-spa/cdk/ContextTree/ArrayRoot.hook.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "best-doctor/ke", "url": "https://github.com/best-doctor/ke.git", "license": "MIT", "stars": 17, "forks": 7}, "metrics": null, "summary": "The getter function from `useArrayRoot` correctly retrieves values from an array based on index.", "mode": "fast-check"} {"id": 55267, "name": "unknown", "code": "test('Getter from context throw error if key not exists in data', () => {\n fc.assert(\n fc.property(arrayWithInvalidKeyArbitrary, ([array, invalidKey]) => {\n const { result } = renderHook(() => useArrayRoot(TestContext, array, jest.fn(), getKeyIndex))\n const getter = result.current[1].value[0]\n\n expect(() => getter(invalidKey)).toThrow(RangeError)\n })\n )\n})", "language": "typescript", "source_file": "./repos/best-doctor/ke/src/django-spa/cdk/ContextTree/ArrayRoot.hook.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "best-doctor/ke", "url": "https://github.com/best-doctor/ke.git", "license": "MIT", "stars": 17, "forks": 7}, "metrics": null, "summary": "Calling the getter from the context should throw a `RangeError` when a non-existent key is accessed in the data.", "mode": "fast-check"} {"id": 55268, "name": "unknown", "code": "test('Updater from context update correct value', () => {\n fc.assert(\n fc.property(arrayWithNewValueArbitrary, ([array, value]) => {\n const onChangeSpy = jest.fn().mockImplementation((cb: (prev: unknown[]) => void) => cb(array))\n const { result } = renderHook(() => useArrayRoot(TestContext, array, onChangeSpy, getKeyIndex))\n const updater = result.current[1].value[1]\n\n array.forEach((_, index) => {\n const keyUpdaterSpy = jest.fn().mockReturnValue(value)\n updater(index, keyUpdaterSpy)\n\n expect(keyUpdaterSpy.mock.calls[0][0]).toBe(array[index])\n const updated = [...array]\n updated[index] = value\n expect(onChangeSpy).toHaveLastReturnedWith(updated)\n })\n })\n )\n})", "language": "typescript", "source_file": "./repos/best-doctor/ke/src/django-spa/cdk/ContextTree/ArrayRoot.hook.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "best-doctor/ke", "url": "https://github.com/best-doctor/ke.git", "license": "MIT", "stars": 17, "forks": 7}, "metrics": null, "summary": "Updating a context with a new array value should result in the updated array being correctly modified and returned.", "mode": "fast-check"} {"id": 55270, "name": "unknown", "code": "test('onChange callback has called on set new value', () => {\n fc.assert(\n fc.property(arrayWithNewValueArbitrary, ([array, value]) => {\n const onChangeSpy = jest.fn()\n const { result } = renderHook(() => useArrayRoot(TestContext, array, onChangeSpy, getKeyIndex))\n const updater = result.current[1].value[1]\n\n array.forEach((_, key) => {\n updater(key, jest.fn().mockReturnValue(value))\n })\n\n expect(onChangeSpy.mock.calls.length).toBe(Object.keys(array).length)\n })\n )\n})", "language": "typescript", "source_file": "./repos/best-doctor/ke/src/django-spa/cdk/ContextTree/ArrayRoot.hook.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "best-doctor/ke", "url": "https://github.com/best-doctor/ke.git", "license": "MIT", "stars": 17, "forks": 7}, "metrics": null, "summary": "Updating an array element using `updater` should trigger the `onChange` callback for each element, resulting in `onChangeSpy` being called as many times as there are elements in the array.", "mode": "fast-check"} {"id": 55271, "name": "unknown", "code": "test('Return items same length as fields prop', () => {\n fc.assert(\n fc.property(fc.array(fieldArbitrary), (fields) => {\n const result = fieldsBuilder(jest.fn(), { fields })\n\n expect(result.length).toBe(fields.length)\n })\n )\n})", "language": "typescript", "source_file": "./repos/best-doctor/ke/src/django-spa/components/Forms/FieldsBuilder.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "best-doctor/ke", "url": "https://github.com/best-doctor/ke.git", "license": "MIT", "stars": 17, "forks": 7}, "metrics": null, "summary": "The output from `fieldsBuilder` should have the same length as the input `fields` array.", "mode": "fast-check"} {"id": 55272, "name": "unknown", "code": "test('Get exists string path from object return correct value', () => {\n fc.assert(\n fc.property(existsTupleArbitrary, ([obj, path, val]) => {\n expect(get(obj, path.join('.'))).toBe(val)\n })\n )\n})", "language": "typescript", "source_file": "./repos/best-doctor/ke/src/common/tests/get.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "best-doctor/ke", "url": "https://github.com/best-doctor/ke.git", "license": "MIT", "stars": 17, "forks": 7}, "metrics": null, "summary": "`get` retrieves the correct value from an object when provided with an existing string path.", "mode": "fast-check"} {"id": 55273, "name": "unknown", "code": "test('Get exists string array path from object return correct value', () => {\n fc.assert(\n fc.property(existsTupleArbitrary, ([obj, path, val]) => {\n expect(get(obj, path)).toBe(val)\n })\n )\n})", "language": "typescript", "source_file": "./repos/best-doctor/ke/src/common/tests/get.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "best-doctor/ke", "url": "https://github.com/best-doctor/ke.git", "license": "MIT", "stars": 17, "forks": 7}, "metrics": null, "summary": "`get` retrieves the correct value from an object using an existing string array path.", "mode": "fast-check"} {"id": 55274, "name": "unknown", "code": "test('Get not exists string path from object return undefined', () => {\n fc.assert(\n fc.property(notExistsTupleArbitrary, ([obj, path]) => {\n expect(get(obj, path.join('.'))).toBeUndefined()\n })\n )\n})", "language": "typescript", "source_file": "./repos/best-doctor/ke/src/common/tests/get.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "best-doctor/ke", "url": "https://github.com/best-doctor/ke.git", "license": "MIT", "stars": 17, "forks": 7}, "metrics": null, "summary": "Getting a non-existent string path from an object should return undefined.", "mode": "fast-check"} {"id": 55275, "name": "unknown", "code": "test('Get not exists string array path from object return undefined', () => {\n fc.assert(\n fc.property(notExistsTupleArbitrary, ([obj, path]) => {\n expect(get(obj, path)).toBeUndefined()\n })\n )\n})", "language": "typescript", "source_file": "./repos/best-doctor/ke/src/common/tests/get.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "best-doctor/ke", "url": "https://github.com/best-doctor/ke.git", "license": "MIT", "stars": 17, "forks": 7}, "metrics": null, "summary": "`get` returns `undefined` when accessing a non-existent array path in an object.", "mode": "fast-check"} {"id": 55276, "name": "unknown", "code": "it(\"Should sign and verify random messages\", () => {\n fc.assert(\n fc.property(\n fc.record({\n msg: fc.uint8Array({ size: \"large\" }),\n sk: fc.uint8Array({ minLength: 32, maxLength: 32 })\n }),\n ({ msg, sk }) => {\n const pk = getPublicKey(hex.encode(sk));\n const signature = sign(msg, sk);\n\n expect(verify(msg, signature, pk)).to.be.true;\n expect(verify_signature(Address.from_public_key(pk), msg, signature)).to.be.true;\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/fleet-sdk/fleet/packages/wallet/src/prover/proveDLogProtocol.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fleet-sdk/fleet", "url": "https://github.com/fleet-sdk/fleet.git", "license": "MIT", "stars": 37, "forks": 8}, "metrics": null, "summary": "Signing and verifying random messages with generated keys should be successful, ensuring both verification methods return true.", "mode": "fast-check"} {"id": 55277, "name": "unknown", "code": "test(\"SByte fuzzing\", () => {\n fc.assert(\n fc.property(fc.integer({ min: MIN_I8, max: MAX_I8 }), (val) => {\n const serialized = SByte(val).toHex();\n expect(serialized).to.be.equal(Value$.ofByte(val).toHex()); // ensure compatibility with sigmastate-js\n expect(SConstant.from(serialized).data).to.be.equal(val);\n })\n );\n })", "language": "typescript", "source_file": "./repos/fleet-sdk/fleet/packages/serializer/src/sigmaConstant.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fleet-sdk/fleet", "url": "https://github.com/fleet-sdk/fleet.git", "license": "MIT", "stars": 37, "forks": 8}, "metrics": null, "summary": "The test verifies that serializing an integer as an `SByte` to hexadecimal is consistent with `Value$.ofByte`, and that deserialization through `SConstant` retrieves the original integer.", "mode": "fast-check"} {"id": 55279, "name": "unknown", "code": "test(\"SInt fuzzing\", () => {\n fc.assert(\n fc.property(fc.integer({ min: MIN_I32, max: MAX_I32 }), (val) => {\n const serialized = SInt(val).toHex();\n expect(serialized).to.be.equal(Value$.ofInt(val).toHex()); // ensure compatibility with sigmastate-js\n expect(SConstant.from(serialized).data).to.be.equal(val);\n })\n );\n })", "language": "typescript", "source_file": "./repos/fleet-sdk/fleet/packages/serializer/src/sigmaConstant.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fleet-sdk/fleet", "url": "https://github.com/fleet-sdk/fleet.git", "license": "MIT", "stars": 37, "forks": 8}, "metrics": null, "summary": "Serializing and deserializing an integer within a defined range should yield consistent hexadecimal outputs and data values, ensuring compatibility with `sigmastate-js`.", "mode": "fast-check"} {"id": 55280, "name": "unknown", "code": "test(\"SLong fuzzing\", () => {\n fc.assert(\n fc.property(fc.bigInt({ min: MIN_I64, max: MAX_I64 }), (val) => {\n const serialized = SLong(val).toHex();\n expect(serialized).to.be.equal(Value$.ofLong(val).toHex()); // ensure compatibility with sigmastate-js\n expect(SConstant.from(serialized).data).to.be.equal(val);\n })\n );\n })", "language": "typescript", "source_file": "./repos/fleet-sdk/fleet/packages/serializer/src/sigmaConstant.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fleet-sdk/fleet", "url": "https://github.com/fleet-sdk/fleet.git", "license": "MIT", "stars": 37, "forks": 8}, "metrics": null, "summary": "`SLong` serialization of a `bigInt` within the range `MIN_I64` to `MAX_I64` should produce a hex string equivalent to `Value$.ofLong`, and `SConstant` should deserialize it back to the original value.", "mode": "fast-check"} {"id": 55281, "name": "unknown", "code": "test(\"SBigInt fuzzing\", () => {\n fc.assert(\n fc.property(fc.bigInt({ min: MIN_I256, max: MAX_I256 }), (val) => {\n const serialized = SBigInt(val).toHex();\n expect(serialized).to.be.equal(Value$.ofBigInt(val).toHex()); // ensure compatibility with sigmastate-js\n expect(SConstant.from(serialized).data).to.be.equal(val);\n })\n );\n })", "language": "typescript", "source_file": "./repos/fleet-sdk/fleet/packages/serializer/src/sigmaConstant.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fleet-sdk/fleet", "url": "https://github.com/fleet-sdk/fleet.git", "license": "MIT", "stars": 37, "forks": 8}, "metrics": null, "summary": "SBigInt serialization should produce a hexadecimal value that matches `Value$.ofBigInt` and deserializes back to the original bigint.", "mode": "fast-check"} {"id": 55283, "name": "unknown", "code": "test(\"Round-trip fuzzing\", () => {\n fc.assert(\n fc.property(fc.bigInt({ min: MIN_I64, max: MAX_I64 }), (n) => {\n expect(zigZag64.decode(zigZag64.encode(n))).to.be.equal(n);\n })\n );\n })", "language": "typescript", "source_file": "./repos/fleet-sdk/fleet/packages/serializer/src/coders/zigZag.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fleet-sdk/fleet", "url": "https://github.com/fleet-sdk/fleet.git", "license": "MIT", "stars": 37, "forks": 8}, "metrics": null, "summary": "Encoding and then decoding an integer using `zigZag64` should return the original integer within the specified range.", "mode": "fast-check"} {"id": 55290, "name": "unknown", "code": "bench(\"should add properties successfully\", async () => {\n expect(\n await overrideSvgAttributes(\"\", {\n height: null,\n width: null,\n \"aria-hidden\": true,\n \"aria-label\": null,\n viewBox: \"0 0 2712 894\",\n }),\n ).toBe('');\n\n await fc.assert(\n fc.asyncProperty(\n svgArbitrary,\n SVGAttributesArbitrary,\n fc.context(),\n async (svgSource, overrides, ctx) => {\n ctx.log(svgSource);\n const transformedSource = await overrideSvgAttributes(\n svgSource,\n overrides,\n );\n ctx.log(transformedSource);\n expect(transformedSource).toBeTruthy();\n // every truthy override should exist in the transformed source\n Object.entries(overrides)\n .filter(([, value]) => {\n ctx.log(`${value}, ${!!value}`);\n return !!value;\n })\n .forEach(([override]) => {\n expect(transformedSource).toContain(override);\n });\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/jasikpark/astro-svg-loader/src/components/Svg/overrideSvgAttributes.bench.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "jasikpark/astro-svg-loader", "url": "https://github.com/jasikpark/astro-svg-loader.git", "license": "MIT", "stars": 23, "forks": 5}, "metrics": null, "summary": "`overrideSvgAttributes` correctly adds only truthy attribute overrides to an SVG string.", "mode": "fast-check"} {"id": 55284, "name": "unknown", "code": "test(\"byte -> hex -> byte\", () => {\n fc.assert(\n fc.property(fc.uint8Array({ size: \"medium\" }), (bytes) => {\n expect(hex.decode(hex.encode(bytes))).to.be.deep.equal(bytes);\n })\n );\n })", "language": "typescript", "source_file": "./repos/fleet-sdk/fleet/packages/crypto/src/coders/hex.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fleet-sdk/fleet", "url": "https://github.com/fleet-sdk/fleet.git", "license": "MIT", "stars": 37, "forks": 8}, "metrics": null, "summary": "Encoding a byte array to hex and decoding it back should return the original byte array.", "mode": "fast-check"} {"id": 55285, "name": "unknown", "code": "test(\"hex -> byte -> hex\", () => {\n fc.assert(\n fc.property(paddedHexArb, (hexString) => {\n expect(hex.encode(hex.decode(hexString))).to.be.equal(hexString.toLowerCase());\n })\n );\n })", "language": "typescript", "source_file": "./repos/fleet-sdk/fleet/packages/crypto/src/coders/hex.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fleet-sdk/fleet", "url": "https://github.com/fleet-sdk/fleet.git", "license": "MIT", "stars": 37, "forks": 8}, "metrics": null, "summary": "Encoding and then decoding a hex string should return the original string in lowercase.", "mode": "fast-check"} {"id": 55286, "name": "unknown", "code": "it(\"Should encode/decode radom numbers\", () => {\n fc.assert(\n fc.property(fc.integer({ min: 0, max: 100000000 }), (n) => {\n expect(readVLQ(new SigmaByteReader(toVLQBytes(n)))).to.be.equal(n);\n })\n );\n })", "language": "typescript", "source_file": "./repos/fleet-sdk/fleet/packages/serializer/src/coders/vlq.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fleet-sdk/fleet", "url": "https://github.com/fleet-sdk/fleet.git", "license": "MIT", "stars": 37, "forks": 8}, "metrics": null, "summary": "Encoding and decoding a random integer using VLQ should return the original integer.", "mode": "fast-check"} {"id": 55287, "name": "unknown", "code": "it(\"Should encode/decode radom numbers\", () => {\n fc.assert(\n fc.property(fc.bigInt({ min: 0n, max: BigInt(Number.MAX_SAFE_INTEGER) }), (n) => {\n expect(readBigVLQ(new SigmaByteReader(toBigVLQBytes(n)))).to.be.equal(n);\n })\n );\n })", "language": "typescript", "source_file": "./repos/fleet-sdk/fleet/packages/serializer/src/coders/vlq.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "fleet-sdk/fleet", "url": "https://github.com/fleet-sdk/fleet.git", "license": "MIT", "stars": 37, "forks": 8}, "metrics": null, "summary": "Encoding and decoding random numbers should result in values matching the original input using `readBigVLQ` and `toBigVLQBytes`.", "mode": "fast-check"} {"id": 55288, "name": "unknown", "code": "it(\"should add properties successfully\", async () => {\n expect(\n await overrideSvgAttributes(\"\", {\n height: null,\n width: null,\n \"aria-hidden\": true,\n \"aria-label\": null,\n viewBox: \"0 0 2712 894\",\n }),\n ).toBe('');\n\n await fc.assert(\n fc.asyncProperty(\n svgArbitrary,\n SVGAttributesArbitrary,\n fc.context(),\n async (svgSource, overrides, ctx) => {\n ctx.log(svgSource);\n const transformedSource = await overrideSvgAttributes(\n svgSource,\n overrides,\n );\n ctx.log(transformedSource);\n expect(transformedSource).toBeTruthy();\n // every truthy override should exist in the transformed source\n Object.entries(overrides)\n .filter(([, value]) => {\n ctx.log(`${value}, ${!!value}`);\n return !!value;\n })\n .forEach(([override]) => {\n expect(transformedSource).toContain(override);\n });\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/jasikpark/astro-svg-loader/src/components/Svg/overrideSvgAttributes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "jasikpark/astro-svg-loader", "url": "https://github.com/jasikpark/astro-svg-loader.git", "license": "MIT", "stars": 23, "forks": 5}, "metrics": null, "summary": "The function `overrideSvgAttributes` should correctly add and retain truthy attributes within an SVG string when given attribute overrides.", "mode": "fast-check"} {"id": 55289, "name": "unknown", "code": "it(\"should never throw\", async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.string({ unit: \"grapheme-composite\" }),\n async (input) => {\n expect(await parse(input)).toBeTruthy();\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/jasikpark/astro-svg-loader/src/components/Svg/overrideSvgAttributes.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "jasikpark/astro-svg-loader", "url": "https://github.com/jasikpark/astro-svg-loader.git", "license": "MIT", "stars": 23, "forks": 5}, "metrics": null, "summary": "The function `parse` should always return a truthy value without throwing an error, regardless of the input string.", "mode": "fast-check"} {"id": 55293, "name": "unknown", "code": "test(\"all-ops\", (t) => {\n fc.assert(\n fc.property(\n fc.array(\n fc.nat().map((v) => v * 2 ** -32),\n { minLength: 10 }\n ),\n (values) => {\n const nbDel = Math.floor(values.length / 4)\n const nbSub = Math.floor(values.length / 4)\n\n const treeList = AvlList.empty()\n const expected: number[] = []\n\n values.forEach((randVal, i) => {\n const index = asU32Between(0, treeList.length + 1, randVal)\n const insVal = i\n treeList.insert(index, insVal)\n expected.splice(index, 0, insVal)\n })\n\n values.slice(0, nbDel).forEach((randVal) => {\n const index = asU32Between(0, treeList.length, randVal)\n treeList.delete(index)\n expected.splice(index, 1)\n })\n\n values.slice(0, nbSub).forEach((randVal, i) => {\n const index = asU32Between(0, treeList.length, randVal)\n const subVal = values.length + i\n treeList.replace(index, subVal)\n expected.splice(index, 1, subVal)\n })\n\n t.deepEqual(treeList.toArray(), expected)\n t.ok(\n isBalanced(\n (treeList as unknown as { root: AvlNode }).root\n )\n )\n }\n )\n )\n})", "language": "typescript", "source_file": "./repos/Conaclos/cow-list/src/avl/avl-list.spec.ts", "start_line": null, "end_line": null, "dependencies": ["isBalanced"], "repo": {"name": "Conaclos/cow-list", "url": "https://github.com/Conaclos/cow-list.git", "license": "Apache-2.0", "stars": 4, "forks": 1}, "metrics": null, "summary": "The operations on the AVL list (insertions, deletions, and replacements) should result in an array matching the expected sequence, and the resulting AVL tree must maintain its balanced property.", "mode": "fast-check"} {"id": 55295, "name": "unknown", "code": "it('can fill', () => {\n let g = new Goma1015()\n //check definition\n expect(g.fill).toBeDefined()\n expect(g.water).toBeDefined()\n\n //filling needs to be pot opened\n expect(() => g.fill(15)).toThrowError(/should be OPEN/)\n expect(g.water()).toBe(0)\n\n //negative water\n g.open()\n expect(() => g.fill(-1)).toThrowError(/can't be filled with negative number/)\n expect(g.water()).toBe(0)\n\n //if full can not be filled water anymore\n //fill water 1,000 ml\n g.fill(1000)\n expect(g.water()).toBe(1000)\n expect(() => g.fill(1)).toThrowError(/is full/)\n\n //property based testing for fill\n g = new Goma1015()\n g.open()\n g.plugIn()\n g.plugOff()\n let water = 0\n fc.assert(\n fc.property(fc.nat(1000), w => {\n // to be full\n if (water + w > 1000) {\n expect(() => g.fill(w)).toThrowError(/is full/)\n return\n }\n g.fill(w)\n water += w\n // confirm water volume\n expect(g.water()).toBe(water)\n }),\n )\n })", "language": "typescript", "source_file": "./repos/freddiefujiwara/goma-1015/__tests__/lib/index.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "freddiefujiwara/goma-1015", "url": "https://github.com/freddiefujiwara/goma-1015.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "The property's hold tests filling the `Goma1015` with water up to 1000 ml while ensuring overfilling results in an error.", "mode": "fast-check"} {"id": 55296, "name": "unknown", "code": "it('can dispense', () => {\n let g = new Goma1015()\n //check definition\n expect(g.dispense).toBeDefined()\n expect(g.plugIn).toBeDefined()\n expect(g.plugOff).toBeDefined()\n\n //deault plugOff\n expect(() => g.dispense(15)).toThrowError(/should be IDLE or KEEP/)\n //dispenseing needs to be pot closed\n g.open()\n g.plugIn()\n g.plugIn()\n expect(() => g.dispense(15)).toThrowError(/should be IDLE or KEEP/)\n g.close()\n\n //dispenseing needs to be pot plugged\n g.plugOff()\n g.plugOff()\n expect(() => g.dispense(15)).toThrowError(/should be IDLE or KEEP/)\n g.plugIn()\n\n //negative sec\n expect(() => g.dispense(-1)).toThrowError(/can't be dispensed with negative sec/)\n //can not dispense water anymore if empty\n expect(g.dispense(100)).toBe(0)\n\n //property based testing for dispense\n g = new Goma1015()\n //fill to full\n let water = 1000\n g.plugIn()\n g.open()\n g.fill(water)\n g.close()\n fc.assert(\n fc.property(fc.nat(10), fc.nat(1000), (s, w) => {\n water = g.water()\n // if it doens't have enough water to be IDLE\n if (water < 10) {\n expect(g.state()).toBe(State.ON_IDLE)\n //water is dispenseed 10 ml/sec\n //means - 10ml\n expect(g.dispense(1)).toBe(water)\n //refill\n g.open()\n g.fill(w)\n g.close()\n return\n }\n //it is active\n if (g.state() === State.ON_ACTIVE_BOIL) {\n //after 1 sec the temp should be 25 > and < 100\n advanceBy(1000)\n expect(g.temperature() > 25).toBe(true)\n expect(g.temperature() < 100).toBe(true)\n //temp should be 100 after 60000 sec passed\n advanceBy(59000)\n expect(g.temperature() == 100).toBe(true)\n //temp should be 100 after 60001 sec passed\n advanceBy(1)\n expect(g.temperature() == 100).toBe(true)\n }\n //it should be KEEP\n expect(g.state()).toBe(State.ON_ACTIVE_KEEP)\n if (s > 0) {\n expect(g.dispense(s)).not.toBe(0)\n }\n }),\n )\n //clear Date.now()\n clear()\n })", "language": "typescript", "source_file": "./repos/freddiefujiwara/goma-1015/__tests__/lib/index.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "freddiefujiwara/goma-1015", "url": "https://github.com/freddiefujiwara/goma-1015.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "The `Goma1015` can dispense water when certain conditions are met: the pot is closed, plugged in, and in the correct state. During property-based testing, it also verifies that water is dispensed based on available water and system state, and that temperature changes appropriately after specific time advances. Additionally, it validates that negative dispense times throw an error.", "mode": "fast-check"} {"id": 55299, "name": "unknown", "code": "it('calculates trivial results correctly', () => {\n fc.assert(\n fc.property(fc.integer({ min: 1, max: 1000000 }), (param) => {\n const result = binomialCoefficient(param, param);\n expect(result).toBe(1);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/Curlyfries13/dice-goblin/src/utils.fuzz.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Curlyfries13/dice-goblin", "url": "https://github.com/Curlyfries13/dice-goblin.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Calculating the binomial coefficient where both parameters are equal returns 1.", "mode": "fast-check"} {"id": 55300, "name": "unknown", "code": "it('calculates null result correctly', () => {\n fc.assert(\n fc.property(fc.integer({ min: 1, max: 1000000 }), (param) => {\n const result = binomialCoefficient(param, 0);\n expect(result).toBe(1);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/Curlyfries13/dice-goblin/src/utils.fuzz.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Curlyfries13/dice-goblin", "url": "https://github.com/Curlyfries13/dice-goblin.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Calculating the binomial coefficient with any positive integer and 0 should return 1.", "mode": "fast-check"} {"id": 55301, "name": "unknown", "code": "it('calculates unit result correctly', () => {\n fc.assert(\n fc.property(fc.integer({ min: 1, max: 1000000 }), (param) => {\n const result = binomialCoefficient(param, 1);\n expect(result).toBe(param);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/Curlyfries13/dice-goblin/src/utils.fuzz.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Curlyfries13/dice-goblin", "url": "https://github.com/Curlyfries13/dice-goblin.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`binomialCoefficient` with a second parameter of 1 should return the first parameter value.", "mode": "fast-check"} {"id": 55302, "name": "unknown", "code": "it('is symmetrical', () => {\n fc.assert(\n fc.property(\n fc.integer({ min: 3, max: 1000000 }),\n fc.integer({ min: 1, max: 500000 }),\n (distribution, offset) => {\n const mid = Math.ceil(distribution / 2);\n fc.pre(offset < mid);\n const a = binomialCoefficient(distribution, offset);\n const b = binomialCoefficient(distribution, distribution - offset);\n expect(a).toEqual(b);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/Curlyfries13/dice-goblin/src/utils.fuzz.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Curlyfries13/dice-goblin", "url": "https://github.com/Curlyfries13/dice-goblin.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The binomial coefficient for given values is symmetrical, meaning it should be equal whether computed with an offset or its complement.", "mode": "fast-check"} {"id": 55303, "name": "unknown", "code": "it('calculates dice average correctly', () => {\n fc.assert(\n fc.property(\n // sides\n fc.integer({ min: 1, max: 1000000 }),\n // count\n fc.integer({ min: 1, max: 1000000 }),\n (sides, count) => {\n const dice = new SimpleDiceGroup(sides, count);\n\n expect(dice.statProps.average).toBe((count * (sides + 1)) / 2);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/Curlyfries13/dice-goblin/src/SimpleDiceGroup.fuzz.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Curlyfries13/dice-goblin", "url": "https://github.com/Curlyfries13/dice-goblin.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The calculated average of a `SimpleDiceGroup` should equal \\((\\text{count} \\times (\\text{sides} + 1)) / 2\\).", "mode": "fast-check"} {"id": 55304, "name": "unknown", "code": "it('calculates dice minimum correctly', () => {\n fc.assert(\n fc.property(\n // count\n fc.integer({ min: 1, max: 1000000 }),\n // sides\n fc.integer({ min: 1, max: 1000000 }),\n (sides, count) => {\n const dice = new SimpleDiceGroup(sides, count);\n\n expect(dice.statProps.min).toBe(count);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/Curlyfries13/dice-goblin/src/SimpleDiceGroup.fuzz.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Curlyfries13/dice-goblin", "url": "https://github.com/Curlyfries13/dice-goblin.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`SimpleDiceGroup` calculates the minimum value as the count of dice.", "mode": "fast-check"} {"id": 55306, "name": "unknown", "code": "it('it parses modifiers correctly', () => {\n const modifiers = ['!', '!!', '!p', 'r', 'ro', 'd', 'k', 'dh', 'dl', 'kh', 'kl'];\n fc.assert(\n fc.property(\n fc.nat({ max: modifiers.length - 1 }),\n // number of dice\n fc.integer({ min: 1, max: 1000000 }),\n // number of sides\n fc.integer({ min: 1, max: 1000000 }),\n (index, count, sides) => {\n const parseText = `${count}d${sides}${modifiers[index]}`;\n const parseResult = parseDice(parseText);\n expect(isModifier(parseResult)).toBe(true);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/Curlyfries13/dice-goblin/src/ParserInterpreterIntegration.fuzz.ts", "start_line": null, "end_line": null, "dependencies": ["isModifier"], "repo": {"name": "Curlyfries13/dice-goblin", "url": "https://github.com/Curlyfries13/dice-goblin.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Ensures `parseDice` correctly identifies strings with any listed modifier as `Modifier` objects.", "mode": "fast-check"} {"id": 55307, "name": "unknown", "code": "it('it parses magnitude modifiers correctly', () => {\n const modifiers = ['d', 'k', 'dh', 'dl', 'kh', 'kl'];\n fc.assert(\n fc.property(\n fc\n .record({\n mod: fc.nat({ max: modifiers.length - 1 }),\n // number of dice\n count: fc.integer({ min: 1, max: 1000000 }),\n // number of sides\n sides: fc.integer({ min: 1, max: 1000000 }),\n magnitude: fc.integer({ min: 1, max: 1000000 }),\n })\n .filter(({ count, magnitude }) => count <= magnitude),\n ({ mod, count, sides, magnitude }) => {\n const parseText = `${count}d${sides}${modifiers[mod]}${magnitude}`;\n const parseResult = parseDice(parseText);\n expect(isModifier(parseResult)).toBe(true);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/Curlyfries13/dice-goblin/src/ParserInterpreterIntegration.fuzz.ts", "start_line": null, "end_line": null, "dependencies": ["isModifier"], "repo": {"name": "Curlyfries13/dice-goblin", "url": "https://github.com/Curlyfries13/dice-goblin.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Parsing a dice expression with magnitude modifiers results in `parseDice` returning an object identified as a `Modifier`.", "mode": "fast-check"} {"id": 55308, "name": "unknown", "code": "it('it parses target modifiers correctly', () => {\n const modifiers = ['!', '!!', '!p'];\n const comparison = ['', '<', '>', '<=', '>=', '='];\n fc.assert(\n fc.property(\n fc\n .record({\n mod: fc.nat({ max: modifiers.length - 1 }),\n comp: fc.nat({ max: comparison.length - 1 }),\n // number of dice\n count: fc.integer({ min: 1, max: 1000000 }),\n // number of sides\n sides: fc.integer({ min: 1, max: 1000000 }),\n target: fc.integer({ min: 1, max: 1000000 }),\n })\n .filter(({ sides, target }) => sides <= target),\n ({ mod, comp, count, sides, target }) => {\n const parseText = `${count}d${sides}${modifiers[mod]}${comparison[comp]}${target}`;\n const parseResult = parseDice(parseText);\n expect(isModifier(parseResult)).toBe(true);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/Curlyfries13/dice-goblin/src/ParserInterpreterIntegration.fuzz.ts", "start_line": null, "end_line": null, "dependencies": ["isModifier"], "repo": {"name": "Curlyfries13/dice-goblin", "url": "https://github.com/Curlyfries13/dice-goblin.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The property confirms that the `parseDice` function correctly parses dice notations with target modifiers, resulting in an output identified as a modifier.", "mode": "fast-check"} {"id": 55309, "name": "unknown", "code": "it('parses simple dice specs', () => {\n fc.assert(\n fc.property(\n // number of dice\n fc.integer({ min: 1, max: 1000000 }),\n // number of sides\n fc.integer({ min: 1, max: 1000000 }),\n (n, s) => {\n const parseText = `${n}d${s}`;\n const parseResult = parse(parseText);\n expect(parseResult.lexErrors).toHaveLength(0);\n expect(parseResult.parseErrors).toHaveLength(0);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/Curlyfries13/dice-goblin/src/Parser/Parser.fuzz.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Curlyfries13/dice-goblin", "url": "https://github.com/Curlyfries13/dice-goblin.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Parses simple dice specifications without lexical or parsing errors for input formats like 'NdS', where N and S are integers.", "mode": "fast-check"} {"id": 55319, "name": "unknown", "code": "it('calculates dice average correctly', () => {\n fc.assert(\n fc.property(\n // sides\n fc.integer({ min: 1, max: 1000000 }),\n // count\n fc.integer({ min: 1, max: 1000000 }),\n (sides, count) => {\n const sidesGen = new Constant(sides);\n const countGen = new Constant(count);\n const dice = new PolyDiceGroup(sidesGen, countGen);\n\n expect(dice.statProps.average).toBe(\n (countGen.statProps.max * (sidesGen.statProps.max + 1)) / 2,\n );\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/Curlyfries13/dice-goblin/src/PolyDiceGroup.fuzz.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Curlyfries13/dice-goblin", "url": "https://github.com/Curlyfries13/dice-goblin.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Calculates the average of dice rolls based on the number of sides and count, ensuring it matches the expected statistical formula.", "mode": "fast-check"} {"id": 55312, "name": "unknown", "code": "it('parses simple modifier expressions', () => {\n const modifiers = ['', '!', '!!', '!p', 'r', 'ro', 'd', 'k', 'dh', 'dl', 'kh', 'kl'];\n fc.assert(\n fc.property(\n fc.nat({ max: modifiers.length - 1 }),\n // number of dice\n fc.integer({ min: 1, max: 1000000 }),\n // number of sides\n fc.integer({ min: 1, max: 1000000 }),\n (index, count, sides) => {\n const parseText = `${count}d${sides}${modifiers[index]}`;\n const parseResult = parse(parseText);\n expect(parseResult.lexErrors).toHaveLength(0);\n expect(parseResult.parseErrors).toHaveLength(0);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/Curlyfries13/dice-goblin/src/Parser/Parser.fuzz.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Curlyfries13/dice-goblin", "url": "https://github.com/Curlyfries13/dice-goblin.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`parse` successfully parses expressions for dice rolls with various valid modifiers without producing lex or parse errors.", "mode": "fast-check"} {"id": 55313, "name": "unknown", "code": "it('parses magnitude modifiers with values', () => {\n const modifiers = ['d', 'k', 'dh', 'dl', 'kh', 'kl'];\n fc.assert(\n fc.property(\n fc\n .record({\n mod: fc.nat({ max: modifiers.length - 1 }),\n // number of dice\n count: fc.integer({ min: 1, max: 1000000 }),\n // number of sides\n sides: fc.integer({ min: 1, max: 1000000 }),\n magnitude: fc.integer({ min: 1, max: 1000000 }),\n })\n .filter(({ count, magnitude }) => count <= magnitude),\n ({ mod, count, sides, magnitude }) => {\n const parseText = `${count}d${sides}${modifiers[mod]}${magnitude}`;\n const parseResult = parse(parseText);\n expect(parseResult.lexErrors).toHaveLength(0);\n expect(parseResult.parseErrors).toHaveLength(0);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/Curlyfries13/dice-goblin/src/Parser/Parser.fuzz.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Curlyfries13/dice-goblin", "url": "https://github.com/Curlyfries13/dice-goblin.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Parses text input with magnitude modifiers and values without any lexical or parsing errors.", "mode": "fast-check"} {"id": 55314, "name": "unknown", "code": "it('parses target modifiers with values', () => {\n const modifiers = ['!', '!!', '!p'];\n const comparison = ['', '<', '>', '<=', '>=', '='];\n fc.assert(\n fc.property(\n fc\n .record({\n mod: fc.nat({ max: modifiers.length - 1 }),\n comp: fc.nat({ max: comparison.length - 1 }),\n // number of dice\n count: fc.integer({ min: 1, max: 1000000 }),\n // number of sides\n sides: fc.integer({ min: 1, max: 1000000 }),\n target: fc.integer({ min: 1, max: 1000000 }),\n })\n .filter(({ sides, target }) => sides <= target),\n ({ mod, comp, count, sides, target }) => {\n const parseText = `${count}d${sides}${modifiers[mod]}${comparison[comp]}${target}`;\n const parseResult = parse(parseText);\n expect(parseResult.lexErrors).toHaveLength(0);\n expect(parseResult.parseErrors).toHaveLength(0);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/Curlyfries13/dice-goblin/src/Parser/Parser.fuzz.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Curlyfries13/dice-goblin", "url": "https://github.com/Curlyfries13/dice-goblin.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Parses dice expressions with target modifiers and comparison values into valid, error-free parse results.", "mode": "fast-check"} {"id": 55315, "name": "unknown", "code": "it('Modifies the counts of the mod', () => {\n fc.assert(\n fc.property(\n // sides\n fc.integer({ min: 1, max: 1000000 }),\n // count & drop: these are dependent\n // we shouldn't be testing if we can drop more than the count - that should be an error\n fc\n .integer({ min: 1, max: 1000000 })\n .chain((count) => fc.tuple(fc.constant(count), fc.nat({ max: count }))),\n // drop mode\n fc.boolean(),\n (sides, countDrop, lowHigh) => {\n const sidesGen = new Constant(sides);\n const countGen = new Constant(countDrop[0]);\n const dropGen = new Constant(countDrop[1]);\n const baseDice = new PolyDiceGroup(sidesGen, countGen);\n const drop = new Drop(baseDice, dropGen, lowHigh ? KeepDropMode.Low : KeepDropMode.High);\n drop.rollGroup();\n expect(drop.currentCount).toBe(countGen.value() - dropGen.value());\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/Curlyfries13/dice-goblin/src/Modifiers/Drop.fuzz.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Curlyfries13/dice-goblin", "url": "https://github.com/Curlyfries13/dice-goblin.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The `Drop` modifier correctly adjusts the dice count by subtracting the specified drop amount from the original count.", "mode": "fast-check"} {"id": 55317, "name": "unknown", "code": "it('calculates the fudge dice average correctly', () => {\n fc.assert(\n fc.property(fc.integer({ min: 1, max: 1000000 }), (count) => {\n const dice = new FudgeDiceGroup(count);\n // interestingly, the average roll on any fudge die is 0\n expect(dice.statProps.average).toBe(0);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/Curlyfries13/dice-goblin/src/FudgeDice.fuzz.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Curlyfries13/dice-goblin", "url": "https://github.com/Curlyfries13/dice-goblin.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "The average roll of any `FudgeDiceGroup` should be 0, regardless of the number of dice.", "mode": "fast-check"} {"id": 55325, "name": "unknown", "code": "it('should throw an assertion error if the number of dimensions is less than 1, infinite, or NaN', () => {\n fc.assert(\n fc.property(invalidDimensions(), dimensions => {\n expect(() => nShell(dimensions)).toThrow()\n }),\n )\n })", "language": "typescript", "source_file": "./repos/resisttheurge/generative/src/lib/generators/n-shell.spec.ts", "start_line": null, "end_line": null, "dependencies": ["invalidDimensions"], "repo": {"name": "resisttheurge/generative", "url": "https://github.com/resisttheurge/generative.git", "license": "MIT", "stars": 3, "forks": 1}, "metrics": null, "summary": "An assertion error is thrown if `nShell` is called with a number of dimensions that is less than 1, infinite, or NaN.", "mode": "fast-check"} {"id": 55326, "name": "unknown", "code": "it('should throw an assertion error if the radius range is infinite, inverted (max <= min), or negative in polarity (max < 0)', () => {\n fc.assert(\n fc.property(\n validDimensions(),\n invalidRadiusRange(),\n (dimensions, radiusRange) => {\n expect(() => nShell(dimensions, radiusRange)).toThrow()\n },\n ),\n )\n })", "language": "typescript", "source_file": "./repos/resisttheurge/generative/src/lib/generators/n-shell.spec.ts", "start_line": null, "end_line": null, "dependencies": ["validDimensions", "invalidRadiusRange"], "repo": {"name": "resisttheurge/generative", "url": "https://github.com/resisttheurge/generative.git", "license": "MIT", "stars": 3, "forks": 1}, "metrics": null, "summary": "`nShell` throws an error if the radius range is infinite, inverted (max \u2264 min), or negative (max < 0).", "mode": "fast-check"} {"id": 55320, "name": "unknown", "code": "it('calculates dice minimum from constant generators correctly', () => {\n fc.assert(\n fc.property(\n // count\n fc.integer({ min: 1, max: 1000000 }),\n // sides\n fc.integer({ min: 1, max: 1000000 }),\n (sides, count) => {\n const sidesGen = new Constant(sides);\n const countGen = new Constant(count);\n const dice = new PolyDiceGroup(sidesGen, countGen);\n\n expect(dice.statProps.min).toBe(count);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/Curlyfries13/dice-goblin/src/PolyDiceGroup.fuzz.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Curlyfries13/dice-goblin", "url": "https://github.com/Curlyfries13/dice-goblin.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "Calculates the minimum value of a dice roll from constant generators to be equal to the count.", "mode": "fast-check"} {"id": 55321, "name": "unknown", "code": "it('calculates dice maximum correctly', () => {\n fc.assert(\n fc.property(\n // count\n fc.integer({ min: 1, max: 1000000 }),\n // sides\n fc.integer({ min: 1, max: 1000000 }),\n (sides, count) => {\n const sidesGen = new Constant(sides);\n const countGen = new Constant(count);\n const dice = new PolyDiceGroup(sidesGen, countGen);\n\n expect(dice.statProps.max).toBe(count * sides);\n },\n ),\n );\n })", "language": "typescript", "source_file": "./repos/Curlyfries13/dice-goblin/src/PolyDiceGroup.fuzz.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "Curlyfries13/dice-goblin", "url": "https://github.com/Curlyfries13/dice-goblin.git", "license": "MIT", "stars": 0, "forks": 0}, "metrics": null, "summary": "`PolyDiceGroup` calculates the maximum possible dice roll as the product of the number of sides and the count of dice.", "mode": "fast-check"} {"id": 55322, "name": "unknown", "code": "it(\"should behave the same way when setting values with indexes\", () => {\n fc.assert(\n fc.property(\n fc.array(fc.tuple(fc.integer({ max: 1000, min: -100 }), fc.float()), {\n maxLength: 100,\n }),\n (testData) => {\n let immList = Immutable.List();\n let list = List.empty();\n testData.forEach(([index, value]) => {\n immList = immList.set(index, value);\n list = list.set(index, value);\n });\n expect([...list]).toEqual(immList.toJS());\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/alexvictoor/ts-immutable/src/list.fc.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "alexvictoor/ts-immutable", "url": "https://github.com/alexvictoor/ts-immutable.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Setting values using indexes should produce identical results for both `Immutable.List` and `List.empty()`.", "mode": "fast-check"} {"id": 55324, "name": "unknown", "code": "it(\"should behave the same way when slicing\", () => {\n fc.assert(\n fc.property(\n fc.tuple(fc.array(fc.string(), { minLength: 320 }), fc.nat(), fc.nat())\n ,\n (testData) => {\n let immList = Immutable.List.of(...testData[0]).slice(testData[1], testData[1] + testData[2]);\n let list = List.of(...testData[0]).slice(testData[1], testData[1] + testData[2]);\n \n expect(list.toJS()).toEqual(immList.toJS());\n }\n )\n , { numRuns: 100 });\n })", "language": "typescript", "source_file": "./repos/alexvictoor/ts-immutable/src/list.fc.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "alexvictoor/ts-immutable", "url": "https://github.com/alexvictoor/ts-immutable.git", "license": "Apache-2.0", "stars": 0, "forks": 0}, "metrics": null, "summary": "Slicing should produce identical results for both `Immutable.List` and `List` when converting to JavaScript arrays.", "mode": "fast-check"} {"id": 55329, "name": "unknown", "code": "it('should be a Generator that returns an array of two numbers', () => {\n expect(boxMullerTransform).toBeInstanceOf(Generator)\n fc.assert(\n fc.property(\n prn(fc.oneof(jsf32(), mulberry32(), sfc32(), splitmix32())), // eslint-disable-line @typescript-eslint/no-explicit-any\n state => {\n const [nextState, nextValue] = boxMullerTransform.run(state)\n expect(nextState).not.toBe(state)\n expect(nextValue).toBeInstanceOf(Array)\n expect(nextValue.length).toBe(2)\n const [first, second] = nextValue\n expect(typeof first).toBe('number')\n expect(first).not.toBeNaN()\n expect(typeof second).toBe('number')\n expect(second).not.toBeNaN()\n },\n ),\n )\n })", "language": "typescript", "source_file": "./repos/resisttheurge/generative/src/lib/generators/gaussians.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "resisttheurge/generative", "url": "https://github.com/resisttheurge/generative.git", "license": "MIT", "stars": 3, "forks": 1}, "metrics": null, "summary": "`boxMullerTransform` is confirmed to be a `Generator` that, when executed, produces a new state and an array of two valid numbers.", "mode": "fast-check"} {"id": 55327, "name": "unknown", "code": "it('should generate points in the unit sphere if no radius range is specified', () => {\n fc.assert(\n fc.property(\n validDimensions(),\n prn(fc.oneof(jsf32(), mulberry32(), sfc32(), splitmix32())), // eslint-disable-line @typescript-eslint/no-explicit-any\n (dimensions, seed) => {\n const generator = nShell(dimensions)\n const [, vector] = generator.run(seed)\n expect(vector.length).toBe(Math.floor(dimensions))\n const m2 = magnitudeSquared(vector)\n expect(m2).toBeGreaterThanOrEqual(0)\n expect(m2).toBeLessThanOrEqual(1)\n },\n ),\n )\n })", "language": "typescript", "source_file": "./repos/resisttheurge/generative/src/lib/generators/n-shell.spec.ts", "start_line": null, "end_line": null, "dependencies": ["validDimensions"], "repo": {"name": "resisttheurge/generative", "url": "https://github.com/resisttheurge/generative.git", "license": "MIT", "stars": 3, "forks": 1}, "metrics": null, "summary": "Generated points should lie within the unit sphere when no radius range is specified, with vector length matching the floor of the specified dimensions and magnitude squared between 0 and 1.", "mode": "fast-check"} {"id": 55328, "name": "unknown", "code": "it('should generate points in the specified radius range', () => {\n fc.assert(\n fc.property(\n validDimensions(),\n validRadiusRange(),\n prn(fc.oneof(jsf32(), mulberry32(), sfc32(), splitmix32())), // eslint-disable-line @typescript-eslint/no-explicit-any\n (dimensions, radiusRange, seed) => {\n const { min = 0, max = 1 } = radiusRange\n const [min2, max2] = [min * min, max * max]\n const generator = nShell(dimensions, radiusRange)\n const [, vector] = generator.run(seed)\n expect(vector.length).toBe(Math.floor(dimensions))\n const mag2 = magnitudeSquared(vector)\n // fuzzy floating point operations mean that the magnitude may be slightly outside the expected range\n if (mag2 < min2) {\n // this is acceptable, but only if the magnitude is very close to the boundary\n expect(mag2).toBeCloseTo(min2)\n } else if (mag2 > max2) {\n expect(mag2).toBeCloseTo(max2)\n } else {\n expect(mag2).toBeGreaterThanOrEqual(min * min)\n expect(mag2).toBeLessThanOrEqual(max * max)\n }\n },\n ),\n )\n })", "language": "typescript", "source_file": "./repos/resisttheurge/generative/src/lib/generators/n-shell.spec.ts", "start_line": null, "end_line": null, "dependencies": ["validDimensions", "validRadiusRange"], "repo": {"name": "resisttheurge/generative", "url": "https://github.com/resisttheurge/generative.git", "license": "MIT", "stars": 3, "forks": 1}, "metrics": null, "summary": "The test ensures that the points generated by `nShell` have magnitudes within the specified squared radius range, allowing for slight floating point imprecision near the boundaries.", "mode": "fast-check"} {"id": 55330, "name": "unknown", "code": "it('should always return a generator of points which are always at least config.radius apart from one another', () => {\n fc.assert(\n fc.property(\n blueNoiseConfig(2),\n prn(fc.oneof(jsf32(), mulberry32(), sfc32(), splitmix32())), // eslint-disable-line @typescript-eslint/no-explicit-any\n (config, seed) => {\n const generator = blueNoise(config)\n const [, points] = generator.run(seed)\n for (let i = 0; i < points.length; i++) {\n for (let j = i + 1; j < points.length; j++) {\n const dist = distanceSquared(points[i], points[j])\n const radiusSquared = config.radius ** 2\n if (dist < radiusSquared) {\n expect(dist).toBeCloseTo(radiusSquared)\n } else {\n expect(dist).toBeGreaterThanOrEqual(radiusSquared)\n }\n }\n }\n },\n ),\n )\n })", "language": "typescript", "source_file": "./repos/resisttheurge/generative/src/lib/generators/blue-noise.spec.ts", "start_line": null, "end_line": null, "dependencies": ["blueNoiseConfig"], "repo": {"name": "resisttheurge/generative", "url": "https://github.com/resisttheurge/generative.git", "license": "MIT", "stars": 3, "forks": 1}, "metrics": null, "summary": "A generator produces points that are always at least `config.radius` apart in a two-dimensional space.", "mode": "fast-check"} {"id": 55331, "name": "unknown", "code": "it('should generate a valid list of variations', () => {\n fc.assert(\n fc.property(optionLists(), optionLists => {\n const varied = cartesianProduct(optionLists)\n expect(varied).toBeInstanceOf(Array)\n expect(varied.length).toBe(\n optionLists.reduce((acc, optionList) => acc * optionList.length, 1),\n )\n expect(\n varied.every(vector => vector.length === optionLists.length),\n ).toBe(true)\n optionLists.forEach((optionList, i) => {\n optionList.forEach(option => {\n expect(varied.some(vector => vector[i] === option)).toBeTruthy()\n })\n })\n }),\n )\n })", "language": "typescript", "source_file": "./repos/resisttheurge/generative/src/lib/data-structures/sized-tuples.spec.ts", "start_line": null, "end_line": null, "dependencies": ["optionLists"], "repo": {"name": "resisttheurge/generative", "url": "https://github.com/resisttheurge/generative.git", "license": "MIT", "stars": 3, "forks": 1}, "metrics": null, "summary": "`cartesianProduct` generates an array of variations with a length equal to the product of the lengths of the input arrays, ensuring each variation vector has the same length as the input arrays, and that every element from the input arrays appears in the corresponding position of some variation.", "mode": "fast-check"} {"id": 55332, "name": "unknown", "code": "it('should be able to rebuild before given only the diff', () => {\n fc.assert(\n fc.property(diffArb, (diff) => {\n // Arrange\n const before = beforeFromDiff(diff);\n const after = afterFromDiff(diff);\n\n // Act\n const computedDiff = textDiffer(before, after);\n\n // Assert\n expect(beforeFromDiff(computedDiff)).toEqual(before);\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/higher-level-algorithms/textDiffer.spec.ts", "start_line": null, "end_line": null, "dependencies": ["beforeFromDiff", "afterFromDiff"], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "Reconstructing the original sequence before changes using only the diff should produce a result that matches the initial 'before' sequence.", "mode": "fast-check"} {"id": 55334, "name": "unknown", "code": "it('should compute the diff having the maximal number of unchanged lines', () => {\n fc.assert(\n fc.property(diffArb, (diff) => {\n // Arrange\n const before = beforeFromDiff(diff);\n const after = afterFromDiff(diff);\n\n // Act\n const computedDiff = textDiffer(before, after);\n\n // Assert\n expect(countUnchangedLines(computedDiff)).toBeGreaterThanOrEqual(countUnchangedLines(diff));\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/higher-level-algorithms/textDiffer.spec.ts", "start_line": null, "end_line": null, "dependencies": ["beforeFromDiff", "afterFromDiff", "countUnchangedLines"], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "`textDiffer` should produce a diff with a number of unchanged lines that is greater than or equal to the original count from the given diff.", "mode": "fast-check"} {"id": 55335, "name": "unknown", "code": "it('should group selected tabs together', () => {\n fc.assert(\n fc.property(tabsWithSelectionArb, ({ tabs, selectedTabs, movePosition }) => {\n // Arrange / Act\n const newTabs = reorderTabs(tabs, selectedTabs, movePosition);\n\n // Assert\n const startMovedSelection = newTabs.indexOf(selectedTabs[0]);\n expect(newTabs.slice(startMovedSelection, startMovedSelection + selectedTabs.length)).toEqual(selectedTabs);\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/higher-level-algorithms/reorderTabs.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "Reordered tabs should contain the selected tabs grouped together at the specified position.", "mode": "fast-check"} {"id": 55339, "name": "unknown", "code": "it('should predict the right podium', () => {\n fc.assert(\n fc.property(tupleN(fc.nat(), 25), (speeds) => {\n // Arrange\n const compareParticipants = (pa: number, pb: number) => {\n if (speeds[pa] !== speeds[pb]) return speeds[pb] - speeds[pa];\n else return pa - pb;\n };\n const runRace = (...participants: RaceParticipants): RaceParticipants => {\n return participants.sort(compareParticipants);\n };\n\n // Act\n const podium = racePodium(runRace);\n\n // Assert\n const rankedParticipants = [...Array(25)].map((_, i) => i).sort(compareParticipants);\n const expectedPodium = rankedParticipants.slice(0, 3);\n expect(podium).toEqual(expectedPodium);\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/higher-level-algorithms/racePodium.spec.ts", "start_line": null, "end_line": null, "dependencies": ["tupleN"], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The function `racePodium` should return the top three participants with the highest speeds from an array of 25 participants sorted by their racing performance.", "mode": "fast-check"} {"id": 55343, "name": "unknown", "code": "it('should build an ordered path of tracks whenever a path from start to end exists', () => {\n fc.assert(\n fc.property(orientedGraphArbitrary, ({ knownPath, tracks, stations }) => {\n // Arrange\n const departure = knownPath[0];\n const destination = knownPath[knownPath.length - 1];\n\n // Act\n const shortestPath = metroRoute(departure, destination, stations, tracks);\n\n // Assert\n for (let index = 1; index < shortestPath.length; ++index) {\n expect(shortestPath[index].from).toBe(shortestPath[index - 1].to);\n }\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/higher-level-algorithms/metroRoute.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The test ensures that if a path from start to end exists in an oriented graph, the `metroRoute` function returns an ordered path of tracks.", "mode": "fast-check"} {"id": 55345, "name": "unknown", "code": "it('should be able to find a path shorther or equal to the one we come up with', () => {\n fc.assert(\n fc.property(orientedGraphArbitrary, ({ knownPath, knownPathTracks, tracks, stations }) => {\n // Arrange\n const departure = knownPath[0];\n const destination = knownPath[knownPath.length - 1];\n\n // Act\n const shortestPath = metroRoute(departure, destination, stations, tracks);\n\n // Assert\n const distanceKnownPath = knownPathTracks.reduce((acc, e) => acc + e.length, 0);\n const distanceShortestPath = shortestPath.reduce((acc, e) => acc + e.length, 0);\n expect(distanceShortestPath).toBeLessThanOrEqual(distanceKnownPath);\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/higher-level-algorithms/metroRoute.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The `metroRoute` function finds a path that is shorter or equal in length to a provided known path between two stations in an oriented graph.", "mode": "fast-check"} {"id": 55347, "name": "unknown", "code": "it('should keep all the tasks for the schedule plan', () => {\n fc.assert(\n fc.property(tasksArbitrary(), (tasks) => {\n // Arrange / Act\n const schedule = christmasFactorySchedule(tasks);\n\n // Assert\n expect(schedule).toHaveLength(tasks.length);\n expect(schedule.map((t) => t.taskId)).toContainAllValues(tasks.map((t) => t.taskId));\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/higher-level-algorithms/christmasFactorySchedule.spec.ts", "start_line": null, "end_line": null, "dependencies": ["tasksArbitrary"], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The test checks that the `christmasFactorySchedule` maintains all tasks in the schedule and ensures that the task IDs in the schedule match the original task set.", "mode": "fast-check"} {"id": 55348, "name": "unknown", "code": "it('should not extend or reduce the duration of tasks', () => {\n fc.assert(\n fc.property(tasksArbitrary(), (tasks) => {\n // Arrange / Act\n const schedule = christmasFactorySchedule(tasks);\n\n // Assert\n for (const scheduledTask of schedule) {\n const task = tasks.find((t) => t.taskId === scheduledTask.taskId);\n expect(scheduledTask.finish - scheduledTask.start).toBe(task.estimatedTime);\n }\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/higher-level-algorithms/christmasFactorySchedule.spec.ts", "start_line": null, "end_line": null, "dependencies": ["tasksArbitrary"], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The duration of tasks in the `christmasFactorySchedule` should match their estimated times from the input tasks.", "mode": "fast-check"} {"id": 55349, "name": "unknown", "code": "it('should not start any task before all its dependencies ended', () => {\n fc.assert(\n fc.property(tasksArbitrary(), (tasks) => {\n // Arrange / Act\n const schedule = christmasFactorySchedule(tasks);\n\n // Assert\n for (const scheduledTask of schedule) {\n const dependencies = tasks.find((t) => t.taskId === scheduledTask.taskId)!.dependsOnTasks;\n for (const depTaskId of dependencies) {\n const depScheduledTask = schedule.find((s) => s.taskId === depTaskId);\n expect(scheduledTask.start).toBeGreaterThanOrEqual(depScheduledTask.finish);\n }\n }\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/higher-level-algorithms/christmasFactorySchedule.spec.ts", "start_line": null, "end_line": null, "dependencies": ["tasksArbitrary"], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "Scheduled tasks should not start until all their dependencies have finished.", "mode": "fast-check"} {"id": 55350, "name": "unknown", "code": "it('should start tasks as soon as possible', () => {\n fc.assert(\n fc.property(tasksArbitrary(), (tasks) => {\n // Arrange / Act\n const schedule = christmasFactorySchedule(tasks);\n\n // Assert\n for (const scheduledTask of schedule) {\n const dependencies = tasks.find((t) => t.taskId === scheduledTask.taskId)!.dependsOnTasks;\n const finishTimeDependencies = dependencies.map((depTaskId) => {\n const depScheduledTask = schedule.find((s) => s.taskId === depTaskId);\n return depScheduledTask.finish;\n });\n const expectedStart = finishTimeDependencies.length !== 0 ? Math.max(...finishTimeDependencies) : 0;\n expect(scheduledTask.start).toBe(expectedStart);\n }\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/higher-level-algorithms/christmasFactorySchedule.spec.ts", "start_line": null, "end_line": null, "dependencies": ["tasksArbitrary"], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "Tasks are scheduled to start as soon as their dependencies are completed.", "mode": "fast-check"} {"id": 55351, "name": "unknown", "code": "it('should not detect any cycle in a non-looping linked list', () => {\n fc.assert(\n fc.property(\n fc.letrec((tie) => ({\n node: fc.record({\n value: fc.integer(),\n next: fc.option(tie('node') as fc.Arbitrary, { nil: undefined, depthFactor: 1 }),\n }),\n })).node,\n (linkedList) => {\n // Arrange / Act\n const cycleDetected = detectCycleInLinkedList(linkedList);\n\n // Assert\n expect(cycleDetected).toBe(false);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/012-detectCycleInLinkedList.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "In a non-looping linked list, `detectCycleInLinkedList` should return false.", "mode": "fast-check"} {"id": 55352, "name": "unknown", "code": "it('should detect a cycle in a looping linked list', () => {\n fc.assert(\n fc.property(fc.array(fc.integer(), { minLength: 1 }), (nodes) => {\n // Arrange\n const lastNode: LinkedList = { value: nodes[0], next: undefined };\n const linkedList = nodes.slice(1).reduce((acc, n) => ({ value: n, next: acc }), lastNode);\n lastNode.next = linkedList;\n\n // Act\n const cycleDetected = detectCycleInLinkedList(linkedList);\n\n // Assert\n expect(cycleDetected).toBe(true);\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/012-detectCycleInLinkedList.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "Detects a cycle in a linked list that loops back to form a circular structure.", "mode": "fast-check"} {"id": 55353, "name": "unknown", "code": "it('should compute the return the minimal number of changes to mutate before into after', () => {\n fc.assert(\n fc.property(changeArb, (changes) => {\n // Arrange\n const before = beforeFromChanges(changes);\n const after = afterFromChanges(changes);\n\n // Act\n const numChanges = minimalNumberOfChangesToBeOther(before, after);\n\n // Assert\n expect(numChanges).toBeLessThanOrEqual(countRequestedOperations(changes));\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/011-minimalNumberOfChangesToBeOther.spec.ts", "start_line": null, "end_line": null, "dependencies": ["beforeFromChanges", "afterFromChanges", "countRequestedOperations"], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The number of changes required to mutate a `before` string into an `after` string should be less than or equal to the number of requested operations in the provided changes.", "mode": "fast-check"} {"id": 55355, "name": "unknown", "code": "it('should be independent of the ordering of the arguments', () => {\n fc.assert(\n fc.property(changeArb, (changes) => {\n // Arrange\n const before = beforeFromChanges(changes);\n const after = afterFromChanges(changes);\n\n // Act\n const numChanges = minimalNumberOfChangesToBeOther(before, after);\n const numChangesReversed = minimalNumberOfChangesToBeOther(after, before);\n\n // Assert\n expect(numChangesReversed).toBe(numChanges);\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/011-minimalNumberOfChangesToBeOther.spec.ts", "start_line": null, "end_line": null, "dependencies": ["beforeFromChanges", "afterFromChanges"], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The test checks that the result of `minimalNumberOfChangesToBeOther` is the same regardless of the order of the arguments.", "mode": "fast-check"} {"id": 55357, "name": "unknown", "code": "it('should reject any expression not containing an even number of signs', () => {\n fc.assert(\n fc.property(\n fc.array(\n fc.tuple(fc.constantFrom('(', '[', '{', ')', ']', '}'), fc.constantFrom('(', '[', '{', ')', ']', '}'))\n ),\n fc.constantFrom('(', '[', '{', ')', ']', '}'),\n (evenNumParentheses, extraParenthesis) => {\n const invalidExpression = [...evenNumParentheses.flat(), extraParenthesis].join('');\n expect(validParentheses(invalidExpression)).toBe(false);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/009-validParentheses.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The property checks that any expression containing an odd number of parentheses or brackets is recognized as invalid by `validParentheses`.", "mode": "fast-check"} {"id": 55358, "name": "unknown", "code": "it('should reject any expression not having the same number of openings and closings', () => {\n fc.assert(\n fc.property(\n wellParenthesedStringArbitrary,\n fc.constantFrom('(', '[', '{', ')', ']', '}'),\n fc.nat().noShrink(),\n (expression, extra, seed) => {\n const position = seed % (expression.length + 1);\n const invalidExpression = expression.substring(0, position) + extra + expression.substring(position);\n expect(validParentheses(invalidExpression)).toBe(false);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/009-validParentheses.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "Expressions with mismatched numbers of opening and closing parentheses should be invalid according to `validParentheses`.", "mode": "fast-check"} {"id": 55359, "name": "unknown", "code": "it('should reject any expression with at least one reversed openings and closings', () => {\n fc.assert(\n fc.property(reversedParenthesedStringArbitrary, (expression) => {\n expect(validParentheses(expression)).toBe(false);\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/009-validParentheses.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "Expressions with at least one pair of reversed parentheses are rejected as invalid.", "mode": "fast-check"} {"id": 55360, "name": "unknown", "code": "it('should reject any expression with non-matching openings and closings', () => {\n fc.assert(\n fc.property(nonMatchingEndParenthesedStringArbitrary, (expression) => {\n expect(validParentheses(expression)).toBe(false);\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/009-validParentheses.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "Expressions with non-matching opening and closing parentheses should return false when evaluated by `validParentheses`.", "mode": "fast-check"} {"id": 55361, "name": "unknown", "code": "it('should simplify any fraction to a fraction having the same result', () => {\n fc.assert(\n fc.property(\n fc.integer(),\n fc.integer().filter((n) => n !== 0),\n (numerator, denominator) => {\n const fSource = { numerator, denominator };\n const fOut = simplifyFraction(fSource);\n expect(fOut.numerator / fOut.denominator).toEqual(fSource.numerator / fSource.denominator);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/008-simplifyFraction.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The `simplifyFraction` function reduces a fraction to its simplest form while maintaining the same numerical value as the original fraction.", "mode": "fast-check"} {"id": 55362, "name": "unknown", "code": "it('should always return a simplified fraction having a positive denominator', () => {\n fc.assert(\n fc.property(\n fc.integer(),\n fc.integer().filter((n) => n !== 0),\n (numerator, denominator) => {\n const fSource = { numerator, denominator };\n const fOut = simplifyFraction(fSource);\n expect(fOut.denominator).toBeGreaterThan(0);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/008-simplifyFraction.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The function `simplifyFraction` returns a simplified fraction with a positive denominator.", "mode": "fast-check"} {"id": 55363, "name": "unknown", "code": "it('should only produce integer values for the numerator and denominator', () => {\n fc.assert(\n fc.property(\n fc.integer(),\n fc.integer().filter((n) => n !== 0),\n (numerator, denominator) => {\n const fSource = { numerator, denominator };\n const fOut = simplifyFraction(fSource);\n expect(fOut.numerator).toSatisfy(Number.isInteger);\n expect(fOut.denominator).toSatisfy(Number.isInteger);\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/008-simplifyFraction.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The `simplifyFraction` function should return a fraction where both the numerator and denominator are integers.", "mode": "fast-check"} {"id": 55364, "name": "unknown", "code": "it('should simplify fractions to simpler form whenever possible', () => {\n fc.assert(\n fc.property(\n fc.integer(),\n fc.integer().filter((n) => n !== 0),\n fc.integer({ min: 1 }),\n (smallNumerator, smallDenominator, factor) => {\n fc.pre(Math.abs(smallNumerator * factor) <= Number.MAX_SAFE_INTEGER);\n fc.pre(Math.abs(smallDenominator * factor) <= Number.MAX_SAFE_INTEGER);\n\n const fSource = { numerator: smallNumerator * factor, denominator: smallDenominator * factor };\n const fOut = simplifyFraction(fSource);\n\n expect(Math.abs(fOut.numerator)).toBeLessThanOrEqual(Math.abs(smallNumerator));\n expect(Math.abs(fOut.denominator)).toBeLessThanOrEqual(Math.abs(smallDenominator));\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/008-simplifyFraction.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The function `simplifyFraction` simplifies fractions so that the absolute values of the numerator and denominator do not exceed those of the original scaled values.", "mode": "fast-check"} {"id": 55367, "name": "unknown", "code": "it('should only print Fizz when divisible by 3 but not by 5', () => {\n fc.assert(\n fc.property(\n fc.oneof(\n fc\n .nat()\n .map((n) => n * 5 + 1)\n .map((n) => n * 3),\n fc\n .nat()\n .map((n) => n * 5 + 2)\n .map((n) => n * 3),\n fc\n .nat()\n .map((n) => n * 5 + 3)\n .map((n) => n * 3),\n fc\n .nat()\n .map((n) => n * 5 + 4)\n .map((n) => n * 3)\n ),\n (n) => {\n expect(fizzbuzz(n)).toBe('Fizz');\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/007-fizzbuzz.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "`fizzbuzz` should return \"Fizz\" for numbers divisible by 3 but not by 5.", "mode": "fast-check"} {"id": 55368, "name": "unknown", "code": "it('should print Buzz whenever divisible by 5', () => {\n fc.assert(\n fc.property(\n fc.nat().map((n) => n * 5),\n (n) => {\n expect(fizzbuzz(n)).toContain('Buzz');\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/007-fizzbuzz.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "`fizzbuzz` includes 'Buzz' in its output for numbers divisible by 5.", "mode": "fast-check"} {"id": 55369, "name": "unknown", "code": "it('should not print Buzz when not divisible by 5', () => {\n fc.assert(\n fc.property(\n fc.oneof(\n fc.nat().map((n) => n * 5 + 1),\n fc.nat().map((n) => n * 5 + 2),\n fc.nat().map((n) => n * 5 + 3),\n fc.nat().map((n) => n * 5 + 4)\n ),\n (n) => {\n expect(fizzbuzz(n)).not.toContain('Buzz');\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/007-fizzbuzz.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "`fizzbuzz` output should not include 'Buzz' for numbers not divisible by 5.", "mode": "fast-check"} {"id": 55370, "name": "unknown", "code": "it('should only print Buzz when divisible by 5 but not by 3', () => {\n fc.assert(\n fc.property(\n fc.oneof(\n fc\n .nat()\n .map((n) => n * 3 + 1)\n .map((n) => n * 5),\n fc\n .nat()\n .map((n) => n * 3 + 2)\n .map((n) => n * 5)\n ),\n (n) => {\n expect(fizzbuzz(n)).toBe('Buzz');\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/007-fizzbuzz.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "`fizzbuzz` should return 'Buzz' for numbers divisible by 5 but not divisible by 3.", "mode": "fast-check"} {"id": 55371, "name": "unknown", "code": "it('should print Fizz Buzz whenever divisible by 3 and 5', () => {\n fc.assert(\n fc.property(\n fc\n .nat()\n .map((n) => n * 3)\n .map((n) => n * 5),\n (n) => {\n expect(fizzbuzz(n)).toBe('Fizz Buzz');\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/007-fizzbuzz.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "`fizzbuzz` returns \"Fizz Buzz\" for numbers divisible by both 3 and 5.", "mode": "fast-check"} {"id": 55372, "name": "unknown", "code": "it('should print the value itself when not divisible by 3 and not divisible by 5', () => {\n fc.assert(\n fc.property(\n fc.oneof(\n fc.nat().map((n) => n * 15 + 1),\n fc.nat().map((n) => n * 15 + 2),\n fc.nat().map((n) => n * 15 + 4), // +3 would be divisible by 3\n fc.nat().map((n) => n * 15 + 7), // +5 would be divisible by 5, +6 would be divisible by 3\n fc.nat().map((n) => n * 15 + 8), // +9 would be divisible by 3, +10 would be divisible by 5\n fc.nat().map((n) => n * 15 + 11),\n fc.nat().map((n) => n * 15 + 13), // +12 would be divisible by 3\n fc.nat().map((n) => n * 15 + 14)\n ),\n (n) => {\n expect(fizzbuzz(n)).toBe(String(n));\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/007-fizzbuzz.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The `fizzbuzz` function outputs the number itself when it is not divisible by 3 or 5.", "mode": "fast-check"} {"id": 55373, "name": "unknown", "code": "it('should produce an array such that the product equals the input', () => {\n fc.assert(\n fc.property(fc.nat(MAX_INPUT), (n) => {\n const factors = decomposeIntoPrimes(n);\n const productOfFactors = factors.reduce((a, b) => a * b, 1);\n return productOfFactors === n;\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/006-decomposeIntoPrimes.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The output array from `decomposeIntoPrimes` should multiply to the input number.", "mode": "fast-check"} {"id": 55375, "name": "unknown", "code": "it('should compute the same factors as to the concatenation of the one of a and b for a times b', () => {\n fc.assert(\n fc.property(fc.integer(2, MAX_INPUT), fc.integer(2, MAX_INPUT), (a, b) => {\n const factorsA = decomposeIntoPrimes(a);\n const factorsB = decomposeIntoPrimes(b);\n const factorsAB = decomposeIntoPrimes(a * b);\n const reorder = (arr: number[]) => [...arr].sort((a, b) => a - b);\n expect(reorder(factorsAB)).toEqual(reorder([...factorsA, ...factorsB]));\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/006-decomposeIntoPrimes.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The concatenated prime factors of integers `a` and `b` should match the prime factors of their product `a * b`, when both are ordered.", "mode": "fast-check"} {"id": 55376, "name": "unknown", "code": "it('should be equal to the sum of fibo(n-1) and fibo(n-2)', () => {\n fc.assert(\n fc.property(fc.integer(2, MaxN), (n) => {\n expect(fibonacci(n)).toBe(fibonacci(n - 1) + fibonacci(n - 2));\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/005-fibonacci.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The Fibonacci number at position `n` should equal the sum of Fibonacci numbers at positions `n-1` and `n-2`.", "mode": "fast-check"} {"id": 55377, "name": "unknown", "code": "it('should fulfill fibo(p)*fibo(q+1)+fibo(p-1)*fibo(q) = fibo(p+q)', () => {\n fc.assert(\n fc.property(fc.integer(1, MaxN), fc.integer(0, MaxN), (p, q) => {\n expect(fibonacci(p + q)).toBe(fibonacci(p) * fibonacci(q + 1) + fibonacci(p - 1) * fibonacci(q));\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/005-fibonacci.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "For any integers \\( p \\) and \\( q \\), the relation \\( \\text{fibonacci}(p) \\times \\text{fibonacci}(q+1) + \\text{fibonacci}(p-1) \\times \\text{fibonacci}(q) = \\text{fibonacci}(p+q) \\) holds.", "mode": "fast-check"} {"id": 55378, "name": "unknown", "code": "it('should fulfill fibo(2p-1) = fibo\u00b2(p-1)+fibo\u00b2(p)', () => {\n // Special case of the property above\n fc.assert(\n fc.property(fc.integer(1, MaxN), (p) => {\n expect(fibonacci(2 * p - 1)).toBe(fibonacci(p - 1) * fibonacci(p - 1) + fibonacci(p) * fibonacci(p));\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/005-fibonacci.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The Fibonacci sequence property where \\(\\text{fibo}(2p-1)\\) is equal to \\(\\text{fibo}(p-1)^2 + \\text{fibo}(p)^2\\) should hold for integers \\(p\\) within a specified range.", "mode": "fast-check"} {"id": 55379, "name": "unknown", "code": "it('should fulfill Catalan identity', () => {\n fc.assert(\n fc.property(fc.integer(0, MaxN), fc.integer(0, MaxN), (a, b) => {\n const [p, q] = a < b ? [b, a] : [a, b];\n const sign = (p - q) % 2 === 0 ? 1n : -1n; // (-1)^(p-q)\n expect(fibonacci(p) * fibonacci(p) - fibonacci(p - q) * fibonacci(p + q)).toBe(\n sign * fibonacci(q) * fibonacci(q)\n );\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/005-fibonacci.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The product identity of Fibonacci numbers should satisfy the Catalan identity for given integer inputs \\(a\\) and \\(b\\).", "mode": "fast-check"} {"id": 55380, "name": "unknown", "code": "it('should fulfill Cassini identity', () => {\n fc.assert(\n fc.property(fc.integer(1, MaxN), fc.integer(0, MaxN), (p) => {\n const sign = p % 2 === 0 ? 1n : -1n; // (-1)^p\n expect(fibonacci(p + 1) * fibonacci(p - 1) - fibonacci(p) * fibonacci(p)).toBe(sign);\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/005-fibonacci.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The Cassini identity should hold for Fibonacci numbers, verifying that the expression \\( F(p+1) \\times F(p-1) - F(p)^2 \\) equals \\((-1)^p\\).", "mode": "fast-check"} {"id": 55382, "name": "unknown", "code": "it('should fulfill gcd(fibo(a), fibo(b)) = fibo(gcd(a,b))', () => {\n fc.assert(\n fc.property(fc.integer(1, MaxN), fc.integer(1, MaxN), (a, b) => {\n const gcdAB = Number(gcd(BigInt(a), BigInt(b)));\n expect(gcd(fibonacci(a), fibonacci(b))).toBe(fibonacci(gcdAB));\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/005-fibonacci.spec.ts", "start_line": null, "end_line": null, "dependencies": ["gcd"], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The test ensures that the greatest common divisor of Fibonacci numbers `fibo(a)` and `fibo(b)` is equal to the Fibonacci number at the position of the greatest common divisor of `a` and `b`.", "mode": "fast-check"} {"id": 55385, "name": "unknown", "code": "it('should only return messages built from words coming from the set of words', () => {\n fc.assert(\n fc.property(\n fc.set(wordArb, { minLength: 1 }).chain((words) =>\n fc.record({\n words: fc.shuffledSubarray(words), // we potentially remove words from the dictionary to cover no match case\n originalMessage: fc.array(fc.constantFrom(...words)).map((items) => items.join(' ')),\n })\n ),\n ({ words, originalMessage }) => {\n const spacelessMessage = originalMessage.replace(/\\s/g, '');\n const combinations = respace(spacelessMessage, words);\n for (const combination of combinations) {\n if (combination.length !== 0) {\n expect(words).toIncludeAnyMembers(combination.split(' '));\n }\n }\n }\n )\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/003-respace.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "Returned messages from `respace` should be composed of words from the provided set.", "mode": "fast-check"} {"id": 55389, "name": "unknown", "code": "it('should have the same length as source', () => {\n fc.assert(\n fc.property(fc.array(fc.integer()), (data) => {\n expect(sorted(data)).toHaveLength(data.length);\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/001-sorted.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The `sorted` function retains the same length as the source array of integers.", "mode": "fast-check"} {"id": 55390, "name": "unknown", "code": "it('should have exactly the same number of occurences as source for each item', () => {\n fc.assert(\n fc.property(fc.array(fc.integer()), (data) => {\n const sortedData = sorted(data);\n expect(countEach(sortedData)).toEqual(countEach(data));\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/001-sorted.spec.ts", "start_line": null, "end_line": null, "dependencies": ["countEach"], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "Sorted arrays maintain the same number of occurrences for each item as the source array.", "mode": "fast-check"} {"id": 55391, "name": "unknown", "code": "it('should produce an ordered array', () => {\n fc.assert(\n fc.property(fc.array(fc.integer()), (data) => {\n const sortedData = sorted(data);\n for (let idx = 1; idx < sortedData.length; ++idx) {\n expect(sortedData[idx - 1]).toBeLessThanOrEqual(sortedData[idx]);\n }\n })\n );\n })", "language": "typescript", "source_file": "./repos/dubzzz/weekly-pbt/001-sorted.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/weekly-pbt", "url": "https://github.com/dubzzz/weekly-pbt.git", "license": "MIT", "stars": 2, "forks": 0}, "metrics": null, "summary": "The function `sorted` should produce an array where each element is less than or equal to the next.", "mode": "fast-check"} {"id": 55392, "name": "unknown", "code": "test(\"Repeat n times\", () => {\n fc.assert(\n fc.property(fc.nat({ max: 10 }), (n) => {\n const increment = (i: number) => i + 1;\n return repeat(n)(increment)(0) === n;\n }),\n );\n })", "language": "typescript", "source_file": "./repos/twofortyfive/utils/src/fp/repeat/index.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "twofortyfive/utils", "url": "https://github.com/twofortyfive/utils.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": "The `repeat` function applies the `increment` function `n` times starting from 0, resulting in the value `n`.", "mode": "fast-check"} {"id": 55393, "name": "unknown", "code": "test(\"n-length range\", () => {\n fc.assert(\n fc.property(fc.nat({ max: 100 }), (n) => {\n const suite = range(n);\n const reversedSuite = [...suite].reverse();\n return suite.reduce(sum, 0) + reversedSuite.reduce(sum, 0) === n * (n + 1);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/twofortyfive/utils/src/maths/range/index.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "twofortyfive/utils", "url": "https://github.com/twofortyfive/utils.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": "A range of length `n` has elements that, when summed with their reverse, equal `n * (n + 1)`.", "mode": "fast-check"} {"id": 55394, "name": "unknown", "code": "test(\"exact values\", () => {\n fc.assert(\n fc.property(fc.nat({ max: 100 }), (n) => {\n const suite = range(n);\n return range(n).every((i) => suite[i - 1] === i);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/twofortyfive/utils/src/maths/range/index.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "twofortyfive/utils", "url": "https://github.com/twofortyfive/utils.git", "license": "MIT", "stars": 0, "forks": 1}, "metrics": null, "summary": "The `range` function should generate an array where each element matches its 1-based index.", "mode": "fast-check"} {"id": 55398, "name": "unknown", "code": "it(\"migrates every key\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.dictionary(fc.string(), fc.array(fc.string(), { minLength: 1 })),\n\t\t\t\t\tx => {\n\t\t\t\t\t\tconst y = f(x)\n\t\t\t\t\t\treturn R.keys(x).every(z => y.has(z))\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/URLSearchParams.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` ensures that every key from a dictionary is present in the resulting `URLSearchParams`.", "mode": "fast-check"} {"id": 55400, "name": "unknown", "code": "it(\"migrates every key\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.tuple(fc.string(), fc.string())), xs => {\n\t\t\t\t\tconst y = f(xs)\n\t\t\t\t\treturn xs.map(T.fst).every(z => y.has(z))\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/URLSearchParams.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Every key from the input array of string tuples should exist in the results of function `f`.", "mode": "fast-check"} {"id": 55401, "name": "unknown", "code": "it(\"never throws\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.tuple(fc.string(), fc.string())), x => {\n\t\t\t\t\tf(x)\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/URLSearchParams.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` should handle arrays of string tuples without throwing an exception.", "mode": "fast-check"} {"id": 55402, "name": "unknown", "code": "it(\"is always retrievable\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string(), fc.string(), (k, v) =>\n\t\t\t\t\texpect(pipe(f(k)(v), lookupFirst(k))).toEqual(O.some(v)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/URLSearchParams.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Retrieving a value from a `URLSearchParams` with a given key should always return the expected value.", "mode": "fast-check"} {"id": 55403, "name": "unknown", "code": "it(\"never throws\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string(), fc.string(), (k, v) => {\n\t\t\t\t\tf(k)(v)\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/URLSearchParams.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` should not throw an exception when applied with any pair of strings as arguments.", "mode": "fast-check"} {"id": 55404, "name": "unknown", "code": "it(\"always increases the size of the dataset\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(arb, fc.string(), fc.string(), (xs, k, v) =>\n\t\t\t\t\texpect(toString(f(k)(v)(xs)).length).toBeGreaterThan(\n\t\t\t\t\t\ttoString(xs).length,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/URLSearchParams.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `toString(f(k)(v)(xs))` applied to a dataset always results in a longer string than the original dataset `toString(xs)`.", "mode": "fast-check"} {"id": 55405, "name": "unknown", "code": "it(\"never increases the size of the dataset\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(arb, fc.string(), (xs, k) =>\n\t\t\t\t\texpect(toString(f(k)(xs)).length).toBeLessThanOrEqual(\n\t\t\t\t\t\ttoString(xs).length,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/URLSearchParams.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f(k)` applied to `xs` should produce a result whose string representation is no longer than the original `xs`.", "mode": "fast-check"} {"id": 55406, "name": "unknown", "code": "it(\"returns all keys\", () => {\n\t\t\texpect(f(new URLSearchParams())).toEqual([])\n\t\t\texpect(f(new URLSearchParams(\"a=1&b=2&a=3\"))).toEqual([\"a\", \"b\", \"a\"])\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.string()), ks => {\n\t\t\t\t\tconst xs = pipe(ks, A.map(withSnd(\"foo\")))\n\n\t\t\t\t\texpect(f(new URLSearchParams(xs))).toEqual(ks)\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/URLSearchParams.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Extracts all keys from a `URLSearchParams` object, including duplicates.", "mode": "fast-check"} {"id": 55407, "name": "unknown", "code": "it(\"returns all values\", () => {\n\t\t\texpect(f(new URLSearchParams())).toEqual([])\n\t\t\texpect(f(new URLSearchParams(\"a=1&b=2&a=3\"))).toEqual([\"1\", \"2\", \"3\"])\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.string()), vs => {\n\t\t\t\t\tconst xs = pipe(vs, A.map(withFst(\"foo\")))\n\n\t\t\t\t\texpect(f(new URLSearchParams(xs))).toEqual(vs)\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/URLSearchParams.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function should return all values from a `URLSearchParams` object, maintaining the correct order and content.", "mode": "fast-check"} {"id": 55408, "name": "unknown", "code": "it(\"is equivalent to the size of the total number of potentially duplicative keys\", () => {\n\t\t\texpect(f(new URLSearchParams())).toBe(0)\n\t\t\texpect(f(new URLSearchParams(\"a=1&b=2&a=3\"))).toBe(3)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.string()), ks => {\n\t\t\t\t\tconst xs = pipe(ks, A.map(withSnd(\"foo\")))\n\t\t\t\t\tconst ys = new URLSearchParams(xs)\n\n\t\t\t\t\texpect(f(ys)).toEqual(A.size(ks))\n\t\t\t\t\texpect(f(ys)).toEqual(A.size(keys(ys)))\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/URLSearchParams.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` applied to a `URLSearchParams` object should return a value equivalent to the count of the total potentially duplicative keys.", "mode": "fast-check"} {"id": 55409, "name": "unknown", "code": "it(\"is infallible\", () => {\n\t\t\tfc.assert(fc.property(mapArb, xs => isURLSearchParams(f(xs))))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/URLSearchParams.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`isURLSearchParams` should always return true for the output of function `f` applied to `xs`.", "mode": "fast-check"} {"id": 55413, "name": "unknown", "code": "it(\"always keeps phony base\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.oneof(fc.string(), fc.webPath()), x =>\n\t\t\t\t\texpect((f(x) as unknown as URL).origin).toBe(phonyBase),\n\t\t\t\t),\n\t\t\t\t{ numRuns: 10000 },\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/URLPath.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Ensures that the `origin` of the URL resulting from function `f` is always `phonyBase`, regardless of the input string or web path.", "mode": "fast-check"} {"id": 55414, "name": "unknown", "code": "it(\"never throws\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string(), x => {\n\t\t\t\t\tf(x)\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/URLPath.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` should not throw an exception for any string input.", "mode": "fast-check"} {"id": 55416, "name": "unknown", "code": "it(\"setPathname =<< getPathname = setPathname (getPathname x) x = id\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string().map(fromPathname), x =>\n\t\t\t\t\texpect(pipe(getPathname, Fn.chain(setPathname), apply(x))).toEqual(x),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/URLPath.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Setting and then getting a pathname using `setPathname` and `getPathname` on a given value should return the original value, demonstrating identity.", "mode": "fast-check"} {"id": 55419, "name": "unknown", "code": "it(\"is the dual of toSnd\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(nonMaxNumber, n =>\n\t\t\t\t\texpect(g(n)).toEqual(pipe(n, toSnd(increment), swap)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Tuple.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Function `g` should produce the same result as applying `toSnd` with `increment` to a number, then swapping the tuple elements.", "mode": "fast-check"} {"id": 55426, "name": "unknown", "code": "it(\"maps both sides\", () => {\n\t\t\tconst g = O.some\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string(), fc.string(), (l, r) =>\n\t\t\t\t\texpect(f(g)([l, r])).toEqual([g(l), g(r)]),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Tuple.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` should map a given operation `g` to both elements of a tuple, resulting in a tuple where each element has `g` applied.", "mode": "fast-check"} {"id": 55441, "name": "unknown", "code": "it(\"does not modify the number at all\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.oneof(fc.integer(), fc.float({ noNaN: true })),\n\t\t\t\t\tn => n === Number(f(n)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Verifies that applying function `f` to a number returns the number unchanged.", "mode": "fast-check"} {"id": 55429, "name": "unknown", "code": "it(\"retracts succ\", () => {\n\t\t\t\tconst f = flow(E.pred, O.chain(E.succ), O.chain(E.pred))\n\t\t\t\tconst g = E.pred\n\n\t\t\t\tfc.assert(\n\t\t\t\t\tfc.property(fc.tuple(fc.boolean(), fc.boolean()), x =>\n\t\t\t\t\t\texpect(f(x)).toEqual(g(x)),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Tuple.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Verifies that applying the function `f`, which involves chaining `E.pred` and `E.succ` with `O.chain`, produces the same result as the function `g`, which directly applies `E.pred`, for any tuple of booleans.", "mode": "fast-check"} {"id": 55433, "name": "unknown", "code": "it(\"returns whole string for number that's too large\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.string(),\n\t\t\t\t\tfc.integer({ min: 0, max: Number.MAX_SAFE_INTEGER }),\n\t\t\t\t\t(x, n) => f(x.length + n)(x) === x,\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "When the integer input is larger than or equal to the string length, the function `f` should return the whole string unchanged.", "mode": "fast-check"} {"id": 55434, "name": "unknown", "code": "it(\"returns empty string for non-positive number\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.integer({ max: 0 }),\n\t\t\t\t\tfc.string(),\n\t\t\t\t\t(n, x) => f(n)(x) === \"\",\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Function `f` returns an empty string when given a non-positive integer and any string.", "mode": "fast-check"} {"id": 55436, "name": "unknown", "code": "it(\"does not throw with non-global regex\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string(), x => {\n\t\t\t\t\tf(/x/)(x)\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Function `f` should not throw an error when applied with a non-global regex on any string.", "mode": "fast-check"} {"id": 55437, "name": "unknown", "code": "it(\"prepends\", () => {\n\t\t\texpect(f(\"\")(\"\")).toBe(\"\")\n\t\t\texpect(f(\"x\")(\"\")).toBe(\"x\")\n\t\t\texpect(f(\"\")(\"x\")).toBe(\"x\")\n\t\t\texpect(f(\"x\")(\"yz\")).toBe(\"xyz\")\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.string(),\n\t\t\t\t\tfc.string(),\n\t\t\t\t\t(x, y) =>\n\t\t\t\t\t\tf(x)(y).length === x.length + y.length &&\n\t\t\t\t\t\tf(y)(x).length === x.length + y.length,\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f(x)(y)` should prepend `x` to `y`, and `f(y)(x)` should prepend `y` to `x`, with both resulting strings maintaining a length equal to the sum of the lengths of `x` and `y`.", "mode": "fast-check"} {"id": 55438, "name": "unknown", "code": "it(\"unprepends if present\", () => {\n\t\t\texpect(f(\"x\")(\"xy\")).toBe(\"y\")\n\t\t\texpect(f(\"x\")(\"xx\")).toBe(\"x\")\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string(), fc.string(), (x, y) => f(x)(x + y) === y),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`f(x)(x + y)` should return `y`, effectively removing `x` from the beginning if present.", "mode": "fast-check"} {"id": 55439, "name": "unknown", "code": "it(\"appends\", () => {\n\t\t\texpect(f(\"\")(\"\")).toBe(\"\")\n\t\t\texpect(f(\"x\")(\"\")).toBe(\"x\")\n\t\t\texpect(f(\"\")(\"x\")).toBe(\"x\")\n\t\t\texpect(f(\"z\")(\"xy\")).toBe(\"xyz\")\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.string(),\n\t\t\t\t\tfc.string(),\n\t\t\t\t\t(x, y) =>\n\t\t\t\t\t\tf(x)(y).length === x.length + y.length &&\n\t\t\t\t\t\tf(y)(x).length === x.length + y.length,\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` appends two strings and maintains the commutative property regarding their combined length.", "mode": "fast-check"} {"id": 55440, "name": "unknown", "code": "it(\"unappends if present\", () => {\n\t\t\texpect(f(\"y\")(\"xy\")).toBe(\"x\")\n\t\t\texpect(f(\"x\")(\"xx\")).toBe(\"x\")\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string(), fc.string(), (x, y) => f(x)(y + x) === y),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` removes the specified string `x` from the end of string `y` if present.", "mode": "fast-check"} {"id": 55442, "name": "unknown", "code": "it(\"always returns a string\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.oneof(fc.integer(), fc.float()), flow(f, S.isString)),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Function `f` should always return a string when given an integer or float.", "mode": "fast-check"} {"id": 55444, "name": "unknown", "code": "it(\"drops specified number of characters\", () => {\n\t\t\texpect(f(2)(\"abc\")).toBe(\"c\")\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.string(),\n\t\t\t\t\tfc.integer({ min: 0, max: Number.MAX_SAFE_INTEGER }),\n\t\t\t\t\t(x, n) => f(n)(x).length === max(N.Ord)(0, x.length - n),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "A function `f(n)` should return a string with a length equal to the original string minus `n`, only if `n` is less than or equal to the string's length; otherwise, it returns an empty string.", "mode": "fast-check"} {"id": 55445, "name": "unknown", "code": "it(\"returns identity on constFalse\", () => {\n\t\t\tfc.assert(fc.property(fc.string(), x => f(constFalse)(x) === x))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Function `f` applied to `constFalse` should return the input string unchanged.", "mode": "fast-check"} {"id": 55447, "name": "unknown", "code": "it(\"returns identity for non-positive number\", () => {\n\t\t\texpect(f(-1)(\"abc\")).toBe(\"abc\")\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.string(),\n\t\t\t\t\tfc.integer({ max: 0 }),\n\t\t\t\t\t(x, n) => f(n)(x) === x,\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f(n)` returns the input string unchanged for non-positive integer values of `n`.", "mode": "fast-check"} {"id": 55452, "name": "unknown", "code": "it(\"returns last character of non-empty string\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string({ minLength: 1, maxLength: 100 }), x =>\n\t\t\t\t\texpect(f(x)).toEqual(O.some(x[x.length - 1])),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`f` returns the last character of a non-empty string as an `O.some` value.", "mode": "fast-check"} {"id": 55453, "name": "unknown", "code": "it(\"returns empty string for string with one character\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string({ minLength: 1, maxLength: 1 }), x =>\n\t\t\t\t\texpect(f(x)).toEqual(O.some(\"\")),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`f` should return an empty string wrapped in `O.some` for any single-character string.", "mode": "fast-check"} {"id": 55454, "name": "unknown", "code": "it(\"returns string one character smaller\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string({ minLength: 1, maxLength: 100 }), x =>\n\t\t\t\t\tpipe(\n\t\t\t\t\t\tf(x),\n\t\t\t\t\t\tO.exists(y => y.length === x.length - 1),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Verifies that applying function `f` to a string results in an output string that is one character shorter than the input.", "mode": "fast-check"} {"id": 55457, "name": "unknown", "code": "it(\"constTrue returns empty string\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string(), x => expect(f(constTrue)(x)).toEqual(\"\")),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`constTrue` returns an empty string for any input string passed through the function `f`.", "mode": "fast-check"} {"id": 55458, "name": "unknown", "code": "it(\"constFalse returns original string\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string(), x => expect(f(constFalse)(x)).toEqual(x)),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`constFalse` applied in function `f` should return the original string.", "mode": "fast-check"} {"id": 55459, "name": "unknown", "code": "it(\"returns input string on constTrue\", () => {\n\t\t\tfc.assert(fc.property(fc.string(), x => f(constTrue)(x) === x))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Applying the `f` function with `constTrue` should return the input string unchanged.", "mode": "fast-check"} {"id": 55460, "name": "unknown", "code": "it(\"returns empty string on constFalse\", () => {\n\t\t\tfc.assert(fc.property(fc.string(), x => f(constFalse)(x) === \"\"))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` returns an empty string when `constFalse` is applied to any string input.", "mode": "fast-check"} {"id": 55461, "name": "unknown", "code": "it(\"returns input string on constTrue\", () => {\n\t\t\tfc.assert(fc.property(fc.string(), x => f(constTrue)(x) === x))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Function `f` returns the input string when applied with `constTrue`.", "mode": "fast-check"} {"id": 55463, "name": "unknown", "code": "it('\"joining\" results in the same string', () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.integer(),\n\t\t\t\t\tfc.string(),\n\t\t\t\t\t(index, str) => splitAt(index)(str).join(\"\") === str,\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Splitting a string at any index and then rejoining the segments results in the original string.", "mode": "fast-check"} {"id": 55466, "name": "unknown", "code": "it(\"does not modify string given empty prefix\", () => {\n\t\t\tfc.assert(fc.property(fc.string(), x => f(\"\")(x) === x))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Applying an empty prefix to a string does not modify the string.", "mode": "fast-check"} {"id": 55468, "name": "unknown", "code": "it(\"does not modify string given empty suffix\", () => {\n\t\t\tfc.assert(fc.property(fc.string(), x => f(\"\")(x) === x))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/String.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "A string remains unchanged when an empty suffix is applied.", "mode": "fast-check"} {"id": 55469, "name": "unknown", "code": "it(\"cannot find anything in empty object\", () => {\n\t\t\tfc.assert(fc.property(fc.string(), x => O.isNone(f({})(x))))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Record.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`f` applied to an empty object should always result in `O.isNone` being true for any string input.", "mode": "fast-check"} {"id": 55470, "name": "unknown", "code": "it(\"is the inverse of filter\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.dictionary(fc.string(), fc.integer()), xs =>\n\t\t\t\t\texpect(pipe(xs, R.filter(p), f)).toEqual({}),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Record.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Applying `filter` with predicate `p` to a dictionary and then applying function `f` results in an empty object.", "mode": "fast-check"} {"id": 55471, "name": "unknown", "code": "it(\"has every unique transformed value as a key\", () => {\n\t\t\tconst g = fromNumber\n\t\t\tconst h: (x: Record) => Array = flow(\n\t\t\t\tvalues,\n\t\t\t\tA.uniq(N.Eq),\n\t\t\t\tA.map(g),\n\t\t\t)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.dictionary(fc.string(), fc.integer()), x =>\n\t\t\t\t\tpipe(x, f(g), R.keys, ks =>\n\t\t\t\t\t\tpipe(\n\t\t\t\t\t\t\th(x),\n\t\t\t\t\t\t\tA.every(k => A.elem(S.Eq)(k)(ks)),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Record.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Each unique value transformed by `fromNumber` in an object should be present as a key after processing with function `f`.", "mode": "fast-check"} {"id": 55472, "name": "unknown", "code": "it(\"has every unique transformed value as a key\", () => {\n\t\t\tconst g = fromNumber\n\t\t\tconst h: (x: Record) => Array = flow(\n\t\t\t\tvalues,\n\t\t\t\tA.uniq(N.Eq),\n\t\t\t\tA.map(g),\n\t\t\t)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.dictionary(fc.string(), fc.integer()), x =>\n\t\t\t\t\tpipe(x, f(g), R.keys, ks =>\n\t\t\t\t\t\tpipe(\n\t\t\t\t\t\t\th(x),\n\t\t\t\t\t\t\tA.every(k => A.elem(S.Eq)(k)(ks)),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Record.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Every unique transformed value from the record values should exist as a key in the output.", "mode": "fast-check"} {"id": 55474, "name": "unknown", "code": "it(\"is the inverse of filter\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.dictionary(fc.string(), fc.integer()), xs =>\n\t\t\t\t\texpect(pipe(xs, RR.filter(p), f)).toEqual({}),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyRecord.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Applying `filter` to a `ReadonlyRecord` and then using function `f` on the result should yield an empty record.", "mode": "fast-check"} {"id": 55475, "name": "unknown", "code": "it(\"has every unique transformed value as a key\", () => {\n\t\t\tconst g = fromNumber\n\t\t\tconst h: (x: RR.ReadonlyRecord) => ReadonlyArray =\n\t\t\t\tflow(values, RA.uniq(N.Eq), RA.map(g))\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.dictionary(fc.string(), fc.integer()), x =>\n\t\t\t\t\tpipe(x, f(g), RR.keys, ks =>\n\t\t\t\t\t\tpipe(\n\t\t\t\t\t\t\th(x),\n\t\t\t\t\t\t\tRA.every(k => RA.elem(S.Eq)(k)(ks)),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyRecord.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Every unique transformed value from a `ReadonlyRecord` of numbers should be present as a key in the resulting array.", "mode": "fast-check"} {"id": 55479, "name": "unknown", "code": "it(\"returns updated array wrapped in Some if index is okay\", () => {\n\t\t\texpect(f(0)([\"x\"])([])).toEqual(O.some([\"x\"]))\n\t\t\texpect(g([\"x\"])).toEqual(O.some([\"x\", \"a\", \"b\"]))\n\t\t\texpect(g([\"x\", \"y\"])).toEqual(O.some([\"x\", \"a\", \"b\", \"y\"]))\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.anything(), {\n\t\t\t\t\t\tminLength: 1,\n\t\t\t\t\t\tmaxLength: 5,\n\t\t\t\t\t}) as fc.Arbitrary>,\n\t\t\t\t\tfc.integer({ min: 0, max: 10 }),\n\t\t\t\t\t(xs, i) => O.isSome(f(i)(xs)(xs)) === i <= A.size(xs),\n\t\t\t\t),\n\t\t\t)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.string(), { minLength: 1, maxLength: 20 }),\n\t\t\t\t\txs =>\n\t\t\t\t\t\texpect(pipe(g(xs), O.map(A.size))).toEqual(O.some(A.size(xs) + 2)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` returns an updated array wrapped in `Some` if the index is within bounds of the array, and the function `g` extends the array by adding two elements, preserving the size increase wrapped in `Some`.", "mode": "fast-check"} {"id": 55481, "name": "unknown", "code": "it(\"never returns a larger array\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.integer()), xs => f(xs).length <= A.size(xs)),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` should return an array with a length not greater than the input array of integers.", "mode": "fast-check"} {"id": 55482, "name": "unknown", "code": "it(\"never introduces new elements\", () => {\n\t\t\tconst g = A.uniq(N.Eq)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.integer()), xs =>\n\t\t\t\t\tpipe(xs, f, g, A.every(elemV(N.Eq)(g(xs)))),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The transformation through functions `f` and `g` on an array ensures no new elements are introduced, with each element still present in the result.", "mode": "fast-check"} {"id": 55483, "name": "unknown", "code": "it(\"returns true for empty subarray\", () => {\n\t\t\tfc.assert(fc.property(fc.array(fc.integer()), xs => f([])(xs)))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Returns true when an empty array is identified as a subarray of any array of integers.", "mode": "fast-check"} {"id": 55484, "name": "unknown", "code": "it(\"checks start of array for subarray\", () => {\n\t\t\texpect(f([1])([1, 2, 3])).toBe(true)\n\t\t\texpect(f([3])([1, 2, 3])).toBe(false)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.integer()), fc.array(fc.integer()), (xs, ys) =>\n\t\t\t\t\tf(xs)(A.concat(ys)(xs)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "A subarray is verified as the starting segment of a concatenated array.", "mode": "fast-check"} {"id": 55485, "name": "unknown", "code": "it(\"returns true for empty subarray\", () => {\n\t\t\tfc.assert(fc.property(fc.array(fc.integer()), xs => f([])(xs)))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Returning true when the subarray is empty for any array `xs`.", "mode": "fast-check"} {"id": 55486, "name": "unknown", "code": "it(\"checks end of array for subarray\", () => {\n\t\t\texpect(f([3])([1, 2, 3])).toBe(true)\n\t\t\texpect(f([1])([1, 2, 3])).toBe(false)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.integer()), fc.array(fc.integer()), (xs, ys) =>\n\t\t\t\t\tf(xs)(A.concat(xs)(ys)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "A subarray checked at the end of an array should always match when concatenated to the original array.", "mode": "fast-check"} {"id": 55487, "name": "unknown", "code": "it(\"removes numbers present in first input array\", () => {\n\t\t\tconst g = f([4, 5])\n\n\t\t\texpect(g([3, 4])).toEqual([3])\n\t\t\texpect(g([4, 5])).toEqual([])\n\t\t\texpect(g([4, 5, 6])).toEqual([6])\n\t\t\texpect(g([3, 4, 5, 6])).toEqual([3, 6])\n\t\t\texpect(g([4, 3, 4, 5, 6, 5])).toEqual([3, 6])\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.integer()), xs =>\n\t\t\t\t\texpect(f(xs)(xs)).toEqual(A.empty),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Function `f` removes elements from the second array that are present in the first input array, ensuring when both inputs are the same array, the result is empty.", "mode": "fast-check"} {"id": 55488, "name": "unknown", "code": "it(\"output array length is the product of input array lengths\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.anything()),\n\t\t\t\t\tfc.array(fc.anything()),\n\t\t\t\t\t(xs, ys) => f(xs)(ys).length === A.size(xs) * ys.length,\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The length of the output array should be the product of the lengths of the two input arrays.", "mode": "fast-check"} {"id": 55489, "name": "unknown", "code": "it(\"sums non-empty input\", () => {\n\t\t\texpect(f([25, 3, 10])).toBe(38)\n\t\t\texpect(f([-3, 2])).toBe(-1)\n\t\t\texpect(f([2.5, 3.2])).toBe(5.7)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.integer()),\n\t\t\t\t\txs => f(xs) === xs.reduce((acc, val) => acc + val, 0),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` should sum the elements of an array, matching the result of using `reduce` with addition on the same array of integers.", "mode": "fast-check"} {"id": 55490, "name": "unknown", "code": "it(\"calculates product of non-empty input\", () => {\n\t\t\texpect(f([4, 2, 3])).toBe(24)\n\t\t\texpect(f([5])).toBe(5)\n\t\t\texpect(f([1.5, -5])).toBe(-7.5)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.integer()),\n\t\t\t\t\txs => f(xs) === xs.reduce((acc, val) => acc * val, 1),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` should return the product of elements in a non-empty integer array, matching the result of using `reduce` with multiplication.", "mode": "fast-check"} {"id": 55491, "name": "unknown", "code": "it(\"returns empty array for empty array input\", () => {\n\t\t\texpect(f(0)([])).toEqual([])\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.integer({ min: 0, max: 100 }), n => !f(n)([]).length),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function returns an empty array when given an empty array, regardless of the integer input.", "mode": "fast-check"} {"id": 55493, "name": "unknown", "code": "it(\"returns empty array for tuple length larger than input array length\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.anything()),\n\t\t\t\t\txs => !f(A.size(xs) + 1)(xs).length,\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function returns an empty array when the tuple length is larger than the input array length.", "mode": "fast-check"} {"id": 55494, "name": "unknown", "code": "it(\"output length is input length - n + 1\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.anything()),\n\t\t\t\t\tfc.integer({ min: 1, max: 100 }),\n\t\t\t\t\t(xs, n) => f(n)(xs).length === max(N.Ord)(0, A.size(xs) - n + 1),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f(n)(xs)` should produce an output where the length is equal to the input array's length minus `n` plus one, bounded by a minimum of zero.", "mode": "fast-check"} {"id": 55495, "name": "unknown", "code": "it(\"behaves identically to Array.prototype.slice\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.anything()),\n\t\t\t\t\tfc.integer(),\n\t\t\t\t\tfc.integer(),\n\t\t\t\t\t(xs, start, end) =>\n\t\t\t\t\t\texpect(f(start)(end)(xs)).toEqual(xs.slice(start, end)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function behaves identically to `Array.prototype.slice` when given arrays and integer start and end indices.", "mode": "fast-check"} {"id": 55496, "name": "unknown", "code": "it(\"is the inverse of filter\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.integer()),\n\t\t\t\t\txs => A.filter(p)(xs).length + f(xs).length === A.size(xs),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The sum of the lengths of the arrays resulting from applying a filter and its inverse function equals the original array's length.", "mode": "fast-check"} {"id": 55497, "name": "unknown", "code": "it(\"returns unmodified array provided same indices (in bounds)\", () => {\n\t\t\tconst n = 10\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.anything(), { minLength: 1, maxLength: n }),\n\t\t\t\t\tfc.integer({ min: 0, max: n - 1 }),\n\t\t\t\t\t(xs, i) => i >= A.size(xs) || expect(f(i)(i)(xs)).toEqual(O.some(xs)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function returns the original array when the same in-bounds index is used for both extraction and insertion.", "mode": "fast-check"} {"id": 55498, "name": "unknown", "code": "it(\"returns None if source is out of bounds\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.anything()), xs =>\n\t\t\t\t\texpect(f(A.size(xs))(0)(xs)).toEqual(O.none),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`f` returns `None` when the source array is empty or out of bounds.", "mode": "fast-check"} {"id": 55501, "name": "unknown", "code": "it(\"returns the same array size\", () => {\n\t\t\tconst n = 10\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.anything(), { minLength: n, maxLength: n }),\n\t\t\t\t\tfc.integer({ min: 0, max: n - 1 }),\n\t\t\t\t\tfc.integer({ min: 0, max: n - 1 }),\n\t\t\t\t\t(xs, i, j) =>\n\t\t\t\t\t\tpipe(\n\t\t\t\t\t\t\tf(i)(j)(xs),\n\t\t\t\t\t\t\tO.exists(ys => A.size(ys) === n),\n\t\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f(i)(j)(xs)` retains the original array size.", "mode": "fast-check"} {"id": 55503, "name": "unknown", "code": "it(\"returns unmodified array provided same indices (in bounds)\", () => {\n\t\t\tconst n = 10\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.anything(), { minLength: 1, maxLength: n }),\n\t\t\t\t\tfc.integer({ min: 0, max: n - 1 }),\n\t\t\t\t\t(xs, i) => i >= A.size(xs) || expect(f(i)(i)(xs)).toEqual(O.some(xs)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` with identical start and end indices (in bounds) should return the original array wrapped in `O.some`.", "mode": "fast-check"} {"id": 55505, "name": "unknown", "code": "it(\"returns None if target is out of bounds\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.anything()), xs =>\n\t\t\t\t\texpect(f(A.size(xs))(0)(xs)).toEqual(O.none),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`f` returns `O.none` if the index is out of bounds for the given array.", "mode": "fast-check"} {"id": 55506, "name": "unknown", "code": "it(\"moves source to target\", () => {\n\t\t\texpect(f(0)(1)([\"a\", \"b\", \"c\"])).toEqual(O.some([\"b\", \"a\", \"c\"]))\n\t\t\texpect(f(1)(0)([\"a\", \"b\", \"c\"])).toEqual(O.some([\"b\", \"a\", \"c\"]))\n\n\t\t\tconst n = 10\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.anything(), { minLength: n, maxLength: n }),\n\t\t\t\t\tfc.integer({ min: 0, max: n - 1 }),\n\t\t\t\t\tfc.integer({ min: 0, max: n - 1 }),\n\t\t\t\t\t(xs, i, j) => O.isSome(f(i)(j)(xs)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Elements at specified indices in an array can be successfully moved, ensuring the operation produces a valid result.", "mode": "fast-check"} {"id": 55508, "name": "unknown", "code": "it(\"sibling indices are interchangeable\", () => {\n\t\t\tconst n = 10\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.anything(), { minLength: n, maxLength: n }),\n\t\t\t\t\tfc.integer({ min: 0, max: n - 2 }),\n\t\t\t\t\t(xs, i) => expect(f(i)(i + 1)(xs)).toEqual(f(i + 1)(i)(xs)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Sibling indices in an array can be swapped without affecting the overall result.", "mode": "fast-check"} {"id": 55509, "name": "unknown", "code": "it(\"counts the same summed number as the length of the array\", () => {\n\t\t\t// fast-check generates keys that fp-ts internals won't iterate over,\n\t\t\t// meaning without this the keys below won't necessarily add up.\n\t\t\tconst filterSpecialKeys: Endomorphism> = A.chain(\n\t\t\t\tflow(k => R.singleton(k, null), R.keys),\n\t\t\t)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.string()),\n\t\t\t\t\txs =>\n\t\t\t\t\t\tpipe(xs, f(identity), values, sum) === filterSpecialKeys(xs).length,\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Verifies that the sum of array elements equals the length of the array when filtering out non-iterable keys.", "mode": "fast-check"} {"id": 55513, "name": "unknown", "code": "it(\"calculates the mean\", () => {\n\t\t\texpect(f([2, 7, 9])).toBe(6)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.integer({ min: 1, max: 50 }),\n\t\t\t\t\tfc.integer(),\n\t\t\t\t\t(x, y) => f(A.replicate(x, y) as ReadonlyNonEmptyArray) === y,\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The mean of a replicated integer in a non-empty array should equal that integer.", "mode": "fast-check"} {"id": 55517, "name": "unknown", "code": "it(\"constTrue returns original array\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.anything()), xs =>\n\t\t\t\t\texpect(f(constTrue)(xs)).toEqual(xs),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`constTrue` returns the original array unchanged.", "mode": "fast-check"} {"id": 55518, "name": "unknown", "code": "it(\"constFalse returns empty array\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.anything()), xs =>\n\t\t\t\t\texpect(f(constFalse)(xs)).toEqual([]),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Applying `constFalse` results in an empty array when used on any array.", "mode": "fast-check"} {"id": 55519, "name": "unknown", "code": "it(\"one empty input returns other input whole\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.integer()), xs =>\n\t\t\t\t\texpect(f(xs)([])).toEqual(xs),\n\t\t\t\t),\n\t\t\t)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.integer()), xs =>\n\t\t\t\t\texpect(f([])(xs)).toEqual(xs),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "When one input array is empty, the function `f` returns the other input array unchanged.", "mode": "fast-check"} {"id": 55522, "name": "unknown", "code": "it(\"returns the smallest value\", () => {\n\t\t\texpect(f([3, 1, 2])).toBe(1)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.integer(),\n\t\t\t\t\tn => f([n, n + 1]) === n && f([n + 1, n]) === n,\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function returns the smallest value from an array of integers.", "mode": "fast-check"} {"id": 55524, "name": "unknown", "code": "it(\"returns the largest value\", () => {\n\t\t\texpect(f([1, 3, 2])).toBe(3)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.integer(),\n\t\t\t\t\tn => f([n, n + 1]) === n + 1 && f([n + 1, n]) === n + 1,\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` should return the largest value from a given array of integers.", "mode": "fast-check"} {"id": 55527, "name": "unknown", "code": "it(\"is identical to filter in an applicative context\", () => {\n\t\t\tconst g = A.filter\n\t\t\tconst isEven: Predicate = n => n % 2 === 0\n\t\t\tconst isEvenIO = flow(isEven, IO.of)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.integer()), xs =>\n\t\t\t\t\texpect(f(isEvenIO)(xs)()).toEqual(g(isEven)(xs)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReadonlyArray.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`f` applied to `isEvenIO` should produce the same result as `filter` applied to `isEven` for arrays of integers.", "mode": "fast-check"} {"id": 55536, "name": "unknown", "code": "it(\"extracts expected TaskEither right from a ReaderTaskEither\", async () => {\n\t\t\ttype Env = { dependency: string }\n\t\t\tconst env: Env = { dependency: \"dependency \" }\n\t\t\tawait fc.assert(\n\t\t\t\tfc.asyncProperty(fc.integer(), async _ => {\n\t\t\t\t\tconst rte: RTE.ReaderTaskEither = pipe(\n\t\t\t\t\t\tE.right(_),\n\t\t\t\t\t\tRTE.fromEither,\n\t\t\t\t\t)\n\t\t\t\t\tconst extractedRight = pipe(rte, runReaderTaskEither(env))()\n\t\t\t\t\tawait expect(extractedRight).resolves.toStrictEqual(E.right(_))\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReaderTaskEither.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Extracting the expected `TaskEither` right value from a `ReaderTaskEither` should match the original `Either` right value when run with a given environment.", "mode": "fast-check"} {"id": 55540, "name": "unknown", "code": "it(\"extracts expected Either right from a ReaderEither\", () => {\n\t\t\ttype Env = { dependency: string }\n\t\t\tconst env: Env = { dependency: \"dependency \" }\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.integer(), _ => {\n\t\t\t\t\tconst re: RE.ReaderEither = pipe(\n\t\t\t\t\t\tE.right(_),\n\t\t\t\t\t\tRE.fromEither,\n\t\t\t\t\t)\n\t\t\t\t\tconst extractedRight = pipe(re, runReaderEither(env))\n\t\t\t\t\texpect(extractedRight).toStrictEqual(E.right(_))\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/ReaderEither.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Extracting an `Either` right value from a `ReaderEither` with a given environment yields the expected result.", "mode": "fast-check"} {"id": 55543, "name": "unknown", "code": "it(\"returns array of input size minus one\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.anything(), { minLength: 2 }), xs =>\n\t\t\t\t\texpect(\n\t\t\t\t\t\tpipe(\n\t\t\t\t\t\t\txs as NonEmptyArray,\n\t\t\t\t\t\t\tf,\n\t\t\t\t\t\t\tIO.map(flow(snd, A.size)),\n\t\t\t\t\t\t\texecute,\n\t\t\t\t\t\t),\n\t\t\t\t\t).toEqual(pipe(xs, A.size, decrement)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Random.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Verifies that applying the function `f` to a non-empty array results in an array whose size is one less than the original array.", "mode": "fast-check"} {"id": 55544, "name": "unknown", "code": "it(\"wraps provided value in Some given a None\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string(), x => expect(f(x)(O.none)).toEqual(O.some(x))),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` wraps a provided string value in `Some` when given `None`.", "mode": "fast-check"} {"id": 55546, "name": "unknown", "code": "it(\"returns None given a Some containing an equivalent value\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string(), x => expect(f(x)(O.some(x))).toEqual(O.none)),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Returns `None` when given a `Some` containing the same value generated by `f`.", "mode": "fast-check"} {"id": 55547, "name": "unknown", "code": "it(\"unwraps Some\", () => {\n\t\t\tfc.assert(fc.property(fc.string(), x => pipe(x, O.some, f) === x))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Option.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` unwraps the value from `O.some`, returning the original string.", "mode": "fast-check"} {"id": 55551, "name": "unknown", "code": "it(\"returns identity on argument on true condition\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(arbOption(fc.string()), x =>\n\t\t\t\t\texpect(f(true)(constant(x))).toEqual(x),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Option.test.ts", "start_line": null, "end_line": null, "dependencies": ["arbOption"], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f(true)` returns the input `Option` unmodified when using `constant(x)`.", "mode": "fast-check"} {"id": 55557, "name": "unknown", "code": "it(\"returns true for any other number\", () => {\n\t\t\tfc.assert(fc.property(fc.integer(), f))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Number.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Function `f` returns true for any integer input.", "mode": "fast-check"} {"id": 55562, "name": "unknown", "code": "it(\"returns some(3) for '3.3'\", () => {\n\t\t\texpect(f(\"3.3\")).toStrictEqual(O.some(3))\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.integer(), x =>\n\t\t\t\t\texpect(f(fromNumber(x))).toStrictEqual(O.some(x)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Number.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` should return `O.some(3)` when given the string \"3.3\", and for any integer input, it should return that integer wrapped in `O.some`.", "mode": "fast-check"} {"id": 55558, "name": "unknown", "code": "it(\"returns some(3) for '3'\", () => {\n\t\t\texpect(f(\"3\")).toStrictEqual(O.some(3))\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.integer(), x =>\n\t\t\t\t\texpect(f(fromNumber(x))).toStrictEqual(O.some(x)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Number.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`f` returns `some(x)` for string representations of integers, including \"3\" and any generated integer converted to a string.", "mode": "fast-check"} {"id": 55559, "name": "unknown", "code": "it(\"returns some(3.3) for '3.3'\", () => {\n\t\t\texpect(f(\"3.3\")).toStrictEqual(O.some(3.3))\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.integer(), x =>\n\t\t\t\t\texpect(f(fromNumber(x))).toStrictEqual(O.some(x)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Number.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` returns `O.some(x)` when converting integers to their string representation and then back to numbers.", "mode": "fast-check"} {"id": 55560, "name": "unknown", "code": "it(\"returns some for floating point number\", () => {\n\t\t\texpect(f(\"3.3\")).toStrictEqual(O.some(3.3))\n\n\t\t\t// Negative zero isn't reversible below via `fromNumber`.\n\t\t\tconst isNegativeZero: Predicate = n => Object.is(n, -0)\n\t\t\texpect(f(\"0\")).toStrictEqual(O.some(0))\n\t\t\texpect(f(\"-0\")).toStrictEqual(O.some(-0))\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.float({ noNaN: true }).filter(Pred.not(isNegativeZero)),\n\t\t\t\t\tx => expect(f(fromNumber(x))).toStrictEqual(O.some(x)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Number.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "For a given string representation of a floating point number, the function should return an `Option` containing the number, except for negative zero which is handled separately.", "mode": "fast-check"} {"id": 55561, "name": "unknown", "code": "it(\"returns some(3) for '3'\", () => {\n\t\t\texpect(f(\"3\")).toStrictEqual(O.some(3))\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.integer(), x =>\n\t\t\t\t\texpect(f(fromNumber(x))).toStrictEqual(O.some(x)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Number.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`f` returns `O.some(3)` for the string \"3\" and `O.some(x)` for any integer `x` converted to a string using `fromNumber`.", "mode": "fast-check"} {"id": 55563, "name": "unknown", "code": "it(\"is reversible\", () => {\n\t\t\tfc.assert(fc.property(fc.integer(), n => f(f(n)) === n))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Number.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The property should hold that applying the function `f` twice to an integer returns the original integer.", "mode": "fast-check"} {"id": 55565, "name": "unknown", "code": "it(\"returns identity on non-Infinity\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.integer({\n\t\t\t\t\t\tmin: Number.MIN_SAFE_INTEGER,\n\t\t\t\t\t\tmax: Number.MAX_SAFE_INTEGER,\n\t\t\t\t\t}),\n\t\t\t\t\tx => f(x) === x,\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Number.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Function `f` should return the same integer input when the input is within the range of safe integers and not infinity.", "mode": "fast-check"} {"id": 55570, "name": "unknown", "code": "it(\"returns true for any number above zero\", () => {\n\t\t\texpect(f(0.000001)).toBe(true)\n\t\t\texpect(f(42)).toBe(true)\n\t\t\texpect(f(Number.POSITIVE_INFINITY)).toBe(true)\n\n\t\t\tfc.assert(fc.property(fc.integer({ min: 1 }), f))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Number.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` returns true for any number greater than zero.", "mode": "fast-check"} {"id": 55574, "name": "unknown", "code": "it(\"retracts pred\", () => {\n\t\t\t\tconst g = flow(\n\t\t\t\t\tEnumInt.pred,\n\t\t\t\t\tO.chain(EnumInt.succ),\n\t\t\t\t\tO.chain(EnumInt.pred),\n\t\t\t\t)\n\t\t\t\tconst h = EnumInt.pred\n\n\t\t\t\tfc.assert(fc.property(fc.integer(), n => expect(g(n)).toEqual(h(n))))\n\t\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Number.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "A number processed through `EnumInt.pred`, `EnumInt.succ`, and `EnumInt.pred` should equal the result of applying `EnumInt.pred` once.", "mode": "fast-check"} {"id": 55575, "name": "unknown", "code": "it(\"retracts succ\", () => {\n\t\t\t\tconst g = flow(\n\t\t\t\t\tEnumInt.succ,\n\t\t\t\t\tO.chain(EnumInt.pred),\n\t\t\t\t\tO.chain(EnumInt.succ),\n\t\t\t\t)\n\t\t\t\tconst h = EnumInt.succ\n\n\t\t\t\tfc.assert(fc.property(fc.integer(), n => expect(g(n)).toEqual(h(n))))\n\t\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Number.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Applying `EnumInt.succ`, then `EnumInt.pred`, and `EnumInt.succ` again should yield the same result as a single `EnumInt.succ` on an integer.", "mode": "fast-check"} {"id": 55580, "name": "unknown", "code": "it(\"maintains newtype contract\", () => {\n\t\t\tfc.assert(fc.property(fc.integer(), flow(f, isValid)))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/NonEmptyString.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The test ensures that applying the function `f` to integers results in values that satisfy the `isValid` condition, maintaining the newtype contract.", "mode": "fast-check"} {"id": 55581, "name": "unknown", "code": "it(\"is equivalent to lifted Str.append\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.string(),\n\t\t\t\t\tarb,\n\t\t\t\t\t(x, y) =>\n\t\t\t\t\t\tStr.append(x)(unNonEmptyString(y)) === unNonEmptyString(f(x)(y)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/NonEmptyString.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`Str.append` applied to a string and an unwrapped non-empty string is equivalent to the unwrapped result of applying function `f` to the same arguments.", "mode": "fast-check"} {"id": 55584, "name": "unknown", "code": "it(\"maintains newtype contract\", () => {\n\t\t\tfc.assert(fc.property(fc.string(), arb, (x, y) => pipe(y, f(x), isValid)))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/NonEmptyString.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Verifies that applying function `f` on a string `x` and `arb` value `y` upholds the `isValid` condition.", "mode": "fast-check"} {"id": 55588, "name": "unknown", "code": "it(\"maintains newtype contract\", () => {\n\t\t\tfc.assert(fc.property(arb, flow(f, isValid)))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/NonEmptyString.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `flow(f, isValid)` should maintain the newtype contract for arbitrary values.", "mode": "fast-check"} {"id": 55590, "name": "unknown", "code": "it(\"maintains newtype contract\", () => {\n\t\t\tfc.assert(fc.property(arb, flow(f, isValid)))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/NonEmptyString.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The property ensures that applying a function `f` to an arbitrary input maintains the newtype contract by producing a valid result according to `isValid`.", "mode": "fast-check"} {"id": 55591, "name": "unknown", "code": "it(\"is equivalent to lifted Str.reverse\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tarb,\n\t\t\t\t\tx => Str.reverse(unNonEmptyString(x)) === unNonEmptyString(f(x)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/NonEmptyString.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Verifies that applying the function `f` to a non-empty string results in a reversed string equivalent to directly reversing it with `Str.reverse`.", "mode": "fast-check"} {"id": 55596, "name": "unknown", "code": "it(\"maintains newtype contract\", () => {\n\t\t\tfc.assert(fc.property(arb, flow(f, isValid)))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/NonEmptyString.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The property ensures that applying `f` to a value generated by `arb` results in a `NonEmptyString` that satisfies `isValid`.", "mode": "fast-check"} {"id": 55597, "name": "unknown", "code": "it(\"is equivalent to lifted Str.size\", () => {\n\t\t\tfc.assert(fc.property(arb, x => _size(unNonEmptyString(x)) === f(x)))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/NonEmptyString.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`_size` function applied to `unNonEmptyString(x)` should be equivalent to the function `f(x)` for all inputs generated by `arb`.", "mode": "fast-check"} {"id": 55598, "name": "unknown", "code": "it(\"is equivalent to lifted Str.includes\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tarb,\n\t\t\t\t\tfc.string(),\n\t\t\t\t\t(haystack, needle) =>\n\t\t\t\t\t\t_includes(needle)(unNonEmptyString(haystack)) ===\n\t\t\t\t\t\tf(needle)(haystack),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/NonEmptyString.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`_includes` and `f` should produce equivalent results when checking for the presence of a string `needle` in a `haystack`.", "mode": "fast-check"} {"id": 55601, "name": "unknown", "code": "it(\"is equivalent to a lifted endomorphism\", () => {\n\t\t\tconst g: Endomorphism = multiply(2)\n\n\t\t\tfc.assert(fc.property(fc.integer(), n => f(g)(mkNum(n)) === mkNum(g(n))))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Newtype.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The test checks that applying a lifted endomorphism `f(g)` to a number wrapped in `mkNum` is equivalent to applying the endomorphism `g` directly to the number and then wrapping the result with `mkNum`.", "mode": "fast-check"} {"id": 55602, "name": "unknown", "code": "it(\"unwraps per provided Foldable instance\", () => {\n\t\t\tfc.assert(fc.property(fc.string(), x => pipe(x, O.some, f) === x))\n\t\t\tfc.assert(fc.property(fc.string(), x => pipe(x, E.right, g) === x))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Monoid.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Unwrapping operations with `Foldable` instances should return the original string for both `Option` and `Either` contexts.", "mode": "fast-check"} {"id": 55603, "name": "unknown", "code": "it(\"unwraps per provided Foldable instance\", () => {\n\t\t\tfc.assert(fc.property(fc.string(), x => pipe(x, O.some, f) === x))\n\t\t\tfc.assert(fc.property(fc.string(), x => pipe(x, E.right, g) === x))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Monoid.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Verifies that wrapping a string in an `Option` or `Either` and then applying the functions `f` or `g` respectively returns the original string.", "mode": "fast-check"} {"id": 55604, "name": "unknown", "code": "it(\"returns identity element on true condition\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string(), x => f(true)(constant(x)) === S.Monoid.empty),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Monoid.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Function `f` returns the identity element of `S.Monoid` when the condition is true.", "mode": "fast-check"} {"id": 55607, "name": "unknown", "code": "it(\"returns identity on argument on true condition\", () => {\n\t\t\tfc.assert(fc.property(fc.string(), x => f(true)(constant(x)) === x))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Monoid.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "When the condition is true, the function returns the identity of the argument.", "mode": "fast-check"} {"id": 55612, "name": "unknown", "code": "it(\"fails when stringification does not return a string\", () => {\n\t\t\tconst e = TypeError(\"Stringify output not a string\")\n\t\t\texpect(f(identity)(undefined)).toEqual(E.left(e))\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.anything(),\n\t\t\t\t\tflow(f(identity), E.fold(constTrue, isString)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/JSON.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "JSON stringification should return a string; if not, it results in a `TypeError`.", "mode": "fast-check"} {"id": 55613, "name": "unknown", "code": "it(\"fails when stringification does not return a string\", () => {\n\t\t\texpect(f(undefined)).toEqual(O.none)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.anything(), flow(f, O.fold(constTrue, isString))),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/JSON.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`f` function should return a string when applied to any value; otherwise, it should return `O.none`.", "mode": "fast-check"} {"id": 55614, "name": "unknown", "code": "it(\"parses valid JSON\", () => {\n\t\t\texpect(f(identity)('{\"a\":1,\"b\":[\"two\"]}')).toEqual(\n\t\t\t\tE.right({ a: 1, b: [\"two\"] }),\n\t\t\t)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.oneof(fc.string(), fc.integer(), fc.boolean(), fc.constant(null)),\n\t\t\t\t\tflow(stringifyPrimitiveUnwrapped, f(identity), E.isRight),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/JSON.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Parsing valid JSON should result in an `E.right` outcome for various primitive values.", "mode": "fast-check"} {"id": 55615, "name": "unknown", "code": "it(\"parses valid JSON\", () => {\n\t\t\texpect(f('{\"a\":1,\"b\":[\"two\"]}')).toEqual(O.some({ a: 1, b: [\"two\"] }))\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.oneof(fc.string(), fc.integer(), fc.boolean(), fc.constant(null)),\n\t\t\t\t\tflow(stringifyPrimitiveUnwrapped, f, O.isSome),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/JSON.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`f` correctly parses strings containing valid JSON, including primitives, into an `O.some` value.", "mode": "fast-check"} {"id": 55616, "name": "unknown", "code": "it(\"always runs the effect on const true predicate\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.integer({ min: 0, max: 99 }), x => {\n\t\t\t\t\tlet n = 0\n\t\t\t\t\tconst g: IO = () => {\n\t\t\t\t\t\tn++\n\t\t\t\t\t}\n\t\t\t\t\tconst h = f(constTrue)(g)\n\n\t\t\t\t\tfor (let i = 0; i < x; i++) h()\n\t\t\t\t\treturn n === x\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/IO.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The property verifies that when an effect is composed with a constant true predicate, the effect runs exactly as many times as called.", "mode": "fast-check"} {"id": 55617, "name": "unknown", "code": "it(\"never runs the effect on const false predicate\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.integer({ min: 0, max: 99 }), x => {\n\t\t\t\t\tlet n = 0\n\t\t\t\t\tconst g: IO = () => {\n\t\t\t\t\t\tn++\n\t\t\t\t\t}\n\t\t\t\t\tconst h = f(constFalse)(g)\n\n\t\t\t\t\tfor (let i = 0; i < x; i++) h()\n\t\t\t\t\treturn n === 0\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/IO.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` should not execute the effect `g` any number of times if the predicate `constFalse` is used, ensuring `n` remains zero.", "mode": "fast-check"} {"id": 55618, "name": "unknown", "code": "it(\"runs the effect whenever the predicate passes\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.integer({ min: 0, max: 99 }), x => {\n\t\t\t\t\tlet n = 0\n\t\t\t\t\tconst g: IO = () => {\n\t\t\t\t\t\tn++\n\t\t\t\t\t}\n\t\t\t\t\tconst h = f(n => n % 2 === 0)(g)\n\n\t\t\t\t\tfor (let i = 0; i < x; i++) h()\n\t\t\t\t\treturn n === Math.floor(x / 2)\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/IO.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function runs an effect only when a predicate, checking if a number is even, passes and increments a counter accordingly.", "mode": "fast-check"} {"id": 55619, "name": "unknown", "code": "it(\"gets the value\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.anything(), x =>\n\t\t\t\t\texpect(x).toEqual(pipe(x, IO.of, execute)),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/IO.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The property ensures that applying `IO.of` and then `execute` on any value returns the original value.", "mode": "fast-check"} {"id": 55620, "name": "unknown", "code": "it(\"identity\", () => {\n\t\t\t\tfc.assert(\n\t\t\t\t\tfc.property(fc.anything(), fc.anything(), (x, y) => {\n\t\t\t\t\t\tconst left = pipe(F.of(x), F.map(identity), apply(y))\n\t\t\t\t\t\tconst right = pipe(F.of(x), identity, apply(y))\n\n\t\t\t\t\t\texpect(left).toEqual(right)\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Function.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Applying the `identity` function within a pipeline should yield the same result as directly applying `identity`, when both are followed by an `apply` operation with the same value.", "mode": "fast-check"} {"id": 55621, "name": "unknown", "code": "it(\"composition\", () => {\n\t\t\t\tfc.assert(\n\t\t\t\t\tfc.property(\n\t\t\t\t\t\tfc.integer(),\n\t\t\t\t\t\tfc.integer(),\n\t\t\t\t\t\tfc.integer(),\n\t\t\t\t\t\tfc.anything(),\n\t\t\t\t\t\t(x, y, z, zz) => {\n\t\t\t\t\t\t\tconst f = add(y)\n\t\t\t\t\t\t\tconst g = multiply(z)\n\n\t\t\t\t\t\t\tconst left = pipe(F.of(x), F.map(flow(f, g)), apply(zz))\n\t\t\t\t\t\t\tconst right = pipe(F.of(x), F.map(f), F.map(g), apply(zz))\n\n\t\t\t\t\t\t\treturn expect(left).toEqual(right)\n\t\t\t\t\t\t},\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Function.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Function composition should produce equivalent outcomes when mapped through a sequence and then applied.", "mode": "fast-check"} {"id": 55622, "name": "unknown", "code": "it(\"identity\", () => {\n\t\t\t\tfc.assert(\n\t\t\t\t\tfc.property(fc.anything(), fc.anything(), (x, y) => {\n\t\t\t\t\t\tconst left = pipe(F.of(identity), F.ap(F.of(x)), apply(y))\n\t\t\t\t\t\tconst right = pipe(F.of(x), apply(y))\n\n\t\t\t\t\t\treturn expect(left).toEqual(right)\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Function.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`F.of(identity)` applied to `F.ap(F.of(x))` and `apply(y)` should produce the same result as `F.of(x)` applied with `apply(y)`.", "mode": "fast-check"} {"id": 55626, "name": "unknown", "code": "it(\"left identity\", () => {\n\t\t\t\tfc.assert(\n\t\t\t\t\tfc.property(fc.integer(), fc.integer(), fc.anything(), (x, y, z) => {\n\t\t\t\t\t\tconst f = flow(add(y), F.of)\n\n\t\t\t\t\t\tconst left = pipe(F.of(x), F.chain(f), apply(z))\n\t\t\t\t\t\tconst right = pipe(f(x), apply(z))\n\n\t\t\t\t\t\treturn expect(left).toEqual(right)\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Function.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The property should hold that applying a function `f` to a monadic value using `left` and `right` transformations results in equivalent outcomes.", "mode": "fast-check"} {"id": 55627, "name": "unknown", "code": "it(\"right identity\", () => {\n\t\t\t\tfc.assert(\n\t\t\t\t\tfc.property(fc.anything(), fc.anything(), (x, y) => {\n\t\t\t\t\t\tconst left = pipe(F.of(x), F.chain(F.of), apply(y))\n\t\t\t\t\t\tconst right = pipe(F.of(x), apply(y))\n\n\t\t\t\t\t\treturn expect(left).toEqual(right)\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Function.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The operation `apply(y)` on `pipe(F.of(x), F.chain(F.of))` should yield the same result as `pipe(F.of(x))` when `apply(y)` is also applied, ensuring right identity.", "mode": "fast-check"} {"id": 55629, "name": "unknown", "code": "it(\"calls the method with arguments on the object\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.string({ minLength: 5, maxLength: 5 }),\n\t\t\t\t\tx => f()(\"padStart\")([8, \".\"])(x) === `...${x}`,\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Function.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The method `padStart` is called with specified arguments on a string, resulting in a string prefixed with three dots and the original string.", "mode": "fast-check"} {"id": 55630, "name": "unknown", "code": "it(\"always returns the same output provided same input\", () => {\n\t\t\tconst g = f(N.Eq)(add(5))\n\n\t\t\texpect(g(2)).toBe(7)\n\t\t\texpect(g(3)).toBe(8)\n\t\t\texpect(g(2)).toBe(7)\n\n\t\t\tfc.assert(fc.property(fc.integer(), n => g(n) === n + 5))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Function.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `g`, derived from `f(N.Eq)(add(5))`, consistently returns the same output for identical integer inputs, specifically outputting the input plus 5.", "mode": "fast-check"} {"id": 55631, "name": "unknown", "code": "it(\"calls all provided functions and returns their outputs in order\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string(), x =>\n\t\t\t\t\texpect(\n\t\t\t\t\t\tfork([\n\t\t\t\t\t\t\tS.append(\"!\"),\n\t\t\t\t\t\t\tidentity,\n\t\t\t\t\t\t\tS.append(\"?\"),\n\t\t\t\t\t\t\tA.of,\n\t\t\t\t\t\t\tS.prepend(\".\"),\n\t\t\t\t\t\t])(x),\n\t\t\t\t\t).toEqual([`${x}!`, x, `${x}?`, [x], `.${x}`]),\n\t\t\t\t),\n\t\t\t)\n\t\t\texpect(f)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Function.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Calling multiple functions on a string should return their outputs in a specified order.", "mode": "fast-check"} {"id": 55633, "name": "unknown", "code": "it(\"calls all provided functions and outputs the resulting tuple to the converging function\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.string(),\n\t\t\t\t\tx =>\n\t\t\t\t\t\tf(join(\" \"))([S.append(\"!\"), identity, S.prepend(\"?\")])(x) ===\n\t\t\t\t\t\t`${x}! ${x} ?${x}`,\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Function.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The result of applying multiple functions to a string should form a tuple that, when joined and passed to a converging function, matches the expected formatted output.", "mode": "fast-check"} {"id": 55634, "name": "unknown", "code": "it(\"returns identity on empty array\", () => {\n\t\t\tfc.assert(fc.property(fc.anything(), x => expect(f([])(x)).toEqual(x)))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Function.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`f` applied to an empty array should return the identity function for any input `x`.", "mode": "fast-check"} {"id": 55636, "name": "unknown", "code": "it(\"returns identity on array of None\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.anything(), fc.array(fc.constant(O.none)), (x, gs) =>\n\t\t\t\t\texpect(f(gs)(x)).toEqual(x),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Function.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`f` applied to an array of `None` values should return the input `x` unchanged.", "mode": "fast-check"} {"id": 55637, "name": "unknown", "code": "it(\"applies the function the specified number of times\", () => {\n\t\t\texpect(f(3)).toBe(5)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.integer({ min: 1, max: 50 }), n => f(n) === n + 2),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Function.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "A function applied a specified number of times should return the input value incremented by 2.", "mode": "fast-check"} {"id": 55639, "name": "unknown", "code": "it(\"can reimplement range\", () => {\n\t\t\tconst g = curry2(NEA.range)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(validPair, ([x, y]) => expect(f(x)(y)).toEqual(g(x)(y))),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Enum.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Reimplementing the `range` function should produce the same results as `NEA.range` for a valid pair of numbers.", "mode": "fast-check"} {"id": 55640, "name": "unknown", "code": "it(\"never throws\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(triple, ([x, y, z]) => {\n\t\t\t\t\tf(x)(y)(z)\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Enum.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` should not throw errors when applied sequentially to elements of a triple.", "mode": "fast-check"} {"id": 55642, "name": "unknown", "code": "it(\"can reimplement range\", () => {\n\t\t\tconst g =\n\t\t\t\t(start: number) =>\n\t\t\t\t(end: number): NonEmptyArray =>\n\t\t\t\t\tf(start)(start + 1)(end)\n\t\t\tconst h = curry2(NEA.range)\n\n\t\t\texpect(g(-1)(0)).toEqual([-1, 0])\n\t\t\texpect(h(-1)(0)).toEqual([-1, 0])\n\t\t\tfc.assert(\n\t\t\t\tfc.property(validPair, ([x, y]) => expect(g(x)(y)).toEqual(h(x)(y))),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Enum.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Reimplementing a range function (`g`) should produce the same output as the `curry2` version of the `NEA.range` function (`h`) for valid number pairs.", "mode": "fast-check"} {"id": 55643, "name": "unknown", "code": "it(\"never throws in succ or pred\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.string(), { maxLength: 100 }),\n\t\t\t\t\tfc.string(),\n\t\t\t\t\t(xs, y) => {\n\t\t\t\t\t\tconst E = f(Str.Ord)(xs as NonEmptyArray)\n\n\t\t\t\t\t\tE.succ(y)\n\t\t\t\t\t\tE.pred(y)\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Enum.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Calling `succ` or `pred` on an enumeration mapping of strings should not throw an error.", "mode": "fast-check"} {"id": 55681, "name": "unknown", "code": "it(\"output A.size is input A.size - n + 1\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.anything()),\n\t\t\t\t\tfc.integer({ min: 1, max: 100 }),\n\t\t\t\t\t(xs, n) => f(n)(xs).length === max(N.Ord)(0, A.size(xs) - n + 1),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The length of the output array should be the size of the input array minus \\( n \\) plus 1, but not less than zero.", "mode": "fast-check"} {"id": 55645, "name": "unknown", "code": "it(\"returns identity on identity input\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string(), x => {\n\t\t\t\t\texpect(f(identity)(E.left(x))).toEqual(E.left(x))\n\t\t\t\t\texpect(f(identity)(E.right(x))).toEqual(E.right(x))\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Either.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Applying `f` with an identity function to either `E.left` or `E.right` returns the input as is.", "mode": "fast-check"} {"id": 55653, "name": "unknown", "code": "it(\"logs string message and shown value\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string(), fc.string(), (x, y) => {\n\t\t\t\t\tconst spy = jest\n\t\t\t\t\t\t.spyOn(global.console, \"log\")\n\t\t\t\t\t\t.mockImplementation(constVoid)\n\t\t\t\t\tf(x)(y)\n\t\t\t\t\texpect(console.log).toHaveBeenCalledTimes(1)\n\t\t\t\t\texpect(console.log).toHaveBeenCalledWith(x, Str.Show.show(y))\n\t\t\t\t\tspy.mockRestore()\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Debug.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Logs a string message and a value's string representation using `console.log` exactly once.", "mode": "fast-check"} {"id": 55654, "name": "unknown", "code": "it(\"returns provided value by reference\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.string(), x => {\n\t\t\t\t\tconst spy = jest\n\t\t\t\t\t\t.spyOn(global.console, \"log\")\n\t\t\t\t\t\t.mockImplementation(constVoid)\n\t\t\t\t\texpect(f(\"\")(x)).toBe(x)\n\t\t\t\t\tspy.mockRestore()\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Debug.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` should return the input string by reference, ensuring the output is the same instance as the input.", "mode": "fast-check"} {"id": 55656, "name": "unknown", "code": "it(\"returns true for any date\", () => {\n\t\t\texpect(f(new Date())).toBe(true)\n\t\t\texpect(f(new Date(\"invalid\"))).toBe(true)\n\n\t\t\tfc.assert(fc.property(fc.date(), isDate))\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Date.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` consistently returns true for any given date, including invalid ones, and `isDate` should return true for all generated dates.", "mode": "fast-check"} {"id": 55659, "name": "unknown", "code": "it(\"wraps date constructor and validates\", () => {\n\t\t\texpect(f(Number.NEGATIVE_INFINITY)).toEqual(O.none)\n\t\t\texpect(f(Number.POSITIVE_INFINITY)).toEqual(O.none)\n\t\t\texpect(f(\"invalid\")).toEqual(O.none)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(dateMillisInt, x =>\n\t\t\t\t\texpect(f(x)).toEqual(O.some(new Date(x))),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Date.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` returns `O.none` for invalid date inputs and `O.some(new Date(x))` for valid date milliseconds.", "mode": "fast-check"} {"id": 55660, "name": "unknown", "code": "it(\"creates date using underlying number\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(dateMillisInt, n =>\n\t\t\t\t\texpect(f(mkMilliseconds(n)).toISOString()).toBe(\n\t\t\t\t\t\tnew Date(n).toISOString(),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Date.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Creating a date from milliseconds results in the same ISO string representation as directly using the number to create a date.", "mode": "fast-check"} {"id": 55664, "name": "unknown", "code": "it(\"joins\", () => {\n\t\t\texpect(f([])).toBe(\"\")\n\t\t\texpect(f([\"x\"])).toBe(\"x\")\n\t\t\texpect(f([\"x\", \"yz\"])).toBe(\"x,yz\")\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.string()), xs => {\n\t\t\t\t\tconst countDelims = flow(\n\t\t\t\t\t\tsplit(\"\"),\n\t\t\t\t\t\tRA.filter(c => c === delim),\n\t\t\t\t\t\tRA.size,\n\t\t\t\t\t)\n\n\t\t\t\t\tconst countDelimsA = flow(RA.map(countDelims), concatAll(N.MonoidSum))\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\tcountDelims(f(xs)) ===\n\t\t\t\t\t\tcountDelimsA(xs) + max(N.Ord)(0, A.size(xs) - 1)\n\t\t\t\t\t)\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` joins an array of strings with delimiters such that the number of delimiters in the result matches the expected count based on the input array's elements and length.", "mode": "fast-check"} {"id": 55675, "name": "unknown", "code": "it(\"output array A.size is the product of input array A.sizes\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.array(fc.anything()),\n\t\t\t\t\tfc.array(fc.anything()),\n\t\t\t\t\t(xs, ys) => f(xs)(ys).length === A.size(xs) * ys.length,\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The length of the output array should be the product of the sizes of two input arrays.", "mode": "fast-check"} {"id": 55701, "name": "unknown", "code": "it(\"calculates the median\", () => {\n\t\t\texpect(f([2, 9, 7])).toBe(7)\n\t\t\texpect(f([7, 2, 10, 9])).toBe(8)\n\n\t\t\tfc.assert(\n\t\t\t\tfc.property(\n\t\t\t\t\tfc.integer({ min: 1, max: 50 }),\n\t\t\t\t\tfc.integer(),\n\t\t\t\t\t(x, y) => f(A.replicate(x, y) as NonEmptyArray) === y,\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Calculates the median of an array and verifies that the median of a non-empty array of identical integers equals the repeated integer.", "mode": "fast-check"} {"id": 55719, "name": "unknown", "code": "it(\"does not reuse the input reference/object\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.anything()), xs => {\n\t\t\t\t\tconst ys = f(xs)\n\n\t\t\t\t\texpect(xs).toBe(xs)\n\t\t\t\t\texpect(xs).not.toBe(ys)\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "Function `f` returns a new array object instead of reusing the input array reference.", "mode": "fast-check"} {"id": 56564, "name": "unknown", "code": "it('returns exactly what it was given', () => {\n fc.assert(\n fc.property(fc.anything(), (anything) => {\n assert.strictEqual(Table.schema(anything as any), anything);\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/table.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`Table.schema` should return the exact input it receives.", "mode": "fast-check"} {"id": 56620, "name": "unknown", "code": "it('should return true for valid IPv4 addresses', () => {\n fc.assert(\n fc.property(fc.mixedCase(fc.ipV4()), (ip) => {\n assert.ok(DataAPIInet.isIPv4(ip));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/datatypes/inet.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`DataAPIInet.isIPv4` returns true for valid IPv4 addresses with varying case inputs.", "mode": "fast-check"} {"id": 56622, "name": "unknown", "code": "it('should return true for valid IPv6 addresses', () => {\n fc.assert(\n fc.property(fc.mixedCase(fc.ipV6()), (ip) => {\n assert.ok(DataAPIInet.isIPv6(ip));\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/datatypes/inet.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`DataAPIInet.isIPv6` should return true for valid IPv6 addresses with mixed casing.", "mode": "fast-check"} {"id": 56621, "name": "unknown", "code": "it('should return false for valid IPv6 addresses', () => {\n fc.assert(\n fc.property(fc.string(), (ip) => {\n fc.pre(tryCatchErrSync(() => new URL(`https://[${ip}]`)) !== undefined);\n assert.ok(!DataAPIInet.isIPv4(ip));\n }), {\n examples: [['a'], ['a'.repeat(100)]],\n },\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/datatypes/inet.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`DataAPIInet.isIPv4` returns false for valid IPv6 addresses.", "mode": "fast-check"} {"id": 56566, "name": "unknown", "code": "it('should not populate unpopulated fields', () => {\n fc.assert(\n fc.property(arbs.tableDefinitionAndRow(), ([schema]) => {\n const resp = serdes.deserialize({}, {\n status: { projectionSchema: schema },\n });\n assert.deepStrictEqual(resp, {});\n }),\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/tables/ser-des/sparse-data.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Deserialization should not populate unpopulated fields in response when given an empty input and a schema.", "mode": "fast-check"} {"id": 56619, "name": "unknown", "code": "it('should allow force creation of invalid values', () => {\n for (const version of [4, 6, undefined] as const) {\n fc.assert(\n fc.property(fc.anything(), (ip) => {\n if (ip !== null && (typeof ip === 'string' || typeof ip === 'object' && 'toLowerCase' in ip && typeof ip.toLowerCase === 'function')) {\n assert.doesNotThrow(() => new DataAPIInet(ip as any, version, false));\n } else {\n assert.throws(() => new DataAPIInet(ip as any, version, false), TypeError);\n }\n }), {\n examples: [[{ toLowerCase: () => 3 }]],\n },\n );\n }\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/datatypes/inet.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "Creating a `DataAPIInet` object with any input should not throw an error if the input is a string or an object with a `toLowerCase` function, but should throw a `TypeError` for other types.", "mode": "fast-check"} {"id": 56623, "name": "unknown", "code": "it('should return false for valid IPv6 addresses', () => {\n fc.assert(\n fc.property(fc.string(), (ip) => {\n fc.pre(tryCatchErrSync(() => new URL(`https://[${ip}]`)) !== undefined);\n assert.ok(!DataAPIInet.isIPv6(ip));\n }), {\n examples: [['a'], ['a'.repeat(100)]],\n },\n );\n })", "language": "typescript", "source_file": "./repos/datastax/astra-db-ts/tests/unit/documents/datatypes/inet.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "datastax/astra-db-ts", "url": "https://github.com/datastax/astra-db-ts.git", "license": "Apache-2.0", "stars": 25, "forks": 10}, "metrics": null, "summary": "`DataAPIInet.isIPv6` returns false for valid IPv6 addresses.", "mode": "fast-check"} {"id": 55720, "name": "unknown", "code": "it(\"copies the array contents\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.anything()), xs => expect(f(xs)).toEqual(xs)),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` should produce an exact copy of the contents of any given array.", "mode": "fast-check"} {"id": 55722, "name": "unknown", "code": "it(\"returns These Left for only Either Lefts\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.anything(), { minLength: 1 }), xs => {\n\t\t\t\t\tconst ys = pipe(xs as NonEmptyArray, NEA.map(E.left))\n\n\t\t\t\t\texpect(f(ys)).toEqual(T.left(xs))\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "The function `f` converts a non-empty array of `Either Left` values into a `These Left` containing the original array.", "mode": "fast-check"} {"id": 55723, "name": "unknown", "code": "it(\"returns These Right for only Either Rights\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.array(fc.anything(), { minLength: 1 }), xs => {\n\t\t\t\t\tconst ys = pipe(xs as NonEmptyArray, NEA.map(E.right))\n\n\t\t\t\t\texpect(f(ys)).toEqual(T.right(xs))\n\t\t\t\t}),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Array.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "`f` returns `These Right` when applied to a non-empty array of `Either Rights`.", "mode": "fast-check"} {"id": 55730, "name": "unknown", "code": "it(\"returns constant empty on all-empty input\", () => {\n\t\t\tfc.assert(\n\t\t\t\tfc.property(fc.anything(), x =>\n\t\t\t\t\texpect(\n\t\t\t\t\t\tf([constant(O.none), constant(O.none), constant(O.none)])(\n\t\t\t\t\t\t\tconstant(x),\n\t\t\t\t\t\t),\n\t\t\t\t\t).toEqual(O.none),\n\t\t\t\t),\n\t\t\t)\n\t\t})", "language": "typescript", "source_file": "./repos/samhh/fp-ts-std/test/Alternative.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "samhh/fp-ts-std", "url": "https://github.com/samhh/fp-ts-std.git", "license": "MIT", "stars": 211, "forks": 27}, "metrics": null, "summary": "For an input array of constant `O.none` functions, the output of `f` should also be `O.none` regardless of the provided argument.", "mode": "fast-check"} {"id": 55738, "name": "unknown", "code": "test('presents a starting state', () => {\n fc.assert(\n fc.property(fc.string(), value => {\n const tseq = new TSeq('p1');\n tseq.splice(0, 0, value);\n expect(tseq.toString()).toBe(value);\n })\n );\n })", "language": "typescript", "source_file": "./repos/m-ld/m-ld-js/test/tseq.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "m-ld/m-ld-js", "url": "https://github.com/m-ld/m-ld-js.git", "license": "MIT", "stars": 41, "forks": 3}, "metrics": null, "summary": "`TSeq` initialized and spliced with a string at the start index should convert to that string.", "mode": "fast-check"} {"id": 55740, "name": "unknown", "code": "test('process group converges with forced sync', () => {\n const numProcs = 3;\n fc.assert(\n fc.property(\n fc.commands([\n TSeqProcessGroupSpliceCommand.arbitrary(numProcs),\n TSeqProcessGroupForceSyncCommand.arbitrary()\n ], {\n size: '+1' // good coverage, <1sec runtime\n }),\n arbitraryProcessIds(numProcs),\n TSeqProcessGroupCommand.runModel\n )\n );\n })", "language": "typescript", "source_file": "./repos/m-ld/m-ld-js/test/tseq.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "m-ld/m-ld-js", "url": "https://github.com/m-ld/m-ld-js.git", "license": "MIT", "stars": 41, "forks": 3}, "metrics": null, "summary": "The `TSeqProcessGroup` achieves convergence through forced synchronization when executing sequences of splice and sync commands across multiple processes.", "mode": "fast-check"} {"id": 55741, "name": "unknown", "code": "test.each([\n [false, false],\n [true, false],\n [false, true],\n [true, true]\n ])('process group converges with partial deliveries', (fuse, redeliver) => {\n const numProcs = 3;\n fc.assert(\n fc.property(\n fc.commands([\n TSeqProcessGroupSpliceCommand.arbitrary(numProcs),\n TSeqProcessGroupDeliverCommand.arbitrary(numProcs, fuse, redeliver),\n TSeqProcessGroupCheckConvergedCommand.arbitrary()\n ], {\n size: '+1' // good coverage, <1sec runtime\n }),\n arbitraryProcessIds(numProcs),\n TSeqProcessGroupCommand.runModel\n )\n );\n })", "language": "typescript", "source_file": "./repos/m-ld/m-ld-js/test/tseq.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "m-ld/m-ld-js", "url": "https://github.com/m-ld/m-ld-js.git", "license": "MIT", "stars": 41, "forks": 3}, "metrics": null, "summary": "The test checks that a `TSeqProcessGroup` converges correctly despite partial deliveries, based on a combination of process commands and configurations with different `fuse` and `redeliver` settings.", "mode": "fast-check"} {"id": 55742, "name": "unknown", "code": "test('diff applies', () => {\n fc.assert(\n fc.property(\n fc.array(fc.nat({ max: 5 }), { maxLength: 4 }),\n fc.array(fc.nat({ max: 5 }), { maxLength: 4 }),\n (olds, news) => {\n const { deletes, inserts } = SubjectPropertyValues\n .for({ '@list': news }, '@list')\n .diff(olds);\n // New items must be expressed as slots\n slotify(inserts);\n const regen = SubjectPropertyValues\n .for({ '@list': [...olds] }, '@list')\n .update(deletes, inserts).values();\n expect(regen).toEqual(news);\n }\n ),\n { ignoreEqualValues: true }\n );\n })", "language": "typescript", "source_file": "./repos/m-ld/m-ld-js/test/subjects.test.ts", "start_line": null, "end_line": null, "dependencies": ["slotify"], "repo": {"name": "m-ld/m-ld-js", "url": "https://github.com/m-ld/m-ld-js.git", "license": "MIT", "stars": 41, "forks": 3}, "metrics": null, "summary": "The test verifies that updating a list by diffing old and new lists, converting new items to slots, and then regenerating the list, results in a list that matches the new list.", "mode": "fast-check"} {"id": 55744, "name": "unknown", "code": "assertArbitrary = (arbitrary: fc.Arbitrary, checks: FilterFunction[], result: boolean): void => {\n fc.assert(\n fc.property(arbitrary, (value) => {\n checks.forEach((check) => {\n expect(check(value)).toBe(result);\n });\n // TypeScript 2.7.2 does not work well with fast-check type definitions\n }) as any,\n );\n}", "language": "typescript", "source_file": "./repos/janjakubnanista/ts-type-checked/test/utils/utils.v2.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "janjakubnanista/ts-type-checked", "url": "https://github.com/janjakubnanista/ts-type-checked.git", "license": "MIT", "stars": 88, "forks": 5}, "metrics": null, "summary": "The function verifies that, for a given arbitrary value, each check in a list of filter functions consistently returns the specified boolean result.", "mode": "fast-check"} {"id": 55745, "name": "unknown", "code": "it('null/undefined should be valid values for any type', () => {\n const isEvent = typeCheckFor();\n\n const validArbitrary: fc.Arbitrary = oneOf(\n eventArbitrary(),\n fc.constantFrom({ Records: null }, { Records: undefined }, null, undefined),\n // Without strict null checks TypeScript is kinda useless - if in this case \"Records\"\n // is null or undefined the check should return true. But that is the case\n // for virtually any type - numbers, strings, booleans etc all have undefined \"Records\" property!\n oneOf(fc.string(), numeric(), fc.boolean(), fc.bigInt(), fc.func(fc.anything())) as fc.Arbitrary,\n );\n const invalidArbitrary = oneOf(\n eventArbitrary().map((event) => ({\n ...event,\n Records: {},\n })),\n eventArbitrary()\n .map((event) => ({\n ...event,\n Records: event.Records.map((record) => ({\n ...record,\n Sns: {\n ...record.Sns,\n TopicArn: 7,\n },\n })),\n }))\n .filter((event) => event.Records.length > 0),\n );\n\n fc.assert(\n fc.property(validArbitrary, (event: AWSSNSEvent): void => {\n expect(isEvent(event)).toBeTruthy();\n expect(isA(event)).toBeTruthy();\n }) as any,\n );\n\n fc.assert(\n fc.property(invalidArbitrary, (notAnEvent: any): void => {\n expect(isEvent(notAnEvent)).toBeFalsy();\n expect(isA(notAnEvent)).toBeFalsy();\n }) as any,\n );\n })", "language": "typescript", "source_file": "./repos/janjakubnanista/ts-type-checked/test/setups/without-strict-mode/tests/withoutStrictMode.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "janjakubnanista/ts-type-checked", "url": "https://github.com/janjakubnanista/ts-type-checked.git", "license": "MIT", "stars": 88, "forks": 5}, "metrics": null, "summary": "`AWSSNSEvent` should allow null or undefined values for any type, validating them as true, while invalid structures should be recognized as false.", "mode": "fast-check"} {"id": 55746, "name": "unknown", "code": "it('null/undefined should be valid values for any type', () => {\n const isEvent = typeCheckFor();\n\n const validArbitrary: fc.Arbitrary = oneOf(\n eventArbitrary(),\n fc.constantFrom({ Records: null }, { Records: undefined }, null, undefined),\n // Without strict null checks TypeScript is kinda useless - if in this case \"Records\"\n // is null or undefined the check should return true. But that is the case\n // for virtually any type - numbers, strings, booleans etc all have undefined \"Records\" property!\n oneOf(fc.string(), numeric(), fc.boolean(), fc.bigInt(), fc.func(fc.anything())) as fc.Arbitrary,\n );\n const invalidArbitrary = oneOf(\n eventArbitrary().map((event) => ({\n ...event,\n Records: {},\n })),\n eventArbitrary()\n .map((event) => ({\n ...event,\n Records: event.Records.map((record) => ({\n ...record,\n Sns: {\n ...record.Sns,\n TopicArn: 7,\n },\n })),\n }))\n .filter((event) => event.Records.length > 0),\n );\n\n fc.assert(\n fc.property(validArbitrary, (event: AWSSNSEvent): void => {\n expect(isEvent(event)).toBeTruthy();\n expect(isA(event)).toBeTruthy();\n }) as any,\n );\n\n fc.assert(\n fc.property(invalidArbitrary, (notAnEvent: any): void => {\n expect(isEvent(notAnEvent)).toBeFalsy();\n expect(isA(notAnEvent)).toBeFalsy();\n }) as any,\n );\n })", "language": "typescript", "source_file": "./repos/janjakubnanista/ts-type-checked/test/setups/without-strict-mode/tests/withoutStrictMode.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "janjakubnanista/ts-type-checked", "url": "https://github.com/janjakubnanista/ts-type-checked.git", "license": "MIT", "stars": 88, "forks": 5}, "metrics": null, "summary": "Null or undefined values should be considered valid for any type, while specific malformed structures should be recognized as invalid by type checks.", "mode": "fast-check"} {"id": 55748, "name": "unknown", "code": "test('recovering after same-type circular structure check', () => {\n const circularArbitrary = fc\n .integer(0, 50)\n .map<[TypeReference1, TypeReference1]>((n) => createLinkedList(n, true));\n\n // We check the valid arbitrary on a finer-grained level than the invalid one\n fc.assert(\n fc.property(circularArbitrary, ([head, tail]) => {\n expect(() => typeCheckFor()(head)).toThrow(circularTypeError);\n expect(() => isA(head)).toThrow(circularTypeError);\n\n head.next = undefined;\n expect(typeCheckFor()(head)).toBeTruthy();\n expect(isA(head)).toBeTruthy();\n\n head.next = tail;\n expect(() => typeCheckFor()(head)).toThrow(circularTypeError);\n expect(() => isA(head)).toThrow(circularTypeError);\n }) as any,\n );\n })", "language": "typescript", "source_file": "./repos/janjakubnanista/ts-type-checked/test/setups/typescript--2.7.2/tests/special-cases.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "janjakubnanista/ts-type-checked", "url": "https://github.com/janjakubnanista/ts-type-checked.git", "license": "MIT", "stars": 88, "forks": 5}, "metrics": null, "summary": "`typeCheckFor` and `isA` throw an error for a circular reference structure, but pass validation when the circular link is removed.", "mode": "fast-check"} {"id": 55749, "name": "unknown", "code": "test('alternating-type circular structure should throw an error', () => {\n const circularArbitrary = fc.integer(0, 100).map((n) => createLinkedList(n, true)[0]);\n\n // We check the valid arbitrary on a finer-grained level than the invalid one\n fc.assert(\n fc.property(circularArbitrary, (value) => {\n expect(() => typeCheckFor()(value)).toThrow(circularTypeError);\n expect(() => isA(value)).toThrow(circularTypeError);\n\n expect(() => typeCheckFor()(value.next)).toThrow(circularTypeError);\n expect(() => isA(value.next)).toThrow(circularTypeError);\n }) as any,\n );\n })", "language": "typescript", "source_file": "./repos/janjakubnanista/ts-type-checked/test/setups/typescript--2.7.2/tests/special-cases.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "janjakubnanista/ts-type-checked", "url": "https://github.com/janjakubnanista/ts-type-checked.git", "license": "MIT", "stars": 88, "forks": 5}, "metrics": null, "summary": "An alternating-type circular structure should throw an error during type checks with `typeCheckFor` and `isA`.", "mode": "fast-check"} {"id": 55750, "name": "unknown", "code": "test('recovering after same-type circular structure check', () => {\n const circularArbitrary = fc\n .integer(0, 50)\n .map<[TypeReference1, TypeReference2]>((n) => createLinkedList(n, true));\n\n // We check the valid arbitrary on a finer-grained level than the invalid one\n fc.assert(\n fc.property(circularArbitrary, ([head, tail]) => {\n expect(() => typeCheckFor()(head)).toThrow(circularTypeError);\n expect(() => isA(head)).toThrow(circularTypeError);\n\n tail.following = undefined;\n expect(typeCheckFor()(head)).toBeTruthy();\n expect(isA(head)).toBeTruthy();\n\n tail.following = head;\n expect(() => typeCheckFor()(head)).toThrow(circularTypeError);\n expect(() => isA(head)).toThrow(circularTypeError);\n }) as any,\n );\n })", "language": "typescript", "source_file": "./repos/janjakubnanista/ts-type-checked/test/setups/typescript--2.7.2/tests/special-cases.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "janjakubnanista/ts-type-checked", "url": "https://github.com/janjakubnanista/ts-type-checked.git", "license": "MIT", "stars": 88, "forks": 5}, "metrics": null, "summary": "Ensures that after detecting a same-type circular structure causing a type error, removing the circularity temporarily allows successful type-checking, but reinstating it leads to the error again.", "mode": "fast-check"} {"id": 55751, "name": "unknown", "code": "it('null/undefined should not be valid values for any type', () => {\n const isEvent = typeCheckFor();\n\n const validArbitrary: fc.Arbitrary = oneOf(eventArbitrary());\n const invalidArbitrary = oneOf(\n eventArbitrary().map((event) => ({\n ...event,\n Records: {},\n })),\n fc.constantFrom({ Records: null }, { Records: undefined }, null, undefined),\n // Without strict null checks TypeScript is kinda useless - if in this case \"Records\"\n // is null or undefined the check should return true. But that is the case\n // for virtually any type - numbers, strings, booleans etc all have undefined \"Records\" property!\n oneOf(fc.string(), numeric(), fc.boolean(), fc.bigInt(), fc.func(fc.anything())) as fc.Arbitrary,\n eventArbitrary()\n .map((event) => ({\n ...event,\n Records: event.Records.map((record) => ({\n ...record,\n Sns: {\n ...record.Sns,\n TopicArn: 7,\n },\n })),\n }))\n .filter((event) => event.Records.length > 0),\n );\n\n fc.assert(\n fc.property(validArbitrary, (event: AWSSNSEvent): void => {\n expect(isEvent(event)).toBeTruthy();\n expect(isA(event)).toBeTruthy();\n }),\n );\n\n fc.assert(\n fc.property(invalidArbitrary, (notAnEvent: any): void => {\n expect(isEvent(notAnEvent)).toBeFalsy();\n expect(isA(notAnEvent)).toBeFalsy();\n }),\n );\n })", "language": "typescript", "source_file": "./repos/janjakubnanista/ts-type-checked/test/setups/issue-43--strict-mode/tests/withStrict.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "janjakubnanista/ts-type-checked", "url": "https://github.com/janjakubnanista/ts-type-checked.git", "license": "MIT", "stars": 88, "forks": 5}, "metrics": null, "summary": "Null or undefined should not be valid for any type, specifically in the context of `AWSSNSEvent`, by ensuring `isEvent` and `isA` return false for invalid data, and true for valid data.", "mode": "fast-check"} {"id": 55752, "name": "unknown", "code": "it('null/undefined should not be valid values for any type', () => {\n const isEvent = typeCheckFor();\n\n const validArbitrary: fc.Arbitrary = oneOf(eventArbitrary());\n const invalidArbitrary = oneOf(\n eventArbitrary().map((event) => ({\n ...event,\n Records: {},\n })),\n fc.constantFrom({ Records: null }, { Records: undefined }, null, undefined),\n // Without strict null checks TypeScript is kinda useless - if in this case \"Records\"\n // is null or undefined the check should return true. But that is the case\n // for virtually any type - numbers, strings, booleans etc all have undefined \"Records\" property!\n oneOf(fc.string(), numeric(), fc.boolean(), fc.bigInt(), fc.func(fc.anything())) as fc.Arbitrary,\n eventArbitrary()\n .map((event) => ({\n ...event,\n Records: event.Records.map((record) => ({\n ...record,\n Sns: {\n ...record.Sns,\n TopicArn: 7,\n },\n })),\n }))\n .filter((event) => event.Records.length > 0),\n );\n\n fc.assert(\n fc.property(validArbitrary, (event: AWSSNSEvent): void => {\n expect(isEvent(event)).toBeTruthy();\n expect(isA(event)).toBeTruthy();\n }),\n );\n\n fc.assert(\n fc.property(invalidArbitrary, (notAnEvent: any): void => {\n expect(isEvent(notAnEvent)).toBeFalsy();\n expect(isA(notAnEvent)).toBeFalsy();\n }),\n );\n })", "language": "typescript", "source_file": "./repos/janjakubnanista/ts-type-checked/test/setups/issue-43--strict-mode/tests/withStrict.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "janjakubnanista/ts-type-checked", "url": "https://github.com/janjakubnanista/ts-type-checked.git", "license": "MIT", "stars": 88, "forks": 5}, "metrics": null, "summary": "`AWSSNSEvent` rejects null and undefined as valid values across different scenarios, ensuring strict type validation.", "mode": "fast-check"} {"id": 55833, "name": "unknown", "code": "it('should trap from a query method', async () => {\n const actor = await getCanisterActor('canister');\n\n await fc.assert(\n fc.asyncProperty(\n fc.string({\n maxLength: 500,\n size: 'max'\n }),\n async (message) => {\n const expectedErrorMessage = new RegExp(\n `Call failed:\\\\s*Canister: ${canisterId}\\\\s*Method: queryTrap \\\\(query\\\\)\\\\s*\"Status\": \"rejected\"\\\\s*\"Code\": \"CanisterError\"\\\\s*\"Message\": \"Error from Canister ${canisterId}: Canister called \\`ic0.trap\\` with message: 'trap proptest message:`\n );\n await expect(actor.queryTrap(message)).rejects.toThrow(\n expectedErrorMessage\n );\n await expect(actor.queryTrap(message)).rejects.toThrow(\n message.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"')\n );\n }\n ),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/trap/test/tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "The query method `queryTrap` should reject calls by trapping with the expected error message, including the user-provided message string.", "mode": "fast-check"} {"id": 55834, "name": "unknown", "code": "it('should trap from an update method', async () => {\n const actor = await getCanisterActor('canister');\n\n await fc.assert(\n fc.asyncProperty(\n fc.string({\n maxLength: 500,\n size: 'max'\n }),\n async (message) => {\n const expectedErrorMessage = new RegExp(\n `Call failed:\\\\s*Canister: ${canisterId}\\\\s*Method: updateTrap \\\\(update\\\\)\\\\s*\"Request ID\": \"[a-f0-9]{64}\"\\\\s*\"Error code\": \"IC0503\"\\\\s*\"Reject code\": \"5\"\\\\s*\"Reject message\": \"Error from Canister ${canisterId}: Canister called \\`ic0.trap\\` with message: 'trap proptest message:`\n );\n await expect(actor.updateTrap(message)).rejects.toThrow(\n expectedErrorMessage\n );\n await expect(actor.updateTrap(message)).rejects.toThrow(\n message.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"')\n );\n }\n ),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/trap/test/tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "An update method in the actor should consistently cause a trap with an expected error message and reject the operation correctly when invoked with various string messages.", "mode": "fast-check"} {"id": 55835, "name": "unknown", "code": "it('should trap from inspectMessage', async () => {\n const actor = await getCanisterActor('canister');\n\n await fc.assert(\n fc.asyncProperty(\n fc.string({\n maxLength: 500,\n size: 'max'\n }),\n async (message) => {\n const expectedErrorMessage = new RegExp(\n `Call failed:\\\\s*Canister: ${canisterId}\\\\s*Method: inspectMessageTrap \\\\(update\\\\)\\\\s*\"Request ID\": \"[a-f0-9]{64}\"\\\\s*\"Error code\": \"IC0503\"\\\\s*\"Reject code\": \"5\"\\\\s*\"Reject message\": \"Error from Canister ${canisterId}: Canister called \\`ic0.trap\\` with message: 'trap proptest message:`\n );\n await expect(\n actor.inspectMessageTrap(message)\n ).rejects.toThrow(expectedErrorMessage);\n await expect(\n actor.inspectMessageTrap(message)\n ).rejects.toThrow(\n message.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"')\n );\n }\n ),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/trap/test/tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "`inspectMessageTrap` method should throw an error, trapping messages that match the expected error pattern, including the specific message content.", "mode": "fast-check"} {"id": 55837, "name": "unknown", "code": "it('should return time from an update method', async () => {\n const actor = await getCanisterActor('canister');\n\n await fc.assert(\n fc.asyncProperty(fc.constant(undefined), async () => {\n const testTimeBefore = new Date().getTime() - 2_000;\n const canisterTime0 = nanoSecondsToMilliseconds(\n await actor.updateTime()\n );\n const canisterTime1 = nanoSecondsToMilliseconds(\n await actor.updateTime()\n );\n const testTimeAfter = new Date().getTime();\n\n expect(canisterTime0).toBeLessThan(canisterTime1);\n\n expect(canisterTime0).toBeGreaterThanOrEqual(\n testTimeBefore\n );\n expect(canisterTime1).toBeGreaterThanOrEqual(\n testTimeBefore\n );\n\n expect(canisterTime0).toBeLessThan(testTimeAfter);\n expect(canisterTime1).toBeLessThanOrEqual(testTimeAfter);\n }),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/time/test/tests.ts", "start_line": null, "end_line": null, "dependencies": ["nanoSecondsToMilliseconds"], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "The property ensures that the `updateTime` method returns increasing time values within a valid range when converted from nanoseconds to milliseconds.", "mode": "fast-check"} {"id": 55838, "name": "unknown", "code": "it('should return time from inspectMessage', async () => {\n const actor = await getCanisterActor('canister');\n\n await fc.assert(\n fc.asyncProperty(fc.constant(undefined), async () => {\n const testTimeBefore = new Date().getTime() - 2_000;\n\n const inspectMessageTime0 = nanoSecondsToMilliseconds(\n await getInspectMessageTime(actor)\n );\n const inspectMessageTime1 = nanoSecondsToMilliseconds(\n await getInspectMessageTime(actor)\n );\n\n const testTimeAfter = new Date().getTime();\n\n expect(inspectMessageTime0).toBeLessThanOrEqual(\n inspectMessageTime1\n );\n\n expect(inspectMessageTime0).toBeGreaterThanOrEqual(\n testTimeBefore\n );\n expect(inspectMessageTime0).toBeLessThan(testTimeAfter);\n\n expect(inspectMessageTime1).toBeGreaterThanOrEqual(\n testTimeBefore\n );\n expect(inspectMessageTime1).toBeLessThanOrEqual(\n testTimeAfter\n );\n }),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/time/test/tests.ts", "start_line": null, "end_line": null, "dependencies": ["nanoSecondsToMilliseconds", "getInspectMessageTime"], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "The property should hold that `inspectMessageTime` converted to milliseconds is non-decreasing and falls within the expected time bounds before and after invocation.", "mode": "fast-check"} {"id": 55839, "name": "unknown", "code": "it('should produce distinct results from cryptoGetRandomValues for multiple calls with the default seed', async () => {\n const actor = await getCanisterActor('canister');\n\n await fc.assert(\n fc.asyncProperty(\n fc.integer({ min: 1, max: 100 }),\n fc.integer({ min: 2, max: 10 }),\n async (length, rawNumCalls) => {\n const numCalls = normalizeNumCalls(length, rawNumCalls);\n\n let results = new Set();\n\n for (let i = 0; i < numCalls; i++) {\n const result =\n await actor.cryptoGetRandomValues(length);\n\n results.add(Buffer.from(result).toString('hex'));\n }\n\n expect(results.size).toBe(numCalls);\n }\n ),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/rand_seed/test/tests.ts", "start_line": null, "end_line": null, "dependencies": ["normalizeNumCalls"], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "`cryptoGetRandomValues` should produce distinct results on successive calls with the default seed, even when limited by normalized call numbers for a given length.", "mode": "fast-check"} {"id": 55840, "name": "unknown", "code": "it('should produce the same results from cryptoGetRandomValues when using the same seed', async () => {\n const actor = await getCanisterActor('canister');\n\n await fc.assert(\n fc.asyncProperty(\n fc.integer({ min: 1, max: 100 }),\n fc.integer({ min: 2, max: 10 }),\n fc.uint8Array({ minLength: 32, maxLength: 32 }),\n async (length, rawNumCalls, seed) => {\n const numCalls = normalizeNumCalls(length, rawNumCalls);\n\n await actor.seed(seed);\n\n let results: string[] = [];\n\n for (let i = 0; i < numCalls; i++) {\n const result =\n await actor.cryptoGetRandomValues(length);\n\n results.push(Buffer.from(result).toString('hex'));\n }\n\n await actor.seed(seed);\n\n for (let i = 0; i < numCalls; i++) {\n const result =\n await actor.cryptoGetRandomValues(length);\n\n expect(Buffer.from(result).toString('hex')).toBe(\n results[i]\n );\n }\n }\n ),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/rand_seed/test/tests.ts", "start_line": null, "end_line": null, "dependencies": ["normalizeNumCalls"], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "`cryptoGetRandomValues` produces consistent outputs when using the same seed across multiple calls.", "mode": "fast-check"} {"id": 55841, "name": "unknown", "code": "it('should produce distinct results from cryptoGetRandomValues when using different seeds', async () => {\n const actor = await getCanisterActor('canister');\n\n await fc.assert(\n fc.asyncProperty(\n fc.integer({ min: 1, max: 100 }),\n fc.integer({ min: 2, max: 10 }),\n fc\n .tuple(\n fc.uint8Array({ minLength: 32, maxLength: 32 }),\n fc.uint8Array({ minLength: 32, maxLength: 32 })\n )\n .filter(\n ([seed1, seed2]) => sameSeed(seed1, seed2) === false\n ),\n async (length, rawNumCalls, [seed1, seed2]) => {\n const numCalls = normalizeNumCalls(length, rawNumCalls);\n\n await actor.seed(seed1);\n\n let results: string[] = [];\n\n for (let i = 0; i < numCalls; i++) {\n const result =\n await actor.cryptoGetRandomValues(length);\n\n results.push(Buffer.from(result).toString('hex'));\n }\n\n await actor.seed(seed2);\n\n for (let i = 0; i < numCalls; i++) {\n const result =\n await actor.cryptoGetRandomValues(length);\n\n expect(\n Buffer.from(result).toString('hex')\n ).not.toBe(results[i]);\n }\n }\n ),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/rand_seed/test/tests.ts", "start_line": null, "end_line": null, "dependencies": ["sameSeed", "normalizeNumCalls"], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "`cryptoGetRandomValues` should produce different results when initialized with different seeds.", "mode": "fast-check"} {"id": 55845, "name": "unknown", "code": "it('should always reply with the input in alwaysReplyQuery and alwaysReplyUpdate', async () => {\n const context: Context = {\n constraints: {}\n };\n await fc.assert(\n fc.asyncProperty(\n CandidValueAndMetaArbGenerator(\n context,\n candidDefinitionArb(context, {}),\n CandidValueArb\n ),\n fc.uuid(),\n async (input, uuid) => {\n const {\n src: {\n typeAnnotation: tsType,\n imports,\n typeObject: idlType,\n variableAliasDeclarations\n },\n value: { agentArgumentValue }\n } = input;\n const canister = await setupCanister(\n uuid,\n idlType,\n tsType,\n Array.from(imports.add('msgArgData')),\n variableAliasDeclarations\n );\n\n const queryResult =\n await canister.alwaysReplyQuery(agentArgumentValue);\n expect(queryResult).toEqual(agentArgumentValue);\n\n const updateResult =\n await canister.alwaysReplyUpdate(\n agentArgumentValue\n );\n expect(updateResult).toEqual(agentArgumentValue);\n\n cleanUpCanister(uuid);\n }\n ),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/msg_reply/test/tests.ts", "start_line": null, "end_line": null, "dependencies": ["setupCanister", "cleanUpCanister"], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "Both `alwaysReplyQuery` and `alwaysReplyUpdate` should return the exact input they receive.", "mode": "fast-check"} {"id": 55846, "name": "unknown", "code": "it('should always reject with the provided message in alwaysRejectQuery', async () => {\n const canister = await getCanisterActor('canister');\n await fc.assert(\n fc.asyncProperty(fc.string(), async (message) => {\n await expect(\n canister.alwaysRejectQuery(message)\n ).rejects.toThrow(\n message.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"')\n );\n }),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/msg_reject/test/tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "`alwaysRejectQuery` should always throw a rejection containing the provided message, ensuring proper handling of string escape characters.", "mode": "fast-check"} {"id": 55849, "name": "unknown", "code": "it('should reply with even numbers and reject odd numbers in evenOrRejectUpdate', async () => {\n const canister = await getCanisterActor('canister');\n await fc.assert(\n fc.asyncProperty(fc.bigInt(), async (number) => {\n if (number % 2n === 0n) {\n const result =\n await canister.evenOrRejectUpdate(number);\n expect(result).toBe(number);\n } else {\n await expect(\n canister.evenOrRejectUpdate(number)\n ).rejects.toThrow('Odd numbers are rejected');\n }\n }),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/msg_reject/test/tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "The property ensures that `evenOrRejectUpdate` replies with the input number for even inputs and rejects with an error message for odd inputs.", "mode": "fast-check"} {"id": 56839, "name": "unknown", "code": "it('should not print Fizz when not divisible by 3', () => {\n fc.assert(\n fc.property(\n fc.oneof(\n fc.nat().map((n) => n * 3 + 1),\n fc.nat().map((n) => n * 3 + 2)\n ),\n (n) => {\n expect(fizzbuzz(n)).not.toContain('Fizz');\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-03.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The `fizzbuzz` function should not return 'Fizz' for numbers not divisible by 3.", "mode": "fast-check"} {"id": 56841, "name": "unknown", "code": "it('should print Buzz whenever divisible by 5', () => {\n fc.assert(\n fc.property(\n fc.nat().map((n) => n * 5),\n (n) => {\n expect(fizzbuzz(n)).toContain('Buzz');\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-03.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The `fizzbuzz` function should include \"Buzz\" in its output for numbers divisible by 5.", "mode": "fast-check"} {"id": 56844, "name": "unknown", "code": "it('should print Fizz Buzz whenever divisible by 3 and 5', () => {\n fc.assert(\n fc.property(\n fc\n .nat()\n .map((n) => n * 3)\n .map((n) => n * 5),\n (n) => {\n expect(fizzbuzz(n)).toBe('Fizz Buzz');\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-03.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The function `fizzbuzz` returns \"Fizz Buzz\" for numbers divisible by both 3 and 5.", "mode": "fast-check"} {"id": 56847, "name": "unknown", "code": "it(\"should produce an array such that the product equals the input\", () => {\n fc.assert(\n fc.property(fc.integer({ min: 2, max: 2 ** 31 - 1 }), (n) => {\n const factors = decomposeIntoPrimes(n);\n const productOfFactors = factors.reduce((a, b) => a * b, 1);\n return productOfFactors === n;\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-02.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Decomposing an integer into its prime factors should result in an array whose product equals the original integer.", "mode": "fast-check"} {"id": 56840, "name": "unknown", "code": "it('should only print Fizz when divisible by 3 but not by 5', () => {\n fc.assert(\n fc.property(\n fc.oneof(\n fc\n .nat()\n .map((n) => n * 5 + 1)\n .map((n) => n * 3),\n fc\n .nat()\n .map((n) => n * 5 + 2)\n .map((n) => n * 3),\n fc\n .nat()\n .map((n) => n * 5 + 3)\n .map((n) => n * 3),\n fc\n .nat()\n .map((n) => n * 5 + 4)\n .map((n) => n * 3)\n ),\n (n) => {\n expect(fizzbuzz(n)).toBe('Fizz');\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-03.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`fizzbuzz` outputs \"Fizz\" for numbers divisible by 3 but not by 5.", "mode": "fast-check"} {"id": 56842, "name": "unknown", "code": "it('should not print Buzz when not divisible by 5', () => {\n fc.assert(\n fc.property(\n fc.oneof(\n fc.nat().map((n) => n * 5 + 1),\n fc.nat().map((n) => n * 5 + 2),\n fc.nat().map((n) => n * 5 + 3),\n fc.nat().map((n) => n * 5 + 4)\n ),\n (n) => {\n expect(fizzbuzz(n)).not.toContain('Buzz');\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-03.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`fizzbuzz` should not include 'Buzz' for numbers not divisible by 5.", "mode": "fast-check"} {"id": 56845, "name": "unknown", "code": "it('should print the value itself when not divisible by 3 and not divisible by 5', () => {\n fc.assert(\n fc.property(\n fc.oneof(\n fc.nat().map((n) => n * 15 + 1),\n fc.nat().map((n) => n * 15 + 2),\n fc.nat().map((n) => n * 15 + 4), // +3 would be divisible by 3\n fc.nat().map((n) => n * 15 + 7), // +5 would be divisible by 5, +6 would be divisible by 3\n fc.nat().map((n) => n * 15 + 8), // +9 would be divisible by 3, +10 would be divisible by 5\n fc.nat().map((n) => n * 15 + 11),\n fc.nat().map((n) => n * 15 + 13), // +12 would be divisible by 3\n fc.nat().map((n) => n * 15 + 14)\n ),\n (n) => {\n expect(fizzbuzz(n)).toBe(String(n));\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-03.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "The function `fizzbuzz` should return the number itself as a string when the number is not divisible by 3 or 5.", "mode": "fast-check"} {"id": 56838, "name": "unknown", "code": "it('should print Fizz whenever divisible by 3', () => {\n fc.assert(\n fc.property(\n fc.nat().map((n) => n * 3),\n (n) => {\n expect(fizzbuzz(n)).toContain('Fizz');\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-03.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`fizzbuzz` includes \"Fizz\" in the output when the input is divisible by 3.", "mode": "fast-check"} {"id": 56843, "name": "unknown", "code": "it('should only print Buzz when divisible by 5 but not by 3', () => {\n fc.assert(\n fc.property(\n fc.oneof(\n fc\n .nat()\n .map((n) => n * 3 + 1)\n .map((n) => n * 5),\n fc\n .nat()\n .map((n) => n * 3 + 2)\n .map((n) => n * 5)\n ),\n (n) => {\n expect(fizzbuzz(n)).toBe('Buzz');\n }\n )\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-03.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "`fizzbuzz` should output \"Buzz\" when a number is divisible by 5 but not by 3.", "mode": "fast-check"} {"id": 56846, "name": "unknown", "code": "it(\"should only produce integer values in [2, 2**31-1] for factors\", () => {\n fc.assert(\n fc.property(fc.integer({ min: 2, max: 2 ** 31 - 1 }), (n) => {\n const factors = decomposeIntoPrimes(n);\n for (const factor of factors) {\n expect(Number.isInteger(factor)).toBe(true);\n expect(factor).toBeGreaterThanOrEqual(2);\n expect(factor).toBeLessThanOrEqual(2 ** 31 - 1);\n }\n })\n );\n})", "language": "typescript", "source_file": "./repos/dubzzz/advent-of-pbt-2021/day-02.spec.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "dubzzz/advent-of-pbt-2021", "url": "https://github.com/dubzzz/advent-of-pbt-2021.git", "license": "MIT", "stars": 5, "forks": 0}, "metrics": null, "summary": "Each factor produced by `decomposeIntoPrimes` should be an integer within the range [2, 2**31-1].", "mode": "fast-check"} {"id": 55850, "name": "unknown", "code": "it('gets the init msg arg data from the canister', async () => {\n const constraints: DefinitionConstraints = {\n recursiveWeights: true,\n weights: {\n func: 0, // random func is not supported for didc\n null: 0, // null comes out of didc random as (null) and out of candidDecode as (null: null)\n opt: 0, // None comes out of didc random as (null) and out of candidDecode as (null: null)\n record: 0, // record property names don't get decoded as actual names\n variant: 0, // variant property names don't get decoded as actual names\n float32: 0, // float32 without a decimal point aren't accepted by candidEncodeQuery\n float64: 0, // float64 with a decimal point is accepted by candidEncodeQuery\n blob: 0, // blobs are different from didc random and candidDecode, but in a way that seems broken\n vec: 0 // if given an empty vec, candidEncode will give a byte array representing a vec of empty regardless of the original type of the vec, additionally if given a vec of nat8 that is the same as blob which is broken\n }\n };\n await fc.assert(\n fc.asyncProperty(\n candidDefinitionArb({ constraints }, {}),\n candidDefinitionArb({ constraints }, {}),\n candidDefinitionArb({ constraints }, {}),\n async (deployArgDef, queryArgDef, updateArgDef) => {\n const actor = await setupCanisters(\n deployArgDef,\n queryArgDef,\n updateArgDef\n );\n\n await testDeploy(actor, deployArgDef, 'init');\n\n await testDeploy(actor, deployArgDef, 'postUpgrade');\n\n for (let i = 0; i < 100; i++) {\n console.info('Query method iteration:', i);\n await testCanisterMethod(queryArgDef, 'Query');\n }\n for (let i = 0; i < 10; i++) {\n console.info('Update method iteration:', i);\n await testCanisterMethod(updateArgDef, 'Update');\n }\n }\n ),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/msg_arg_data/test/tests.ts", "start_line": null, "end_line": null, "dependencies": ["setupCanisters", "testDeploy", "testCanisterMethod"], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "Setup and verify canister initialization and message argument data consistency through multiple deployment and call operations using random Candid inputs, ensuring correct data handling across initialization, post-upgrade, query, and update operations.", "mode": "fast-check"} {"id": 55854, "name": "unknown", "code": "it('should return false for non-controller principal from a query method', async () => {\n const actor = await getCanisterActor('canister');\n\n await fc.assert(\n fc.asyncProperty(\n fc.uint8Array({ minLength: 29, maxLength: 29 }),\n async (bytes) => {\n const principal = Principal.fromUint8Array(bytes);\n\n const isController =\n await actor.queryIsController(principal);\n\n expect(isController).toStrictEqual(false);\n }\n ),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/is_controller/test/tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "`queryIsController` should return false for principals constructed from 29-byte arrays that do not represent the canister controller.", "mode": "fast-check"} {"id": 55851, "name": "unknown", "code": "it.each(testCases)(\n 'should test jsonStringify and jsonParse with $type method',\n async ({ method }) => {\n const executionParams = {\n ...defaultPropTestParams(),\n numRuns:\n 20 * Number(process.env.AZLE_PROPTEST_NUM_RUNS ?? 1)\n };\n\n await fc.assert(\n fc.asyncProperty(recursiveValueArb, async (value) => {\n const actor =\n await getCanisterActor('canister');\n\n const jsonString = jsonStringify(value);\n\n const returnedJsonString =\n await actor[method](jsonString);\n const parsedValue = jsonParse(returnedJsonString);\n\n expect(returnedJsonString).toBe(jsonString);\n expect(parsedValue).toEqual(value);\n }),\n executionParams\n );\n }\n )", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/json/test/tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "Verifies `jsonStringify` and `jsonParse` functions maintain value integrity through serialization and deserialization using the specified canister actor method.", "mode": "fast-check"} {"id": 55852, "name": "unknown", "code": "it('should return true for whoami principal from a query method', async () => {\n const actor = await getCanisterActor('canister');\n\n await fc.assert(\n fc.asyncProperty(fc.constant(undefined), async () => {\n const principal = Principal.fromText(whoamiPrincipal());\n\n const isController =\n await actor.queryIsController(principal);\n\n expect(isController).toStrictEqual(true);\n }),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/is_controller/test/tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "`queryIsController` should return true when the queried principal is the `whoamiPrincipal`.", "mode": "fast-check"} {"id": 55856, "name": "unknown", "code": "it('should return true for controller principal from an update method', async () => {\n const actor = await getCanisterActor('canister');\n\n await fc.assert(\n fc.asyncProperty(\n fc.uint8Array({ minLength: 29, maxLength: 29 }),\n async (bytes) => {\n const principal = Principal.fromUint8Array(bytes);\n\n execSync(\n `dfx canister update-settings canister --add-controller ${principal}`,\n {\n stdio: 'inherit'\n }\n );\n\n const isController =\n await actor.updateIsController(principal);\n\n execSync(\n `dfx canister update-settings canister --remove-controller ${principal}`,\n {\n stdio: 'inherit'\n }\n );\n\n expect(isController).toStrictEqual(true);\n }\n ),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/is_controller/test/tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "Returns true for a principal designated as a controller during an update method call on an actor.", "mode": "fast-check"} {"id": 55858, "name": "unknown", "code": "it('should send all cycles from intermediary to cycles canister and receive none back', async () => {\n const intermediaryCanister =\n await getCanisterActor('intermediary');\n await fc.assert(\n fc.asyncProperty(fc.bigInt(0n, 10_000_000n), async (amount) => {\n const result =\n await intermediaryCanister.sendAllCycles(amount);\n validateCyclesResult(result, amount, 'all');\n }),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/cycles/test/tests.ts", "start_line": null, "end_line": null, "dependencies": ["validateCyclesResult"], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "Ensures that sending all cycles from the intermediary canister results in no cycles being refunded, with the entire amount sent and accepted matching the initial available cycles.", "mode": "fast-check"} {"id": 55859, "name": "unknown", "code": "it('should send a portion of the cycles from intermediary to cycles canister and receive the rest back', async () => {\n const intermediaryCanister =\n await getCanisterActor('intermediary');\n await fc.assert(\n fc.asyncProperty(\n fc.bigInt(0n, 10_000_000n),\n fc.bigInt(0n, 10_000_000n),\n async (amountToSend, amountToAccept) => {\n const result =\n await intermediaryCanister.sendVariableCycles(\n amountToSend,\n amountToAccept\n );\n validateCyclesResult(\n result,\n amountToSend,\n 'variable',\n amountToAccept\n );\n }\n ),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/cycles/test/tests.ts", "start_line": null, "end_line": null, "dependencies": ["validateCyclesResult"], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "Transferring a portion of cycles results in the correct acceptance, refunding, and balance changes, based on specified amounts sent and accepted in variable mode.", "mode": "fast-check"} {"id": 55860, "name": "unknown", "code": "it('should receive all cycles back to the intermediary if none are received by the cycles canister', async () => {\n const intermediaryCanister =\n await getCanisterActor('intermediary');\n await fc.assert(\n fc.asyncProperty(fc.bigInt(0n, 10_000_000n), async (amount) => {\n const result =\n await intermediaryCanister.sendNoCycles(amount);\n validateCyclesResult(result, amount, 'none');\n }),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/cycles/test/tests.ts", "start_line": null, "end_line": null, "dependencies": ["validateCyclesResult"], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "When no cycles are received by the cycles canister, all cycles should be returned to the intermediary.", "mode": "fast-check"} {"id": 55861, "name": "unknown", "code": "it('should send cycles in chunks from intermediary to cycles canister', async () => {\n const intermediaryCanister =\n await getCanisterActor('intermediary');\n await fc.assert(\n fc.asyncProperty(\n fc.bigInt(0n, 10_000_000n),\n fc.bigInt(1n, 10n),\n async (amount, numChunks) => {\n const result =\n await intermediaryCanister.sendCyclesByChunk(\n amount,\n numChunks\n );\n\n validateCyclesResult(result, amount, 'all');\n }\n ),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/cycles/test/tests.ts", "start_line": null, "end_line": null, "dependencies": ["validateCyclesResult"], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "Sending cycles from an intermediary to a canister results in the entire amount being accepted and properly accounted for in all fields of `CyclesResult`.", "mode": "fast-check"} {"id": 55862, "name": "unknown", "code": "it('should burn the cycles', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.bigInt(0n, 1_000_000_000_000_000n),\n async (amount) => {\n execSync(\n `dfx ledger fabricate-cycles --canister canister --cycles 1000000000000000`,\n { stdio: 'inherit' }\n );\n\n const actor = await getCanisterActor('canister');\n\n const cycleBalanceBefore =\n await actor.getCycleBalance();\n const cyclesBurned =\n await actor.updateCyclesBurn(amount);\n const cycleBalanceAfter = await actor.getCycleBalance();\n\n expect(\n cycleBalanceBefore -\n cycleBalanceAfter -\n cyclesBurned\n ).toBeLessThanOrEqual(10_000_000n);\n }\n ),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/cycles_burn/test/tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "The function should accurately burn a specified amount of cycles from a canister, with the discrepancy between the cycle balance before and after being minimal.", "mode": "fast-check"} {"id": 55863, "name": "unknown", "code": "it.each(testCases)(\n 'should fill the $typedArray.name correctly and return the correct byte length for round $round.name',\n async ({ round, typedArray }) => {\n if (round.name === 'after upgrade-unchanged') {\n execSync('dfx deploy canister --upgrade-unchanged');\n }\n\n if (round.name === 'after reinstall') {\n execSync('dfx canister uninstall-code canister');\n execSync('dfx deploy canister');\n }\n\n const actor = await getCanisterActor('canister');\n const maxElements = Math.floor(\n 65_536 / typedArray.bytesPerElement\n );\n\n await fc.assert(\n fc.asyncProperty(\n fc.nat(maxElements),\n fc.integer({ min: 2, max: 10 }),\n async (length, rawNumCalls) => {\n const numCalls = normalizeNumCalls(\n length,\n rawNumCalls\n );\n\n await validateCryptoGetRandomValues(\n actor,\n typedArray.name,\n typedArray.bytesPerElement,\n length,\n numCalls\n );\n }\n ),\n defaultPropTestParams()\n );\n }\n )", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/crypto_get_random_values/test/tests.ts", "start_line": null, "end_line": null, "dependencies": ["normalizeNumCalls", "validateCryptoGetRandomValues"], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "`validateCryptoGetRandomValues` ensures that multiple calls to `cryptoGetRandomValues` produce unique arrays of correct byte length, with each byte within the valid range.", "mode": "fast-check"} {"id": 55864, "name": "unknown", "code": "it.each(testCases)(\n 'should throw quota exceeded error for $typedArray.name with byte length > 65_536 for round $round.name',\n async ({ round, typedArray }) => {\n if (round.name === 'after upgrade-unchanged') {\n execSync('dfx deploy canister --upgrade-unchanged');\n }\n\n if (round.name === 'after reinstall') {\n execSync('dfx canister uninstall-code canister');\n execSync('dfx deploy canister');\n }\n\n const actor = await getCanisterActor('canister');\n const minElementsToExceed =\n Math.floor(65_536 / typedArray.bytesPerElement) + 1;\n\n await fc.assert(\n fc.asyncProperty(\n fc.integer({\n min: minElementsToExceed,\n max: 1_000_000\n }),\n async (length) => {\n await expect(\n actor.cryptoGetRandomValues(\n typedArray.name,\n length\n )\n ).rejects.toThrow(\n 'QuotaExceeded: array cannot be larger than 65_536 bytes'\n );\n }\n ),\n defaultPropTestParams()\n );\n }\n )", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/crypto_get_random_values/test/tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "The test confirms that calling `cryptoGetRandomValues` with a typed array exceeding 65,536 bytes consistently throws a \"QuotaExceeded\" error.", "mode": "fast-check"} {"id": 55867, "name": "unknown", "code": "it('should not hit the instruction limit with chunking in a timer', async () => {\n const actor = await getCanisterActor('canister');\n\n await fc.assert(\n fc.asyncProperty(fc.nat({ max }), async (constant) => {\n await actor.measureSumTimer(\n 20_000_000 + 1_000_000 * constant,\n true\n );\n\n // We want to give the timer enough time to at least get started\n await new Promise((resolve) => setTimeout(resolve, 5_000));\n\n let continueLoop: boolean = true;\n\n while (continueLoop) {\n const timerStarted = await actor.getTimerStarted();\n\n expect(timerStarted).toStrictEqual(true);\n\n const timerEnded = await actor.getTimerEnded();\n\n if (timerEnded === true) {\n const timerInstructions =\n await actor.getTimerInstructions();\n\n expect(timerInstructions).toBeGreaterThanOrEqual(\n updateCallInstructionLimit\n );\n\n continueLoop = false;\n } else {\n await new Promise((resolve) =>\n setTimeout(resolve, 5_000)\n );\n }\n }\n }),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/chunk/test/tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "The timer with chunking should start and finish without exceeding the instruction limit.", "mode": "fast-check"} {"id": 55868, "name": "unknown", "code": "it('sets and gets certified data', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.uint8Array({ minLength: 0, maxLength: 32 }),\n async (data) => {\n const agent = await createAuthenticatedAgent(whoami());\n const actor = await getCanisterActor(\n CANISTER_NAME,\n {\n agent\n }\n );\n\n await actor.setData(data);\n\n await testCertifiedData(\n data,\n actor,\n agent,\n CANISTER_NAME\n );\n }\n ),\n {\n ...defaultPropTestParams(),\n numRuns:\n Number(process.env.AZLE_PROPTEST_NUM_RUNS ?? 1) * 10\n }\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/certified_data/test/tests.ts", "start_line": null, "end_line": null, "dependencies": ["testCertifiedData"], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "The property should hold that setting and retrieving certified data from a canister results in the data matching the expected value, with the certificate verification succeeding.", "mode": "fast-check"} {"id": 55871, "name": "unknown", "code": "it('sets certified data in post upgrade', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.uint8Array({ minLength: 0, maxLength: 32 }),\n async (data) => {\n uninstallCanister();\n deployCanister();\n const agent = await createAuthenticatedAgent(whoami());\n const actor = await getCanisterActor(\n CANISTER_NAME,\n {\n agent\n }\n );\n\n // Check that getCertificate returns an empty array initially\n await testCertifiedData(\n new Uint8Array(),\n actor,\n agent,\n CANISTER_NAME\n );\n\n deployCanister({\n setData: true,\n force: true,\n data\n });\n\n await testCertifiedData(\n data,\n actor,\n agent,\n CANISTER_NAME\n );\n }\n ),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/certified_data/test/tests.ts", "start_line": null, "end_line": null, "dependencies": ["uninstallCanister", "deployCanister", "testCertifiedData"], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "Certified data in a canister is accurately set and verified after deployment and upgrade, ensuring it matches expected values.", "mode": "fast-check"} {"id": 55872, "name": "unknown", "code": "it('always returns undefined (which comes out of the canister as [] (ie None)) when trying to get data certificate in update method', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.uint8Array({ minLength: 0, maxLength: 32 }),\n async (data) => {\n const actor =\n await getCanisterActor(CANISTER_NAME);\n\n expect(\n await actor.getDataCertificateInUpdate()\n ).toEqual([]);\n\n await actor.setData(data);\n\n expect(\n await actor.getDataCertificateInUpdate()\n ).toEqual([]);\n }\n ),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/certified_data/test/tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "Calling `getDataCertificateInUpdate` in an update method always returns `undefined`, represented as an empty array `[]`.", "mode": "fast-check"} {"id": 55873, "name": "unknown", "code": "it('throws error when trying to set certified data longer than 32 bytes', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.uint8Array({ minLength: 0, maxLength: 32 }), // valid data\n fc.uint8Array({ minLength: 33, maxLength: 100 }), // invalid data\n async (validData, invalidData) => {\n const agent = await createAuthenticatedAgent(whoami());\n const canisterId = getCanisterId(CANISTER_NAME);\n const actor = await getCanisterActor(\n CANISTER_NAME,\n {\n agent\n }\n );\n\n // First verify we can set valid data\n await actor.setData(validData);\n await testCertifiedData(\n validData,\n actor,\n agent,\n CANISTER_NAME\n );\n\n // Then verify invalid data throws error\n const expectedErrorMessage = new RegExp(\n `Call failed:\\\\s*Canister: ${canisterId}\\\\s*Method: setData \\\\(update\\\\)\\\\s*\"Request ID\": \"[a-f0-9]{64}\"\\\\s*\"Error code\": \"IC0504\"\\\\s*\"Reject code\": \"5\"\\\\s*\"Reject message\": \"Error from Canister ${canisterId}:`\n );\n await expect(\n actor.setData(invalidData)\n ).rejects.toThrow(expectedErrorMessage);\n await expect(\n actor.setData(invalidData)\n ).rejects.toThrow(\n 'Canister violated contract: ic0_certified_data_set failed because the passed data must be no larger than 32 bytes'\n );\n\n // Verify the certificate still contains the valid data\n await testCertifiedData(\n validData,\n actor,\n agent,\n CANISTER_NAME\n );\n }\n ),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/certified_data/test/tests.ts", "start_line": null, "end_line": null, "dependencies": ["testCertifiedData"], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "Setting certified data over 32 bytes should throw an error, while setting data within the limit should succeed and retain validity.", "mode": "fast-check"} {"id": 55874, "name": "unknown", "code": "it('gets the canister version from the canister', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.nat({\n max: 10\n }),\n async (timesToDeploy) => {\n // Stop and delete the canister before every run\n execSync(`dfx canister stop canister || true`, {\n stdio: 'inherit'\n });\n\n execSync(`dfx canister delete canister || true`, {\n stdio: 'inherit'\n });\n\n execSync(`dfx deploy canister`, {\n stdio: 'inherit'\n });\n\n const startingVer = 1n; // Canister version starts at 0 when it's created but the deploy above will increment it to be at 1 by the time it gets here\n\n const actor = await getCanisterActor('canister');\n\n await checkInitVersion(actor, startingVer);\n await checkUpgradeVersion(actor);\n await checkInspectVersion(actor, startingVer);\n await checkQueryAndUpdateVersion(\n actor,\n startingVer + 1n\n );\n\n const versionsAtDeploy = Array.from(\n { length: timesToDeploy },\n (_, index) => BigInt(index * 2) + startingVer\n );\n\n for (const version of versionsAtDeploy) {\n execSync(`dfx deploy canister --upgrade-unchanged`);\n\n await checkInitVersion(actor);\n await checkUpgradeVersion(actor, version);\n await checkInspectVersion(actor, version);\n await checkQueryAndUpdateVersion(actor, version);\n }\n }\n ),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/canister_version/test/tests.ts", "start_line": null, "end_line": null, "dependencies": ["checkInitVersion", "checkUpgradeVersion", "checkInspectVersion", "checkQueryAndUpdateVersion"], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "The test ensures that the canister's version increments correctly across multiple deployments, starting from a defined version, and that the initial, post-upgrade, inspect, query, and update versions are as expected.", "mode": "fast-check"} {"id": 55875, "name": "unknown", "code": "it('should deploy and check all canister id methods', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.nat({\n max: 254\n }),\n async (nat) => {\n // We need to ensure that the canister id that we generate is on the\n // correct local subnet. We've taken the binary representation of\n // uxrrr-q7777-77774-qaaaq-cai and just add to the end of it.\n // uxrrr-q7777-77774-qaaaq-cai is the first canister id you get\n // if you deploy to the local replica.\n const canisterId = Principal.fromUint8Array(\n Uint8Array.from([\n 255,\n 255,\n 255,\n 255,\n 255,\n 144,\n 0,\n 1,\n 1,\n 1 + nat\n ])\n );\n const canisterIdText = canisterId.toText();\n\n execSync(`dfx canister stop canister`, {\n stdio: 'inherit'\n });\n\n execSync(`dfx canister delete canister`, {\n stdio: 'inherit'\n });\n\n execSync(\n `dfx deploy canister --no-wallet --specified-id ${canisterIdText}`\n );\n\n const actor = await getCanisterActor('canister');\n\n const initCanisterSelf =\n await actor.getInitCanisterSelf();\n expect(initCanisterSelf[0]?.toText()).toEqual(\n canisterIdText\n );\n\n const postUpgradeCanisterSelf =\n await actor.getPostUpgradeCanisterSelf();\n expect(postUpgradeCanisterSelf).toHaveLength(0);\n\n const preUpgradeCanisterSelf =\n await actor.getPreUpgradeCanisterSelf();\n expect(preUpgradeCanisterSelf).toHaveLength(0);\n\n await actor.setInspectMessageCanisterSelf();\n const inspectMessageCanisterSelf =\n await actor.getInspectMessageCanisterSelf();\n expect(inspectMessageCanisterSelf[0]?.toText()).toEqual(\n canisterIdText\n );\n\n const queryCanisterSelf =\n await actor.getQueryCanisterSelf();\n expect(queryCanisterSelf.toText()).toEqual(\n canisterIdText\n );\n\n const updateCanisterSelf =\n await actor.getUpdateCanisterSelf();\n expect(updateCanisterSelf.toText()).toEqual(\n canisterIdText\n );\n\n execSync(`dfx deploy canister --upgrade-unchanged`);\n\n const postUpgradeCanisterSelfAfterUpgrade =\n await actor.getPostUpgradeCanisterSelf();\n expect(\n postUpgradeCanisterSelfAfterUpgrade[0]?.toText()\n ).toEqual(canisterIdText);\n\n const preUpgradeCanisterSelfAfterUpgrade =\n await actor.getPreUpgradeCanisterSelf();\n expect(\n preUpgradeCanisterSelfAfterUpgrade[0]?.toText()\n ).toEqual(canisterIdText);\n }\n ),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/canister_self/test/tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "Deploying a canister with a specific ID ensures that various canister ID retrieval methods return the correct ID before and after upgrades.", "mode": "fast-check"} {"id": 55876, "name": "unknown", "code": "it('should encode and decode candid values correctly', async () => {\n /* TODO: We aren't able to test the full range of candid values yet\n * because we are limited by the random values that didc generates.\n * As shown in the constraints below, several types need to be\n * disabled for these tests to work.\n *\n * We could potentially extend our arbitraries to support these\n * candid string formats, which would be straightforward but\n * time-consuming to implement. This would also reduce our\n * dependency on didc for testing.\n */\n /* TODO: once we get the arbs more robust, as per\n * https://github.com/demergent-labs/azle/issues/2276, it would be\n * good to do things in the reverse as well, that is to say, generate\n * an arb and use it's bytes to decode, then encode that result, and\n * make sure we get the bytes back.\n */\n const constraints: DefinitionConstraints = {\n recursiveWeights: true,\n weights: {\n func: 0, // random func is not supported for didc\n null: 0, // null comes out of didc random as (null) and out of candidDecode as (null: null)\n opt: 0, // None comes out of didc random as (null) and out of candidDecode as (null: null)\n record: 0, // record property names don't get decoded as actual names\n variant: 0, // variant property names don't get decoded as actual names\n float32: 0, // float32 without a decimal point aren't accepted by candidEncodeQuery\n float64: 0, // float64 with a decimal point is accepted by candidEncodeQuery\n blob: 0, // blobs are different from didc random and candidDecode, but in a way that seems broken\n nat8: 0 // nat8 if paired with vec will make a blob, so we have to filter it out too\n }\n };\n await fc.assert(\n fc.asyncProperty(\n candidDefinitionArb({ constraints }, {}),\n async (candid) => {\n // TODO IDL.Empty is a placeholder for void...not quite correct\n const didVisitorResult = (\n candid.definition.candidMeta.runtimeTypeObject ??\n IDL.Empty\n ).accept(new DidVisitor(), getDefaultVisitorData());\n const candidString = didVisitorResult[0];\n const command = `didc random -t '(${candidString})'`;\n const candidValueString = execSync(command)\n .toString()\n .trim();\n console.info(candidValueString);\n\n const canister =\n await getCanisterActor('canister');\n\n const encodedBytes =\n await canister.candidEncodeQuery(candidValueString);\n\n const decodedString =\n await canister.candidDecodeQuery(encodedBytes);\n\n expect(encodedBytes instanceof Uint8Array).toBe(true);\n expect(decodedString).toBe(candidValueString);\n }\n ),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/candid/test/tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "The property should ensure that candid values encode to bytes and decode back to their original string representation correctly.", "mode": "fast-check"} {"id": 55877, "name": "unknown", "code": "it('should return the inspectMessage principal', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.uint8Array({ minLength: 32, maxLength: 32 }),\n async (bytes) => {\n const identity = Ed25519KeyIdentity.generate(bytes);\n const identityPrincipalText = identity\n .getPrincipal()\n .toText();\n\n const actor = await getCanisterActor(\n 'canister',\n {\n identity\n }\n );\n\n await actor.setInspectMessageCaller();\n const inspectMessageCaller =\n await actor.getInspectMessageCaller();\n\n expect(inspectMessageCaller[0]?.toText()).toBe(\n identityPrincipalText\n );\n }\n ),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/ic_api/caller/test/tests.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "The test checks that the `getInspectMessageCaller` function returns the principal associated with the `identity` used in the canister actor setup.", "mode": "fast-check"} {"id": 55879, "name": "unknown", "code": "it('should trigger low memory handler when memory limit is approached', async () => {\n await fc.assert(\n fc.asyncProperty(\n fc.integer({ min: 0, max: 99 }),\n fc.integer({\n min: 90 * 1024 * 1024, // 90 MiB in bytes (about the smallest size of this azle canister)\n max: HARD_LIMIT\n }),\n async (wasmMemoryThresholdPercentage, wasmMemoryLimit) => {\n // eslint-disable-next-line no-param-reassign\n wasmMemoryThresholdPercentage = 0; // TODO remove after https://github.com/demergent-labs/azle/issues/2613 is resolved\n // Calculate actual threshold based on percentage\n const wasmMemoryThreshold = Math.floor(\n wasmMemoryLimit *\n (wasmMemoryThresholdPercentage / 100)\n );\n\n const actor = await deployFreshCanister(\n CANISTER_NAME,\n wasmMemoryThreshold,\n wasmMemoryLimit\n );\n\n await validateInitialStatus(actor, wasmMemoryLimit);\n\n await addBytesUntilLimitReached(actor);\n\n await validateFinalStatus(\n actor,\n wasmMemoryLimit,\n wasmMemoryThreshold\n );\n }\n ),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/property/candid_rpc/canister_methods/on_low_wasm_memory/test/tests.ts", "start_line": null, "end_line": null, "dependencies": ["validateInitialStatus", "addBytesUntilLimitReached", "validateFinalStatus"], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "The low memory handler should be triggered when the canister's memory usage approaches the limit, confirming the initial and final status relative to the specified memory threshold and limit.", "mode": "fast-check"} {"id": 55880, "name": "unknown", "code": "it('verifies certified variable updates', async () => {\n const canisterName = 'cert-var';\n const agent = await createAuthenticatedAgent(whoami());\n const certVarCanister = await getCanisterActor(\n canisterName,\n {\n agent\n }\n );\n await fc.assert(\n fc.asyncProperty(\n fc.nat({ max: 4_294_967_295 }), // max value for Nat32\n async (arbitraryValue) => {\n await testCertifiedVariableUpdate(\n arbitraryValue,\n certVarCanister,\n agent,\n canisterName\n );\n }\n ),\n defaultPropTestParams()\n );\n })", "language": "typescript", "source_file": "./repos/demergent-labs/azle/examples/stable/test/end_to_end/candid_rpc/motoko_examples/cert-var/test/tests.ts", "start_line": null, "end_line": null, "dependencies": ["testCertifiedVariableUpdate"], "repo": {"name": "demergent-labs/azle", "url": "https://github.com/demergent-labs/azle.git", "license": "MIT", "stars": 225, "forks": 42}, "metrics": null, "summary": "Certified variable updates should correctly reflect changes by verifying that the updated value matches the expected outcome and that the associated certificate is valid and accurate.", "mode": "fast-check"} {"id": 55881, "name": "unknown", "code": "t.test('literal', () => {\n fc.assert(fc.property(fc.float(), roundtrip))\n fc.assert(fc.property(fc.string(), roundtrip))\n fc.assert(fc.property(fc.boolean(), roundtrip))\n })", "language": "typescript", "source_file": "./repos/briancavalier/braindump/packages/codec/src/roundtrip.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "briancavalier/braindump", "url": "https://github.com/briancavalier/braindump.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "The `roundtrip` function maintains data integrity when applied to floats, strings, and booleans.", "mode": "fast-check"} {"id": 55882, "name": "unknown", "code": "t.test('literal', () => {\n fc.assert(fc.property(fc.float(), roundtrip))\n fc.assert(fc.property(fc.string(), roundtrip))\n fc.assert(fc.property(fc.boolean(), roundtrip))\n })", "language": "typescript", "source_file": "./repos/briancavalier/braindump/packages/codec/src/roundtrip.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "briancavalier/braindump", "url": "https://github.com/briancavalier/braindump.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "The property ensures that the `roundtrip` process remains consistent for floats, strings, and booleans.", "mode": "fast-check"} {"id": 55884, "name": "unknown", "code": "t.test('enum (object literal)', () =>\n fc.assert(fc.property(fc.record({\n a: fc.float(),\n b: fc.float()\n }), (e) =>\n roundtrip(enumOf(e)))))", "language": "typescript", "source_file": "./repos/briancavalier/braindump/packages/codec/src/roundtrip.test.ts", "start_line": null, "end_line": null, "dependencies": ["roundtrip"], "repo": {"name": "briancavalier/braindump", "url": "https://github.com/briancavalier/braindump.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "The test ensures that the `roundtrip` function correctly handles enums created from object literals by maintaining consistency through decoding and encoding processes.", "mode": "fast-check"} {"id": 55886, "name": "unknown", "code": "test('fuzz', () => {\n fc.assert(\n fc.property(F.arbConsume, consume => {\n // F.c.log(consume)\n const out1: unknown[] = []\n const out2: unknown[] = []\n const val1 = F.consumeX(consume, out1)\n const val2 = F.consumeE(consume, out2)\n expect(out1).toEqual(out2)\n expect(val1).toEqual(val2)\n }),\n {},\n )\n})", "language": "typescript", "source_file": "./repos/zeng-y-l/xunhuan/test/fuzz.test.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "zeng-y-l/xunhuan", "url": "https://github.com/zeng-y-l/xunhuan.git", "license": "MIT", "stars": 1, "forks": 0}, "metrics": null, "summary": "`F.consumeX` and `F.consumeE` should produce equivalent outputs and results when consuming the same input.", "mode": "fast-check"} {"id": 55921, "name": "unknown", "code": "it('all some', () => {\n fc.assert(fc.property(fc.array(fc.integer()), (n) =>\n assertOptional(Optionals.sequence(Arr.map(n, (x) => Optional.some(x))), Optionals.traverse(n, (x) => Optional.some(x)))\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalsSequenceTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The test checks that `Optionals.sequence` and `Optionals.traverse` produce equivalent results when applied to arrays of integers wrapped in `Optional.some`.", "mode": "fast-check"} {"id": 55928, "name": "unknown", "code": "it('some !== none, for any predicate', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt1) => {\n assert.isFalse(Optionals.equals(opt1, Optional.none(), boom));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Optionals.equals` should return false when comparing `some` with `none`, regardless of the predicate.", "mode": "fast-check"} {"id": 55929, "name": "unknown", "code": "it('none !== some, for any predicate', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt1) => {\n assert.isFalse(Optionals.equals(Optional.none(), opt1, boom));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Optional.none()` is not equal to any `some` option, regardless of the predicate used.", "mode": "fast-check"} {"id": 55930, "name": "unknown", "code": "it('Checking Optionals.equals(some(x), some(y), _, _ -> false) === false', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), arbOptionSome(fc.integer()), (opt1, opt2) => {\n assert.isFalse(Optionals.equals(opt1, opt2, Fun.never));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Optionals.equals returns false when comparing `some(x)` and `some(y)` with a function that always returns false.", "mode": "fast-check"} {"id": 55932, "name": "unknown", "code": "it('Checking Optionals.equals(some(x), some(y), f) iff. f(x, y)', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), arbOptionSome(fc.integer()), fc.func(fc.boolean()), (a, b, f) => {\n const opt1 = Optional.some(a);\n const opt2 = Optional.some(b);\n return f(a, b) === Optionals.equals(opt1, opt2, f);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalsEqualTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Optionals.equals(some(x), some(y), f)` should be true if and only if the function `f(x, y)` is true.", "mode": "fast-check"} {"id": 55933, "name": "unknown", "code": "it('Checking some(x).fold(die, id) === x', () => {\n fc.assert(fc.property(fc.integer(), (json) => {\n const opt = Optional.some(json);\n const actual = opt.fold(Fun.die('Should not be none!'), Fun.identity);\n assert.deepEqual(actual, json);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Calling `fold` on `Optional.some(x)` with a function that throws for `none` and the identity function for `some` should return `x`.", "mode": "fast-check"} {"id": 55936, "name": "unknown", "code": "it('Checking some(x).isNone === false', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => !opt.isNone()));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`some(x).isNone` should return false for any integer wrapped by `arbOptionSome`.", "mode": "fast-check"} {"id": 55937, "name": "unknown", "code": "it('Checking some(x).getOr(v) === x', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), arbOptionSome(fc.integer()), (a, b) => {\n assert.equal(Optional.some(a).getOr(b), a);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Optional.some(a).getOr(b)` returns `a`.", "mode": "fast-check"} {"id": 55940, "name": "unknown", "code": "it('Checking some(x).or(oSomeValue) === some(x)', () => {\n fc.assert(fc.property(fc.integer(), arbOptionSome(fc.integer()), (json, other) => {\n const output = Optional.some(json).or(other);\n assert.isTrue(Optionals.is(output, json));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Optional.some(x).or(oSomeValue)` should equal `Optional.some(x)`.", "mode": "fast-check"} {"id": 55941, "name": "unknown", "code": "it('Checking some(x).orThunk(_ -> oSomeValue) === some(x)', () => {\n fc.assert(fc.property(fc.integer(), arbOptionSome(fc.integer()), (i, other) => {\n const output = Optional.some(i).orThunk(() => other);\n assert.isTrue(Optionals.is(output, i));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`some(x).orThunk(_ -> oSomeValue)` should return `some(x)`.", "mode": "fast-check"} {"id": 55942, "name": "unknown", "code": "it('Checking some(x).map(f) === some(f(x))', () => {\n fc.assert(fc.property(fc.integer(), fc.func(fc.integer()), (a, f) => {\n const opt = Optional.some(a);\n const actual = opt.map(f);\n assert.equal(actual.getOrDie(), f(a));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Verifies that mapping a function over `Optional.some(x)` is equivalent to `Optional.some(f(x))`.", "mode": "fast-check"} {"id": 55943, "name": "unknown", "code": "it('Checking some(x).each(f) === undefined and f gets x', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => {\n let hack: number | null = null;\n const actual = opt.each((x) => {\n hack = x;\n });\n assert.isUndefined(actual);\n assert.equal(opt.getOrDie(), hack);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`some(x).each(f)` returns undefined, and the function `f` receives `x` as its argument.", "mode": "fast-check"} {"id": 55944, "name": "unknown", "code": "it('Given f :: s -> some(b), checking some(x).bind(f) === some(b)', () => {\n fc.assert(fc.property(fc.integer(), fc.func(arbOptionSome(fc.integer())), (i, f) => {\n const actual = Optional.some(i).bind(f);\n assert.deepEqual(actual, f(i));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Optional.some(x).bind(f)` results in the same value as `f(x)` when `f` returns a `some(b)`.", "mode": "fast-check"} {"id": 55948, "name": "unknown", "code": "it('Checking some(x).exists(f) iff. f(x)', () => {\n fc.assert(fc.property(fc.integer(), fc.func(fc.boolean()), (i, f) => {\n const opt = Optional.some(i);\n if (f(i)) {\n assert.isTrue(opt.exists(f));\n } else {\n assert.isFalse(opt.exists(f));\n }\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The property should hold that `Optional.some(x).exists(f)` returns true if and only if `f(x)` is true.", "mode": "fast-check"} {"id": 55949, "name": "unknown", "code": "it('Checking some(x).forall(_ -> false) === false', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => !opt.forall(Fun.never)));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The test verifies that applying `forall` with a function returning `false` on `some(x)` results in `false`.", "mode": "fast-check"} {"id": 55950, "name": "unknown", "code": "it('Checking some(x).forall(_ -> true) === true', () => {\n fc.assert(fc.property(arbOptionSome(fc.integer()), (opt) => opt.forall(Fun.always)));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The property asserts that `forall` applied to `Some(x)` with a predicate that always returns true results in true.", "mode": "fast-check"} {"id": 55951, "name": "unknown", "code": "it('Checking some(x).forall(f) iff. f(x)', () => {\n fc.assert(fc.property(fc.integer(), fc.func(fc.boolean()), (i, f) => {\n const opt = Optional.some(i);\n if (f(i)) {\n assert.isTrue(opt.forall(f));\n } else {\n assert.isFalse(opt.forall(f));\n }\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "For an integer `i`, `Optional.some(i).forall(f)` should return true if and only if `f(i)` is true.", "mode": "fast-check"} {"id": 55952, "name": "unknown", "code": "it('Checking some(x).toArray equals [ x ]', () => {\n fc.assert(fc.property(fc.integer(), (json) => {\n assert.deepEqual(Optional.some(json).toArray(), [ json ]);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Optional.some(x).toArray()` should return an array containing only `x`.", "mode": "fast-check"} {"id": 55953, "name": "unknown", "code": "it('Checking some(x).toString equals \"some(x)\"', () => {\n fc.assert(fc.property(fc.integer(), (json) => {\n assert.equal(Optional.some(json).toString(), 'some(' + json + ')');\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalSomeTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Optional.some(x).toString()` should return the string \"some(x)\" for integer inputs.", "mode": "fast-check"} {"id": 55957, "name": "unknown", "code": "it('Checking none.getOrThunk(_ -> v) === v', () => {\n fc.assert(fc.property(fc.func(fc.integer()), (thunk) => {\n assert.equal(Optional.none().getOrThunk(thunk), thunk());\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Optional.none().getOrThunk(thunk)` returns the result of invoking `thunk()`.", "mode": "fast-check"} {"id": 55958, "name": "unknown", "code": "it('Checking none.getOrDie() always throws', () => {\n // Require non empty string of msg falsiness gets in the way.\n fc.assert(fc.property(fc.string(1, 40), (s) => {\n assert.throws(() => {\n Optional.none().getOrDie(s);\n });\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Calling `getOrDie` on `Optional.none()` always throws an exception.", "mode": "fast-check"} {"id": 55959, "name": "unknown", "code": "it('Checking none.or(oSomeValue) === oSomeValue', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n const output = Optional.none().or(Optional.some(i));\n assert.isTrue(Optionals.is(output, i));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Optional.none().or(Optional.some(i))` should return an `Optional` containing `i`.", "mode": "fast-check"} {"id": 55960, "name": "unknown", "code": "it('Checking none.orThunk(_ -> v) === v', () => {\n fc.assert(fc.property(fc.integer(), (i) => {\n const output = Optional.none().orThunk(() => Optional.some(i));\n assert.isTrue(Optionals.is(output, i));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalNoneTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Optional.none().orThunk(() => Optional.some(i))` should return `Optional` containing `i`.", "mode": "fast-check"} {"id": 55964, "name": "unknown", "code": "it('Optional.getOr', () => {\n fc.assert(fc.property(fc.integer(), (x) => {\n assert.equal(Optional.none().getOr(x), x);\n assert.equal(Optional.none().getOrThunk(() => x), x);\n }));\n fc.assert(fc.property(fc.integer(), fc.integer(), (x, y) => {\n assert.equal(Optional.some(x).getOr(y), x);\n assert.equal(Optional.some(x).getOrThunk(Fun.die('boom')), x);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/OptionalGetOrTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Optional.none` uses `getOr` and `getOrThunk` to return a default value, while `Optional.some` returns its contained value, ignoring the default.", "mode": "fast-check"} {"id": 55968, "name": "unknown", "code": "it('fails for none vs some', () => {\n fc.assert(fc.property(fc.nat(), (n) => {\n assert.throw(() => {\n assertOptional(Optional.none(), Optional.some(n));\n });\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/AssertOptionalTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "Ensures that comparing `Optional.none()` with `Optional.some(n)` results in an exception being thrown.", "mode": "fast-check"} {"id": 55970, "name": "unknown", "code": "it('fails when some values are different', () => {\n fc.assert(fc.property(fc.nat(), (n) => {\n assert.throw(() => {\n assertOptional(Optional.some(n), Optional.some(n + 1));\n });\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/AssertOptionalTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`assertOptional` throws an error when comparing two `Optional` instances with different values.", "mode": "fast-check"} {"id": 55972, "name": "unknown", "code": "it('passes for identical some arrays', () => {\n fc.assert(fc.property(fc.array(fc.nat()), (n) => {\n assertOptional(Optional.some(n), Optional.some(n));\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/optional/AssertOptionalTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`assertOptional` confirms that two `Optional.some` arrays containing identical natural numbers pass the assertion.", "mode": "fast-check"} {"id": 55973, "name": "unknown", "code": "it('StringMatch.matches(StringMatch.starts(s1), s1 + s) === true', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(),\n (s, s1) => {\n assert.isTrue(StringMatch.matches(\n StringMatch.starts(s1, StringMatch.caseInsensitive),\n s1 + s\n ));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`StringMatch.matches` returns true when checking if a string `s1 + s` starts with `s1` in a case-insensitive manner.", "mode": "fast-check"} {"id": 55974, "name": "unknown", "code": "it('StringMatch.matches(StringMatch.contains(s1), s1 + s) === true', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(),\n (s, s1) => {\n assert.isTrue(StringMatch.matches(\n StringMatch.contains(s1, StringMatch.caseInsensitive),\n s1 + s\n ));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`StringMatch.matches` returns true when `StringMatch.contains` with `s1` is matched against `s1` concatenated with another string, using case-insensitive matching.", "mode": "fast-check"} {"id": 55975, "name": "unknown", "code": "it('StringMatch.matches(StringMatch.contains(s1), s + s1) === true', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(),\n (s, s1) => {\n assert.isTrue(StringMatch.matches(\n StringMatch.contains(s1, StringMatch.caseInsensitive),\n s + s1\n ));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`StringMatch.matches` returns true when the combined string contains `s1`, using a case-insensitive match.", "mode": "fast-check"} {"id": 55976, "name": "unknown", "code": "it('StringMatch.matches(StringMatch.contains(s1), s) === s.indexOf(s1)', () => {\n fc.assert(fc.property(\n fc.asciiString(),\n fc.asciiString(1, 40),\n (s, s1) => {\n assert.equal(StringMatch.matches(\n StringMatch.contains(s1, StringMatch.caseInsensitive),\n s\n ), s.toLowerCase().indexOf(s1.toLowerCase()) > -1);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`StringMatch.matches` using `StringMatch.contains` should return true if and only if `s1` is a substring of `s`, regardless of case.", "mode": "fast-check"} {"id": 55977, "name": "unknown", "code": "it('StringMatch.matches(StringMatch.contains(s), s) === true', () => {\n fc.assert(fc.property(\n fc.string(),\n (s) => {\n assert.isTrue(StringMatch.matches(\n StringMatch.contains(s, StringMatch.caseInsensitive),\n s\n ));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The test verifies that using `StringMatch.contains` with a string `s` and a case-insensitive option results in `StringMatch.matches` returning true for the same string `s`.", "mode": "fast-check"} {"id": 55978, "name": "unknown", "code": "it('StringMatch.matches(StringMatch.exact(s), s + s1) === false', () => {\n fc.assert(fc.property(\n fc.string(1, 40),\n fc.string(1, 40),\n (s, s1) => {\n assert.isFalse(StringMatch.matches(\n StringMatch.exact(s, StringMatch.caseInsensitive),\n s + s1\n ));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`StringMatch.matches` returns false when attempting to match a concatenated string `s + s1` with `StringMatch.exact(s)` using case-insensitive comparison.", "mode": "fast-check"} {"id": 55980, "name": "unknown", "code": "it('StringMatch.matches(StringMatch.exact(s), s) === true', () => {\n fc.assert(fc.property(\n fc.string(1, 40),\n (s) => {\n assert.isTrue(StringMatch.matches(\n StringMatch.exact(s, StringMatch.caseInsensitive),\n s\n ));\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/str/StringMatchTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`StringMatch.matches` should return true when comparing a string with an exact match created from the same string, using case-insensitive match.", "mode": "fast-check"} {"id": 55985, "name": "unknown", "code": "it('positive range', () => {\n fc.assert(fc.property(fc.char(), fc.integer(1, 100), (c, count) => {\n const actual = Strings.repeat(c, count);\n assert.equal(actual.length, count);\n assert.equal(actual.charAt(0), c);\n assert.equal(actual.charAt(actual.length - 1), c);\n }));\n\n fc.assert(fc.property(fc.asciiString(5), fc.integer(1, 100), (s, count) => {\n const actual = Strings.repeat(s, count);\n assert.equal(actual.length, count * s.length);\n assert.equal(actual.indexOf(s), 0);\n assert.equal(actual.lastIndexOf(s), actual.length - s.length);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/str/RepeatTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "The `repeat` function should generate a string with the correct length, starting and ending with the original character or string, when repeated a specified number of times.", "mode": "fast-check"} {"id": 55987, "name": "unknown", "code": "it('removeTrailing property', () => {\n fc.assert(fc.property(\n fc.asciiString(),\n fc.asciiString(),\n (prefix, suffix) => {\n assert.equal(Strings.removeTrailing(prefix + suffix, suffix), prefix);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/str/RemoveTrailingTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Strings.removeTrailing` removes the specified suffix from the end of a concatenated string, leaving only the prefix.", "mode": "fast-check"} {"id": 55988, "name": "unknown", "code": "it('removeLeading removes prefix', () => {\n fc.assert(fc.property(\n fc.asciiString(),\n fc.asciiString(),\n (prefix, suffix) => {\n assert.equal(Strings.removeLeading(prefix + suffix, prefix), suffix);\n }\n ));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/str/RemoveLeadingTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Strings.removeLeading` removes the specified prefix from the beginning of a string.", "mode": "fast-check"} {"id": 55989, "name": "unknown", "code": "it('ensureTrailing is identity if string already ends with suffix', () => {\n fc.assert(fc.property(\n fc.string(),\n fc.string(),\n (prefix, suffix) => {\n const s = prefix + suffix;\n assert.equal(Strings.ensureTrailing(s, suffix), s);\n }));\n })", "language": "typescript", "source_file": "./repos/hugerte/hugerte/modules/katamari/src/test/ts/atomic/api/str/EnsureTrailingTest.ts", "start_line": null, "end_line": null, "dependencies": [], "repo": {"name": "hugerte/hugerte", "url": "https://github.com/hugerte/hugerte.git", "license": "MIT", "stars": 326, "forks": 26}, "metrics": null, "summary": "`Strings.ensureTrailing` returns the original string if it already ends with the given suffix.", "mode": "fast-check"}