@@ -960,7 +960,7 @@ mod tests {
960
960
mod diff {
961
961
/*
962
962
Probably this hole section should be refactored when complete sdiff
963
- arrives. I would say that these tests are more to document the
963
+ arrives. I would say that these tests are more to document the
964
964
behavior of the engine than to actually test whether it is right,
965
965
because it is right, but right up to its limitations.
966
966
*/
@@ -1117,7 +1117,7 @@ mod tests {
1117
1117
fn test_interleaved_add_remove ( ) {
1118
1118
let params = generate_params ( ) ;
1119
1119
let from_file = b"A\n B\n C\n D" ;
1120
- let to_file = b"B\n X\n D\n Y" ;
1120
+ let to_file = b"B\n X\n D\n Y" ;
1121
1121
let mut output = vec ! [ ] ;
1122
1122
diff ( from_file, to_file, & mut output, & params) ;
1123
1123
@@ -1165,7 +1165,7 @@ mod tests {
1165
1165
let to_file = b"Same\n New1\n SameMid\n New2\n New3\n SameEnd" ;
1166
1166
let mut output = vec ! [ ] ;
1167
1167
diff ( from_file, to_file, & mut output, & params) ;
1168
-
1168
+
1169
1169
assert_eq ! ( calc_lines( & output) , 8 ) ;
1170
1170
assert_eq ! ( contains_string( & output, "<" ) , 2 ) ;
1171
1171
assert_eq ! ( contains_string( & output, ">" ) , 3 ) ;
@@ -1199,62 +1199,62 @@ mod tests {
1199
1199
assert_eq ! ( contains_string( & output, ">" ) , 3 ) ;
1200
1200
}
1201
1201
}
1202
-
1202
+
1203
1203
mod config {
1204
1204
use super :: * ;
1205
-
1205
+
1206
1206
fn create_config ( full_width : usize , tab_size : usize , expanded : bool ) -> Config {
1207
1207
Config :: new ( full_width, tab_size, expanded)
1208
1208
}
1209
-
1209
+
1210
1210
#[ test]
1211
1211
fn test_full_width_80_tab_4 ( ) {
1212
1212
let config = create_config ( 80 , 4 , false ) ;
1213
1213
assert_eq ! ( config. sdiff_half_width, 37 ) ;
1214
1214
assert_eq ! ( config. sdiff_column_two_offset, 40 ) ;
1215
1215
assert_eq ! ( config. separator_pos, 38 ) ;
1216
1216
}
1217
-
1217
+
1218
1218
#[ test]
1219
1219
fn test_full_width_40_tab_8 ( ) {
1220
1220
let config = create_config ( 40 , 8 , true ) ;
1221
1221
assert_eq ! ( config. sdiff_half_width, 16 ) ;
1222
1222
assert_eq ! ( config. sdiff_column_two_offset, 24 ) ;
1223
1223
assert_eq ! ( config. separator_pos, 19 ) ; // (16 +24 -1) /2 = 19.5 truncado para 19
1224
1224
}
1225
-
1225
+
1226
1226
#[ test]
1227
1227
fn test_full_width_30_tab_2 ( ) {
1228
1228
let config = create_config ( 30 , 2 , false ) ;
1229
1229
assert_eq ! ( config. sdiff_half_width, 13 ) ;
1230
1230
assert_eq ! ( config. sdiff_column_two_offset, 16 ) ;
1231
1231
assert_eq ! ( config. separator_pos, 14 ) ;
1232
1232
}
1233
-
1233
+
1234
1234
#[ test]
1235
1235
fn test_small_width_10_tab_4 ( ) {
1236
1236
let config = create_config ( 10 , 4 , false ) ;
1237
1237
assert_eq ! ( config. sdiff_half_width, 2 ) ;
1238
1238
assert_eq ! ( config. sdiff_column_two_offset, 8 ) ;
1239
1239
assert_eq ! ( config. separator_pos, 4 ) ;
1240
1240
}
1241
-
1241
+
1242
1242
#[ test]
1243
1243
fn test_minimal_width_3_tab_4 ( ) {
1244
1244
let config = create_config ( 3 , 4 , false ) ;
1245
1245
assert_eq ! ( config. sdiff_half_width, 0 ) ;
1246
1246
assert_eq ! ( config. sdiff_column_two_offset, 3 ) ;
1247
1247
assert_eq ! ( config. separator_pos, 1 ) ;
1248
1248
}
1249
-
1249
+
1250
1250
#[ test]
1251
1251
fn test_odd_width_7_tab_3 ( ) {
1252
1252
let config = create_config ( 7 , 3 , false ) ;
1253
1253
assert_eq ! ( config. sdiff_half_width, 1 ) ;
1254
1254
assert_eq ! ( config. sdiff_column_two_offset, 6 ) ;
1255
1255
assert_eq ! ( config. separator_pos, 3 ) ;
1256
1256
}
1257
-
1257
+
1258
1258
#[ test]
1259
1259
fn test_tab_size_larger_than_width ( ) {
1260
1260
let config = create_config ( 5 , 10 , false ) ;
0 commit comments