diff --git a/tests/unit-initcpio.cpp b/tests/unit-initcpio.cpp index f5e994d..af12389 100644 --- a/tests/unit-initcpio.cpp +++ b/tests/unit-initcpio.cpp @@ -57,12 +57,20 @@ int main() { // Insert data. initcpio.append_module("radeon"); initcpio.append_hook("btrfs"); - initcpio.modules.insert(initcpio.modules.end(), {"crc32c-intel"}); + initcpio.append_module("crc32c-intel"); initcpio.hooks.insert(initcpio.hooks.end(), {"usr", "lvm2", "zfs"}); // Write data. assert(initcpio.write()); + // Checking insertion of equal items + initcpio.append_module("radeon"); + initcpio.append_hook("btrfs"); + initcpio.append_module("crc32c-intel"); + + // Write data. + assert(initcpio.write()); + // Check if file is equal to test data. // "\n# MODULES\nMODULES=(crc32c-intel)\n\n# BINARIES\nBINARIES=()\n\n# FILES\nFILES=()\n\n# HOOKS\nHOOKS=(base usr lvm2 zfs)"\n const auto& file_content = utils::read_whole_file(filename);