| 
									
										
										
										
											2016-05-24 21:55:46 +02:00
										 |  |  | package assert | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | import ( | 
					
						
							| 
									
										
										
										
											2016-08-20 20:55:45 +02:00
										 |  |  | 	"v2ray.com/core/common/serial" | 
					
						
							| 
									
										
										
										
											2016-05-24 21:55:46 +02:00
										 |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-27 21:39:09 +01:00
										 |  |  | func (v *Assert) Int64(value int64) *Int64Subject { | 
					
						
							| 
									
										
										
										
											2016-05-24 21:55:46 +02:00
										 |  |  | 	return &Int64Subject{ | 
					
						
							|  |  |  | 		Subject: Subject{ | 
					
						
							| 
									
										
										
										
											2016-11-27 21:39:09 +01:00
										 |  |  | 			a:    v, | 
					
						
							| 
									
										
										
										
											2016-05-24 21:55:46 +02:00
										 |  |  | 			disp: serial.Int64ToString(value), | 
					
						
							|  |  |  | 		}, | 
					
						
							|  |  |  | 		value: value, | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | type Int64Subject struct { | 
					
						
							|  |  |  | 	Subject | 
					
						
							|  |  |  | 	value int64 | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | func (subject *Int64Subject) Equals(expectation int64) { | 
					
						
							|  |  |  | 	if subject.value != expectation { | 
					
						
							|  |  |  | 		subject.Fail("is equal to", serial.Int64ToString(expectation)) | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | func (subject *Int64Subject) GreaterThan(expectation int64) { | 
					
						
							|  |  |  | 	if subject.value <= expectation { | 
					
						
							|  |  |  | 		subject.Fail("is greater than", serial.Int64ToString(expectation)) | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | func (subject *Int64Subject) AtMost(expectation int64) { | 
					
						
							|  |  |  | 	if subject.value > expectation { | 
					
						
							|  |  |  | 		subject.Fail("is at most", serial.Int64ToString(expectation)) | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | func (subject *Int64Subject) AtLeast(expectation int64) { | 
					
						
							|  |  |  | 	if subject.value < expectation { | 
					
						
							|  |  |  | 		subject.Fail("is at least", serial.Int64ToString(expectation)) | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } |