📄 tmap.in
字号:
# CreateElement <index># ClearElements# GetCount <expected count># IsEmpty <0 = not empty, 1 = empty># Lookup <index> <0 = lookup failed, 1 = lookup success># SetAt <index># RemoveKey <index> <0 = remove failed, 1 = remove success># RemoveAll# Note: Rhs[] represents using the [] operator on the right hand side# of an expression. For example: value = map[key];# Rhs[] <index> <0 = item not in map, 1 = item in map># Note: Lhs[] represents using the [] operator on the left hand side# of an expression. For example: map[key] = value# Lhs[] <index># Note: IsNull should only be used on keys that are in the map.# It is intended to test the case where Rhs[] inserts a value# into the map when it is not already present# IsNull <index> <0 = map value is not null, 1 = map value is null># RunMapSpecificTests# Check initial conditionsIsEmpty 1GetCount 0# Add an element to the mapCreateElement 0Lookup 0 0SetAt 0GetCount 1IsEmpty 0IsNull 0 0Lookup 0 1RemoveKey 0 1GetCount 0IsEmpty 1Lookup 0 0RemoveKey 0 0# Add the same element multiple timesSetAt 0GetCount 1SetAt 0GetCount 1RemoveKey 0 1RemoveKey 0 0# Add multiple elementsCreateElement 1CreateElement 2SetAt 0SetAt 1GetCount 2SetAt 2GetCount 3Lookup 0 1Lookup 1 1Lookup 2 1RemoveKey 2 1Lookup 0 1Lookup 1 1Lookup 2 0RemoveKey 0 1Lookup 0 0Lookup 1 1Lookup 2 0GetCount 1RemoveKey 1 1Lookup 0 0Lookup 1 0Lookup 2 0GetCount 0IsEmpty 1# Test RemoveAllSetAt 0SetAt 1SetAt 2GetCount 3RemoveAllGetCount 0IsEmpty 1Lookup 0 0Lookup 1 0Lookup 2 0# Test Rhs[]GetCount 0# Note: The key value pair for index 0 is not in the map so a null# value is inserted into the map with the key associated with index 0# This will cause Lookup tests to fail since the value in the map# does not match the value in our key value storeGetCount 0Rhs[] 0 0IsNull 0 1GetCount 1RemoveKey 0 1GetCount 0SetAt 0Rhs[] 0 1Lookup 0 1RemoveKey 0 1# Test Lhs[]GetCount 0Lhs[] 2GetCount 1Lookup 2 1RemoveKey 2 1GetCount 0RunMapSpecificTests
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -