Skip to content

Commit e3871bf

Browse files
committed
fix: embedding tests broken by multi-line grep from locale stubs
Locale stubs share the same way ID as the English entry, causing grep to return multiple score lines. The awk numeric comparison choked on the multi-line input. Fix: head -1 to take only the highest score. 15/15 tests pass. make setup exits clean.
1 parent 748c221 commit e3871bf

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tools/way-embed/test-embedding.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ check() {
2626
if [[ "$should_match" == "yes" ]]; then
2727
if echo "$result" | grep -q "^${expected} "; then
2828
local score
29-
score=$(echo "$result" | grep "^${expected} " | cut -f2)
29+
score=$(echo "$result" | grep "^${expected} " | head -1 | cut -f2)
3030
printf " PASS %-60s → %s (%s)\n" "$desc" "$expected" "$score"
3131
pass=$((pass + 1))
3232
else
@@ -38,7 +38,7 @@ check() {
3838
else
3939
# Should NOT match: check that expected way is below runtime threshold (0.35)
4040
local score
41-
score=$(echo "$result" | grep "^${expected} " | cut -f2 || echo "0.0000")
41+
score=$(echo "$result" | grep "^${expected} " | head -1 | cut -f2 || echo "0.0000")
4242
if [[ -z "$score" ]] || awk "BEGIN{exit !($score < 0.35)}" 2>/dev/null; then
4343
printf " PASS %-60s → %s correctly below threshold (%s)\n" "$desc" "$expected" "${score:-absent}"
4444
pass=$((pass + 1))

0 commit comments

Comments
 (0)