File tree Expand file tree Collapse file tree 3 files changed +40
-0
lines changed
test/live_view_native/swiftui Expand file tree Collapse file tree 3 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.1.0/ ) ,
6
6
and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
7
7
8
+ ## [ unreleased]
9
+
10
+ ## Added
11
+ - ` LiveViewNative.SwiftUI.normalize_os_version/1 `
12
+ - ` LiveViewNative.SwiftUI.normalize_app_version/1 `
13
+
14
+ ## Changed
15
+
16
+ ## Fixed
17
+
8
18
## [ 0.3.0] 2024-08-21
9
19
10
20
### Added
Original file line number Diff line number Diff line change @@ -7,4 +7,19 @@ defmodule LiveViewNative.SwiftUI do
7
7
module_suffix: :SwiftUI ,
8
8
template_engine: LiveViewNative.Engine ,
9
9
stylesheet_rules_parser: LiveViewNative.SwiftUI.RulesParser
10
+
11
+ def normalize_os_version ( os_version ) ,
12
+ do: normalize_version ( os_version )
13
+
14
+ def normalize_app_version ( app_version ) ,
15
+ do: normalize_version ( app_version )
16
+
17
+ defp normalize_version ( version ) do
18
+ version
19
+ |> String . split ( "." )
20
+ |> Enum . map ( fn ( number ) ->
21
+ { number , _rem } = Integer . parse ( number )
22
+ number
23
+ end )
24
+ end
10
25
end
Original file line number Diff line number Diff line change
1
+ defmodule LiveViewNative.SwiftUITest do
2
+ use ExUnit.Case
3
+
4
+ alias LiveViewNative.SwiftUI
5
+
6
+ describe "version normalization" do
7
+ test "normalize_os_version" do
8
+ assert [ 1 , 2 , 3 ] = SwiftUI . normalize_os_version ( "1.2.3" )
9
+ end
10
+
11
+ test "normalize_app_version" do
12
+ assert [ 1 , 2 , 3 ] = SwiftUI . normalize_app_version ( "1.2.3" )
13
+ end
14
+ end
15
+ end
You can’t perform that action at this time.
0 commit comments