mirror of
				https://github.com/eledio-devices/thirdparty-tinyexpr.git
				synced 2025-10-31 16:14:16 +01:00 
			
		
		
		
	Added test cases to insure te_compile returns 0 on error.
This commit is contained in:
		
							
								
								
									
										7
									
								
								test.c
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								test.c
									
									
									
									
									
								
							| @@ -162,8 +162,13 @@ void test_syntax() { | |||||||
|         const int e = errors[i].answer; |         const int e = errors[i].answer; | ||||||
|  |  | ||||||
|         int err; |         int err; | ||||||
|         te_interp(expr, &err); |         const double r = te_interp(expr, &err); | ||||||
|         lequal(err, e); |         lequal(err, e); | ||||||
|  |         lok(r != r); | ||||||
|  |  | ||||||
|  |         te_expr *n = te_compile(expr, 0, 0, &err); | ||||||
|  |         lequal(err, e); | ||||||
|  |         lok(!n); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user