From: Ian Jackson Date: Sat, 10 Oct 2020 23:09:45 +0000 (+0100) Subject: fix various targets and tests X-Git-Tag: otter-0.2.0~699 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=1ac5040d0707076801925039971293a1801b4b54;p=otter.git fix various targets and tests Signed-off-by: Ian Jackson --- diff --git a/Makefile b/Makefile index eddc2243..d489fbd0 100644 --- a/Makefile +++ b/Makefile @@ -85,11 +85,14 @@ WASM := wasm32-unknown-unknown check: stamp/cargo.check @echo 'All tests passed.' +doc: cargo-doc + debug release:: %: stamp/cargo.% assets extra-% cargo: cargo-debug cargo-wasm-release -cargo-debug cargo-release cargo-check cargo-wasm-debug cargo-wasm-release:: \ +cargo-debug cargo-release cargo-check cargo-doc \ +cargo-wasm-debug cargo-wasm-release:: \ cargo-%: stamp/cargo.% cargo-wasm: cargo-wasm-release @@ -114,7 +117,11 @@ stamp/cargo.%: $(call rsrcs,. ! -path './wasm/*') $(stamp) stamp/cargo.check: $(call rsrcs,.) - $(CARGO) test + $(CARGO) test --workspace + $(stamp) + +stamp/cargo.doc: $(call rsrcs,.) + $(CARGO) doc --workspace $(stamp) $(addprefix stamp/cargo.wasm-,$(DR)):: \ diff --git a/zcoord/zcoord.rs b/zcoord/zcoord.rs index a5871db6..3418261b 100644 --- a/zcoord/zcoord.rs +++ b/zcoord/zcoord.rs @@ -452,8 +452,8 @@ mod innards { #[cfg(test)] mod test { - // everything from here on is seded by the js test extractor! use super::*; + use std::mem; fn bf(s: &str) -> ZCoord { ZCoord::from_str(s).unwrap() @@ -500,20 +500,24 @@ mod test { } #[test] - fn addition() { + fn incdec() { fn mk(s: &str) -> super::Mutable { bf(s).clone_mut() } impl Mutable { - fn tincdec(mut self, exp: &str, id: IncDecOffset) -> Self { + fn tincdec(mut self, exp: &str, id: ID) -> Self { let got = self.incdec(id).unwrap(); assert_eq!(got.to_string(), exp); self } - fn tinc(mut self, exp: &str) -> Self { self.tincdec(exp, IncDecInc) } - fn tdec(mut self, exp: &str) -> Self { self.tincdec(exp, IncDecDec) } + fn tinc(self, exp: &str) -> Self { self.tincdec(exp, IncDecInc) } + fn tdec(self, exp: &str) -> Self { self.tincdec(exp, IncDecDec) } } mk("000000000a") .tinc("000100000a") .tinc("000200000a") + .tdec("000100000a") + .tdec("000000000a") + .tdec("000000000a_vvvvvvvvvv_vvvuvvvvvv") + .tdec("000000000a_vvvvvvvvvv_vvvtvvvvvv") ; mk("vvvvvvvvvv") .tinc("vvvvvvvvvv_0000000000_0001000000")