diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/store.scm | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/store.scm b/tests/store.scm index 87773bf0c36..e7ba7469047 100644 --- a/tests/store.scm +++ b/tests/store.scm | |||
| @@ -78,6 +78,30 @@ | |||
| 78 | (open-connection #f #:port port) | 78 | (open-connection #f #:port port) |
| 79 | 'broken))) | 79 | 'broken))) |
| 80 | 80 | ||
| 81 | (test-assert "valid-path-syntax?" | ||
| 82 | (valid-path-syntax? (string-append (%store-prefix) | ||
| 83 | "/yp8mg1rwaw3y1p09bc8dx4l6rx4qx961-coreutils-9.1"))) | ||
| 84 | |||
| 85 | (test-assert "valid-path-syntax? truncated hash" | ||
| 86 | (not (valid-path-syntax? | ||
| 87 | (string-append (%store-prefix) | ||
| 88 | "/p8mg1rwaw3y1p09bc8dx4l6rx4qx961-coreutils-9.1")))) | ||
| 89 | |||
| 90 | (test-assert "valid-path-syntax? slash" | ||
| 91 | (not (valid-path-syntax? | ||
| 92 | (string-append (%store-prefix) | ||
| 93 | "/yp8mg1rwaw3y1p09bc8dx4l6rx4qx961-coreutils-9.1/../../../etc/passwd")))) | ||
| 94 | |||
| 95 | (test-assert "valid-path-syntax? leading dot" | ||
| 96 | (not (valid-path-syntax? (string-append (%store-prefix) | ||
| 97 | "/yp8mg1rwaw3y1p09bc8dx4l6rx4qx961-.leading-dot")))) | ||
| 98 | |||
| 99 | (test-assert "valid-path-syntax? prefix" | ||
| 100 | (not (valid-path-syntax? (%store-prefix)))) | ||
| 101 | |||
| 102 | (test-assert "valid-path-syntax? truncated" | ||
| 103 | (not (valid-path-syntax? (string-append (%store-prefix) "/aaaaaaaaaaa")))) | ||
| 104 | |||
| 81 | (test-equal "store-path-hash-part" | 105 | (test-equal "store-path-hash-part" |
| 82 | "283gqy39v3g9dxjy26rynl0zls82fmcg" | 106 | "283gqy39v3g9dxjy26rynl0zls82fmcg" |
| 83 | (store-path-hash-part | 107 | (store-path-hash-part |
