参考所有分组:补 close_and_downcase word source 覆盖,测试通过

This commit is contained in:
cnc
2026-06-03 08:49:10 +08:00
parent 2f7a46758b
commit 090a5fb89c
3 changed files with 22 additions and 0 deletions

View File

@@ -563,6 +563,7 @@ grep -F 'tests/gcode/linuxcnc_readonly_named_parameters.ngc' test-native.sh >/de
grep -F 'read_n_number()' test-linuxcnc-source-link.sh >/dev/null
grep -F 'tests/gcode/linuxcnc_fractional_linenumbers.ngc' test-linuxcnc-source-link.sh >/dev/null
grep -F 'tests/gcode/linuxcnc_extended_linenumbers.ngc' test-linuxcnc-source-link.sh >/dev/null
grep -F 'tests/gcode/linuxcnc_close_and_downcase_words.ngc' test-linuxcnc-source-link.sh >/dev/null
for script in \
test-native.sh \

View File

@@ -1495,6 +1495,12 @@ CNC_SIM_RS274_VAR="$var_file" \
CNC_SIM_RS274_VAR="$var_file" \
"$build_dir/linuxcnc_rs274_source_dump" tests/gcode/linuxcnc_extended_linenumbers.ngc \
>"$output_dir/cnc_sim_linuxcnc_source_extended_linenumbers.json"
# Source basis: LinuxCNC src/emc/rs274ngc/interp_read.cc read_text()
# calls close_and_downcase() to downcase words and remove spaces/tabs outside
# comments before read_items() dispatches the words.
CNC_SIM_RS274_VAR="$var_file" \
"$build_dir/linuxcnc_rs274_source_dump" tests/gcode/linuxcnc_close_and_downcase_words.ngc \
>"$output_dir/cnc_sim_linuxcnc_source_close_and_downcase_words.json"
CNC_SIM_RS274_SOURCE_OUTPUT_DIR="$output_dir" python3 - <<'PY'
import json
@@ -1556,6 +1562,16 @@ if extended_spindle_states[:3] != [(1, 111), (2, 222), (3, 333)]:
f"{extended_spindle_states!r}"
)
close_and_downcase_words = load("cnc_sim_linuxcnc_source_close_and_downcase_words.json")
if not any(
event["type"] == "linear-feed" and
event["line"] == 3 and
event["end"]["x"] == 3 and
event["end"]["y"] == 4
for event in close_and_downcase_words
):
raise SystemExit("missing source-linked close_and_downcase mixed-case spaced-word move")
block_delete_off = load("cnc_sim_linuxcnc_source_block_delete_off.json")
if not any(
event["type"] == "linear-feed" and event["line"] == 2 and event["end"]["x"] == 5
@@ -3444,3 +3460,4 @@ echo "dumped $output_dir/cnc_sim_linuxcnc_source_g52_xz_nurbs.json"
echo "dumped $output_dir/cnc_sim_linuxcnc_source_g62_xz_nurbs.json"
echo "dumped $output_dir/cnc_sim_linuxcnc_source_fractional_linenumbers.json"
echo "dumped $output_dir/cnc_sim_linuxcnc_source_extended_linenumbers.json"
echo "dumped $output_dir/cnc_sim_linuxcnc_source_close_and_downcase_words.json"

View File

@@ -0,0 +1,4 @@
G 21 G 90 G 17
F 100
g 1 x 3 y 4
M2