library/test/buffer_test.cpp

19 lines
491 B
C++
Raw Normal View History

#include "../src/internal.hpp"
#include "../src/vkvm.hpp"
#include <catch2/catch.hpp>
TEST_CASE("Keyboard Buffer") {
SECTION("write") {
vkvm::setLogLevel(vkvm::DEBUG);
vkvm::buttonPressed(vkvm::A);
vkvm::buttonPressed(vkvm::B);
vkvm::buttonPressed(vkvm::C);
}
SECTION("read") {
2020-01-07 11:40:47 +01:00
CHECK(vkvm::getLastPressedKey() == vkvm::C);
CHECK(vkvm::getLastPressedKey() == vkvm::C);
CHECK(vkvm::getLastPressedKey() == vkvm::C);
}
}