mirror of https://github.com/sunface/rust-course
				
				
				
			
			You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					18 lines
				
				431 B
			
		
		
			
		
	
	
					18 lines
				
				431 B
			| 
								 
											4 years ago
										 
									 | 
							
								// tests1.rs
							 | 
						||
| 
								 
											4 years ago
										 
									 | 
							
								// 测试对于确保代码实现了预期功能非常重要。
							 | 
						||
| 
								 | 
							
								// 可以用下面的命令对当前文件中的代码进行测试:
							 | 
						||
| 
								 
											4 years ago
										 
									 | 
							
								// rustlings run tests1
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 
											4 years ago
										 
									 | 
							
								// 关于测试还有个问题——如何成功编译测试、通过测试或者使测试失败?
							 | 
						||
| 
								 | 
							
								// 执行 `rustlings hint tests1` 获取提示 :)
							 | 
						||
| 
								 
											4 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 | 
							
								// I AM NOT DONE
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#[cfg(test)]
							 | 
						||
| 
								 | 
							
								mod tests {
							 | 
						||
| 
								 | 
							
								    #[test]
							 | 
						||
| 
								 | 
							
								    fn you_can_assert() {
							 | 
						||
| 
								 | 
							
								        assert!();
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								}
							 |