Repository: DiceDB/dice
File: internal/eval/eval_test.go (Go)

Code before:
			output: []byte("$-1\r\n"),
		},
		"root not string strlen(object)": {
			setup: func() {
				key := "EXISTING_KEY"
				value := "{\"name\":\"Bhima\",\"age\":10}"
				var rootData interface{}
				_ = sonic.Unmarshal([]byte(value), &rootData)
				obj := store.NewObj(rootData, -1, object.ObjTypeJSON, object.ObjEncodingJSON)
				store.Put(key, obj)
			},
			input:  []string{"EXISTING_KEY"},
			output: []byte("-WRONGTYPE wrong type of path value - expected string but found object\r\n"),
		},
		"root not string strlen(number)": {
			setup: func() {
				key := "EXISTING_KEY"
				value := "10"
				var rootData interface{}
				_ = sonic.Unmarshal([]byte(value), &rootData)
				obj := store.NewObj(rootData, -1, object.ObjTypeJSON, object.ObjEncodingJSON)
				store.Put(key, obj)
			},
			input:  []string{"EXISTING_KEY"},
			output: []byte("-WRONGTYPE wrong type of path value - expected string but found number\r\n"),
		},
		"root not string strlen(array)": {
			setup: func() {
				key := "EXISTING_KEY"
				value := "[\"age\", \"name\"]"
				var rootData interface{}
				_ = sonic.Unmarshal([]byte(value), &rootData)
				obj := store.NewObj(rootData, -1, object.ObjTypeJSON, object.ObjEncodingJSON)
				store.Put(key, obj)
			},
			input:  []string{"EXISTING_KEY"},
			output: []byte("-WRONGTYPE wrong type of path value - expected string but found array\r\n"),
		},
		"root not string strlen(boolean)": {
			setup: func() {
				key := "EXISTING_KEY"
				value := "true"
				var rootData interface{}
				_ = sonic.Unmarshal([]byte(value), &rootData)
				obj := store.NewObj(rootData, -1, object.ObjTypeJSON, object.ObjEncodingJSON)
				store.Put(key, obj)
			},
			input:  []string{"EXISTING_KEY"},
			output: []byte("-WRONGTYPE wrong type of path value - expected string but found boolean\r\n"),
		},
		"root array strlen": {

Review comment (bug):
```suggestion
			output: []byte("-WRONGTYPE wrong type of path value - expected string but found integer\r\n"),
```

Code after:
			input:  []string{"NONEXISTENT_KEY"},
			output: []byte("$-1\r\n"),
		},
		"root not string strlen(object)": {
			setup: func() {
				key := "EXISTING_KEY"
				value := "{\"name\":\"Bhima\",\"age\":10}"
				var rootData interface{}
				_ = sonic.Unmarshal([]byte(value), &rootData)
				obj := store.NewObj(rootData, -1, object.ObjTypeJSON, object.ObjEncodingJSON)
				store.Put(key, obj)
			},
			input:  []string{"EXISTING_KEY"},
			output: []byte("-WRONGTYPE wrong type of path value - expected string but found object\r\n"),
		},
		"root not string strlen(number)": {
			setup: func() {
				key := "EXISTING_KEY"
				value := "10.9"
				var rootData interface{}
				_ = sonic.Unmarshal([]byte(value), &rootData)
				obj := store.NewObj(rootData, -1, object.ObjTypeJSON, object.ObjEncodingJSON)
				store.Put(key, obj)
			},
			input:  []string{"EXISTING_KEY"},
			output: []byte("-WRONGTYPE wrong type of path value - expected string but found number\r\n"),
		},
		"root not string strlen(integer)": {
			setup: func() {
				key := "EXISTING_KEY"
				value := "10"
				var rootData interface{}
				_ = sonic.Unmarshal([]byte(value), &rootData)
				obj := store.NewObj(rootData, -1, object.ObjTypeJSON, object.ObjEncodingJSON)
				store.Put(key, obj)
			},
			input:  []string{"EXISTING_KEY"},
			output: []byte("-WRONGTYPE wrong type of path value - expected string but found integer\r\n"),
		},
		"root not string strlen(array)": {
			setup: func() {
				key := "EXISTING_KEY"
				value := "[\"age\", \"name\"]"
				var rootData interface{}
				_ = sonic.Unmarshal([]byte(value), &rootData)
				obj := store.NewObj(rootData, -1, object.ObjTypeJSON, object.ObjEncodingJSON)
				store.Put(key, obj)
			},
			input:  []string{"EXISTING_KEY"},
			output: []byte("-WRONGTYPE wrong type of path value - expected string but found array\r\n"),
		},