mirror of
https://github.com/red0124/ssp.git
synced 2025-12-15 22:29:55 +01:00
Resolve clang-tidy warnings (#48)
* Resolve clang-tidy warnings, update single_header_generator.py * Update single header test, resolve additional clang-tidy warnings
This commit is contained in:
@@ -3,12 +3,14 @@
|
||||
set -x
|
||||
set -e
|
||||
|
||||
python3 script/single_header_generator.py > ssp.cpp
|
||||
TMP_HDR=test_single_header.hpp
|
||||
TMP_SRC=test_single_header.cpp
|
||||
TMP_BIN=test_single_header
|
||||
|
||||
echo 'int main(){ ss::parser p{""}; p.get_next<int, float>(); return 0; }' \
|
||||
>> ssp.cpp
|
||||
python3 script/single_header_generator.py > ${TMP_HDR}
|
||||
cat ${TMP_HDR} test/test_single_header_main.txt > ${TMP_SRC}
|
||||
|
||||
g++ -std=c++17 ssp.cpp -o ssp.bin -Wall -Wextra
|
||||
./ssp.bin
|
||||
g++ -std=c++17 ${TMP_SRC} -o ${TMP_BIN} -Wall -Wextra
|
||||
./${TMP_BIN}
|
||||
|
||||
rm ssp.cpp ssp.bin
|
||||
rm ${TMP_HDR} ${TMP_SRC} ${TMP_BIN}
|
||||
|
||||
12
test/test_single_header_main.txt
Normal file
12
test/test_single_header_main.txt
Normal file
@@ -0,0 +1,12 @@
|
||||
int main() {
|
||||
using quote = ss::quote<'"'>;
|
||||
using escape = ss::escape<'\\'>;
|
||||
using trim = ss::trim<' '>;
|
||||
|
||||
std::string data = "1,string,2.34,c";
|
||||
|
||||
ss::parser<quote, escape, trim, ss::multiline> p{data.c_str(), data.size()};
|
||||
auto tup = p.get_next<int, std::string, float, std::optional<char>>();
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user