| 
									
										
										
										
											2025-03-20 11:06:27 +13:00
										 |  |  | --- | 
					
						
							|  |  |  | source: kcl-lib/src/simulation_tests.rs | 
					
						
							|  |  |  | description: Result of unparsing boolean_logical_and.kcl | 
					
						
							|  |  |  | --- | 
					
						
							|  |  |  | aa = true & false | 
					
						
							|  |  |  | a = if aa { | 
					
						
							|  |  |  |   1 | 
					
						
							|  |  |  | } else { | 
					
						
							|  |  |  |   2 | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2025-04-22 12:44:52 -05:00
										 |  |  | assert(a, isEqualTo = 2, error = "right branch of and is false makes the whole expression false") | 
					
						
							| 
									
										
										
										
											2025-03-20 11:06:27 +13:00
										 |  |  | 
 | 
					
						
							|  |  |  | bb = false & true | 
					
						
							|  |  |  | b = if bb { | 
					
						
							|  |  |  |   1 | 
					
						
							|  |  |  | } else { | 
					
						
							|  |  |  |   2 | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2025-04-22 12:44:52 -05:00
										 |  |  | assert(b, isEqualTo = 2, error = "left branch of and is false makes the whole expression false") | 
					
						
							| 
									
										
										
										
											2025-03-20 11:06:27 +13:00
										 |  |  | 
 | 
					
						
							|  |  |  | cc = true & true | 
					
						
							|  |  |  | c = if cc { | 
					
						
							|  |  |  |   1 | 
					
						
							|  |  |  | } else { | 
					
						
							|  |  |  |   2 | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2025-04-22 12:44:52 -05:00
										 |  |  | assert(c, isEqualTo = 1, error = "both branches of and are true makes the whole expression true") | 
					
						
							| 
									
										
										
										
											2025-03-20 11:06:27 +13:00
										 |  |  | 
 | 
					
						
							|  |  |  | dd = false & false | 
					
						
							|  |  |  | d = if dd { | 
					
						
							|  |  |  |   1 | 
					
						
							|  |  |  | } else { | 
					
						
							|  |  |  |   2 | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2025-04-22 12:44:52 -05:00
										 |  |  | assert(d, isEqualTo = 2, error = "both branches of and are false makes the whole expression false") |