mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-30 22:42:24 -05:00 
			
		
		
		
	[chore] Better diff for envparsing test (#1562)
This checks if jd is availalbe and if so uses that to create the diff instead. jd can tell you at which (nested) key the values are differing which makes for more human friendly output.
This commit is contained in:
		
					parent
					
						
							
								5a45b6ec6a
							
						
					
				
			
			
				commit
				
					
						6c2bd141f7
					
				
			
		
					 1 changed files with 6 additions and 1 deletions
				
			
		|  | @ -94,7 +94,12 @@ echo "$OUTPUT" > "$OUTPUT_OUT" | ||||||
| EXPECT_OUT=$(mktemp) | EXPECT_OUT=$(mktemp) | ||||||
| echo "$EXPECT" > "$EXPECT_OUT" | echo "$EXPECT" > "$EXPECT_OUT" | ||||||
| 
 | 
 | ||||||
| if ! DIFF=$(diff "$OUTPUT_OUT" "$EXPECT_OUT"); then | DIFFCMD=$(command -v diff 2>&1) | ||||||
|  | if command -v jd >/dev/null 2>&1; then | ||||||
|  |     DIFFCMD=$(command -v jd 2>&1) | ||||||
|  | fi | ||||||
|  | 
 | ||||||
|  | if ! DIFF=$("$DIFFCMD" "$OUTPUT_OUT" "$EXPECT_OUT"); then | ||||||
|     echo "OUTPUT not equal EXPECTED" |     echo "OUTPUT not equal EXPECTED" | ||||||
|     echo "$DIFF" |     echo "$DIFF" | ||||||
|     exit 1 |     exit 1 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue