github.com/joomcode/cue@v0.4.4-0.20221111115225-539fe3512047/tools/trim/testdata/constraintroots.txtar (about)

     1  # TODO(fmt): tabs incorrectly converted to spaces within comments: cuelang.org/issue/1040
     2  
     3  // Issue #716
     4  -- in.cue --
     5  keepPatternConstraintRoot: {
     6  	if true {
     7  		deployment: "name": {spec: []}
     8  	}
     9  
    10  	deployment: name: spec: []
    11  
    12  	deployment: [string]: spec: []
    13  }
    14  
    15  // TODO(additional): add once implemented
    16  // keepAdditionalRoots: {
    17  //  if true {
    18  //   deployment: "name": {spec: [1]}
    19  //  }
    20  //
    21  // deployment: name: spec: [1]
    22  //
    23  // deployment: [string]: spec: [1]
    24  // }
    25  
    26  keepPatternConstraintRootSolo: {
    27  	if true {
    28  		deployment: "name": {spec: [1]}
    29  	}
    30  
    31  	deployment: [string]: spec: [1]
    32  }
    33  
    34  keepPatternConstraintRootIndirect: {
    35  	if true {
    36  		deployment: "name": {spec: []}
    37  	}
    38  
    39  	deployment: name: spec: []
    40  
    41  	deployment: indirect
    42  
    43  	indirect: {{[string]: spec: []}}
    44  }
    45  
    46  keepPatternConstraintRootDef: {
    47  	if true {
    48  		deployment: "name": {spec: []}
    49  	}
    50  
    51  	#Deployment: spec: []
    52  
    53  	deployment: name: #Deployment
    54  
    55  	deployment: [string]: spec: []
    56  }
    57  -- out/trim --
    58  == in.cue
    59  keepPatternConstraintRoot: {
    60  	if true {
    61  		deployment: "name": {spec: []}
    62  	}
    63  
    64  	deployment: [string]: spec: []
    65  }
    66  
    67  // TODO(additional): add once implemented
    68  // keepAdditionalRoots: {
    69  //  if true {
    70  //   deployment: "name": {spec: [1]}
    71  //  }
    72  //
    73  // deployment: name: spec: [1]
    74  //
    75  // deployment: [string]: spec: [1]
    76  // }
    77  
    78  keepPatternConstraintRootSolo: {
    79  	if true {
    80  		deployment: "name": {spec: [1]}
    81  	}
    82  
    83  	deployment: [string]: spec: [1]
    84  }
    85  
    86  keepPatternConstraintRootIndirect: {
    87  	if true {
    88  		deployment: "name": {spec: []}
    89  	}
    90  
    91  	deployment: indirect
    92  
    93  	indirect: {{[string]: spec: []}}
    94  }
    95  
    96  keepPatternConstraintRootDef: {
    97  	if true {
    98  		deployment: "name": {spec: []}
    99  	}
   100  
   101  	#Deployment: spec: []
   102  
   103  	deployment: [string]: spec: []
   104  }