.PHONY: $(CARGO_TARGET_DIR)/debug/server
.PHONY: $(CARGO_TARGET_DIR)/release/server
+check: cargo-check js-check
+ @echo 'All tests passed.'
+
extra-debug:
extra-release: bundled-sources
@echo Bundled sources.
.PHONY: bundle-sources $(CARGO_TARGET_DIR)/bundled-sources
+cargo-check:
+ $(CARGO) test
+
$(CARGO_TARGET_DIR)/debug/server:
$(CARGO) build
$(CARGO_TARGET_DIR)/release/server:
$(CARGO) build --release
-templates/script.js: tsc-wrap tsconfig.json $(TS_SRC_FILES)
- ./tsc-wrap $@ tsconfig.json $(TS_SRC_FILES)
+templates/%.js: tsc-wrap tsconfig.json
+ ./tsc-wrap $@ tsconfig.json $(filter %.ts,$^)
+
+templates/script.js: $(TS_SRC_FILES)
+templates/bigfloat-tests.js: templates/bigfloat.ts templates/bigfloat-tests.ts
+
+js-check: templates/bigfloat-tests.js
+ nodejs <$<
+ @echo 'nodejs check $< ok'
DEPLOY_ARCH=x86_64-unknown-linux-musl
DEPLOY_RELEASE=debug
// SPDX-License-Identifier: AGPL-3.0-or-later
// There is NO WARRANTY.
-function assert_eq(a,b) { if (a != b) throw('unequal ' + a + ' ' + b); }
+function assert_eq(a: string, b: string) {
+ if (a != b) throw('unequal ' + a + ' ' + b);
+}
-x = "!0000 ffff_ffff_fff0";
-y = "!0000 0000_0000_0040";
-i = Bigfloats.iter_upto(x, y, 4);
+let x = "!0000 ffff_ffff_fff0" as any;
+let y = "!0000 0000_0000_0040" as any;
+let i = Bigfloats.iter_upto(x, y, 4);
assert_eq(i(), "+0000 0000_0000_0000");
assert_eq(i(), "+0000 0000_0000_0010");
assert_eq(i(), "+0000 0000_0000_0020");
-assert_eq(i(), "+0000x 0000_0000_0030");
+assert_eq(i(), "+0000 0000_0000_0030");