git.delta.rocks / jrsonnet / refs/commits / cfd7ffef0b97

difftreelog

test fixes for latest updates

Лач2020-06-27parent: #65d5493.patch.diff
in: master

2 files changed

modifiedcmds/jrsonnet/src/location.rsdiffbeforeafterboth
84 CodeLocation {84 CodeLocation {
85 line: 1,85 line: 1,
86 column: 1,86 column: 1,
87 line_start_offset: 0,87 line_start_offset: 1,
88 line_end_offset: 1188 line_end_offset: 11
89 },89 },
90 CodeLocation {90 CodeLocation {
91 line: 2,91 line: 2,
92 column: 3,92 column: 3,
93 line_start_offset: 11,93 line_start_offset: 12,
94 line_end_offset: 6794 line_end_offset: 67
95 }95 }
96 ]96 ]
modifiedcrates/jsonnet-evaluator/src/lib.rsdiffbeforeafterboth
--- a/crates/jsonnet-evaluator/src/lib.rs
+++ b/crates/jsonnet-evaluator/src/lib.rs
@@ -390,13 +390,15 @@
 		($str: expr) => {{
 			let evaluator = EvaluationState::default();
 			evaluator.with_stdlib();
-			evaluator
-				.parse_evaluate_raw($str)
-				.unwrap()
-				.into_json(0)
-				.unwrap()
-				.replace("\n", "")
-			}};
+			evaluator.run_in_state(||{
+				evaluator
+					.parse_evaluate_raw($str)
+					.unwrap()
+					.into_json(0)
+					.unwrap()
+					.replace("\n", "")
+			})
+		}}
 	}
 
 	/// Asserts given code returns `true`
@@ -500,11 +502,13 @@
 	}
 
 	#[test]
+	#[should_panic]
 	fn tailstrict_args() {
 		eval!("local test(a) = 2; test(error '3') tailstrict");
 	}
 
 	#[test]
+	#[should_panic]
 	fn no_binding_error() {
 		eval!("a");
 	}