diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2021-10-12 12:22:48 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2021-10-12 12:25:24 +0300 |
commit | ac657bee0142f96fcd3fa5d56455658834a19b19 (patch) | |
tree | c42d64080a0fa651a8f654c3fff78172282fc796 /source/blender/blenkernel/intern/asset_catalog_path_test.cc | |
parent | 29e5dc1b197908e09d0872267500b79c8f41c317 (diff) |
Tests: simplify asset catalog tree testing code
Simplify the testing code that verifies the asset catalog tree. It now
prints clearer error messages when things go wrong, and it gets simpler
data to test (instead of having to explicitly pass the parent count, it
just counts the number of separators in the expected path).
No functional changes to Blender.
Diffstat (limited to 'source/blender/blenkernel/intern/asset_catalog_path_test.cc')
-rw-r--r-- | source/blender/blenkernel/intern/asset_catalog_path_test.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/asset_catalog_path_test.cc b/source/blender/blenkernel/intern/asset_catalog_path_test.cc index 6110217a0fb..d8da91d5d18 100644 --- a/source/blender/blenkernel/intern/asset_catalog_path_test.cc +++ b/source/blender/blenkernel/intern/asset_catalog_path_test.cc @@ -58,6 +58,15 @@ TEST(AssetCatalogPathTest, length) EXPECT_EQ(21, utf8.length()) << "13 characters should be 21 bytes."; } +TEST(AssetCatalogPathTest, name) +{ + EXPECT_EQ(StringRefNull(""), AssetCatalogPath("").name()); + EXPECT_EQ(StringRefNull("word"), AssetCatalogPath("word").name()); + EXPECT_EQ(StringRefNull("Пермь"), AssetCatalogPath("дорога/в/Пермь").name()); + EXPECT_EQ(StringRefNull("windows\\paths"), + AssetCatalogPath("these/are/not/windows\\paths").name()); +} + TEST(AssetCatalogPathTest, comparison_operators) { const AssetCatalogPath empty(""); |