From 460ce4891b97b1667ae5ee5529eda9d2449f623f Mon Sep 17 00:00:00 2001 From: ArchiMoebius Date: Wed, 27 Mar 2024 23:56:02 +0000 Subject: [PATCH] PR feedback --- spec/rex/text/lang_spec.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/spec/rex/text/lang_spec.rb b/spec/rex/text/lang_spec.rb index d14e445..45467a6 100644 --- a/spec/rex/text/lang_spec.rb +++ b/spec/rex/text/lang_spec.rb @@ -4,7 +4,7 @@ RSpec.describe Rex::Text do - LANGUAGES = %w[ bash c csharp golang masm nim rust perl python ruby ] + LANGUAGES = %w[ bash c csharp golang masm nim rust perl python ruby zig ] describe "languages match expected output" do let(:expected_bash) do @@ -43,6 +43,10 @@ "buf = \n\"\\x41\\x41\\x41\\x41\\x41\\x41\" +\n\"\\x41\\x41\\x41\\x41\"\n" end + let(:expected_zig) do + "\nconst buf: []const u8 = &.{\n0x41,0x41,0x41,0x41,0x41,0x41,\n0x41,0x41,0x41,0x41};\n" + end + it "bash is as expected" do output = described_class.to_bash('A' * 10, 30) expect(output).to eq(expected_bash) @@ -113,6 +117,11 @@ output = described_class.to_ruby('A' * 10, 30) expect(output).to eq(expected_ruby) end + + it "zig is as expected" do + output = described_class.to_zig('A' * 10, 30) + expect(output).to eq(expected_zig) + end end