Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm committed Sep 13, 2023
1 parent 05802bd commit 83c267e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions vlib/toml/tests/encode_and_decode_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,22 @@ title = 2'
assert y.title == .worker
}

struct Example {
array []Problem
}

struct Problem {
}

pub fn (example Example) to_toml() string {
return '[This is Valid]'
}

fn test_custom_encode_of_complex_struct() {
example := Example{}
assert toml.encode(example) == '[This is Valid]'
}

fn test_array_encode_decode() {
a := Arrs{
strs: ['foo', 'bar']
Expand Down

0 comments on commit 83c267e

Please sign in to comment.