cuelang.org/go@v0.10.1/pkg/time/testdata/duration.txtar (about)

     1  // Copyright 2022 CUE Authors
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  
    16  -- in.cue --
    17  import "time"
    18  
    19  FormatDuration: [...{
    20  	arg: int
    21  	out: time.FormatDuration(arg)
    22  }]
    23  
    24  FormatDuration: [
    25  	{arg: 10920000000000},
    26  	{arg: 5000000000},
    27  	{arg: 600000000},
    28  ]
    29  -- out/time --
    30  FormatDuration: [{
    31  	arg: 10920000000000
    32  	out: "3h2m0s"
    33  }, {
    34  	arg: 5000000000
    35  	out: "5s"
    36  }, {
    37  	arg: 600000000
    38  	out: "600ms"
    39  }]