🔧 Adjust tests

This commit is contained in:
Vladislav Nepogodin 2022-08-12 03:41:04 +04:00
parent b8adedf529
commit f0cb6b2246
No known key found for this signature in database
GPG Key ID: B62C3D10C54D5DA9

View File

@ -57,12 +57,20 @@ int main() {
// Insert data. // Insert data.
initcpio.append_module("radeon"); initcpio.append_module("radeon");
initcpio.append_hook("btrfs"); 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"}); initcpio.hooks.insert(initcpio.hooks.end(), {"usr", "lvm2", "zfs"});
// Write data. // Write data.
assert(initcpio.write()); 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. // 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 // "\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); const auto& file_content = utils::read_whole_file(filename);