rust-pgn-reader-python-binding 1.0.0__tar.gz → 1.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -212,7 +212,7 @@ dependencies = [
212
212
 
213
213
  [[package]]
214
214
  name = "rust_pgn_reader_python_binding"
215
- version = "1.0.0"
215
+ version = "1.1.0"
216
216
  dependencies = [
217
217
  "nom",
218
218
  "pgn-reader",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "rust_pgn_reader_python_binding"
3
- version = "1.0.0"
3
+ version = "1.1.0"
4
4
  edition = "2021"
5
5
 
6
6
  # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rust_pgn_reader_python_binding
3
- Version: 1.0.0
3
+ Version: 1.1.0
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -12,7 +12,7 @@ use nom::{
12
12
  pub enum CommentContent {
13
13
  Text(String),
14
14
  Eval(f64),
15
- ClkTime((u32, u32, u32)),
15
+ ClkTime((u32, u8, f64)),
16
16
  }
17
17
 
18
18
  pub fn parse_comments(input: &str) -> IResult<&str, Vec<CommentContent>> {
@@ -133,7 +133,7 @@ mod tests {
133
133
  vec![
134
134
  CommentContent::Eval(123.0),
135
135
  CommentContent::Text(" some text ".to_string()),
136
- CommentContent::ClkTime((12, 34, 56))
136
+ CommentContent::ClkTime((12, 34, 56.0))
137
137
  ]
138
138
  );
139
139
  assert_eq!(remaining, "");
@@ -148,13 +148,23 @@ mod tests {
148
148
  assert_eq!(
149
149
  parsed,
150
150
  vec![
151
- CommentContent::ClkTime((12, 34, 56)),
151
+ CommentContent::ClkTime((12, 34, 56.0)),
152
152
  CommentContent::Text(" some text ".to_string())
153
153
  ]
154
154
  );
155
155
  assert_eq!(remaining, "");
156
156
  }
157
157
 
158
+ #[test]
159
+ fn test_comment_fractional_sec() {
160
+ let input = "[%clk 12:34:56.0123]";
161
+ let result = parse_comments(input);
162
+ assert!(result.is_ok());
163
+ let (remaining, parsed) = result.unwrap();
164
+ assert_eq!(parsed, vec![CommentContent::ClkTime((12, 34, 56.0123)),]);
165
+ assert_eq!(remaining, "");
166
+ }
167
+
158
168
  #[test]
159
169
  fn test_tag_parser() {
160
170
  let input = "[%eval 123]";
@@ -24,7 +24,7 @@ struct MoveExtractor {
24
24
  evals: Vec<f64>,
25
25
 
26
26
  #[pyo3(get)]
27
- clock_times: Vec<(u32, u32, u32)>,
27
+ clock_times: Vec<(u32, u8, f64)>,
28
28
 
29
29
  pos: Chess,
30
30
  }