Implemented t.Run in generic, hash, list, and set module tests

This commit is contained in:
Kelvin Mwinuka
2024-04-06 02:21:29 +08:00
parent 7a77d4fd81
commit 16743a36df
6 changed files with 2779 additions and 2327 deletions

View File

@@ -1108,270 +1108,88 @@ github.com/echovault/echovault/pkg/modules/acl/commands.go:578.62,580.7 1 1
github.com/echovault/echovault/pkg/modules/acl/commands.go:589.62,591.7 1 1
github.com/echovault/echovault/pkg/modules/acl/commands.go:603.62,605.7 1 0
github.com/echovault/echovault/pkg/modules/acl/commands.go:614.62,616.7 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:31.105,33.16 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:33.16,35.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:37.2,40.25 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:40.25,42.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:44.2,44.38 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:44.38,46.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:48.2,48.33 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:48.33,50.17 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:50.17,52.4 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:53.3,54.59 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:54.59,56.4 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:57.3,57.59 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:60.2,60.51 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:60.51,62.3 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:63.2,66.9 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:66.9,68.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:70.2,71.36 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:71.36,72.42 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:72.42,73.26 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:73.26,76.5 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:77.4,77.12 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:79.3,80.13 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:82.2,82.55 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:82.55,84.3 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:86.2,86.51 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:89.105,91.16 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:91.16,93.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:95.2,98.33 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:98.33,100.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:102.2,102.52 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:102.52,104.3 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:105.2,108.9 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:108.9,110.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:112.2,115.31 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:115.31,117.19 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:117.19,119.12 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:121.3,121.34 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:121.34,123.12 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:125.3,125.31 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:125.31,127.12 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:129.3,129.35 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:129.35,132.12 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:134.3,134.32 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:137.2,137.25 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:140.108,142.16 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:142.16,144.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:146.2,149.33 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:149.33,151.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:153.2,153.52 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:153.52,155.3 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:156.2,159.9 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:159.9,161.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:163.2,166.31 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:166.31,168.19 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:168.19,170.12 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:172.3,172.34 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:172.34,174.12 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:176.3,176.35 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:176.35,179.12 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:181.3,181.31 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:181.31,183.12 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:185.3,185.18 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:188.2,188.25 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:191.106,193.16 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:193.16,195.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:197.2,199.33 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:199.33,201.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:203.2,203.52 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:203.52,205.3 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:206.2,209.9 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:209.9,211.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:213.2,214.27 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:214.27,215.32 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:215.32,217.12 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:219.3,219.33 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:219.33,222.12 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:224.3,224.29 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:224.29,226.4 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:229.2,229.25 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:232.111,234.16 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:234.16,236.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:238.2,241.19 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:241.19,243.17 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:243.17,245.4 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:246.3,246.13 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:246.13,248.4 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:249.3,249.12 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:252.2,253.19 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:253.19,254.46 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:254.46,256.4 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:256.9,258.4 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:261.2,261.33 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:261.33,263.3 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:265.2,265.52 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:265.52,267.3 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:268.2,271.9 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:271.9,273.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:276.2,276.24 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:276.24,278.17 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:278.17,280.4 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:281.3,281.34 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:281.34,283.18 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:283.18,284.36 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:284.36,286.14 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:288.5,288.37 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:288.37,291.14 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:293.5,293.33 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:293.33,295.14 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:299.3,299.26 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:303.2,304.29 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:304.29,306.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:309.2,311.46 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:311.46,315.16 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:315.16,316.59 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:316.59,318.5 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:322.2,323.16 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:323.16,325.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:326.2,326.38 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:326.38,328.17 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:328.17,329.41 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:329.41,331.13 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:333.4,333.42 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:333.42,336.13 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:338.4,338.38 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:338.38,340.13 2 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:345.2,345.25 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:348.105,350.16 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:350.16,352.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:354.2,356.33 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:356.33,358.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:360.2,360.52 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:360.52,362.3 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:363.2,366.9 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:366.9,368.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:370.2,370.55 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:373.106,375.16 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:375.16,377.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:379.2,381.33 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:381.33,383.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:385.2,385.52 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:385.52,387.3 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:388.2,391.9 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:391.9,393.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:395.2,396.29 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:396.29,398.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:400.2,400.25 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:403.108,405.16 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:405.16,407.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:409.2,415.47 5 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:415.47,417.17 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:417.17,419.4 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:420.3,420.21 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:421.8,423.17 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:423.17,425.4 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:426.3,426.19 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:429.2,429.33 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:429.33,430.62 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:430.62,432.4 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:433.3,435.48 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:435.48,437.57 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:437.57,439.5 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:440.4,440.96 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:441.9,443.57 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:443.57,445.5 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:446.4,446.60 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:450.2,450.52 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:450.52,452.3 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:453.2,456.9 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:456.9,458.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:460.2,460.24 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:460.24,462.3 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:464.2,464.28 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:465.10,466.69 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:467.11,469.48 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:469.48,471.4 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:471.9,473.4 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:474.15,476.48 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:476.48,478.4 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:478.9,480.4 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:483.2,483.55 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:483.55,485.3 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:487.2,487.40 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:487.40,489.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:491.2,492.47 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:495.108,497.16 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:497.16,499.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:501.2,503.33 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:503.33,505.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:507.2,507.52 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:507.52,509.3 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:510.2,513.9 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:513.9,515.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:517.2,518.33 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:518.33,520.34 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:520.34,522.4 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:523.3,523.35 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:523.35,526.4 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:527.3,527.31 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:527.31,529.4 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:532.2,532.25 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:535.108,537.16 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:537.16,539.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:541.2,544.33 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:544.33,546.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:548.2,548.52 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:548.52,550.3 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:551.2,554.9 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:554.9,556.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:558.2,558.24 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:558.24,560.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:562.2,562.30 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:565.105,567.16 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:567.16,569.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:571.2,574.33 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:574.33,576.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:578.2,578.51 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:578.51,580.3 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:581.2,584.9 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:584.9,586.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:588.2,590.31 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:590.31,591.25 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:591.25,594.4 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:597.2,597.55 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:597.55,599.3 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:601.2,601.51 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:604.33,725.2 1 0
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:22.50,23.18 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:23.18,25.3 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:26.2,26.22 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:29.52,30.18 1 0
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:30.18,32.3 1 0
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:33.2,33.22 1 0
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:36.50,37.18 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:37.18,39.3 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:40.2,40.22 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:43.53,44.18 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:44.18,46.3 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:47.2,47.22 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:50.51,51.19 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:51.19,53.3 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:54.2,54.21 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:57.56,58.34 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:58.34,60.3 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:61.2,61.19 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:61.19,63.3 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:64.2,64.22 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:67.50,68.19 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:68.19,70.3 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:71.2,71.21 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:74.51,75.19 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:75.19,77.3 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:78.2,78.21 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:81.53,82.19 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:82.19,84.3 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:85.2,85.22 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:88.53,89.19 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:89.19,91.3 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:92.2,92.21 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:95.53,96.19 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:96.19,98.3 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:99.2,99.22 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:102.50,103.18 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:103.18,105.3 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:106.2,106.22 1 1
github.com/echovault/echovault/pkg/modules/admin/commands.go:29.115,35.29 4 1
github.com/echovault/echovault/pkg/modules/admin/commands.go:35.29,36.54 1 1
github.com/echovault/echovault/pkg/modules/admin/commands.go:36.54,42.42 4 1
github.com/echovault/echovault/pkg/modules/admin/commands.go:42.42,44.5 1 1
github.com/echovault/echovault/pkg/modules/admin/commands.go:46.4,49.12 3 1
github.com/echovault/echovault/pkg/modules/admin/commands.go:52.3,52.36 1 1
github.com/echovault/echovault/pkg/modules/admin/commands.go:52.36,59.43 5 1
github.com/echovault/echovault/pkg/modules/admin/commands.go:59.43,61.5 1 1
github.com/echovault/echovault/pkg/modules/admin/commands.go:63.4,65.21 2 1
github.com/echovault/echovault/pkg/modules/admin/commands.go:69.2,71.25 2 1
github.com/echovault/echovault/pkg/modules/admin/commands.go:74.109,78.35 3 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:78.35,79.65 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:79.65,80.41 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:80.41,82.5 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:83.4,83.12 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:85.3,85.13 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:88.2,88.51 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:91.110,92.18 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:93.9,98.36 4 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:98.36,99.66 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:99.66,100.52 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:100.52,104.6 3 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:105.5,105.13 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:107.4,108.14 2 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:110.3,111.26 2 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:113.9,117.45 3 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:117.45,119.4 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:120.3,120.42 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:120.42,124.37 3 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:124.37,125.67 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:125.67,126.53 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:126.53,127.59 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:127.59,131.8 3 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:133.6,133.14 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:135.5,135.54 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:135.54,138.6 2 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:140.9,140.50 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:140.50,144.37 3 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:144.37,145.67 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:145.67,146.53 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:146.53,148.24 2 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:148.24,151.8 2 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:153.6,153.14 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:155.5,155.33 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:155.33,158.6 2 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:160.9,160.49 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:160.49,164.37 3 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:164.37,165.67 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:165.67,166.53 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:166.53,167.55 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:167.55,171.8 3 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:173.6,173.14 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:175.5,175.50 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:175.50,178.6 2 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:180.9,182.4 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:183.3,184.26 2 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:185.10,186.54 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:190.103,192.2 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:194.33,202.60 1 1
github.com/echovault/echovault/pkg/modules/admin/commands.go:202.60,202.86 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:211.60,213.5 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:221.62,221.88 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:230.62,230.88 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:240.62,240.88 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:251.60,253.5 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:254.113,255.49 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:255.49,257.6 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:258.5,258.45 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:267.60,269.5 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:270.113,272.18 2 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:272.18,274.6 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:275.5,275.53 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:284.60,286.5 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:287.113,288.47 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:288.47,290.6 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:291.5,291.45 1 0
github.com/echovault/echovault/pkg/modules/connection/commands.go:26.108,27.18 1 1
github.com/echovault/echovault/pkg/modules/connection/commands.go:28.10,29.54 1 1
github.com/echovault/echovault/pkg/modules/connection/commands.go:30.9,31.34 1 1
github.com/echovault/echovault/pkg/modules/connection/commands.go:32.9,33.72 1 1
github.com/echovault/echovault/pkg/modules/connection/commands.go:37.33,45.60 1 0
github.com/echovault/echovault/pkg/modules/connection/commands.go:45.60,47.5 1 0
github.com/echovault/echovault/pkg/modules/generic/commands.go:36.104,38.16 2 1
github.com/echovault/echovault/pkg/modules/generic/commands.go:38.16,40.3 1 1
github.com/echovault/echovault/pkg/modules/generic/commands.go:42.2,48.16 6 1
@@ -1622,88 +1440,270 @@ github.com/echovault/echovault/pkg/modules/generic/utils.go:107.3,109.17 3 1
github.com/echovault/echovault/pkg/modules/generic/utils.go:109.17,111.4 1 1
github.com/echovault/echovault/pkg/modules/generic/utils.go:112.3,113.53 2 1
github.com/echovault/echovault/pkg/modules/generic/utils.go:115.10,116.95 1 1
github.com/echovault/echovault/pkg/modules/admin/commands.go:29.115,35.29 4 1
github.com/echovault/echovault/pkg/modules/admin/commands.go:35.29,36.54 1 1
github.com/echovault/echovault/pkg/modules/admin/commands.go:36.54,42.42 4 1
github.com/echovault/echovault/pkg/modules/admin/commands.go:42.42,44.5 1 1
github.com/echovault/echovault/pkg/modules/admin/commands.go:46.4,49.12 3 1
github.com/echovault/echovault/pkg/modules/admin/commands.go:52.3,52.36 1 1
github.com/echovault/echovault/pkg/modules/admin/commands.go:52.36,59.43 5 1
github.com/echovault/echovault/pkg/modules/admin/commands.go:59.43,61.5 1 1
github.com/echovault/echovault/pkg/modules/admin/commands.go:63.4,65.21 2 1
github.com/echovault/echovault/pkg/modules/admin/commands.go:69.2,71.25 2 1
github.com/echovault/echovault/pkg/modules/admin/commands.go:74.109,78.35 3 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:78.35,79.65 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:79.65,80.41 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:80.41,82.5 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:83.4,83.12 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:85.3,85.13 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:88.2,88.51 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:91.110,92.18 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:93.9,98.36 4 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:98.36,99.66 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:99.66,100.52 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:100.52,104.6 3 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:105.5,105.13 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:107.4,108.14 2 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:110.3,111.26 2 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:113.9,117.45 3 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:117.45,119.4 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:120.3,120.42 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:120.42,124.37 3 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:124.37,125.67 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:125.67,126.53 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:126.53,127.59 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:127.59,131.8 3 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:133.6,133.14 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:135.5,135.54 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:135.54,138.6 2 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:140.9,140.50 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:140.50,144.37 3 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:144.37,145.67 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:145.67,146.53 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:146.53,148.24 2 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:148.24,151.8 2 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:153.6,153.14 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:155.5,155.33 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:155.33,158.6 2 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:160.9,160.49 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:160.49,164.37 3 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:164.37,165.67 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:165.67,166.53 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:166.53,167.55 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:167.55,171.8 3 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:173.6,173.14 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:175.5,175.50 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:175.50,178.6 2 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:180.9,182.4 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:183.3,184.26 2 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:185.10,186.54 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:190.103,192.2 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:194.33,202.60 1 1
github.com/echovault/echovault/pkg/modules/admin/commands.go:202.60,202.86 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:211.60,213.5 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:221.62,221.88 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:230.62,230.88 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:240.62,240.88 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:251.60,253.5 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:254.113,255.49 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:255.49,257.6 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:258.5,258.45 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:267.60,269.5 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:270.113,272.18 2 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:272.18,274.6 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:275.5,275.53 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:284.60,286.5 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:287.113,288.47 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:288.47,290.6 1 0
github.com/echovault/echovault/pkg/modules/admin/commands.go:291.5,291.45 1 0
github.com/echovault/echovault/pkg/modules/connection/commands.go:26.108,27.18 1 1
github.com/echovault/echovault/pkg/modules/connection/commands.go:28.10,29.54 1 1
github.com/echovault/echovault/pkg/modules/connection/commands.go:30.9,31.34 1 1
github.com/echovault/echovault/pkg/modules/connection/commands.go:32.9,33.72 1 1
github.com/echovault/echovault/pkg/modules/connection/commands.go:37.33,45.60 1 0
github.com/echovault/echovault/pkg/modules/connection/commands.go:45.60,47.5 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:31.105,33.16 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:33.16,35.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:37.2,40.25 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:40.25,42.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:44.2,44.38 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:44.38,46.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:48.2,48.33 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:48.33,50.17 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:50.17,52.4 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:53.3,54.59 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:54.59,56.4 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:57.3,57.59 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:60.2,60.51 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:60.51,62.3 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:63.2,66.9 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:66.9,68.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:70.2,71.36 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:71.36,72.42 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:72.42,73.26 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:73.26,76.5 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:77.4,77.12 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:79.3,80.13 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:82.2,82.55 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:82.55,84.3 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:86.2,86.51 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:89.105,91.16 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:91.16,93.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:95.2,98.33 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:98.33,100.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:102.2,102.52 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:102.52,104.3 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:105.2,108.9 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:108.9,110.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:112.2,115.31 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:115.31,117.19 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:117.19,119.12 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:121.3,121.34 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:121.34,123.12 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:125.3,125.31 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:125.31,127.12 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:129.3,129.35 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:129.35,132.12 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:134.3,134.32 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:137.2,137.25 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:140.108,142.16 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:142.16,144.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:146.2,149.33 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:149.33,151.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:153.2,153.52 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:153.52,155.3 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:156.2,159.9 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:159.9,161.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:163.2,166.31 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:166.31,168.19 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:168.19,170.12 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:172.3,172.34 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:172.34,174.12 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:176.3,176.35 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:176.35,179.12 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:181.3,181.31 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:181.31,183.12 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:185.3,185.18 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:188.2,188.25 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:191.106,193.16 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:193.16,195.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:197.2,199.33 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:199.33,201.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:203.2,203.52 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:203.52,205.3 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:206.2,209.9 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:209.9,211.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:213.2,214.27 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:214.27,215.32 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:215.32,217.12 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:219.3,219.33 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:219.33,222.12 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:224.3,224.29 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:224.29,226.4 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:229.2,229.25 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:232.111,234.16 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:234.16,236.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:238.2,241.19 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:241.19,243.17 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:243.17,245.4 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:246.3,246.13 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:246.13,248.4 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:249.3,249.12 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:252.2,253.19 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:253.19,254.46 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:254.46,256.4 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:256.9,258.4 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:261.2,261.33 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:261.33,263.3 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:265.2,265.52 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:265.52,267.3 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:268.2,271.9 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:271.9,273.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:276.2,276.24 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:276.24,278.17 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:278.17,280.4 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:281.3,281.34 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:281.34,283.18 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:283.18,284.36 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:284.36,286.14 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:288.5,288.37 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:288.37,291.14 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:293.5,293.33 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:293.33,295.14 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:299.3,299.26 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:303.2,304.29 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:304.29,306.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:309.2,311.46 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:311.46,315.16 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:315.16,316.59 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:316.59,318.5 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:322.2,323.16 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:323.16,325.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:326.2,326.38 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:326.38,328.17 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:328.17,329.41 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:329.41,331.13 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:333.4,333.42 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:333.42,336.13 3 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:338.4,338.38 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:338.38,340.13 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:345.2,345.25 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:348.105,350.16 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:350.16,352.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:354.2,356.33 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:356.33,358.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:360.2,360.52 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:360.52,362.3 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:363.2,366.9 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:366.9,368.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:370.2,370.55 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:373.106,375.16 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:375.16,377.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:379.2,381.33 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:381.33,383.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:385.2,385.52 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:385.52,387.3 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:388.2,391.9 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:391.9,393.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:395.2,396.29 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:396.29,398.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:400.2,400.25 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:403.108,405.16 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:405.16,407.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:409.2,415.47 5 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:415.47,417.17 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:417.17,419.4 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:420.3,420.21 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:421.8,423.17 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:423.17,425.4 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:426.3,426.19 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:429.2,429.33 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:429.33,430.62 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:430.62,432.4 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:433.3,435.48 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:435.48,437.57 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:437.57,439.5 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:440.4,440.96 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:441.9,443.57 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:443.57,445.5 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:446.4,446.60 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:450.2,450.52 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:450.52,452.3 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:453.2,456.9 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:456.9,458.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:460.2,460.24 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:460.24,462.3 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:464.2,464.28 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:465.10,466.69 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:467.11,469.48 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:469.48,471.4 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:471.9,473.4 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:474.15,476.48 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:476.48,478.4 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:478.9,480.4 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:483.2,483.55 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:483.55,485.3 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:487.2,487.40 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:487.40,489.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:491.2,492.47 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:495.108,497.16 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:497.16,499.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:501.2,503.33 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:503.33,505.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:507.2,507.52 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:507.52,509.3 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:510.2,513.9 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:513.9,515.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:517.2,518.33 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:518.33,520.34 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:520.34,522.4 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:523.3,523.35 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:523.35,526.4 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:527.3,527.31 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:527.31,529.4 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:532.2,532.25 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:535.108,537.16 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:537.16,539.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:541.2,544.33 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:544.33,546.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:548.2,548.52 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:548.52,550.3 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:551.2,554.9 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:554.9,556.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:558.2,558.24 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:558.24,560.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:562.2,562.30 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:565.105,567.16 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:567.16,569.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:571.2,574.33 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:574.33,576.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:578.2,578.51 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:578.51,580.3 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:581.2,584.9 3 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:584.9,586.3 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:588.2,590.31 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:590.31,591.25 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:591.25,594.4 2 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:597.2,597.55 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:597.55,599.3 1 0
github.com/echovault/echovault/pkg/modules/hash/commands.go:601.2,601.51 1 1
github.com/echovault/echovault/pkg/modules/hash/commands.go:604.33,725.2 1 0
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:22.50,23.18 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:23.18,25.3 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:26.2,26.22 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:29.52,30.18 1 0
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:30.18,32.3 1 0
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:33.2,33.22 1 0
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:36.50,37.18 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:37.18,39.3 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:40.2,40.22 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:43.53,44.18 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:44.18,46.3 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:47.2,47.22 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:50.51,51.19 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:51.19,53.3 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:54.2,54.21 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:57.56,58.34 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:58.34,60.3 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:61.2,61.19 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:61.19,63.3 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:64.2,64.22 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:67.50,68.19 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:68.19,70.3 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:71.2,71.21 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:74.51,75.19 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:75.19,77.3 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:78.2,78.21 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:81.53,82.19 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:82.19,84.3 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:85.2,85.22 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:88.53,89.19 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:89.19,91.3 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:92.2,92.21 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:95.53,96.19 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:96.19,98.3 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:99.2,99.22 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:102.50,103.18 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:103.18,105.3 1 1
github.com/echovault/echovault/pkg/modules/hash/key_funcs.go:106.2,106.22 1 1
github.com/echovault/echovault/pkg/modules/list/commands.go:30.105,32.16 2 1
github.com/echovault/echovault/pkg/modules/list/commands.go:32.16,34.3 1 1
github.com/echovault/echovault/pkg/modules/list/commands.go:36.2,38.33 2 1

