@@ -167,12 +167,33 @@ mod tests {
167167
168168 #[ test]
169169 fn rename_magic_method ( ) {
170- for magic in MAGIC_METHOD {
170+ for & ( magic, expected) in & [
171+ ( "__construct" , "__construct" ) ,
172+ ( "__destruct" , "__destruct" ) ,
173+ ( "__call" , "__call" ) ,
174+ ( "__call_static" , "__callStatic" ) ,
175+ ( "__get" , "__get" ) ,
176+ ( "__set" , "__set" ) ,
177+ ( "__isset" , "__isset" ) ,
178+ ( "__unset" , "__unset" ) ,
179+ ( "__sleep" , "__sleep" ) ,
180+ ( "__wakeup" , "__wakeup" ) ,
181+ ( "__serialize" , "__serialize" ) ,
182+ ( "__unserialize" , "__unserialize" ) ,
183+ ( "__to_string" , "__toString" ) ,
184+ ( "__invoke" , "__invoke" ) ,
185+ ( "__set_state" , "__set_state" ) ,
186+ ( "__clone" , "__clone" ) ,
187+ ( "__debug_info" , "__debugInfo" ) ,
188+ ] {
171189 assert_eq ! ( magic, magic. rename_method( & RenameRule :: None ) ) ;
172- assert_eq ! ( magic, magic. rename_method( & RenameRule :: Camel ) ) ;
173- assert_eq ! ( magic, magic. rename_method( & RenameRule :: Pascal ) ) ;
174- assert_eq ! ( magic, magic. rename_method( & RenameRule :: Snake ) ) ;
175- assert_eq ! ( magic, magic. rename_method( & RenameRule :: ScreamingSnakeCase ) ) ;
190+ assert_eq ! ( expected, magic. rename_method( & RenameRule :: Camel ) ) ;
191+ assert_eq ! ( expected, magic. rename_method( & RenameRule :: Pascal ) ) ;
192+ assert_eq ! ( expected, magic. rename_method( & RenameRule :: Snake ) ) ;
193+ assert_eq ! (
194+ expected,
195+ magic. rename_method( & RenameRule :: ScreamingSnakeCase )
196+ ) ;
176197 }
177198 }
178199
0 commit comments