Add musicplayer module that wraps all logic
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
import gleam/list
|
||||
import gleeunit
|
||||
|
||||
import musicplayer/control.{type Control}
|
||||
import musicplayer/input/key.{type Key, Char}
|
||||
import musicplayer/mpv/control.{type Control}
|
||||
import musicplayer/mpv/internal as control_internal
|
||||
|
||||
pub fn main() -> Nil {
|
||||
gleeunit.main()
|
||||
@@ -23,11 +22,3 @@ pub fn control_from_key_test() {
|
||||
assert tc.expected == control.from_key(tc.key)
|
||||
})
|
||||
}
|
||||
|
||||
pub fn parse_playback_time_test() {
|
||||
let json_string =
|
||||
"{\"data\":\"123.456789\",\"request_id\":0,\"error\":\"success\"}\n"
|
||||
|
||||
let assert Ok(data) = control_internal.parse_playback_time(json_string)
|
||||
assert data == 123.456789
|
||||
}
|
||||
15
test/musicplayer/mpv/mpv_test.gleam
Normal file
15
test/musicplayer/mpv/mpv_test.gleam
Normal file
@@ -0,0 +1,15 @@
|
||||
import gleeunit
|
||||
|
||||
import musicplayer/mpv/internal as control_internal
|
||||
|
||||
pub fn main() -> Nil {
|
||||
gleeunit.main()
|
||||
}
|
||||
|
||||
pub fn parse_playback_time_test() {
|
||||
let json_string =
|
||||
"{\"data\":\"123.456789\",\"request_id\":0,\"error\":\"success\"}\n"
|
||||
|
||||
let assert Ok(data) = control_internal.parse_playback_time(json_string)
|
||||
assert data == 123.456789
|
||||
}
|
||||
Reference in New Issue
Block a user