mirror of
				https://github.com/davidgiven/fluxengine.git
				synced 2025-10-24 11:11:02 -07:00 
			
		
		
		
	
		
			
				
	
	
		
			34 lines
		
	
	
		
			1011 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
		
			1011 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| #include "lib/core/globals.h"
 | |
| #include "lib/config/config.h"
 | |
| #include "lib/vfs/vfs.h"
 | |
| #include "snowhouse/snowhouse.h"
 | |
| 
 | |
| using namespace snowhouse;
 | |
| 
 | |
| static void testPathParsing()
 | |
| {
 | |
|     AssertThat(Path(""), Equals(std::vector<std::string>{}));
 | |
|     AssertThat(Path("/"), Equals(std::vector<std::string>{}));
 | |
|     AssertThat(Path("one"), Equals(std::vector<std::string>{"one"}));
 | |
|     AssertThat(Path("one/two"), Equals(std::vector<std::string>{"one", "two"}));
 | |
|     AssertThat(
 | |
|         Path("/one/two"), Equals(std::vector<std::string>{"one", "two"}));
 | |
| }
 | |
| 
 | |
| static void testPathParenthood()
 | |
| {
 | |
|     AssertThat(Path("").parent(), Equals(std::vector<std::string>{}));
 | |
|     AssertThat(Path("one").parent(), Equals(std::vector<std::string>{}));
 | |
|     AssertThat(
 | |
|         Path("one/two").parent(), Equals(std::vector<std::string>{"one"}));
 | |
|     AssertThat(Path("one/two/three").parent(),
 | |
|         Equals(std::vector<std::string>{"one", "two"}));
 | |
| }
 | |
| 
 | |
| int main(void)
 | |
| {
 | |
|     testPathParsing();
 | |
|     testPathParenthood();
 | |
|     return 0;
 | |
| }
 |