tests: add initial tests
Signed-off-by: Christopher Arndt <chris@chrisarndt.de>
This commit is contained in:
		
							parent
							
								
									bff6f5e9fa
								
							
						
					
					
						commit
						892d087c40
					
				@ -1 +1,3 @@
 | 
				
			|||||||
--path:"../src/"
 | 
					--path:"../src/"
 | 
				
			||||||
 | 
					--warning[BareExcept]:off
 | 
				
			||||||
 | 
					--warning[UnusedImport]:off
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										20
									
								
								tests/test_version.nim
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								tests/test_version.nim
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,20 @@
 | 
				
			|||||||
 | 
					import std/[re, strformat, unittest]
 | 
				
			||||||
 | 
					import jacket
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					suite "test version":
 | 
				
			||||||
 | 
					    test "getVersion":
 | 
				
			||||||
 | 
					        var major, minor, micro, proto: cint
 | 
				
			||||||
 | 
					        getVersion(major.addr, minor.addr, micro.addr, proto.addr)
 | 
				
			||||||
 | 
					        #echo fmt"{major}.{minor}.{micro} proto {proto}"
 | 
				
			||||||
 | 
					        check:
 | 
				
			||||||
 | 
					            # yes, the function simply returns 0 for all vars :-D
 | 
				
			||||||
 | 
					            major == 0
 | 
				
			||||||
 | 
					            minor == 0
 | 
				
			||||||
 | 
					            micro == 0
 | 
				
			||||||
 | 
					            proto == 0
 | 
				
			||||||
 | 
					    test "getVersionString":
 | 
				
			||||||
 | 
					        let version = getVersionString()
 | 
				
			||||||
 | 
					        #echo $version
 | 
				
			||||||
 | 
					        check:
 | 
				
			||||||
 | 
					            $typeof(version) == "cstring"
 | 
				
			||||||
 | 
					            match($version, re(r"\d+\.\d+\.\d+"))
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user