From 1079132177aa97980610d76afe10c292fb6300b6 Mon Sep 17 00:00:00 2001 From: Kayou Date: Tue, 25 Jun 2024 16:57:40 +0200 Subject: [PATCH 1/3] more test on config read --- tests/test_helpers.d/ynhtest_config.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/test_helpers.d/ynhtest_config.sh b/tests/test_helpers.d/ynhtest_config.sh index b64943a48..961fef12f 100644 --- a/tests/test_helpers.d/ynhtest_config.sh +++ b/tests/test_helpers.d/ynhtest_config.sh @@ -27,6 +27,8 @@ ENABLED = False # TITLE = "Old title" TITLE = "Lorem Ipsum" THEME = "colib'ris" +NOT_AN_EMAIL = "thisisnothemailyouarelookingfor" +EMAIL_IS_NOT = "notthemailyouarelookingforthisis" EMAIL = "root@example.com" # This is a comment without quotes PORT = 1234 # This is a comment without quotes URL = 'https://yunohost.org' @@ -83,6 +85,8 @@ ENABLED = False # TITLE = "Old title" TITLE = "Lorem Ipsum" THEME = "colib'ris" +NOT_AN_EMAIL = "thisisnothemailyouarelookingfor" +EMAIL_IS_NOT = "notthemailyouarelookingforthisis" EMAIL = "root@example.com" # This is a comment without quotes PORT = 1234 # This is a comment without quotes URL = 'https://yunohost.org' @@ -165,6 +169,8 @@ enabled = False # title = Old title title = Lorem Ipsum theme = colib'ris +not_an_email = thisisnothemailyouarelookingfor +email_is_not = notthemailyouarelookingforthisis email = root@example.com ; This is a comment without quotes port = 1234 ; This is a comment without quotes url = https://yunohost.org @@ -216,6 +222,8 @@ enabled = False # title = Old title title = Lorem Ipsum theme = colib'ris +not_an_email = thisisnothemailyouarelookingfor +email_is_not = notthemailyouarelookingforthisis email = root@example.com # This is a comment without quotes port = 1234 # This is a comment without quotes url = https://yunohost.org @@ -293,6 +301,8 @@ enabled: false # title: old title title: Lorem Ipsum theme: colib'ris +not_an_email: thisisnothemailyouarelookingfor +email_is_not: notthemailyouarelookingforthisis email: root@example.com # This is a comment without quotes port: 1234 # This is a comment without quotes url: https://yunohost.org @@ -342,6 +352,8 @@ enabled: false # title: old title title: Lorem Ipsum theme: colib'ris +not_an_email: thisisnothemailyouarelookingfor +email_is_not: notthemailyouarelookingforthisis email: root@example.com # This is a comment without quotes port: 1234 # This is a comment without quotes url: https://yunohost.org @@ -417,6 +429,8 @@ ynhtest_config_read_json() { "enabled": false, "title": "Lorem Ipsum", "theme": "colib'ris", + "not_an_email": "thisisnothemailyouarelookingfor", + "email_is_not": "notthemailyouarelookingforthisis", "email": "root@example.com", "port": 1234, "url": "https://yunohost.org", @@ -468,6 +482,8 @@ ynhtest_config_write_json() { "enabled": false, "title": "Lorem Ipsum", "theme": "colib'ris", + "not_an_email": "thisisnothemailyouarelookingfor", + "email_is_not": "notthemailyouarelookingforthisis", "email": "root@example.com", "port": 1234, "url": "https://yunohost.org", @@ -551,6 +567,8 @@ ynhtest_config_read_php() { // \$title = "old title"; \$title = "Lorem Ipsum"; \$theme = "colib'ris"; + \$not_an_email = "thisisnothemailyouarelookingfor"; + \$email_is_not = "notthemailyouarelookingforthisis"; \$email = "root@example.com"; // This is a comment without quotes \$port = 1234; // This is a second comment without quotes \$url = "https://yunohost.org"; @@ -610,6 +628,8 @@ ynhtest_config_write_php() { // \$title = "old title"; \$title = "Lorem Ipsum"; \$theme = "colib'ris"; + \$not_an_email = "thisisnothemailyouarelookingfor"; + \$email_is_not = "notthemailyouarelookingforthisis"; \$email = "root@example.com"; // This is a comment without quotes \$port = 1234; // This is a comment without quotes \$url = "https://yunohost.org"; From 070b0f1ef44382654cd26a8f412a7856d07d8e3f Mon Sep 17 00:00:00 2001 From: Kayou Date: Tue, 25 Jun 2024 17:16:48 +0200 Subject: [PATCH 2/3] more tests with dot --- tests/test_helpers.d/ynhtest_config.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test_helpers.d/ynhtest_config.sh b/tests/test_helpers.d/ynhtest_config.sh index 961fef12f..635c4dd50 100644 --- a/tests/test_helpers.d/ynhtest_config.sh +++ b/tests/test_helpers.d/ynhtest_config.sh @@ -29,6 +29,7 @@ TITLE = "Lorem Ipsum" THEME = "colib'ris" NOT_AN_EMAIL = "thisisnothemailyouarelookingfor" EMAIL_IS_NOT = "notthemailyouarelookingforthisis" +NOT_AN.EMAIL = "thisisnothemailyouarelookingfor" EMAIL = "root@example.com" # This is a comment without quotes PORT = 1234 # This is a comment without quotes URL = 'https://yunohost.org' @@ -87,6 +88,7 @@ TITLE = "Lorem Ipsum" THEME = "colib'ris" NOT_AN_EMAIL = "thisisnothemailyouarelookingfor" EMAIL_IS_NOT = "notthemailyouarelookingforthisis" +NOT_AN.EMAIL = "thisisnothemailyouarelookingfor" EMAIL = "root@example.com" # This is a comment without quotes PORT = 1234 # This is a comment without quotes URL = 'https://yunohost.org' @@ -171,6 +173,7 @@ title = Lorem Ipsum theme = colib'ris not_an_email = thisisnothemailyouarelookingfor email_is_not = notthemailyouarelookingforthisis +not_an.email = thisisnothemailyouarelookingfor email = root@example.com ; This is a comment without quotes port = 1234 ; This is a comment without quotes url = https://yunohost.org @@ -224,6 +227,7 @@ title = Lorem Ipsum theme = colib'ris not_an_email = thisisnothemailyouarelookingfor email_is_not = notthemailyouarelookingforthisis +not_an.email = thisisnothemailyouarelookingfor email = root@example.com # This is a comment without quotes port = 1234 # This is a comment without quotes url = https://yunohost.org @@ -303,6 +307,7 @@ title: Lorem Ipsum theme: colib'ris not_an_email: thisisnothemailyouarelookingfor email_is_not: notthemailyouarelookingforthisis +not_an.email: thisisnothemailyouarelookingfor email: root@example.com # This is a comment without quotes port: 1234 # This is a comment without quotes url: https://yunohost.org @@ -354,6 +359,7 @@ title: Lorem Ipsum theme: colib'ris not_an_email: thisisnothemailyouarelookingfor email_is_not: notthemailyouarelookingforthisis +not_an.email: thisisnothemailyouarelookingfor email: root@example.com # This is a comment without quotes port: 1234 # This is a comment without quotes url: https://yunohost.org @@ -431,6 +437,7 @@ ynhtest_config_read_json() { "theme": "colib'ris", "not_an_email": "thisisnothemailyouarelookingfor", "email_is_not": "notthemailyouarelookingforthisis", + "not_an.email": "thisisnothemailyouarelookingfor", "email": "root@example.com", "port": 1234, "url": "https://yunohost.org", @@ -484,6 +491,7 @@ ynhtest_config_write_json() { "theme": "colib'ris", "not_an_email": "thisisnothemailyouarelookingfor", "email_is_not": "notthemailyouarelookingforthisis", + "not_an.email": "thisisnothemailyouarelookingfor", "email": "root@example.com", "port": 1234, "url": "https://yunohost.org", @@ -569,6 +577,7 @@ ynhtest_config_read_php() { \$theme = "colib'ris"; \$not_an_email = "thisisnothemailyouarelookingfor"; \$email_is_not = "notthemailyouarelookingforthisis"; + \$not_an.email = "thisisnothemailyouarelookingfor"; \$email = "root@example.com"; // This is a comment without quotes \$port = 1234; // This is a second comment without quotes \$url = "https://yunohost.org"; @@ -630,6 +639,7 @@ ynhtest_config_write_php() { \$theme = "colib'ris"; \$not_an_email = "thisisnothemailyouarelookingfor"; \$email_is_not = "notthemailyouarelookingforthisis"; + \$not_an.email = "thisisnothemailyouarelookingfor"; \$email = "root@example.com"; // This is a comment without quotes \$port = 1234; // This is a comment without quotes \$url = "https://yunohost.org"; From c8a483ab83abf5b8a4047e59869377260b4bfcfa Mon Sep 17 00:00:00 2001 From: Kayou Date: Fri, 28 Jun 2024 09:36:26 +0200 Subject: [PATCH 3/3] dot aren't valid in key name for both python and php --- tests/test_helpers.d/ynhtest_config.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/test_helpers.d/ynhtest_config.sh b/tests/test_helpers.d/ynhtest_config.sh index 635c4dd50..5535bd5d0 100644 --- a/tests/test_helpers.d/ynhtest_config.sh +++ b/tests/test_helpers.d/ynhtest_config.sh @@ -29,7 +29,6 @@ TITLE = "Lorem Ipsum" THEME = "colib'ris" NOT_AN_EMAIL = "thisisnothemailyouarelookingfor" EMAIL_IS_NOT = "notthemailyouarelookingforthisis" -NOT_AN.EMAIL = "thisisnothemailyouarelookingfor" EMAIL = "root@example.com" # This is a comment without quotes PORT = 1234 # This is a comment without quotes URL = 'https://yunohost.org' @@ -88,7 +87,6 @@ TITLE = "Lorem Ipsum" THEME = "colib'ris" NOT_AN_EMAIL = "thisisnothemailyouarelookingfor" EMAIL_IS_NOT = "notthemailyouarelookingforthisis" -NOT_AN.EMAIL = "thisisnothemailyouarelookingfor" EMAIL = "root@example.com" # This is a comment without quotes PORT = 1234 # This is a comment without quotes URL = 'https://yunohost.org' @@ -577,7 +575,6 @@ ynhtest_config_read_php() { \$theme = "colib'ris"; \$not_an_email = "thisisnothemailyouarelookingfor"; \$email_is_not = "notthemailyouarelookingforthisis"; - \$not_an.email = "thisisnothemailyouarelookingfor"; \$email = "root@example.com"; // This is a comment without quotes \$port = 1234; // This is a second comment without quotes \$url = "https://yunohost.org"; @@ -639,7 +636,6 @@ ynhtest_config_write_php() { \$theme = "colib'ris"; \$not_an_email = "thisisnothemailyouarelookingfor"; \$email_is_not = "notthemailyouarelookingforthisis"; - \$not_an.email = "thisisnothemailyouarelookingfor"; \$email = "root@example.com"; // This is a comment without quotes \$port = 1234; // This is a comment without quotes \$url = "https://yunohost.org";