json: move _test.v files to vlib/json/tests/ (#22731)

This commit is contained in:
Hitalo Souza 2024-11-12 14:33:01 -04:00 committed by GitHub
parent 9de84888b3
commit 8ebbacecd6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
37 changed files with 1 additions and 1 deletions

View file

@ -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) }
}