nodemcu-firmware/lua_tests/mispec_ws2812_effects.lua
Gregor Hartmann d4b5b0cbaf Fixes for ws2812 and ws2812_effects (#2953)
* clean effects library
* Fix several issues in ws2812 and effects
* Implement working way of calling shift from callback
2020-06-09 22:26:06 +02:00

32 lines
777 B
Lua

require 'mispec'
local buffer, buffer1, buffer2
describe('WS2812_effects', function(it)
it:should('set_speed', function()
buffer = ws2812.newBuffer(9, 3)
ws2812_effects.init(buffer)
ws2812_effects.set_speed(0)
ws2812_effects.set_speed(255)
failwith("should be", ws2812_effects.set_speed, -1)
failwith("should be", ws2812_effects.set_speed, 256)
end)
it:should('set_brightness', function()
buffer = ws2812.newBuffer(9, 3)
ws2812_effects.init(buffer)
ws2812_effects.set_brightness(0)
ws2812_effects.set_brightness(255)
failwith("should be", ws2812_effects.set_brightness, -1)
failwith("should be", ws2812_effects.set_brightness, 256)
end)
end)
mispec.run()