Handle end of input in scan

This commit is contained in:
Victor Zverovich
2023-12-25 07:18:23 -08:00
parent 1fd093add4
commit c5a85f8d7d
2 changed files with 43 additions and 10 deletions
+6
View File
@@ -10,6 +10,7 @@
#include <time.h>
#include <climits>
#include <thread>
#include "fmt/os.h"
#include "gmock/gmock.h"
@@ -123,6 +124,11 @@ TEST(scan_test, example) {
EXPECT_EQ(value, 42);
}
TEST(scan_test, end_of_input) {
int value = 0;
fmt::scan("", "{}", value);
}
#if FMT_USE_FCNTL
TEST(scan_test, file) {
fmt::file read_end, write_end;