Add ability to get playback-time
This commit is contained in:
@@ -2,6 +2,7 @@ import gleam/list
|
||||
import gleeunit
|
||||
|
||||
import mpv/control.{type Control}
|
||||
import mpv/internal/control as control_internal
|
||||
import mpv/key.{type Key, Char}
|
||||
|
||||
pub fn main() -> Nil {
|
||||
@@ -22,3 +23,11 @@ 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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user