@@ -51,127 +51,127 @@ mod tests {
5151
5252 #[ test]
5353 fn test_assign_name ( ) {
54- let source = String :: from ( "x = (1, 2, 3)" ) ;
55- let parse_ast = parse_program ( & source, "<test>" ) . unwrap ( ) ;
54+ let source = "x = (1, 2, 3)" ;
55+ let parse_ast = parse_program ( source, "<test>" ) . unwrap ( ) ;
5656 insta:: assert_debug_snapshot!( parse_ast) ;
5757 }
5858
5959 #[ test]
6060 fn test_assign_tuple ( ) {
61- let source = String :: from ( "(x, y) = (1, 2, 3)" ) ;
62- let parse_ast = parse_program ( & source, "<test>" ) . unwrap ( ) ;
61+ let source = "(x, y) = (1, 2, 3)" ;
62+ let parse_ast = parse_program ( source, "<test>" ) . unwrap ( ) ;
6363 insta:: assert_debug_snapshot!( parse_ast) ;
6464 }
6565
6666 #[ test]
6767 fn test_assign_list ( ) {
68- let source = String :: from ( "[x, y] = (1, 2, 3)" ) ;
69- let parse_ast = parse_program ( & source, "<test>" ) . unwrap ( ) ;
68+ let source = "[x, y] = (1, 2, 3)" ;
69+ let parse_ast = parse_program ( source, "<test>" ) . unwrap ( ) ;
7070 insta:: assert_debug_snapshot!( parse_ast) ;
7171 }
7272
7373 #[ test]
7474 fn test_assign_attribute ( ) {
75- let source = String :: from ( "x.y = (1, 2, 3)" ) ;
76- let parse_ast = parse_program ( & source, "<test>" ) . unwrap ( ) ;
75+ let source = "x.y = (1, 2, 3)" ;
76+ let parse_ast = parse_program ( source, "<test>" ) . unwrap ( ) ;
7777 insta:: assert_debug_snapshot!( parse_ast) ;
7878 }
7979
8080 #[ test]
8181 fn test_assign_subscript ( ) {
82- let source = String :: from ( "x[y] = (1, 2, 3)" ) ;
83- let parse_ast = parse_program ( & source, "<test>" ) . unwrap ( ) ;
82+ let source = "x[y] = (1, 2, 3)" ;
83+ let parse_ast = parse_program ( source, "<test>" ) . unwrap ( ) ;
8484 insta:: assert_debug_snapshot!( parse_ast) ;
8585 }
8686
8787 #[ test]
8888 fn test_assign_starred ( ) {
89- let source = String :: from ( "(x, *y) = (1, 2, 3)" ) ;
90- let parse_ast = parse_program ( & source, "<test>" ) . unwrap ( ) ;
89+ let source = "(x, *y) = (1, 2, 3)" ;
90+ let parse_ast = parse_program ( source, "<test>" ) . unwrap ( ) ;
9191 insta:: assert_debug_snapshot!( parse_ast) ;
9292 }
9393
9494 #[ test]
9595 fn test_assign_for ( ) {
96- let source = String :: from ( "for x in (1, 2, 3): pass" ) ;
97- let parse_ast = parse_program ( & source, "<test>" ) . unwrap ( ) ;
96+ let source = "for x in (1, 2, 3): pass" ;
97+ let parse_ast = parse_program ( source, "<test>" ) . unwrap ( ) ;
9898 insta:: assert_debug_snapshot!( parse_ast) ;
9999 }
100100
101101 #[ test]
102102 fn test_assign_list_comp ( ) {
103- let source = String :: from ( "x = [y for y in (1, 2, 3)]" ) ;
104- let parse_ast = parse_program ( & source, "<test>" ) . unwrap ( ) ;
103+ let source = "x = [y for y in (1, 2, 3)]" ;
104+ let parse_ast = parse_program ( source, "<test>" ) . unwrap ( ) ;
105105 insta:: assert_debug_snapshot!( parse_ast) ;
106106 }
107107
108108 #[ test]
109109 fn test_assign_set_comp ( ) {
110- let source = String :: from ( "x = {y for y in (1, 2, 3)}" ) ;
111- let parse_ast = parse_program ( & source, "<test>" ) . unwrap ( ) ;
110+ let source = "x = {y for y in (1, 2, 3)}" ;
111+ let parse_ast = parse_program ( source, "<test>" ) . unwrap ( ) ;
112112 insta:: assert_debug_snapshot!( parse_ast) ;
113113 }
114114
115115 #[ test]
116116 fn test_assign_with ( ) {
117- let source = String :: from ( "with 1 as x: pass" ) ;
118- let parse_ast = parse_program ( & source, "<test>" ) . unwrap ( ) ;
117+ let source = "with 1 as x: pass" ;
118+ let parse_ast = parse_program ( source, "<test>" ) . unwrap ( ) ;
119119 insta:: assert_debug_snapshot!( parse_ast) ;
120120 }
121121
122122 #[ test]
123123 fn test_assign_named_expr ( ) {
124- let source = String :: from ( "if x:= 1: pass" ) ;
125- let parse_ast = parse_program ( & source, "<test>" ) . unwrap ( ) ;
124+ let source = "if x:= 1: pass" ;
125+ let parse_ast = parse_program ( source, "<test>" ) . unwrap ( ) ;
126126 insta:: assert_debug_snapshot!( parse_ast) ;
127127 }
128128
129129 #[ test]
130130 fn test_ann_assign_name ( ) {
131- let source = String :: from ( "x: int = 1" ) ;
132- let parse_ast = parse_program ( & source, "<test>" ) . unwrap ( ) ;
131+ let source = "x: int = 1" ;
132+ let parse_ast = parse_program ( source, "<test>" ) . unwrap ( ) ;
133133 insta:: assert_debug_snapshot!( parse_ast) ;
134134 }
135135
136136 #[ test]
137137 fn test_aug_assign_name ( ) {
138- let source = String :: from ( "x += 1" ) ;
139- let parse_ast = parse_program ( & source, "<test>" ) . unwrap ( ) ;
138+ let source = "x += 1" ;
139+ let parse_ast = parse_program ( source, "<test>" ) . unwrap ( ) ;
140140 insta:: assert_debug_snapshot!( parse_ast) ;
141141 }
142142
143143 #[ test]
144144 fn test_aug_assign_attribute ( ) {
145- let source = String :: from ( "x.y += (1, 2, 3)" ) ;
146- let parse_ast = parse_program ( & source, "<test>" ) . unwrap ( ) ;
145+ let source = "x.y += (1, 2, 3)" ;
146+ let parse_ast = parse_program ( source, "<test>" ) . unwrap ( ) ;
147147 insta:: assert_debug_snapshot!( parse_ast) ;
148148 }
149149
150150 #[ test]
151151 fn test_aug_assign_subscript ( ) {
152- let source = String :: from ( "x[y] += (1, 2, 3)" ) ;
153- let parse_ast = parse_program ( & source, "<test>" ) . unwrap ( ) ;
152+ let source = "x[y] += (1, 2, 3)" ;
153+ let parse_ast = parse_program ( source, "<test>" ) . unwrap ( ) ;
154154 insta:: assert_debug_snapshot!( parse_ast) ;
155155 }
156156
157157 #[ test]
158158 fn test_del_name ( ) {
159- let source = String :: from ( "del x" ) ;
160- let parse_ast = parse_program ( & source, "<test>" ) . unwrap ( ) ;
159+ let source = "del x" ;
160+ let parse_ast = parse_program ( source, "<test>" ) . unwrap ( ) ;
161161 insta:: assert_debug_snapshot!( parse_ast) ;
162162 }
163163
164164 #[ test]
165165 fn test_del_attribute ( ) {
166- let source = String :: from ( "del x.y" ) ;
167- let parse_ast = parse_program ( & source, "<test>" ) . unwrap ( ) ;
166+ let source = "del x.y" ;
167+ let parse_ast = parse_program ( source, "<test>" ) . unwrap ( ) ;
168168 insta:: assert_debug_snapshot!( parse_ast) ;
169169 }
170170
171171 #[ test]
172172 fn test_del_subscript ( ) {
173- let source = String :: from ( "del x[y]" ) ;
174- let parse_ast = parse_program ( & source, "<test>" ) . unwrap ( ) ;
173+ let source = "del x[y]" ;
174+ let parse_ast = parse_program ( source, "<test>" ) . unwrap ( ) ;
175175 insta:: assert_debug_snapshot!( parse_ast) ;
176176 }
177177}
0 commit comments