File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -35,3 +35,43 @@ HEAD 1 │ test('arg1');
35
35
36
36
root. close ( ) . unwrap ( ) ;
37
37
}
38
+
39
+ #[ test]
40
+ fn js_highlight_panics ( ) {
41
+ let root = snapbox:: path:: PathFixture :: mutable_temp ( ) . unwrap ( ) ;
42
+ let root_path = root. path ( ) . unwrap ( ) ;
43
+ let plan = git_fixture:: TodoList {
44
+ commands : vec ! [
45
+ git_fixture:: Command :: Tree ( git_fixture:: Tree {
46
+ files: [ ( "basic.js" , "test('arg1');" ) ]
47
+ . into_iter( )
48
+ . map( |( p, c) | ( p. into( ) , c. into( ) ) )
49
+ . collect:: <std:: collections:: HashMap <_, _>>( ) ,
50
+ message: Some ( "A" . to_owned( ) ) ,
51
+ author: None ,
52
+ } ) ,
53
+ git_fixture:: Command :: Branch ( "main" . into( ) ) ,
54
+ ] ,
55
+ ..Default :: default ( )
56
+ } ;
57
+ plan. run ( root_path) . unwrap ( ) ;
58
+
59
+ snapbox:: cmd:: Command :: new ( snapbox:: cmd:: cargo_bin!( "git-dive" ) )
60
+ . arg ( "basic.js" )
61
+ . current_dir ( root_path)
62
+ . env ( "CLICOLOR_FORCE" , "1" )
63
+ . assert ( )
64
+ . failure ( )
65
+ . stdout_eq (
66
+ "\
67
+ ",
68
+ )
69
+ . stderr_matches (
70
+ "\
71
+ thread 'main' panicked at 'regex string should be pre-tested: [..]
72
+ note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
73
+ " ,
74
+ ) ;
75
+
76
+ root. close ( ) . unwrap ( ) ;
77
+ }
You can’t perform that action at this time.
0 commit comments