nomen-lang 0.6.13 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOMEN_AGENTS.md +27 -13
- package/audit_runtime.c +2 -0
- package/core/System/Arena.nm +4 -4
- package/core/System/Array.nm +108 -78
- package/core/System/Atomic.nm +81 -0
- package/core/System/Awaitable.nm +12 -5
- package/core/System/BigInt.nm +1 -1
- package/core/System/Box.nm +32 -0
- package/core/System/Buffer.nm +18 -18
- package/core/System/Channel.nm +27 -11
- package/core/System/ClassBuffer.nm +24 -28
- package/core/System/Console.nm +4 -4
- package/core/System/Controls/Button.nm +8 -3
- package/core/System/Controls/CheckBox.nm +8 -3
- package/core/System/Controls/Container.nm +18 -11
- package/core/System/Controls/Layout.nm +1 -1
- package/core/System/Controls/Text.nm +9 -4
- package/core/System/Controls/TextBox.nm +8 -3
- package/core/System/Controls/Window.nm +10 -3
- package/core/System/Fiber.nm +6 -2
- package/core/System/Graph.nm +2 -2
- package/core/System/Init.nm +2 -2
- package/core/System/LinkedList.nm +2 -2
- package/core/System/List.nm +7 -7
- package/core/System/Map.nm +10 -7
- package/core/System/Math.nm +1 -1
- package/core/System/Mutex.nm +14 -2
- package/core/System/Random.nm +7 -1
- package/core/System/Result.nm +1 -1
- package/core/System/Sendable.nm +2 -2
- package/core/System/Set.nm +6 -6
- package/core/System/Spawnable.nm +9 -9
- package/core/System/Stream/Directory.nm +1 -2
- package/core/System/Stream/File.nm +8 -9
- package/core/System/Stream/Http.nm +2 -3
- package/core/System/Stream/Tcp.nm +13 -8
- package/core/System/String.nm +22 -12
- package/core/System/StringBuilder.nm +2 -2
- package/core/System/Task.nm +21 -29
- package/core/System/Test.nm +10 -4
- package/core/System/Text/CharIndex.nm +2 -3
- package/core/System/Text/Json.nm +8 -12
- package/core/System/Text/JsonTree.nm +4 -4
- package/core/System/Text/Regex.nm +7 -7
- package/core/System/Text/Utf8.nm +2 -3
- package/core/System/Thread.nm +9 -4
- package/core/System/Tree.nm +2 -2
- package/core/System/Viewable.nm +2 -2
- package/core/System/WeakHandle.nm +56 -0
- package/core/System/bool.nm +1 -1
- package/core/System/char.nm +1 -1
- package/core/System/float.nm +1 -1
- package/core/System/float32.nm +1 -1
- package/core/System/float64.nm +1 -1
- package/core/System/int.nm +1 -1
- package/core/System/int16.nm +1 -1
- package/core/System/int32.nm +1 -1
- package/core/System/int64.nm +1 -1
- package/core/System/int8.nm +1 -1
- package/core/System/ufloat.nm +1 -1
- package/core/System/ufloat32.nm +1 -1
- package/core/System/ufloat64.nm +1 -1
- package/core/System/uint.nm +1 -1
- package/core/System/uint16.nm +1 -1
- package/core/System/uint32.nm +1 -1
- package/core/System/uint64.nm +1 -1
- package/core/System/uint8.nm +1 -1
- package/core/docs/System/Result.md +2 -2
- package/dist/index.mjs +29031 -25546
- package/package.json +1 -1
- package/src/test.ts +26 -11
package/package.json
CHANGED
package/src/test.ts
CHANGED
|
@@ -591,9 +591,14 @@ const C = {
|
|
|
591
591
|
cyan: (s: string) => `\x1b[36m${s}\x1b[0m`,
|
|
592
592
|
};
|
|
593
593
|
|
|
594
|
-
/**
|
|
595
|
-
|
|
594
|
+
/**
|
|
595
|
+
* Print a vitest-style report for one file's results. `progress` (e.g.
|
|
596
|
+
* "[3/24]") is appended to the header line when given — the streaming
|
|
597
|
+
* `runTests` passes a done/total counter so long suites show movement.
|
|
598
|
+
*/
|
|
599
|
+
export function report_file(result: TestFileResult, progress?: string): void {
|
|
596
600
|
const rel = path.relative(process.cwd(), result.file);
|
|
601
|
+
const counter = progress ? ` ${C.dim(progress)}` : "";
|
|
597
602
|
if (result.crashed && result.tests.length === 0 && result.fails.length === 0) {
|
|
598
603
|
// Name the stage that actually failed. A binary that linked fine and
|
|
599
604
|
// then died before emitting any record (e.g. SIGSEGV) is NOT a build
|
|
@@ -606,14 +611,14 @@ export function report_file(result: TestFileResult): void {
|
|
|
606
611
|
: result.phase === "setup"
|
|
607
612
|
? "(setup failed)"
|
|
608
613
|
: "(failed to build)";
|
|
609
|
-
console.log(` ${C.red("✗")} ${rel} ${C.red(label)}`);
|
|
614
|
+
console.log(` ${C.red("✗")} ${rel} ${C.red(label)}${counter}`);
|
|
610
615
|
console.log(C.red(result.crashed));
|
|
611
616
|
return;
|
|
612
617
|
}
|
|
613
618
|
const totalTests = result.tests.length;
|
|
614
619
|
const mark = result.ok ? C.green("✓") : C.red("✗");
|
|
615
620
|
console.log(
|
|
616
|
-
` ${mark} ${rel} ${C.dim(`(${totalTests} tests)`)} ${C.dim(format_duration(result.ms))}`,
|
|
621
|
+
` ${mark} ${rel} ${C.dim(`(${totalTests} tests)`)} ${C.dim(format_duration(result.ms))}${counter}`,
|
|
617
622
|
);
|
|
618
623
|
if (result.crashed) {
|
|
619
624
|
console.log(C.red(` ${result.crashed}`));
|
|
@@ -701,7 +706,13 @@ export async function runTests(root: string, options: RunTestsOptions = {}): Pro
|
|
|
701
706
|
const lib = resolve_lib_for(root);
|
|
702
707
|
const files = collect_test_files(root).filter((f) => !options.filter || options.filter.test(f));
|
|
703
708
|
|
|
704
|
-
console.log(`Found ${files.length} test file(s)
|
|
709
|
+
console.log(`Found ${files.length} test file(s)`);
|
|
710
|
+
// Announce everything that will run before the first result lands, so a
|
|
711
|
+
// long suite shows its scope immediately instead of a single counter line.
|
|
712
|
+
for (const file of files) {
|
|
713
|
+
console.log(` ${C.dim(path.relative(process.cwd(), file))}`);
|
|
714
|
+
}
|
|
715
|
+
console.log("");
|
|
705
716
|
|
|
706
717
|
const startTime = performance.now();
|
|
707
718
|
// The CWD contract: test binaries run in the --in root, so relative
|
|
@@ -711,13 +722,16 @@ export async function runTests(root: string, options: RunTestsOptions = {}): Pro
|
|
|
711
722
|
// Bounded-concurrency pool: at most `jobs` files are in flight. The
|
|
712
723
|
// parse/build halves are synchronous (no internal awaits), so they run
|
|
713
724
|
// atomically on the main thread between the subprocess awaits — the
|
|
714
|
-
// compiler's in-process state never interleaves. Results are
|
|
715
|
-
// file INDEX
|
|
716
|
-
//
|
|
717
|
-
//
|
|
725
|
+
// compiler's in-process state never interleaves. Results are ALSO
|
|
726
|
+
// collected by file INDEX (for the discovery-order summary below), but
|
|
727
|
+
// each finished file reports the moment it lands: `report_file` runs
|
|
728
|
+
// synchronously on the event loop, so its lines can never interleave
|
|
729
|
+
// with another worker's, and a slow file no longer hides the files that
|
|
730
|
+
// finished (or failed) before it.
|
|
718
731
|
const jobs = Math.max(1, Math.min(options.jobs ?? default_jobs(), files.length));
|
|
719
|
-
const results: TestFileResult[] =
|
|
732
|
+
const results: TestFileResult[] = Array.from<TestFileResult>({ length: files.length });
|
|
720
733
|
let next = 0;
|
|
734
|
+
let done = 0;
|
|
721
735
|
const worker = async (): Promise<void> => {
|
|
722
736
|
for (;;) {
|
|
723
737
|
const i = next++;
|
|
@@ -731,10 +745,11 @@ export async function runTests(root: string, options: RunTestsOptions = {}): Pro
|
|
|
731
745
|
options.release,
|
|
732
746
|
binary_cwd,
|
|
733
747
|
);
|
|
748
|
+
done += 1;
|
|
749
|
+
report_file(results[i], `[${done}/${files.length}]`);
|
|
734
750
|
}
|
|
735
751
|
};
|
|
736
752
|
await Promise.all(Array.from({ length: jobs }, worker));
|
|
737
|
-
for (const result of results) report_file(result);
|
|
738
753
|
|
|
739
754
|
const elapsed = performance.now() - startTime;
|
|
740
755
|
const totalFiles = results.length;
|