mirror of
https://github.com/vlang/v.git
synced 2025-09-14 15:02:33 +03:00
json: move _test.v
files to vlib/json/tests/
(#22731)
This commit is contained in:
parent
9de84888b3
commit
8ebbacecd6
37 changed files with 1 additions and 1 deletions
|
@ -1,42 +0,0 @@
|
|||
module main
|
||||
|
||||
import json
|
||||
|
||||
pub enum PlatformType {
|
||||
unknown
|
||||
osx
|
||||
ubuntu
|
||||
alpine
|
||||
}
|
||||
|
||||
pub enum CPUType {
|
||||
unknown
|
||||
intel
|
||||
arm
|
||||
intel32
|
||||
arm32
|
||||
}
|
||||
|
||||
@[heap]
|
||||
pub struct Node {
|
||||
pub:
|
||||
name string = 'mymachine'
|
||||
pub mut:
|
||||
platform PlatformType
|
||||
cputype CPUType
|
||||
done map[string]string
|
||||
environment map[string]string
|
||||
}
|
||||
|
||||
pub fn (mut node Node) save() ! {
|
||||
data := json.encode(node)
|
||||
dump(data)
|
||||
}
|
||||
|
||||
fn test_encode_with_mut_struct() {
|
||||
mut n := Node{
|
||||
platform: .osx
|
||||
cputype: .unknown
|
||||
}
|
||||
n.save() or { panic(err) }
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue