Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiMoebius committed Mar 27, 2024
1 parent 94436fe commit 460ce48
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion spec/rex/text/lang_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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


Expand Down

0 comments on commit 460ce48

Please sign in to comment.