From 93c316567893071adb758d1511d8a8e4605a4997 Mon Sep 17 00:00:00 2001 From: James Harton Date: Sun, 9 Jul 2023 14:04:30 +1200 Subject: [PATCH] chore: run formatter. --- mix.lock | 2 +- test/gcode/parser/engine_test.exs | 43 +++++++++++++++++-------------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/mix.lock b/mix.lock index 2326607..e7f1b46 100644 --- a/mix.lock +++ b/mix.lock @@ -8,7 +8,7 @@ "git_cli": {:hex, :git_cli, "0.3.0", "a5422f9b95c99483385b976f5d43f7e8233283a47cda13533d7c16131cb14df5", [:mix], [], "hexpm", "78cb952f4c86a41f4d3511f1d3ecb28edb268e3a7df278de2faa1bd4672eaf9b"}, "git_ops": {:hex, :git_ops, "2.4.5", "185a724dfde3745edd22f7571d59c47a835cf54ded67e9ccbc951920b7eec4c2", [:mix], [{:git_cli, "~> 0.2", [hex: :git_cli, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "e323a5b01ad53bc8c19c3a444be3e61ed7803ecd2e95530446ae9327d0143ecc"}, "jason": {:hex, :jason, "1.2.2", "ba43e3f2709fd1aa1dce90aaabfd039d000469c05c56f0b8e31978e03fa39052", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "18a228f5f0058ee183f29f9eae0805c6e59d61c3b006760668d8d18ff0d12179"}, - "makeup": {:hex, :makeup, "1.1.0", "6b67c8bc2882a6b6a445859952a602afc1a41c2e08379ca057c0f525366fc3ca", [], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "0a45ed501f4a8897f580eabf99a2e5234ea3e75a4373c8a52824f6e873be57a6"}, + "makeup": {:hex, :makeup, "1.1.0", "6b67c8bc2882a6b6a445859952a602afc1a41c2e08379ca057c0f525366fc3ca", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "0a45ed501f4a8897f580eabf99a2e5234ea3e75a4373c8a52824f6e873be57a6"}, "makeup_elixir": {:hex, :makeup_elixir, "0.16.1", "cc9e3ca312f1cfeccc572b37a09980287e243648108384b97ff2b76e505c3555", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "e127a341ad1b209bd80f7bd1620a15693a9908ed780c3b763bccf7d200c767c6"}, "makeup_erlang": {:hex, :makeup_erlang, "0.1.2", "ad87296a092a46e03b7e9b0be7631ddcf64c790fa68a9ef5323b6cbb36affc72", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "f3f5a1ca93ce6e092d92b6d9c049bcda58a3b617a8d888f8e7231c85630e8108"}, "nimble_parsec": {:hex, :nimble_parsec, "1.3.1", "2c54013ecf170e249e9291ed0a62e5832f70a476c61da16f6aac6dca0189f2af", [:mix], [], "hexpm", "2682e3c0b2eb58d90c6375fc0cc30bc7be06f365bf72608804fb9cffa5e1b167"}, diff --git a/test/gcode/parser/engine_test.exs b/test/gcode/parser/engine_test.exs index d0979ae..f57bfb5 100644 --- a/test/gcode/parser/engine_test.exs +++ b/test/gcode/parser/engine_test.exs @@ -5,36 +5,39 @@ defmodule Gcode.Parser.EngineTest do import FixtureHelper @moduledoc false - it_parses_into("%", tape: '') - it_parses_into("% hello", tape: 'hello') - it_parses_into("()", comment: '') - it_parses_into("(hello)", comment: 'hello') - it_parses_into("( hello )", comment: 'hello') - it_parses_into("; hello", comment: 'hello') - it_parses_into("G0", block: [word: [command: 'G', address: [integer: '0']]]) - it_parses_into("G 0", block: [word: [command: 'G', address: [integer: '0']]]) - it_parses_into("G54.1", block: [word: [command: 'G', address: [float: '54.1']]]) - it_parses_into("G 54.1", block: [word: [command: 'G', address: [float: '54.1']]]) - it_parses_into("G-1", block: [word: [command: 'G', address: [{:-, [integer: '1']}]]]) - it_parses_into("G+1", block: [word: [command: 'G', address: [{:+, [integer: '1']}]]]) - it_parses_into("G!1", block: [word: [command: 'G', address: [{:!, [integer: '1']}]]]) + it_parses_into("%", tape: ~c"") + it_parses_into("% hello", tape: ~c"hello") + it_parses_into("()", comment: ~c"") + it_parses_into("(hello)", comment: ~c"hello") + it_parses_into("( hello )", comment: ~c"hello") + it_parses_into("; hello", comment: ~c"hello") + it_parses_into("G0", block: [word: [command: ~c"G", address: [integer: ~c"0"]]]) + it_parses_into("G 0", block: [word: [command: ~c"G", address: [integer: ~c"0"]]]) + it_parses_into("G54.1", block: [word: [command: ~c"G", address: [float: ~c"54.1"]]]) + it_parses_into("G 54.1", block: [word: [command: ~c"G", address: [float: ~c"54.1"]]]) + it_parses_into("G-1", block: [word: [command: ~c"G", address: [{:-, [integer: ~c"1"]}]]]) + it_parses_into("G+1", block: [word: [command: ~c"G", address: [{:+, [integer: ~c"1"]}]]]) + it_parses_into("G!1", block: [word: [command: ~c"G", address: [{:!, [integer: ~c"1"]}]]]) it_parses_into("G1 X112.518 Y131.525 E59.51636 (hello)", block: [ - word: [command: 'G', address: [integer: '1']], - word: [command: 'X', address: [float: '112.518']], - word: [command: 'Y', address: [float: '131.525']], - word: [command: 'E', address: [float: '59.51636']], - comment: 'hello' + word: [command: ~c"G", address: [integer: ~c"1"]], + word: [command: ~c"X", address: [float: ~c"112.518"]], + word: [command: ~c"Y", address: [float: ~c"131.525"]], + word: [command: ~c"E", address: [float: ~c"59.51636"]], + comment: ~c"hello" ] ) it_parses_into("M82 ;absolute extrusion mode", - block: [word: [command: 'M', address: [integer: '82']], comment: 'absolute extrusion mode'] + block: [ + word: [command: ~c"M", address: [integer: ~c"82"]], + comment: ~c"absolute extrusion mode" + ] ) it_parses_into("M117 Hello world", - block: [word: [command: 'M', address: [integer: '117']], string: 'Hello world'] + block: [word: [command: ~c"M", address: [integer: ~c"117"]], string: ~c"Hello world"] ) it_parses_into(read_fixture("fusion_360_milling_grbl.nc"), fn tokens ->