fix: configuration Firebase acceptée avec guillemets typographiques ou google-services.json
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R9CBCVP5oDu2sfoYPisNCQ
This commit is contained in:
1 parent
1d707f8785
commit
11d7ed1fa6
2 files changed
+31
-4
No files matched your search
@@ -35,6 +35,25 @@ class FirebaseConfigTest {
|
||||
assertEquals(expected, FirebaseConfig.parse(" fc1:${b64.chunked(20).joinToString("\n")} "))
|
||||
}
|
||||
|
||||
@Test fun `guillemets typographiques`() {
|
||||
val js = "apiKey: “AIzaTest”, projectId: «mon-projet», appId: ‘1:123:android:abc’"
|
||||
assertEquals(expected, FirebaseConfig.parse(js))
|
||||
}
|
||||
|
||||
@Test fun `fichier google-services json`() {
|
||||
val gs = """
|
||||
{
|
||||
"project_info": { "project_number": "123", "project_id": "mon-projet", "storage_bucket": "mon-projet.appspot.com" },
|
||||
"client": [ {
|
||||
"client_info": { "mobilesdk_app_id": "1:123:android:abc",
|
||||
"android_client_info": { "package_name": "com.jttools.datacontrol" } },
|
||||
"api_key": [ { "current_key": "AIzaTest" } ]
|
||||
} ]
|
||||
}
|
||||
""".trimIndent()
|
||||
assertEquals(expected, FirebaseConfig.parse(gs))
|
||||
}
|
||||
|
||||
@Test fun `champ manquant ou illisible`() {
|
||||
assertNull(FirebaseConfig.parse("""{"apiKey":"AIzaTest","projectId":"mon-projet"}"""))
|
||||
assertNull(FirebaseConfig.parse("fc1:!!!"))
|
||||
|
||||
Reference in new issue
Block a user