| 
									
										
										
										
											2020-07-05 17:26:26 -07:00
										 |  |  | test("basic functionality", () => { | 
					
						
							| 
									
										
										
										
											2020-07-06 07:37:45 -07:00
										 |  |  |     const x = 1; | 
					
						
							| 
									
										
										
										
											2020-04-13 10:31:13 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-06 07:37:45 -07:00
										 |  |  |     expect(x === 1 ? true : false).toBeTrue(); | 
					
						
							|  |  |  |     expect(x ? x : 0).toBe(x); | 
					
						
							|  |  |  |     expect(1 < 2 ? true : false).toBeTrue(); | 
					
						
							|  |  |  |     expect(0 ? 1 : 1 ? 10 : 20).toBe(10); | 
					
						
							|  |  |  |     expect(0 ? (1 ? 1 : 10) : 20).toBe(20); | 
					
						
							| 
									
										
										
										
											2020-07-05 17:26:26 -07:00
										 |  |  | }); | 
					
						
							| 
									
										
										
										
											2020-04-03 12:14:28 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-05 17:26:26 -07:00
										 |  |  | test("object values", () => { | 
					
						
							| 
									
										
										
										
											2020-07-06 07:37:45 -07:00
										 |  |  |     const o = {}; | 
					
						
							|  |  |  |     o.f = true; | 
					
						
							|  |  |  |     expect(o.f ? true : false).toBeTrue(); | 
					
						
							|  |  |  |     expect(1 ? o.f : null).toBeTrue(); | 
					
						
							| 
									
										
										
										
											2020-07-05 17:26:26 -07:00
										 |  |  | }); | 
					
						
							| 
									
										
										
										
											2020-12-14 13:05:24 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | test("issue #4409, '?.' followed by decimal digit", () => { | 
					
						
							| 
									
										
										
										
											2021-06-18 19:09:17 +01:00
										 |  |  |     expect("false?.1:.2").toEvalTo(0.2); | 
					
						
							| 
									
										
										
										
											2020-12-14 13:05:24 +00:00
										 |  |  | }); |