Implement a simple config file parser
This commit is contained in:
parent
405b68b824
commit
167b8bee8d
20 changed files with 601 additions and 0 deletions
12
Tests/SimpleConf/TestConfigs/BasicConversions.conf
Normal file
12
Tests/SimpleConf/TestConfigs/BasicConversions.conf
Normal file
|
@ -0,0 +1,12 @@
|
|||
# First, we wanna test if it can even do the basics
|
||||
an int = 123456
|
||||
a float = 3.5
|
||||
a long (8B) = 121212121212121212
|
||||
a double = 0.0000128
|
||||
|
||||
# Now we want to see if it correctly blows up
|
||||
an incorrect char = 256
|
||||
unsigned = -34
|
||||
signed, but large = 3000000000
|
||||
mangled float = 3.f4
|
||||
mangled float 2 = 2.4f
|
4
Tests/SimpleConf/TestConfigs/Comments.conf
Normal file
4
Tests/SimpleConf/TestConfigs/Comments.conf
Normal file
|
@ -0,0 +1,4 @@
|
|||
# Test whether comments behave correctly
|
||||
|
||||
# this shouldn't = be accessible
|
||||
while this = is accessible # and this comment doesn't interfere
|
3
Tests/SimpleConf/TestConfigs/CommentsOnly.conf
Normal file
3
Tests/SimpleConf/TestConfigs/CommentsOnly.conf
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Another example of an empty config
|
||||
# The config should initialize successfully,
|
||||
# but there should be no kv-pairs inside it
|
0
Tests/SimpleConf/TestConfigs/Empty.conf
Normal file
0
Tests/SimpleConf/TestConfigs/Empty.conf
Normal file
2
Tests/SimpleConf/TestConfigs/Optionality.conf
Normal file
2
Tests/SimpleConf/TestConfigs/Optionality.conf
Normal file
|
@ -0,0 +1,2 @@
|
|||
# This probably doesn't need to exist, but eh
|
||||
existing key = existing value
|
10
Tests/SimpleConf/TestConfigs/Parsing-EmptyKey.conf
Normal file
10
Tests/SimpleConf/TestConfigs/Parsing-EmptyKey.conf
Normal file
|
@ -0,0 +1,10 @@
|
|||
# A simple config file that
|
||||
|
||||
normal_key=normal_value
|
||||
another_key=another_value
|
||||
generic=generic
|
||||
another_one=another_value
|
||||
= oh no, an empty key
|
||||
another_one=...
|
||||
|
||||
# It doesn't really matter what's here, because the parser won't reach it
|
8
Tests/SimpleConf/TestConfigs/Parsing-HashInKey.conf
Normal file
8
Tests/SimpleConf/TestConfigs/Parsing-HashInKey.conf
Normal file
|
@ -0,0 +1,8 @@
|
|||
# A simple config file that contains a # character inside the key
|
||||
|
||||
normal_key=normal_value
|
||||
another_key=another_value
|
||||
a_very_bas#ic_key=generic_value
|
||||
another_one=...
|
||||
|
||||
# It doesn't really matter what's here, because the parser won't reach it
|
10
Tests/SimpleConf/TestConfigs/Parsing-KeyAtEnd.conf
Normal file
10
Tests/SimpleConf/TestConfigs/Parsing-KeyAtEnd.conf
Normal file
|
@ -0,0 +1,10 @@
|
|||
# A simple config file that
|
||||
|
||||
normal_key=normal_value
|
||||
another_key=another_value
|
||||
generic=generic
|
||||
another_one=another_value
|
||||
another_one=...
|
||||
|
||||
# It doesn't really matter what's here, because the parser won't reach it
|
||||
sneaky_key
|
4
Tests/SimpleConf/TestConfigs/Parsing-MultipleEquals.conf
Normal file
4
Tests/SimpleConf/TestConfigs/Parsing-MultipleEquals.conf
Normal file
|
@ -0,0 +1,4 @@
|
|||
# A simple config
|
||||
that appears = correct
|
||||
but it = has = an invalid line # Should blow up here
|
||||
another=pair
|
10
Tests/SimpleConf/TestConfigs/Parsing-OnlyKey.conf
Normal file
10
Tests/SimpleConf/TestConfigs/Parsing-OnlyKey.conf
Normal file
|
@ -0,0 +1,10 @@
|
|||
# A simple config file that contains only the key on a single line
|
||||
|
||||
normal_key=normal_value
|
||||
another_key=another_value
|
||||
generic=generic
|
||||
another_one=another_value
|
||||
a_very_basic_key
|
||||
another_one=...
|
||||
|
||||
# It doesn't really matter what's here, because the parser won't reach it
|
Loading…
Add table
Add a link
Reference in a new issue