@@ -8,20 +8,23 @@ defmodule Unifex.LoggerIntegrationTest do
88 unless Process . whereis ( Unifex.Logger ) do
99 { :ok , _pid } = Unifex.Logger . start_link ( [ ] )
1010 end
11+
1112 :ok
1213 end
1314
1415 describe "Unifex.Logger integration with native code" do
15-
1616 @ tag :integration
1717 test "logger process handles messages from native code" do
1818 # This test would require a native function that calls unifex_log()
1919 # For now, we'll test that the logger process can handle direct messages
2020 pid = Process . whereis ( Unifex.Logger )
21-
21+
2222 # Send a message directly to the logger
23- send ( pid , { :unifex_logger , :info , "Test message" , 1700000000000000 , [ "test" , "direct" ] } )
24-
23+ send (
24+ pid ,
25+ { :unifex_logger , :info , "Test message" , 1_700_000_000_000_000 , [ "test" , "direct" ] }
26+ )
27+
2528 # The logger should process it without crashing
2629 assert Process . alive? ( pid )
2730 end
@@ -30,7 +33,7 @@ defmodule Unifex.LoggerIntegrationTest do
3033 test "logger normalizes all valid Elixir log levels" do
3134 for level <- @ valid_levels do
3235 pid = Process . whereis ( Unifex.Logger )
33- send ( pid , { :unifex_logger , level , "Test message" , 1700000000000000 , [ "test" ] } )
36+ send ( pid , { :unifex_logger , level , "Test message" , 1_700_000_000_000_000 , [ "test" ] } )
3437 assert Process . alive? ( pid )
3538 end
3639 end
@@ -39,36 +42,41 @@ defmodule Unifex.LoggerIntegrationTest do
3942 test "logger handles string level from C code" do
4043 # The C code uses string levels like "debug", "info", "warning", "error"
4144 pid = Process . whereis ( Unifex.Logger )
42-
45+
4346 # Test each of the UNIFEX_LOG_LEVEL_ constants
4447 for level <- [ "debug" , "info" , "warning" , "error" ] do
45- send ( pid , { :unifex_logger , level , "Test message" , 1700000000000000 , [ "test" ] } )
48+ send ( pid , { :unifex_logger , level , "Test message" , 1_700_000_000_000_000 , [ "test" ] } )
4649 assert Process . alive? ( pid )
4750 end
4851 end
4952
5053 @ tag :integration
5154 test "logger handles unknown levels gracefully" do
5255 pid = Process . whereis ( Unifex.Logger )
53-
56+
5457 # Send a message with an unknown level
55- send ( pid , { :unifex_logger , :unknown_level , "Test message" , 1700000000000000 , [ "test" ] } )
56-
58+ send ( pid , { :unifex_logger , :unknown_level , "Test message" , 1_700_000_000_000_000 , [ "test" ] } )
59+
5760 # Should still be alive and should have logged a warning about unknown level
5861 assert Process . alive? ( pid )
5962 end
6063
6164 @ tag :integration
6265 test "logger handles messages with empty tags" do
6366 pid = Process . whereis ( Unifex.Logger )
64- send ( pid , { :unifex_logger , :info , "Test message" , 1700000000000000 , [ ] } )
67+ send ( pid , { :unifex_logger , :info , "Test message" , 1_700_000_000_000_000 , [ ] } )
6568 assert Process . alive? ( pid )
6669 end
6770
6871 @ tag :integration
6972 test "logger handles messages with nil tags" do
7073 pid = Process . whereis ( Unifex.Logger )
71- send ( pid , { :unifex_logger , :info , "Test message" , 1700000000000000 , [ nil , "valid" , nil ] } )
74+
75+ send (
76+ pid ,
77+ { :unifex_logger , :info , "Test message" , 1_700_000_000_000_000 , [ nil , "valid" , nil ] }
78+ )
79+
7280 assert Process . alive? ( pid )
7381 end
7482 end
@@ -83,4 +91,4 @@ defmodule Unifex.LoggerIntegrationTest do
8391 assert Process . alive? ( pid )
8492 end
8593 end
86- end
94+ end
0 commit comments