View File

@@ -32,7 +32,7 @@ func (RealClock) After(d time.Duration) <-chan time.Time {
type MockClock struct{}
func (MockClock) Now() time.Time {
t, _ := time.Parse(time.RFC3339, "2036-01-02T15:04:05+07:00")
t, _ := time.Parse(time.RFC3339, "2006-01-02T15:04:05+07:00")
return t
}

File diff suppressed because it is too large Load Diff

View File

@@ -41,6 +41,7 @@ func init() {
func Test_HandleHSET(t *testing.T) {
// Tests for both HSET and HSETNX
tests := []struct {
name string
preset bool
key string
presetValue interface{}
@@ -49,7 +50,8 @@ func Test_HandleHSET(t *testing.T) {
expectedValue map[string]interface{}
expectedError error
}{
{ // HSETNX set field on non-existent hash map
{
name: "1. HSETNX set field on non-existent hash map",
preset: false,
key: "HsetKey1",
presetValue: map[string]interface{}{},
@@ -58,7 +60,8 @@ func Test_HandleHSET(t *testing.T) {
expectedValue: map[string]interface{}{"field1": "value1"},
expectedError: nil,
},
{ // HSETNX set field on existing hash map
{
name: "2. HSETNX set field on existing hash map",
preset: true,
key: "HsetKey2",
presetValue: map[string]interface{}{"field1": "value1"},
@@ -67,7 +70,8 @@ func Test_HandleHSET(t *testing.T) {
expectedValue: map[string]interface{}{"field1": "value1", "field2": "value2"},
expectedError: nil,
},
{ // HSETNX skips operation when setting on existing field
{
name: "3. HSETNX skips operation when setting on existing field",
preset: true,
key: "HsetKey3",
presetValue: map[string]interface{}{"field1": "value1"},
@@ -76,7 +80,8 @@ func Test_HandleHSET(t *testing.T) {
expectedValue: map[string]interface{}{"field1": "value1"},
expectedError: nil,
},
{ // Regular HSET command on non-existent hash map
{
name: "4. Regular HSET command on non-existent hash map",
preset: false,
key: "HsetKey4",
presetValue: map[string]interface{}{},
@@ -85,7 +90,8 @@ func Test_HandleHSET(t *testing.T) {
expectedValue: map[string]interface{}{"field1": "value1", "field2": "value2"},
expectedError: nil,
},
{ // Regular HSET update on existing hash map
{
name: "5. Regular HSET update on existing hash map",
preset: true,
key: "HsetKey5",
presetValue: map[string]interface{}{"field1": "value1", "field2": "value2"},
@@ -94,7 +100,8 @@ func Test_HandleHSET(t *testing.T) {
expectedValue: map[string]interface{}{"field1": "value1-new", "field2": "value2-ne2", "field3": "value3"},
expectedError: nil,
},
{ // HSET returns error when the target key is not a map
{
name: "6. HSET returns error when the target key is not a map",
preset: true,
key: "HsetKey6",
presetValue: "Default preset value",
@@ -103,7 +110,8 @@ func Test_HandleHSET(t *testing.T) {
expectedValue: map[string]interface{}{},
expectedError: errors.New("value at HsetKey6 is not a hash"),
},
{ // HSET returns error when there's a mismatch in key/values
{
name: "7. HSET returns error when there's a mismatch in key/values",
preset: false,
key: "HsetKey7",
presetValue: nil,
@@ -112,7 +120,8 @@ func Test_HandleHSET(t *testing.T) {
expectedValue: map[string]interface{}{},
expectedError: errors.New("each field must have a corresponding value"),
},
{ // Command too short
{
name: "8. Command too short",
preset: true,
key: "HsetKey8",
presetValue: nil,
@@ -124,6 +133,7 @@ func Test_HandleHSET(t *testing.T) {
}
for i, test := range tests {
t.Run(test.name, func(t *testing.T) {
ctx := context.WithValue(context.Background(), "test_name", fmt.Sprintf("HSET/HSETNX, %d", i))
if test.preset {
if _, err := mockServer.CreateKeyAndLock(ctx, test.key); err != nil {
@@ -139,7 +149,7 @@ func Test_HandleHSET(t *testing.T) {
if err.Error() != test.expectedError.Error() {
t.Errorf("expected error \"%s\", got \"%s\"", test.expectedError.Error(), err.Error())
}
continue
return
}
rd := resp.NewReader(bytes.NewBuffer(res))
rv, _, err := rd.ReadValue()
@@ -162,12 +172,14 @@ func Test_HandleHSET(t *testing.T) {
t.Errorf("expected value \"%+v\" for field \"%+v\", got \"%+v\"", test.expectedValue[field], field, value)
}
}
})
}
}
func Test_HandleHINCRBY(t *testing.T) {
// Tests for both HINCRBY and HINCRBYFLOAT
tests := []struct {
name string
preset bool
key string
presetValue interface{}
@@ -176,7 +188,8 @@ func Test_HandleHINCRBY(t *testing.T) {
expectedValue map[string]interface{}
expectedError error
}{
{ // Increment by integer on non-existent hash should create a new one
{
name: "1. Increment by integer on non-existent hash should create a new one",
preset: false,
key: "HincrbyKey1",
presetValue: nil,
@@ -185,7 +198,8 @@ func Test_HandleHINCRBY(t *testing.T) {
expectedValue: map[string]interface{}{"field1": 1},
expectedError: nil,
},
{ // Increment by float on non-existent hash should create one
{
name: "2. Increment by float on non-existent hash should create one",
preset: false,
key: "HincrbyKey2",
presetValue: nil,
@@ -194,7 +208,8 @@ func Test_HandleHINCRBY(t *testing.T) {
expectedValue: map[string]interface{}{"field1": 3.142},
expectedError: nil,
},
{ // Increment by integer on existing hash
{
name: "3. Increment by integer on existing hash",
preset: true,
key: "HincrbyKey3",
presetValue: map[string]interface{}{"field1": 1},
@@ -203,7 +218,8 @@ func Test_HandleHINCRBY(t *testing.T) {
expectedValue: map[string]interface{}{"field1": 11},
expectedError: nil,
},
{ // Increment by float on an existing hash
{
name: "4. Increment by float on an existing hash",
preset: true,
key: "HincrbyKey4",
presetValue: map[string]interface{}{"field1": 3.142},
@@ -212,7 +228,8 @@ func Test_HandleHINCRBY(t *testing.T) {
expectedValue: map[string]interface{}{"field1": 6.284},
expectedError: nil,
},
{ // Command too short
{
name: "5. Command too short",
preset: false,
key: "HincrbyKey5",
presetValue: nil,
@@ -221,7 +238,8 @@ func Test_HandleHINCRBY(t *testing.T) {
expectedValue: map[string]interface{}{},
expectedError: errors.New(constants.WrongArgsResponse),
},
{ // Command too long
{
name: "6. Command too long",
preset: false,
key: "HincrbyKey6",
presetValue: nil,
@@ -230,7 +248,8 @@ func Test_HandleHINCRBY(t *testing.T) {
expectedValue: map[string]interface{}{},
expectedError: errors.New(constants.WrongArgsResponse),
},
{ // Error when increment by float does not pass valid float
{
name: "7. Error when increment by float does not pass valid float",
preset: false,
key: "HincrbyKey7",
presetValue: nil,
@@ -239,7 +258,8 @@ func Test_HandleHINCRBY(t *testing.T) {
expectedValue: map[string]interface{}{},
expectedError: errors.New("increment must be a float"),
},
{ // Error when increment does not pass valid integer
{
name: "8. Error when increment does not pass valid integer",
preset: false,
key: "HincrbyKey8",
presetValue: nil,
@@ -248,7 +268,8 @@ func Test_HandleHINCRBY(t *testing.T) {
expectedValue: map[string]interface{}{},
expectedError: errors.New("increment must be an integer"),
},
{ // Error when trying to increment on a key that is not a hash
{
name: "9. Error when trying to increment on a key that is not a hash",
preset: true,
key: "HincrbyKey9",
presetValue: "Default value",
@@ -257,7 +278,8 @@ func Test_HandleHINCRBY(t *testing.T) {
expectedValue: map[string]interface{}{},
expectedError: errors.New("value at HincrbyKey9 is not a hash"),
},
{ // Error when trying to increment a hash field that is not a number
{
name: "10. Error when trying to increment a hash field that is not a number",
preset: true,
key: "HincrbyKey10",
presetValue: map[string]interface{}{"field1": "value1"},
@@ -269,6 +291,7 @@ func Test_HandleHINCRBY(t *testing.T) {
}
for i, test := range tests {
t.Run(test.name, func(t *testing.T) {
ctx := context.WithValue(context.Background(), "test_name", fmt.Sprintf("HINCRBY, %d", i))
if test.preset {
@@ -285,7 +308,7 @@ func Test_HandleHINCRBY(t *testing.T) {
if err.Error() != test.expectedError.Error() {
t.Errorf("expected error \"%s\", got \"%s\"", test.expectedError.Error(), err.Error())
}
continue
return
}
rd := resp.NewReader(bytes.NewBuffer(res))
rv, _, err := rd.ReadValue()
@@ -317,11 +340,13 @@ func Test_HandleHINCRBY(t *testing.T) {
t.Errorf("expected value \"%+v\" for field \"%+v\", got \"%+v\"", test.expectedValue[field], field, value)
}
}
})
}
}
func Test_HandleHGET(t *testing.T) {
tests := []struct {
name string
preset bool
key string
presetValue interface{}
@@ -330,7 +355,8 @@ func Test_HandleHGET(t *testing.T) {
expectedValue map[string]interface{}
expectedError error
}{
{ // Return nil when attempting to get from non-existed key
{
name: "1. Return nil when attempting to get from non-existed key",
preset: true,
key: "HgetKey1",
presetValue: map[string]interface{}{"field1": "value1", "field2": 365, "field3": 3.142},
@@ -339,7 +365,8 @@ func Test_HandleHGET(t *testing.T) {
expectedValue: map[string]interface{}{},
expectedError: nil,
},
{ // Return nil when attempting to get from non-existed key
{
name: "2. Return nil when attempting to get from non-existed key",
preset: false,
key: "HgetKey2",
presetValue: map[string]interface{}{},
@@ -348,7 +375,8 @@ func Test_HandleHGET(t *testing.T) {
expectedValue: map[string]interface{}{},
expectedError: nil,
},
{ // Error when trying to get from a value that is not a hash map
{
name: "3. Error when trying to get from a value that is not a hash map",
preset: true,
key: "HgetKey3",
presetValue: "Default Value",
@@ -357,7 +385,8 @@ func Test_HandleHGET(t *testing.T) {
expectedValue: map[string]interface{}{},
expectedError: errors.New("value at HgetKey3 is not a hash"),
},
{ // Command too short
{
name: "4. Command too short",
preset: false,
key: "HgetKey4",
presetValue: map[string]interface{}{},
@@ -369,6 +398,7 @@ func Test_HandleHGET(t *testing.T) {
}
for i, test := range tests {
t.Run(test.name, func(t *testing.T) {
ctx := context.WithValue(context.Background(), "test_name", fmt.Sprintf("HINCRBY, %d", i))
if test.preset {
@@ -385,7 +415,7 @@ func Test_HandleHGET(t *testing.T) {
if err.Error() != test.expectedError.Error() {
t.Errorf("expected error \"%s\", got \"%s\"", test.expectedError.Error(), err.Error())
}
continue
return
}
rd := resp.NewReader(bytes.NewBuffer(res))
rv, _, err := rd.ReadValue()
@@ -396,7 +426,7 @@ func Test_HandleHGET(t *testing.T) {
if !rv.IsNull() {
t.Errorf("expected nil response, got %+v", rv)
}
continue
return
}
if expectedArr, ok := test.expectedResponse.([]interface{}); ok {
for i, v := range rv.Array() {
@@ -417,11 +447,13 @@ func Test_HandleHGET(t *testing.T) {
}
}
}
})
}
}
func Test_HandleHSTRLEN(t *testing.T) {
tests := []struct {
name string
preset bool
key string
presetValue interface{}
@@ -433,6 +465,7 @@ func Test_HandleHSTRLEN(t *testing.T) {
{
// Return lengths of field values.
// If the key does not exist, its length should be 0.
name: "1. Return lengths of field values.",
preset: true,
key: "HstrlenKey1",
presetValue: map[string]interface{}{"field1": "value1", "field2": 123456789, "field3": 3.142},
@@ -441,7 +474,8 @@ func Test_HandleHSTRLEN(t *testing.T) {
expectedValue: map[string]interface{}{},
expectedError: nil,
},
{ // Nil response when trying to get HSTRLEN non-existent key
{
name: "2. Nil response when trying to get HSTRLEN non-existent key",
preset: false,
key: "HstrlenKey2",
presetValue: map[string]interface{}{},
@@ -450,7 +484,8 @@ func Test_HandleHSTRLEN(t *testing.T) {
expectedValue: map[string]interface{}{},
expectedError: nil,
},
{ // Command too short
{
name: "3. Command too short",
preset: false,
key: "HstrlenKey3",
presetValue: map[string]interface{}{},
@@ -459,7 +494,8 @@ func Test_HandleHSTRLEN(t *testing.T) {
expectedValue: map[string]interface{}{},
expectedError: errors.New(constants.WrongArgsResponse),
},
{ // Trying to get lengths on a non hash map returns error
{
name: "4. Trying to get lengths on a non hash map returns error",
preset: true,
key: "HstrlenKey4",
presetValue: "Default value",
@@ -471,6 +507,7 @@ func Test_HandleHSTRLEN(t *testing.T) {
}
for i, test := range tests {
t.Run(test.name, func(t *testing.T) {
ctx := context.WithValue(context.Background(), "test_name", fmt.Sprintf("HSTRLEN, %d", i))
if test.preset {
@@ -487,7 +524,7 @@ func Test_HandleHSTRLEN(t *testing.T) {
if err.Error() != test.expectedError.Error() {
t.Errorf("expected error \"%s\", got \"%s\"", test.expectedError.Error(), err.Error())
}
continue
return
}
rd := resp.NewReader(bytes.NewBuffer(res))
rv, _, err := rd.ReadValue()
@@ -498,7 +535,7 @@ func Test_HandleHSTRLEN(t *testing.T) {
if !rv.IsNull() {
t.Errorf("expected nil response, got %+v", rv)
}
continue
return
}
expectedResponse, _ := test.expectedResponse.([]int)
for i, v := range rv.Array() {
@@ -506,11 +543,13 @@ func Test_HandleHSTRLEN(t *testing.T) {
t.Errorf("expected \"%d\", got \"%d\"", expectedResponse[i], v.Integer())
}
}
})
}
}
func Test_HandleHVALS(t *testing.T) {
tests := []struct {
name string
preset bool
key string
presetValue interface{}
@@ -520,7 +559,7 @@ func Test_HandleHVALS(t *testing.T) {
expectedError error
}{
{
// Return all the values from a hash
name: "1. Return all the values from a hash",
preset: true,
key: "HvalsKey1",
presetValue: map[string]interface{}{"field1": "value1", "field2": 123456789, "field3": 3.142},
@@ -529,7 +568,8 @@ func Test_HandleHVALS(t *testing.T) {
expectedValue: map[string]interface{}{},
expectedError: nil,
},
{ // Empty array response when trying to get HSTRLEN non-existent key
{
name: "2. Empty array response when trying to get HSTRLEN non-existent key",
preset: false,
key: "HvalsKey2",
presetValue: map[string]interface{}{},
@@ -538,7 +578,8 @@ func Test_HandleHVALS(t *testing.T) {
expectedValue: map[string]interface{}{},
expectedError: nil,
},
{ // Command too short
{
name: "3. Command too short",
preset: false,
key: "HvalsKey3",
presetValue: map[string]interface{}{},
@@ -547,7 +588,8 @@ func Test_HandleHVALS(t *testing.T) {
expectedValue: map[string]interface{}{},
expectedError: errors.New(constants.WrongArgsResponse),
},
{ // Command too long
{
name: "4. Command too long",
preset: false,
key: "HvalsKey4",
presetValue: map[string]interface{}{},
@@ -556,7 +598,8 @@ func Test_HandleHVALS(t *testing.T) {
expectedValue: map[string]interface{}{},
expectedError: errors.New(constants.WrongArgsResponse),
},
{ // Trying to get lengths on a non hash map returns error
{
name: "5. Trying to get lengths on a non hash map returns error",
preset: true,
key: "HvalsKey5",
presetValue: "Default value",
@@ -568,6 +611,7 @@ func Test_HandleHVALS(t *testing.T) {
}
for i, test := range tests {
t.Run(test.name, func(t *testing.T) {
ctx := context.WithValue(context.Background(), "test_name", fmt.Sprintf("HVALS, %d", i))
if test.preset {
@@ -584,7 +628,7 @@ func Test_HandleHVALS(t *testing.T) {
if err.Error() != test.expectedError.Error() {
t.Errorf("expected error \"%s\", got \"%s\"", test.expectedError.Error(), err.Error())
}
continue
return
}
rd := resp.NewReader(bytes.NewBuffer(res))
rv, _, err := rd.ReadValue()
@@ -620,11 +664,13 @@ func Test_HandleHVALS(t *testing.T) {
}
}
}
})
}
}
func Test_HandleHRANDFIELD(t *testing.T) {
tests := []struct {
name string
preset bool
key string
presetValue interface{}
@@ -634,7 +680,8 @@ func Test_HandleHRANDFIELD(t *testing.T) {
expectedResponse []string
expectedError error
}{
{ // Get a random field
{
name: "1. Get a random field",
preset: true,
key: "HrandfieldKey1",
presetValue: map[string]interface{}{"field1": "value1", "field2": 123456789, "field3": 3.142},
@@ -644,7 +691,8 @@ func Test_HandleHRANDFIELD(t *testing.T) {
expectedResponse: []string{"field1", "field2", "field3"},
expectedError: nil,
},
{ // Get a random field with a value
{
name: "2. Get a random field with a value",
preset: true,
key: "HrandfieldKey2",
presetValue: map[string]interface{}{"field1": "value1", "field2": 123456789, "field3": 3.142},
@@ -654,7 +702,8 @@ func Test_HandleHRANDFIELD(t *testing.T) {
expectedResponse: []string{"field1", "value1", "field2", "123456789", "field3", "3.142"},
expectedError: nil,
},
{ // Get several random fields
{
name: "3. Get several random fields",
preset: true,
key: "HrandfieldKey3",
presetValue: map[string]interface{}{
@@ -670,7 +719,8 @@ func Test_HandleHRANDFIELD(t *testing.T) {
expectedResponse: []string{"field1", "field2", "field3", "field4", "field5"},
expectedError: nil,
},
{ // Get several random fields with their corresponding values
{
name: "4. Get several random fields with their corresponding values",
preset: true,
key: "HrandfieldKey4",
presetValue: map[string]interface{}{
@@ -689,7 +739,8 @@ func Test_HandleHRANDFIELD(t *testing.T) {
},
expectedError: nil,
},
{ // Get the entire hash
{
name: "5. Get the entire hash",
preset: true,
key: "HrandfieldKey5",
presetValue: map[string]interface{}{
@@ -705,7 +756,8 @@ func Test_HandleHRANDFIELD(t *testing.T) {
expectedResponse: []string{"field1", "field2", "field3", "field4", "field5"},
expectedError: nil,
},
{ // Get the entire hash with values
{
name: "6. Get the entire hash with values",
preset: true,
key: "HrandfieldKey5",
presetValue: map[string]interface{}{
@@ -724,35 +776,40 @@ func Test_HandleHRANDFIELD(t *testing.T) {
},
expectedError: nil,
},
{ // Command too short
{
name: "7. Command too short",
preset: false,
key: "HrandfieldKey10",
presetValue: map[string]interface{}{},
command: []string{"HRANDFIELD"},
expectedError: errors.New(constants.WrongArgsResponse),
},
{ // Command too long
{
name: "8. Command too long",
preset: false,
key: "HrandfieldKey11",
presetValue: map[string]interface{}{},
command: []string{"HRANDFIELD", "HrandfieldKey11", "HrandfieldKey11", "HrandfieldKey11", "HrandfieldKey11"},
expectedError: errors.New(constants.WrongArgsResponse),
},
{ // Trying to get random field on a non hash map returns error
{
name: "9. Trying to get random field on a non hash map returns error",
preset: true,
key: "HrandfieldKey12",
presetValue: "Default value",
command: []string{"HRANDFIELD", "HrandfieldKey12"},
expectedError: errors.New("value at HrandfieldKey12 is not a hash"),
},
{ // Throw error when count provided is not an integer
{
name: "10. Throw error when count provided is not an integer",
preset: true,
key: "HrandfieldKey12",
presetValue: "Default value",
command: []string{"HRANDFIELD", "HrandfieldKey12", "COUNT"},
expectedError: errors.New("count must be an integer"),
},
{ // If fourth argument is provided, it must be "WITHVALUES"
{
name: "11. If fourth argument is provided, it must be \"WITHVALUES\"",
preset: true,
key: "HrandfieldKey12",
presetValue: "Default value",
@@ -762,6 +819,7 @@ func Test_HandleHRANDFIELD(t *testing.T) {
}
for i, test := range tests {
t.Run(test.name, func(t *testing.T) {
ctx := context.WithValue(context.Background(), "test_name", fmt.Sprintf("HRANDFIELD, %d", i))
if test.preset {
@@ -778,7 +836,7 @@ func Test_HandleHRANDFIELD(t *testing.T) {
if err.Error() != test.expectedError.Error() {
t.Errorf("expected error \"%s\", got \"%s\"", test.expectedError.Error(), err.Error())
}
continue
return
}
rd := resp.NewReader(bytes.NewBuffer(res))
rv, _, err := rd.ReadValue()
@@ -816,11 +874,13 @@ func Test_HandleHRANDFIELD(t *testing.T) {
}
}
}
})
}
}
func Test_HandleHLEN(t *testing.T) {
tests := []struct {
name string
preset bool
key string
presetValue interface{}
@@ -830,7 +890,7 @@ func Test_HandleHLEN(t *testing.T) {
expectedError error
}{
{
// Return the correct length of the hash
name: "1. Return the correct length of the hash",
preset: true,
key: "HlenKey1",
presetValue: map[string]interface{}{"field1": "value1", "field2": 123456789, "field3": 3.142},
@@ -839,7 +899,8 @@ func Test_HandleHLEN(t *testing.T) {
expectedValue: map[string]interface{}{},
expectedError: nil,
},
{ // 0 response when trying to call HLEN on non-existent key
{
name: "2. 0 response when trying to call HLEN on non-existent key",
preset: false,
key: "HlenKey2",
presetValue: map[string]interface{}{},
@@ -848,7 +909,8 @@ func Test_HandleHLEN(t *testing.T) {
expectedValue: map[string]interface{}{},
expectedError: nil,
},
{ // Command too short
{
name: "3. Command too short",
preset: false,
key: "HlenKey3",
presetValue: map[string]interface{}{},
@@ -857,7 +919,8 @@ func Test_HandleHLEN(t *testing.T) {
expectedValue: map[string]interface{}{},
expectedError: errors.New(constants.WrongArgsResponse),
},
{ // Command too long
{
name: "4. Command too long",
preset: false,
key: "HlenKey4",
presetValue: map[string]interface{}{},
@@ -866,7 +929,8 @@ func Test_HandleHLEN(t *testing.T) {
expectedValue: map[string]interface{}{},
expectedError: errors.New(constants.WrongArgsResponse),
},
{ // Trying to get lengths on a non hash map returns error
{
name: "5. Trying to get lengths on a non hash map returns error",
preset: true,
key: "HlenKey5",
presetValue: "Default value",
@@ -878,6 +942,7 @@ func Test_HandleHLEN(t *testing.T) {
}
for i, test := range tests {
t.Run(test.name, func(t *testing.T) {
ctx := context.WithValue(context.Background(), "test_name", fmt.Sprintf("HLEN, %d", i))
if test.preset {
@@ -894,7 +959,7 @@ func Test_HandleHLEN(t *testing.T) {
if err.Error() != test.expectedError.Error() {
t.Errorf("expected error \"%s\", got \"%s\"", test.expectedError.Error(), err.Error())
}
continue
return
}
rd := resp.NewReader(bytes.NewBuffer(res))
rv, _, err := rd.ReadValue()
@@ -905,14 +970,16 @@ func Test_HandleHLEN(t *testing.T) {
if rv.Integer() != expectedResponse {
t.Errorf("expected ineger \"%d\", got \"%d\"", expectedResponse, rv.Integer())
}
continue
return
}
t.Error("expected integer response, got another type")
})
}
}
func Test_HandleHKeys(t *testing.T) {
tests := []struct {
name string
preset bool
key string
presetValue interface{}
@@ -922,7 +989,7 @@ func Test_HandleHKeys(t *testing.T) {
expectedError error
}{
{
// Return an array containing all the keys of the hash
name: "1. Return an array containing all the keys of the hash",
preset: true,
key: "HkeysKey1",
presetValue: map[string]interface{}{"field1": "value1", "field2": 123456789, "field3": 3.142},
@@ -931,7 +998,8 @@ func Test_HandleHKeys(t *testing.T) {
expectedValue: map[string]interface{}{},
expectedError: nil,
},
{ // Empty array response when trying to call HKEYS on non-existent key
{
name: "2. Empty array response when trying to call HKEYS on non-existent key",
preset: false,
key: "HkeysKey2",
presetValue: map[string]interface{}{},
@@ -940,7 +1008,8 @@ func Test_HandleHKeys(t *testing.T) {
expectedValue: map[string]interface{}{},
expectedError: nil,
},
{ // Command too short
{
name: "3. Command too short",
preset: false,
key: "HkeysKey3",
presetValue: map[string]interface{}{},
@@ -949,7 +1018,8 @@ func Test_HandleHKeys(t *testing.T) {
expectedValue: map[string]interface{}{},
expectedError: errors.New(constants.WrongArgsResponse),
},
{ // Command too long
{
name: "4. Command too long",
preset: false,
key: "HkeysKey4",
presetValue: map[string]interface{}{},
@@ -958,7 +1028,8 @@ func Test_HandleHKeys(t *testing.T) {
expectedValue: map[string]interface{}{},
expectedError: errors.New(constants.WrongArgsResponse),
},
{ // Trying to get lengths on a non hash map returns error
{
name: "5. Trying to get lengths on a non hash map returns error",
preset: true,
key: "HkeysKey5",
presetValue: "Default value",
@@ -970,6 +1041,7 @@ func Test_HandleHKeys(t *testing.T) {
}
for i, test := range tests {
t.Run(test.name, func(t *testing.T) {
ctx := context.WithValue(context.Background(), "test_name", fmt.Sprintf("HKEYS, %d", i))
if test.preset {
@@ -986,7 +1058,7 @@ func Test_HandleHKeys(t *testing.T) {
if err.Error() != test.expectedError.Error() {
t.Errorf("expected error \"%s\", got \"%s\"", test.expectedError.Error(), err.Error())
}
continue
return
}
rd := resp.NewReader(bytes.NewBuffer(res))
rv, _, err := rd.ReadValue()
@@ -1004,14 +1076,16 @@ func Test_HandleHKeys(t *testing.T) {
t.Errorf("could not find expected to find key \"%s\" in response", field)
}
}
continue
return
}
t.Error("expected array response, got another type")
})
}
}
func Test_HandleHGETALL(t *testing.T) {
tests := []struct {
name string
preset bool
key string
presetValue interface{}
@@ -1021,7 +1095,7 @@ func Test_HandleHGETALL(t *testing.T) {
expectedError error
}{
{
// Return an array containing all the fields and values of the hash
name: "1. Return an array containing all the fields and values of the hash",
preset: true,
key: "HGetAllKey1",
presetValue: map[string]interface{}{"field1": "value1", "field2": 123456789, "field3": 3.142},
@@ -1030,7 +1104,8 @@ func Test_HandleHGETALL(t *testing.T) {
expectedValue: map[string]interface{}{},
expectedError: nil,
},
{ // Empty array response when trying to call HGETALL on non-existent key
{
name: "2. Empty array response when trying to call HGETALL on non-existent key",
preset: false,
key: "HGetAllKey2",
presetValue: map[string]interface{}{},
@@ -1039,7 +1114,8 @@ func Test_HandleHGETALL(t *testing.T) {
expectedValue: map[string]interface{}{},
expectedError: nil,
},
{ // Command too short
{
name: "3. Command too short",
preset: false,
key: "HGetAllKey3",
presetValue: map[string]interface{}{},
@@ -1048,7 +1124,8 @@ func Test_HandleHGETALL(t *testing.T) {
expectedValue: map[string]interface{}{},
expectedError: errors.New(constants.WrongArgsResponse),
},
{ // Command too long
{
name: "4. Command too long",
preset: false,
key: "HGetAllKey4",
presetValue: map[string]interface{}{},
@@ -1057,7 +1134,8 @@ func Test_HandleHGETALL(t *testing.T) {
expectedValue: map[string]interface{}{},
expectedError: errors.New(constants.WrongArgsResponse),
},
{ // Trying to get lengths on a non hash map returns error
{
name: "5. Trying to get lengths on a non hash map returns error",
preset: true,
key: "HGetAllKey5",
presetValue: "Default value",
@@ -1069,6 +1147,7 @@ func Test_HandleHGETALL(t *testing.T) {
}
for i, test := range tests {
t.Run(test.name, func(t *testing.T) {
ctx := context.WithValue(context.Background(), "test_name", fmt.Sprintf("HGETALL, %d", i))
if test.preset {
@@ -1085,7 +1164,7 @@ func Test_HandleHGETALL(t *testing.T) {
if err.Error() != test.expectedError.Error() {
t.Errorf("expected error \"%s\", got \"%s\"", test.expectedError.Error(), err.Error())
}
continue
return
}
rd := resp.NewReader(bytes.NewBuffer(res))
rv, _, err := rd.ReadValue()
@@ -1116,12 +1195,14 @@ func Test_HandleHGETALL(t *testing.T) {
}
}
continue
return
})
}
}
func Test_HandleHEXISTS(t *testing.T) {
tests := []struct {
name string
preset bool
key string
presetValue interface{}
@@ -1131,7 +1212,7 @@ func Test_HandleHEXISTS(t *testing.T) {
expectedError error
}{
{
// Return 1 if the field exists in the hash
name: "1. Return 1 if the field exists in the hash",
preset: true,
key: "HexistsKey1",
presetValue: map[string]interface{}{"field1": "value1", "field2": 123456789, "field3": 3.142},
@@ -1140,7 +1221,8 @@ func Test_HandleHEXISTS(t *testing.T) {
expectedValue: map[string]interface{}{},
expectedError: nil,
},
{ // 0 response when trying to call HEXISTS on non-existent key
{
name: "2. 0 response when trying to call HEXISTS on non-existent key",
preset: false,
key: "HexistsKey2",
presetValue: map[string]interface{}{},
@@ -1149,7 +1231,8 @@ func Test_HandleHEXISTS(t *testing.T) {
expectedValue: map[string]interface{}{},
expectedError: nil,
},
{ // Command too short
{
name: "3. Command too short",
preset: false,
key: "HexistsKey3",
presetValue: map[string]interface{}{},
@@ -1158,7 +1241,8 @@ func Test_HandleHEXISTS(t *testing.T) {
expectedValue: map[string]interface{}{},
expectedError: errors.New(constants.WrongArgsResponse),
},
{ // Command too long
{
name: "4. Command too long",
preset: false,
key: "HexistsKey4",
presetValue: map[string]interface{}{},
@@ -1167,7 +1251,8 @@ func Test_HandleHEXISTS(t *testing.T) {
expectedValue: map[string]interface{}{},
expectedError: errors.New(constants.WrongArgsResponse),
},
{ // Trying to get lengths on a non hash map returns error
{
name: "5. Trying to get lengths on a non hash map returns error",
preset: true,
key: "HexistsKey5",
presetValue: "Default value",
@@ -1179,6 +1264,7 @@ func Test_HandleHEXISTS(t *testing.T) {
}
for i, test := range tests {
t.Run(test.name, func(t *testing.T) {
ctx := context.WithValue(context.Background(), "test_name", fmt.Sprintf("HEXISTS, %d", i))
if test.preset {
@@ -1195,7 +1281,7 @@ func Test_HandleHEXISTS(t *testing.T) {
if err.Error() != test.expectedError.Error() {
t.Errorf("expected error \"%s\", got \"%s\"", test.expectedError.Error(), err.Error())
}
continue
return
}
rd := resp.NewReader(bytes.NewBuffer(res))
rv, _, err := rd.ReadValue()
@@ -1206,14 +1292,16 @@ func Test_HandleHEXISTS(t *testing.T) {
if rv.Integer() != expectedResponse {
t.Errorf("expected \"%d\", got \"%d\"", expectedResponse, rv.Integer())
}
continue
return
}
t.Error("expected integer response, got another type")
})
}
}
func Test_HandleHDEL(t *testing.T) {
tests := []struct {
name string
preset bool
key string
presetValue interface{}
@@ -1223,7 +1311,7 @@ func Test_HandleHDEL(t *testing.T) {
expectedError error
}{
{
// Return count of deleted fields in the specified hash
name: "1. Return count of deleted fields in the specified hash",
preset: true,
key: "HdelKey1",
presetValue: map[string]interface{}{"field1": "value1", "field2": 123456789, "field3": 3.142, "field7": "value7"},
@@ -1232,7 +1320,8 @@ func Test_HandleHDEL(t *testing.T) {
expectedValue: map[string]interface{}{"field1": nil, "field2": nil, "field3": nil, "field7": "value1"},
expectedError: nil,
},
{ // 0 response when passing delete fields that are non-existent on valid hash
{
name: "2. 0 response when passing delete fields that are non-existent on valid hash",
preset: true,
key: "HdelKey2",
presetValue: map[string]interface{}{"field1": "value1", "field2": "value2", "field3": "value3"},
@@ -1241,7 +1330,8 @@ func Test_HandleHDEL(t *testing.T) {
expectedValue: map[string]interface{}{"field1": "value1", "field2": "value2", "field3": "value3"},
expectedError: nil,
},
{ // 0 response when trying to call HDEL on non-existent key
{
name: "3. 0 response when trying to call HDEL on non-existent key",
preset: false,
key: "HdelKey3",
presetValue: map[string]interface{}{},
@@ -1250,7 +1340,8 @@ func Test_HandleHDEL(t *testing.T) {
expectedValue: map[string]interface{}{},
expectedError: nil,
},
{ // Command too short
{
name: "4. Command too short",
preset: false,
key: "HdelKey4",
presetValue: map[string]interface{}{},
@@ -1259,7 +1350,8 @@ func Test_HandleHDEL(t *testing.T) {
expectedValue: map[string]interface{}{},
expectedError: errors.New(constants.WrongArgsResponse),
},
{ // Trying to get lengths on a non hash map returns error
{
name: "5. Trying to get lengths on a non hash map returns error",
preset: true,
key: "HdelKey5",
presetValue: "Default value",
@@ -1271,6 +1363,7 @@ func Test_HandleHDEL(t *testing.T) {
}
for i, test := range tests {
t.Run(test.name, func(t *testing.T) {
ctx := context.WithValue(context.Background(), "test_name", fmt.Sprintf("HDEL, %d", i))
if test.preset {
@@ -1287,7 +1380,7 @@ func Test_HandleHDEL(t *testing.T) {
if err.Error() != test.expectedError.Error() {
t.Errorf("expected error \"%s\", got \"%s\"", test.expectedError.Error(), err.Error())
}
continue
return
}
rd := resp.NewReader(bytes.NewBuffer(res))
rv, _, err := rd.ReadValue()
@@ -1298,7 +1391,7 @@ func Test_HandleHDEL(t *testing.T) {
if rv.Integer() != expectedResponse {
t.Errorf("expected \"%d\", got \"%d\"", expectedResponse, rv.Integer())
}
continue
return
}
if _, err = mockServer.KeyRLock(ctx, test.key); err != nil {
t.Error(err)
@@ -1309,8 +1402,9 @@ func Test_HandleHDEL(t *testing.T) {
t.Errorf("expected value \"%+v\", got \"%+v\"", test.expectedValue[field], value)
}
}
continue
return
}
t.Error("expected hash value but got another type")
})
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff