@@ -5,8 +5,7 @@ use std::path::Path;
55
66#[ test]
77fn test_version_command ( ) {
8- let output = Command :: cargo_bin ( "canon" )
9- . unwrap ( )
8+ let output = Command :: new ( env ! ( "CARGO_BIN_EXE_canon" ) )
109 . arg ( "--version" )
1110 . assert ( )
1211 . success ( ) ;
@@ -17,8 +16,7 @@ fn test_version_command() {
1716
1817#[ test]
1918fn test_describe_command ( ) {
20- let output = Command :: cargo_bin ( "canon" )
21- . unwrap ( )
19+ let output = Command :: new ( env ! ( "CARGO_BIN_EXE_canon" ) )
2220 . arg ( "--describe" )
2321 . assert ( )
2422 . success ( ) ;
@@ -34,24 +32,25 @@ fn test_describe_command() {
3432
3533#[ test]
3634fn test_schema_command ( ) {
37- let output = Command :: cargo_bin ( "canon" )
38- . unwrap ( )
35+ let output = Command :: new ( env ! ( "CARGO_BIN_EXE_canon" ) )
3936 . arg ( "--schema" )
4037 . assert ( )
4138 . success ( ) ;
4239
4340 let stdout = String :: from_utf8 ( output. get_output ( ) . stdout . clone ( ) ) . unwrap ( ) ;
4441 let json: Value = serde_json:: from_str ( & stdout) . expect ( "--schema should output valid JSON" ) ;
4542
46- assert_eq ! ( json[ "$schema" ] , "https://json-schema.org/draft/2020-12/schema" ) ;
43+ assert_eq ! (
44+ json[ "$schema" ] ,
45+ "https://json-schema.org/draft/2020-12/schema"
46+ ) ;
4747 assert_eq ! ( json[ "$id" ] , "https://canon.v0/schema.json" ) ;
4848 assert ! ( json[ "properties" ] . is_object( ) ) ;
4949}
5050
5151#[ test]
5252fn test_all_resolved_exit_code ( ) {
53- Command :: cargo_bin ( "canon" )
54- . unwrap ( )
53+ Command :: new ( env ! ( "CARGO_BIN_EXE_canon" ) )
5554 . arg ( "tests/fixtures/inputs/all_resolved.csv" )
5655 . arg ( "--registry" )
5756 . arg ( "tests/fixtures/registries/cusip-isin" )
@@ -63,8 +62,7 @@ fn test_all_resolved_exit_code() {
6362
6463#[ test]
6564fn test_partial_exit_code ( ) {
66- Command :: cargo_bin ( "canon" )
67- . unwrap ( )
65+ Command :: new ( env ! ( "CARGO_BIN_EXE_canon" ) )
6866 . arg ( "tests/fixtures/inputs/partial.csv" )
6967 . arg ( "--registry" )
7068 . arg ( "tests/fixtures/registries/cusip-isin" )
@@ -76,8 +74,7 @@ fn test_partial_exit_code() {
7674
7775#[ test]
7876fn test_all_unresolved_exit_code ( ) {
79- Command :: cargo_bin ( "canon" )
80- . unwrap ( )
77+ Command :: new ( env ! ( "CARGO_BIN_EXE_canon" ) )
8178 . arg ( "tests/fixtures/inputs/all_unresolved.csv" )
8279 . arg ( "--registry" )
8380 . arg ( "tests/fixtures/registries/cusip-isin" )
@@ -89,8 +86,7 @@ fn test_all_unresolved_exit_code() {
8986
9087#[ test]
9188fn test_missing_input_file_refusal ( ) {
92- Command :: cargo_bin ( "canon" )
93- . unwrap ( )
89+ Command :: new ( env ! ( "CARGO_BIN_EXE_canon" ) )
9490 . arg ( "nonexistent.csv" )
9591 . arg ( "--registry" )
9692 . arg ( "tests/fixtures/registries/cusip-isin" )
@@ -103,8 +99,7 @@ fn test_missing_input_file_refusal() {
10399
104100#[ test]
105101fn test_emit_csv_with_jsonl_refusal ( ) {
106- Command :: cargo_bin ( "canon" )
107- . unwrap ( )
102+ Command :: new ( env ! ( "CARGO_BIN_EXE_canon" ) )
108103 . arg ( "tests/fixtures/inputs/basic.jsonl" )
109104 . arg ( "--registry" )
110105 . arg ( "tests/fixtures/registries/cusip-isin" )
@@ -119,8 +114,7 @@ fn test_emit_csv_with_jsonl_refusal() {
119114
120115#[ test]
121116fn test_column_not_found_refusal ( ) {
122- Command :: cargo_bin ( "canon" )
123- . unwrap ( )
117+ Command :: new ( env ! ( "CARGO_BIN_EXE_canon" ) )
124118 . arg ( "tests/fixtures/inputs/all_resolved.csv" )
125119 . arg ( "--registry" )
126120 . arg ( "tests/fixtures/registries/cusip-isin" )
@@ -133,8 +127,7 @@ fn test_column_not_found_refusal() {
133127
134128#[ test]
135129fn test_json_mode_success_to_stdout ( ) {
136- let output = Command :: cargo_bin ( "canon" )
137- . unwrap ( )
130+ let output = Command :: new ( env ! ( "CARGO_BIN_EXE_canon" ) )
138131 . arg ( "tests/fixtures/inputs/all_resolved.csv" )
139132 . arg ( "--registry" )
140133 . arg ( "tests/fixtures/registries/cusip-isin" )
@@ -156,8 +149,7 @@ fn test_json_mode_success_to_stdout() {
156149
157150#[ test]
158151fn test_csv_mode_success_to_stdout ( ) {
159- let output = Command :: cargo_bin ( "canon" )
160- . unwrap ( )
152+ let output = Command :: new ( env ! ( "CARGO_BIN_EXE_canon" ) )
161153 . arg ( "tests/fixtures/inputs/all_resolved.csv" )
162154 . arg ( "--registry" )
163155 . arg ( "tests/fixtures/registries/cusip-isin" )
@@ -178,8 +170,7 @@ fn test_csv_mode_success_to_stdout() {
178170
179171#[ test]
180172fn test_csv_mode_refusal_to_stderr ( ) {
181- let output = Command :: cargo_bin ( "canon" )
182- . unwrap ( )
173+ let output = Command :: new ( env ! ( "CARGO_BIN_EXE_canon" ) )
183174 . arg ( "tests/fixtures/inputs/wrong_column.csv" )
184175 . arg ( "--registry" )
185176 . arg ( "tests/fixtures/registries/cusip-isin" )
@@ -202,8 +193,7 @@ fn test_csv_mode_refusal_to_stderr() {
202193#[ test]
203194fn test_witness_flag_no_witness ( ) {
204195 // This test just ensures --no-witness doesn't break execution
205- Command :: cargo_bin ( "canon" )
206- . unwrap ( )
196+ Command :: new ( env ! ( "CARGO_BIN_EXE_canon" ) )
207197 . arg ( "tests/fixtures/inputs/all_resolved.csv" )
208198 . arg ( "--registry" )
209199 . arg ( "tests/fixtures/registries/cusip-isin" )
@@ -221,8 +211,7 @@ fn test_map_out_sidecar_in_csv_mode() {
221211 let temp_file = NamedTempFile :: new ( ) . unwrap ( ) ;
222212 let map_out_path = temp_file. path ( ) . to_str ( ) . unwrap ( ) ;
223213
224- Command :: cargo_bin ( "canon" )
225- . unwrap ( )
214+ Command :: new ( env ! ( "CARGO_BIN_EXE_canon" ) )
226215 . arg ( "tests/fixtures/inputs/all_resolved.csv" )
227216 . arg ( "--registry" )
228217 . arg ( "tests/fixtures/registries/cusip-isin" )
@@ -242,4 +231,4 @@ fn test_map_out_sidecar_in_csv_mode() {
242231
243232 assert_eq ! ( json[ "version" ] , "canon.v0" ) ;
244233 assert_eq ! ( json[ "outcome" ] , "RESOLVED" ) ;
245- }
234+ }
0 commit comments