mirror of
https://github.com/hanzoai/telemetry.git
synced 2026-10-30 20:01:49 +00:00
This PR contains the following updates: | Package | Change | Age | Confidence | |---|---|---|---| | golang.org/x/mod | `v0.28.0` -> `v0.30.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | golang.org/x/sys | `v0.37.0` -> `v0.38.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | golang.org/x/tools | `v0.38.0` -> `v0.39.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Configuration 📅 **Schedule**: Branch creation - "on tuesday" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/open-telemetry/opentelemetry-collector). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi4xOS45IiwidXBkYXRlZEluVmVyIjoiNDIuMTkuOSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIiwicmVub3ZhdGVib3QiXX0=--> --------- Signed-off-by: alex boten <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Pablo Baeyens <[email protected]> Co-authored-by: Alex Boten <[email protected]> Co-authored-by: Pablo Baeyens <[email protected]>
28 lines
776 B
Go
28 lines
776 B
Go
// Copyright The OpenTelemetry Authors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package pcommon
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestUnixNanosConverters(t *testing.T) {
|
|
t1 := time.Date(2020, 3, 24, 1, 13, 23, 789, time.UTC)
|
|
tun := Timestamp(t1.UnixNano())
|
|
|
|
assert.EqualValues(t, uint64(1585012403000000789), tun)
|
|
assert.Equal(t, tun, NewTimestampFromTime(t1))
|
|
assert.Equal(t, t1, NewTimestampFromTime(t1).AsTime())
|
|
assert.Equal(t, "2020-03-24 01:13:23.000000789 +0000 UTC", t1.String())
|
|
}
|
|
|
|
func TestZeroTimestamp(t *testing.T) {
|
|
assert.Equal(t, time.Unix(0, 0).UTC(), Timestamp(0).AsTime())
|
|
assert.Zero(t, NewTimestampFromTime(time.Unix(0, 0).UTC()))
|
|
assert.Equal(t, "1970-01-01 00:00:00 +0000 UTC", Timestamp(0).String())
|
|
}
|