diff --git a/tests/data/fomod/moduleconfig/banana.xml b/tests/data/fomod/moduleconfig/banana.xml
new file mode 100644
index 0000000..f6b1eee
--- /dev/null
+++ b/tests/data/fomod/moduleconfig/banana.xml
@@ -0,0 +1,88 @@
+
+ The BANANA Mod
+
+
+
+
+
+
+
+
+
+
+
+ Bananas from the 1700s were vastly different from what we see on the shelves today!
+ 1
+
+
+
+
+ Nobody knows why, but Australia has some WEIRD bananas.
+ 1
+
+
+
+
+ Ah, the modern Cavendish banana! How not-sweet it tastes! Do yourself a favor and get one from the 1700s.
+ 1
+
+
+
+
+ ~~CENSORED~~
+ 1
+
+
+
+
+ Sorry, but you can't have feces.
+ 1
+
+
+
+
+
+
+
+
+
+
+
+ These textures are used for anything we didn't downscale/upscale.
+ 1
+
+
+
+
+ 2K is a comfortable resolution fot banana textures.
+ 1
+
+
+
+
+ 4K might be a bit over the top, but hey.
+ 1
+
+
+
+
+ Looks awful.
+ 1
+
+
+
+
+ Just... don't install the mod.
+ 1
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/data/fomod/moduleconfig/example_01.xml b/tests/data/fomod/moduleconfig/example_01.xml
new file mode 100644
index 0000000..c92b929
--- /dev/null
+++ b/tests/data/fomod/moduleconfig/example_01.xml
@@ -0,0 +1,10 @@
+
+
+ Example Mod
+
+
+
+
+
+
diff --git a/tests/data/fomod/moduleconfig/example_02.xml b/tests/data/fomod/moduleconfig/example_02.xml
new file mode 100644
index 0000000..5e3d7f3
--- /dev/null
+++ b/tests/data/fomod/moduleconfig/example_02.xml
@@ -0,0 +1,30 @@
+
+
+
+ Example Mod
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/data/fomod/moduleconfig/example_03.xml b/tests/data/fomod/moduleconfig/example_03.xml
new file mode 100644
index 0000000..68d8d8b
--- /dev/null
+++ b/tests/data/fomod/moduleconfig/example_03.xml
@@ -0,0 +1,86 @@
+
+
+
+ Example Mod
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Select this to install Option A!
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Select this to install Option B!
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/data/fomod/moduleconfig/example_04.xml b/tests/data/fomod/moduleconfig/example_04.xml
new file mode 100644
index 0000000..2d9356c
--- /dev/null
+++ b/tests/data/fomod/moduleconfig/example_04.xml
@@ -0,0 +1,141 @@
+
+
+
+ Example Mod
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Select this to install Option A!
+
+
+
+
+
+
+ selected
+
+
+
+
+
+
+
+ Select this to install Option B!
+
+
+
+
+
+ selected
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Select this to install Texture Blue!
+
+
+
+
+
+
+
+
+
+
+ Select this to install Texture Red!
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Select this to install Texture Blue!
+
+
+
+
+
+
+
+
+
+
+ Select this to install Texture Red!
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/data/fomod/moduleconfig/example_05.xml b/tests/data/fomod/moduleconfig/example_05.xml
new file mode 100644
index 0000000..1257a0f
--- /dev/null
+++ b/tests/data/fomod/moduleconfig/example_05.xml
@@ -0,0 +1,133 @@
+
+
+ Example Mod
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Select this to install Option A!
+
+
+ selected
+
+
+
+
+
+
+
+ Select this to install Option B!
+
+
+ selected
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Select this to install Texture Blue!
+
+
+ selected
+
+
+
+
+
+
+
+ Select this to install Texture Red!
+
+
+ selected
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/data/fomod/moduleconfig/ineed.xml b/tests/data/fomod/moduleconfig/ineed.xml
new file mode 100644
index 0000000..b54e167
--- /dev/null
+++ b/tests/data/fomod/moduleconfig/ineed.xml
@@ -0,0 +1,118 @@
+
+ iNeed - Food, Water and Sleep - Continued
+
+
+
+
+
+
+
+ Contains the main mod.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Requires AE and Creation Club Fishing. This option is not compatible with other mods that modify vanilla food, recipes and with 'Survival' mode! Enables snow collection from medium to large exterior snow drifts simply by activating them. Removes magic effect buffs and debuffs from most food and drink items. Removes the Salt Pile ingredient from cooked meat. Rebalances soup recipes by adding a water ingredient requirement and by changing the number of soups produced from 1 to 2. Innkeepers will now sometimes sell soups and Hearthfire foods.
+
+
+
+
+
+
+
+
+
+
+
+ Requires AE and Creation Club Fishing. This option is not compatible with other mods that modify vanilla recipes and with 'Survival' mode! Enables snow collection from medium to large exterior snow drifts simply by activating them. Removes the Salt Pile ingredient from cooked meat. Rebalances soup recipes by adding a water ingredient requirement and by changing the number of soups produced from 1 to 2. Innkeepers will now sometimes sell soups and Hearthfire foods.
+
+
+
+
+
+
+
+
+
+
+
+ Requires AE and Creation Club Fishing. Enables snow collection from medium to large exterior snow drifts simply by activating them. This option is compatible with all other mods that change "vanilla" cooking recipes, such as CACO or Cooking Expanded. Install it if such mods are installed, for better compatibility with iNeed.
+
+
+
+
+
+
+
+
+
+
+
+ iNeed - Extended will not be installed.
+
+
+
+
+
+
+
+
+
+
+
+
+ Select this option if you have any version of iNeed - Extended installed along with Nordic Snow. This patch will match up the snow drift textures with the rest of the landscape modified by Nordic Snow.
+
+
+
+
+
+
+
+
+
+
+
+ Select this option if you have any version of iNeed - Extended installed along with NobleSkyrimMod. This patch will match up the snow drift textures with the rest of the landscape modified by NobleSkyrimMod.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ All non-transformative diseases will be more unique, harder to cure and progress through 4 deadlier stages at random intervals. See mod description for more information.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/data/fomod/moduleconfig/starui.xml b/tests/data/fomod/moduleconfig/starui.xml
new file mode 100644
index 0000000..d8c600a
--- /dev/null
+++ b/tests/data/fomod/moduleconfig/starui.xml
@@ -0,0 +1,171 @@
+
+
+ StarUI Inventory
+
+
+
+
+
+
+
+
+
+ StarUI Inventory improves all inventory screens for use on a PC. Compact display style. More details in sortable columns. Item category icons. Category as left sidebar. Many quality of life features!
+
+
+
+
+
+
+
+
+
+
+ Select this if you use Vortex
+
+
+ Active
+
+
+
+
+
+
+
+
+ Select this if you use Mod Organizer 2.
+
+
+ Active
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Vanilla interface FPS. As like in the original game.
+
+
+ Active
+
+
+
+
+
+
+ Doubles the default interface FPS. Smoother and more responsive.
+
+
+ Active
+
+
+
+
+
+
+ High-FPS version. This version needs an appropiate monitor to be used.
+WARNING: Using 120FPS may cause the game to crash, as the game engine is not programmed for such high interface FPS rates.
+
+USE AT YOUR OWN RISK.
+
+
+
+ Active
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ You will need to enable Archive Invalidation to load loose files.
+If you haven't done that yet, see the mod page for detailed instructions.
+
+
+
+
+
+
+
+ You can configure many different settings in the file Interface\StarUI Inventory.ini .
+Every settings is described in the file, so you can easily adapt the whole mod to your liking.
+
+
+
+
+
+
+
+ Ready for installation.
+If you are updating, make sure you have a backup of your StarUI Inventory.ini to keep your settings.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/data/fomod/moduleconfig/trade_barter.xml b/tests/data/fomod/moduleconfig/trade_barter.xml
new file mode 100644
index 0000000..aefa2ca
--- /dev/null
+++ b/tests/data/fomod/moduleconfig/trade_barter.xml
@@ -0,0 +1,60 @@
+
+Trade and Barter - Patches
+
+
+
+
+
+
+
+
+
+ ESPLite version
+
+
+
+
+
+
+
+
+
+
+ ESPLite version
+
+
+
+
+
+
+
+
+
+
+ ESPLite version
+
+
+
+
+
+
+
+
+
+
+ ESPLite version
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/fomod_test.rs b/tests/fomod_test.rs
new file mode 100644
index 0000000..79d98f9
--- /dev/null
+++ b/tests/fomod_test.rs
@@ -0,0 +1,41 @@
+use std::path::PathBuf;
+
+use fomod_manager::fomod::{self, FOModError};
+
+fn get_parent() -> PathBuf {
+ PathBuf::from(file!()).parent().unwrap().to_owned()
+}
+
+fn get_xml(filename: &str) -> PathBuf {
+ get_parent().join(format!("data/fomod/moduleconfig/{}", filename))
+}
+
+fn err_to_string(e: FOModError) -> String {
+ match e {
+ FOModError::Io(error) => format!("IO: {:?}", error),
+ FOModError::Parse(de_error) => match de_error {
+ quick_xml::DeError::UnexpectedStart(items) => {
+ format!("UnexpectedStart: {}", str::from_utf8(&items).unwrap())
+ }
+ _ => format!("Other: {:?}", de_error),
+ },
+ }
+}
+
+#[test]
+fn parse() {
+ for xml in [
+ "ineed.xml",
+ "trade_barter.xml",
+ "starui.xml",
+ "example_01.xml",
+ "example_02.xml",
+ "example_03.xml",
+ "example_04.xml",
+ "example_05.xml",
+ "banana.xml",
+ ] {
+ fomod::Config::load_from_file(get_xml(xml))
+ .unwrap_or_else(|e| panic!("Parse for {xml} with {}", err_to_string(e)));
+ }
+}