|
9 | 9 | import os |
10 | 10 | from libcachesim import ( |
11 | 11 | # Basic algorithms |
| 12 | + LHD, |
12 | 13 | LRU, |
13 | 14 | FIFO, |
14 | 15 | LFU, |
@@ -71,6 +72,7 @@ class TestCacheBasicFunctionality: |
71 | 72 | @pytest.mark.parametrize( |
72 | 73 | "cache_class", |
73 | 74 | [ |
| 75 | + LHD, |
74 | 76 | LRU, |
75 | 77 | FIFO, |
76 | 78 | LFU, |
@@ -109,10 +111,14 @@ def test_cache_initialization(self, cache_class): |
109 | 111 | pytest.skip(f"Cache {cache_class.__name__} failed to initialize: {e}") |
110 | 112 |
|
111 | 113 | @pytest.mark.parametrize( |
112 | | - "cache_class", [LRU, FIFO, LFU, ARC, Clock, Random, S3FIFO, Sieve, LIRS, TwoQ, SLRU, WTinyLFU] |
| 114 | + "cache_class", [LHD, LRU, FIFO, LFU, ARC, Clock, Random, S3FIFO, Sieve, LIRS, TwoQ, SLRU, WTinyLFU] |
113 | 115 | ) |
114 | 116 | def test_basic_get_and_insert(self, cache_class): |
115 | 117 | """Test basic get and insert operations""" |
| 118 | + if cache_class == LHD: |
| 119 | + pytest.skip("LHD's insert always returns None") |
| 120 | + |
| 121 | + |
116 | 122 | cache = cache_class(1024 * 1024) # 1MB cache |
117 | 123 |
|
118 | 124 | # Create a request |
@@ -141,6 +147,7 @@ def test_basic_get_and_insert(self, cache_class): |
141 | 147 | @pytest.mark.parametrize( |
142 | 148 | "cache_class", |
143 | 149 | [ |
| 150 | + LHD, |
144 | 151 | LRU, |
145 | 152 | FIFO, |
146 | 153 | LFU, |
@@ -192,6 +199,7 @@ def test_cache_eviction(self, cache_class): |
192 | 199 | @pytest.mark.parametrize( |
193 | 200 | "cache_class", |
194 | 201 | [ |
| 202 | + LHD, |
195 | 203 | LRU, |
196 | 204 | FIFO, |
197 | 205 | LFU, |
@@ -239,6 +247,7 @@ def test_cache_find_method(self, cache_class): |
239 | 247 | @pytest.mark.parametrize( |
240 | 248 | "cache_class", |
241 | 249 | [ |
| 250 | + LHD, |
242 | 251 | LRU, |
243 | 252 | FIFO, |
244 | 253 | LFU, |
|
0 commit comments