cuelang.org/go@v0.10.1/cue/testdata/export/022.txtar (about)

     1  # DO NOT EDIT; generated by go run testdata/gen.go
     2  #
     3  raw: true
     4  eval: true
     5  noOpt: true
     6  -- in.cue --
     7  {
     8  	job: [Name=_]: {
     9  		name:     Name
    10  		replicas: uint | *1 @protobuf(10)
    11  		command:  string
    12  	}
    13  
    14  	job: list: command: "ls"
    15  
    16  	job: nginx: {
    17  		command:  "nginx"
    18  		replicas: 2
    19  	}
    20  }
    21  -- out/def --
    22  job: {
    23  	{[Name=string]: {
    24  		name: Name, replicas: >=0 | *1 @protobuf(10), command: string
    25  	}}
    26  	list: {
    27  		name:     "list"
    28  		replicas: >=0 | *1 @protobuf(10)
    29  		command:  "ls"
    30  	}
    31  	nginx: {
    32  		name:     "nginx"
    33  		replicas: 2 @protobuf(10)
    34  		command:  "nginx"
    35  	}
    36  }
    37  -- out/export --
    38  job: {
    39  	list: {
    40  		name:     "list"
    41  		replicas: 1 @protobuf(10)
    42  		command:  "ls"
    43  	}
    44  	nginx: {
    45  		name:     "nginx"
    46  		replicas: 2 @protobuf(10)
    47  		command:  "nginx"
    48  	}
    49  }
    50  -- out/yaml --
    51  job:
    52    list:
    53      name: list
    54      replicas: 1
    55      command: ls
    56    nginx:
    57      name: nginx
    58      replicas: 2
    59      command: nginx
    60  -- out/json --
    61  {"job":{"list":{"name":"list","replicas":1,"command":"ls"},"nginx":{"name":"nginx","replicas":2,"command":"nginx"}}}
    62  -- out/compile --
    63  --- in.cue
    64  {
    65    {
    66      job: {
    67        [_]: {
    68          name: 〈1;-〉
    69          replicas: (&(int, >=0)|*1)
    70          command: string
    71        }
    72      }
    73      job: {
    74        list: {
    75          command: "ls"
    76        }
    77      }
    78      job: {
    79        nginx: {
    80          command: "nginx"
    81          replicas: 2
    82        }
    83      }
    84    }
    85  }
    86  -- out/eval/stats --
    87  Leaks:  0
    88  Freed:  14
    89  Reused: 8
    90  Allocs: 6
    91  Retain: 0
    92  
    93  Unifications: 10
    94  Conjuncts:    22
    95  Disjuncts:    14
    96  -- out/eval --
    97  (struct){
    98    job: (struct){
    99      list: (struct){
   100        command: (string){ "ls" }
   101        name: (string){ "list" }
   102        replicas: (int){ |(*(int){ 1 }, (int){ &(>=0, int) }) }
   103      }
   104      nginx: (struct){
   105        command: (string){ "nginx" }
   106        replicas: (int){ 2 }
   107        name: (string){ "nginx" }
   108      }
   109    }
   110  }