Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omnet/blob/main/om/codec/test/gen/vectors.sh # omnet aien-dev/omnet Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omnet / om / codec / test / gen / vectors.sh` 25 lines ยท 1294 bytes Raw Blame History 1 #!/bin/sh 2 # SPDX-License-Identifier: Apache-2.0 3 # Regenerates test/vectors/malformed.txt: the hand-made corpus of gen/oracle (oracle corpus) with 4 # the result Go go1.26.0 gives for each case. Test tooling only. 5 # Usage: sh om/codec/test/gen/vectors.sh Environment: GO (default go). 6 set -eu 7 here=$(cd "$(dirname "$0")" && pwd) 8 root=$(cd "$here/../../../.." && pwd) 9 out="$root/build/test/codec/gen" 10 go=${GO:-go} 11 mkdir -p "$out" 12 (cd "$here/oracle" && GOTOOLCHAIN=go1.26.0 "$go" build -o "$out/oracle" .) 13 "$out/oracle" corpus > "$out/corpus.txt" 14 grep -v '^#' "$out/corpus.txt" | "$out/oracle" > "$out/corpus.res" 15 v="$here/../vectors/malformed.txt" 16 { 17 echo "# om/codec malformed-input corpus: OP ARG RESULT, in the driver's case and result format." 18 echo "# Cases: test/gen/oracle 'corpus'. Results: Go $(GOTOOLCHAIN=go1.26.0 "$go" env GOVERSION)" \ 19 "encoding/base64, encoding/base32, encoding/hex and" 20 echo "# the transcribed tailscale.com v1.102.0 AUMHash/NodePublic UnmarshalText (gen/oracle/main.go)." 21 echo "# Generated by test/gen/vectors.sh. Lines starting with # name the input class that follows." 22 awk 'NR == FNR { r[NR] = $0; next } /^#/ { print; next } { print $0, r[++i] }' \ 23 "$out/corpus.res" "$out/corpus.txt" 24 } > "$v" 25 echo "vectors: $(grep -vc '^#' "$v") cases written to $v"