diff --git a/test-all-native.sh b/test-all-native.sh index 8b6ee28..17d1a5d 100755 --- a/test-all-native.sh +++ b/test-all-native.sh @@ -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 \ diff --git a/test-linuxcnc-source-link.sh b/test-linuxcnc-source-link.sh index 1fa62ba..a7c0108 100755 --- a/test-linuxcnc-source-link.sh +++ b/test-linuxcnc-source-link.sh @@ -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" diff --git a/tests/gcode/linuxcnc_close_and_downcase_words.ngc b/tests/gcode/linuxcnc_close_and_downcase_words.ngc new file mode 100644 index 0000000..48cf589 --- /dev/null +++ b/tests/gcode/linuxcnc_close_and_downcase_words.ngc @@ -0,0 +1,4 @@ +G 21 G 90 G 17 +F 100 +g 1 x 3 y 4 +M2