FTXUI/src/ftxui/component/terminal_input_parser_test_fuzzer.cpp
Arthur Sonzogni 9c4218c2a8
Support SIGTSTP and task posting. (#331)
- Add support for SIGTSTP:
https://github.com/ArthurSonzogni/FTXUI/issues/330
This

- Add support for task posting.
This allows folks to defer function execution, and execute it directly
below the main loop. The task are executed in a FIFO order.
2022-02-13 11:11:34 +01:00

24 lines
733 B
C++

//#include "ftxui/component/event.hpp"
//#include "ftxui/component/receiver.hpp"
#include <vector>
#include "ftxui/component/terminal_input_parser.hpp"
extern "C" int LLVMFuzzerTestOneInput(const char* data, size_t size) {
using namespace ftxui;
auto event_receiver = MakeReceiver<Task>();
{
auto parser = TerminalInputParser(event_receiver->MakeSender());
for (size_t i = 0; i < size; ++i)
parser.Add(data[i]);
}
Task received;
while (event_receiver->Receive(&received))
;
return 0; // Non-zero return values are reserved for future use.
}
// Copyright 2021 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.