From a8e3d77ba4460132238c5092a22476093903afbf Mon Sep 17 00:00:00 2001
From: Georgy Moshkin <gmoshkin@picodata.io>
Date: Thu, 29 Feb 2024 12:44:50 +0300
Subject: [PATCH] test: add a test to illustrate a bug we have

---
 src/config.rs | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/config.rs b/src/config.rs
index 7207fcace8..aa52ed68ea 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -903,6 +903,19 @@ instance:
         assert_eq!(listen.port, "3301");
     }
 
+    #[test]
+    fn default_http_port() {
+        let yaml = r###"
+instance:
+    http_listen: localhost
+"###;
+        let config = PicodataConfig::read_yaml_contents(&yaml.trim_start()).unwrap();
+        let listen = config.instance.http_listen.unwrap();
+        assert_eq!(listen.host, "localhost");
+        assert_eq!(listen.port, "3301"); // FIXME: This is wrong! The default
+                                         // http port should be something different
+    }
+
     #[rustfmt::skip]
     #[test]
     fn parameter_source_precedence() {
-- 
GitLab