test(tvix/eval): test word behavior in builtins.compareVersions
We delegate to Rust std's Ord trait, so we should at least do a sanity check here. Change-Id: I9596068f8ab3e51b79602de0bac79af6d558086e Reviewed-on: https://cl.tvl.fyi/c/depot/+/6723 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
This commit is contained in:
		
							parent
							
								
									3fec7185f4
								
							
						
					
					
						commit
						ee0b89c402
					
				
					 2 changed files with 6 additions and 1 deletions
				
			
		| 
						 | 
					@ -1 +1 @@
 | 
				
			||||||
[ 0 -1 -1 0 0 0 1 1 -1 1 -1 1 -1 -1 -1 -1 0 -1 -1 0 1 1 1 1 -1 -1 -1 -1 -1 ]
 | 
					[ 0 -1 -1 0 0 0 1 1 -1 1 -1 1 -1 -1 -1 -1 0 1 -1 -1 1 -1 -1 0 1 1 1 1 -1 -1 -1 -1 -1 ]
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -25,6 +25,11 @@ in
 | 
				
			||||||
  (cmp "2.3" "2.3prepre")
 | 
					  (cmp "2.3" "2.3prepre")
 | 
				
			||||||
  (cmp "2.3pre" "2.3prepre")
 | 
					  (cmp "2.3pre" "2.3prepre")
 | 
				
			||||||
  (cmp "2.3prepre" "2.3prepre")
 | 
					  (cmp "2.3prepre" "2.3prepre")
 | 
				
			||||||
 | 
					  # check that the plain word comparison (via Ord) behaves the same
 | 
				
			||||||
 | 
					  (cmp "foo" "bar")
 | 
				
			||||||
 | 
					  (cmp "FoO" "fOo")
 | 
				
			||||||
 | 
					  (cmp "foo" "fooo")
 | 
				
			||||||
 | 
					  (cmp "foopre" "foo")
 | 
				
			||||||
  # Subset of test cases from eval-okay-versions.nix shipped by C++ Nix
 | 
					  # Subset of test cases from eval-okay-versions.nix shipped by C++ Nix
 | 
				
			||||||
  (cmp "1.0" "2.3")
 | 
					  (cmp "1.0" "2.3")
 | 
				
			||||||
  (cmp "2.1" "2.3")
 | 
					  (cmp "2.1" "2.3")
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue