mirror of
				https://git.proxmox.com/git/proxmox
				synced 2025-10-31 03:36:49 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			21 lines
		
	
	
		
			516 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			516 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| use proxmox_sortable_macro::sortable;
 | |
| 
 | |
| // In a normal project we would use this Cargo.toml line:
 | |
| //
 | |
| // [dependencies]
 | |
| // proxmox = { version = "0.1", features = [ "sortable-macro" ] }
 | |
| //
 | |
| // Then:
 | |
| // use proxmox::{sortable, identity};
 | |
| 
 | |
| #[test]
 | |
| fn test_id() {
 | |
|     #[sortable]
 | |
|     const FOO: [&str; 3] = sorted!(["3", "2", "1"]);
 | |
|     assert_eq!(FOO, ["1", "2", "3"]);
 | |
| 
 | |
|     #[sortable]
 | |
|     const FOO2: [(&str, usize); 3] = sorted!([("3", 1), ("2", 2), ("1", 3)]);
 | |
|     assert_eq!(FOO2, [("1", 3), ("2", 2), ("3", 1)]);
 | |
| }
 | 
