diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2021-10-25 13:35:21 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2021-10-25 13:37:35 +0300 |
commit | 550cbec5c4dcf785d382950e2651a423f55b2f6a (patch) | |
tree | 0bbbbdc5c83e34ed94111bd17d46624c0e82adb6 /source/blender/blenkernel/intern/asset_catalog_path_test.cc | |
parent | 31f6e7837024672a895bba0390f6e25df0482162 (diff) |
Cleanup: asset catalog path test, improve sub-test separation
Put related lines in a block of their own, such that each block doesn't
have access to the variables of the previous blocks.
This makes it easier to correctly copy-paste some tests, as the compiler
forces you to update the code afterwards.
Diffstat (limited to 'source/blender/blenkernel/intern/asset_catalog_path_test.cc')
-rw-r--r-- | source/blender/blenkernel/intern/asset_catalog_path_test.cc | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/source/blender/blenkernel/intern/asset_catalog_path_test.cc b/source/blender/blenkernel/intern/asset_catalog_path_test.cc index be50f2fc001..997f57a161c 100644 --- a/source/blender/blenkernel/intern/asset_catalog_path_test.cc +++ b/source/blender/blenkernel/intern/asset_catalog_path_test.cc @@ -193,19 +193,21 @@ TEST(AssetCatalogPathTest, is_contained_in) TEST(AssetCatalogPathTest, cleanup) { - AssetCatalogPath ugly_path("/ some / родитель / "); - AssetCatalogPath clean_path = ugly_path.cleanup(); - - EXPECT_EQ(AssetCatalogPath("/ some / родитель / "), ugly_path) - << "cleanup should not modify the path instance itself"; - - EXPECT_EQ(AssetCatalogPath("some/родитель"), clean_path); - - AssetCatalogPath double_slashed("some//родитель"); - EXPECT_EQ(AssetCatalogPath("some/родитель"), double_slashed.cleanup()); - - AssetCatalogPath with_colons("some/key:subkey=value/path"); - EXPECT_EQ(AssetCatalogPath("some/key-subkey=value/path"), with_colons.cleanup()); + { + AssetCatalogPath ugly_path("/ some / родитель / "); + AssetCatalogPath clean_path = ugly_path.cleanup(); + EXPECT_EQ(AssetCatalogPath("/ some / родитель / "), ugly_path) + << "cleanup should not modify the path instance itself"; + EXPECT_EQ(AssetCatalogPath("some/родитель"), clean_path); + } + { + AssetCatalogPath double_slashed("some//родитель"); + EXPECT_EQ(AssetCatalogPath("some/родитель"), double_slashed.cleanup()); + } + { + AssetCatalogPath with_colons("some/key:subkey=value/path"); + EXPECT_EQ(AssetCatalogPath("some/key-subkey=value/path"), with_colons.cleanup()); + } } TEST(AssetCatalogPathTest, iterate_components) |