<commit_before>package middleware

import (
	"net/http"
	"net/http/httptest"
	"testing"

	"github.com/davecgh/go-spew/spew"
	"github.com/labstack/echo"
	uuid "github.com/satori/go.uuid"
	"github.com/stretchr/testify/assert"
)

func TestRequestID(t *testing.T) {
	e := echo.New()
	req, _ := http.NewRequest(echo.GET, "/", nil)
	rec := httptest.NewRecorder()
	c := e.NewContext(req, rec)
	rid := RequestIDWithConfig(RequestIDConfig{})
	h := rid(func(c echo.Context) error {
		return c.String(http.StatusOK, "test")
	})

	h(c)
	if assert.NotEmpty(t, rec.Header().Get("X-Request-ID")) {
		u, err := uuid.FromString(rec.Header().Get("X-Request-ID"))
		spew.Dump(u)
		assert.NoError(t, err)
		assert.Equal(t, uint(4), u.Version())
		assert.Equal(t, uint(uuid.VariantRFC4122), u.Variant())
	}
}
<commit_msg>remove debug print in request_id_test.go<commit_after>package middleware

import (
	"net/http"
	"net/http/httptest"
	"testing"

	"github.com/labstack/echo"
	uuid "github.com/satori/go.uuid"
	"github.com/stretchr/testify/assert"
)

func TestRequestID(t *testing.T) {
	e := echo.New()
	req, _ := http.NewRequest(echo.GET, "/", nil)
	rec := httptest.NewRecorder()
	c := e.NewContext(req, rec)
	rid := RequestIDWithConfig(RequestIDConfig{})
	h := rid(func(c echo.Context) error {
		return c.String(http.StatusOK, "test")
	})

	h(c)
	if assert.NotEmpty(t, rec.Header().Get("X-Request-ID")) {
		u, err := uuid.FromString(rec.Header().Get("X-Request-ID"))
		assert.NoError(t, err)
		assert.Equal(t, uint(4), u.Version())
		assert.Equal(t, uint(uuid.VariantRFC4122), u.Variant())
	}
}

{'fraction_non_alphanumeric': 0.19213696892834495, 'fraction_numerical': 0.0063411540900443885, 'mean_word_length': 4.536842105263158, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4125590', 'n_tokens_mistral': 662, 'n_tokens_neox': 646, 'n_words': 100}