lunarmodules / busted

Elegant Lua unit testing.
https://lunarmodules.github.io/busted/
MIT License
1.4k stars 185 forks source link

Weird characters showing up in Windows Powershell #627

Closed xvnnnk closed 4 years ago

xvnnnk commented 4 years ago

I have written a simple test and I run it this way:

busted simple_test.lua

This is the lua file:

describe("This is the test", function()
    it("It part: ", function()
        local instance = game(false)
        instance:add_player("1", 10)
        instance:add_player("2", 10)
        assert.are.equal(#instance.user_ids, 2)
    end)
end)

and this is the output:

ΓùÅ
1 success / 0 failures / 0 errors / 0 pending : 0.0 seconds

What is the ΓùÅ part?

Tieske commented 4 years ago

it is probably the default output formatter; which prints colored dots. I think it is not properly recognizing the powersehll terminal as not supporting those.

try another formatter like gtest for example;

busted -o gtest simple_test.lua

Once you find one that works for you you can add a .busted config file with those as a default.

Tieske commented 4 years ago

see here: https://github.com/Olivine-Labs/busted/tree/master/busted/outputHandlers

(note that base is a base-class, the other ones can be used by specifying their file names, without the .lua part)