I expected the specified db (-d TEST1) was dropped and created, not the TEST2 db.
In essence it seems that the –d parameter is ignored and TEST1 db remains untouched.
What is the correct behavior? Is a pg_restore error? Is a reference documentation error? Or simply I have not interpreted correctly it?
You're misunderstanding the documentation slightly. The '-d' parameter is what database to connect to. The '-c' and '-C' parameters define how pg_restore handles the database(s) defined inside the dump.
Think of it this way, if you have a completely new empty PostgreSQL install, and you have a dump of 'testdb' you want to restore, you can't use '-d testdb' because you can't connect to a db that doesn't exist yet.