Show More
@@ -225,6 +225,7 b' test-largefiles-small-disk.t' | |||
|
225 | 225 | test-largefiles-update.t |
|
226 | 226 | test-largefiles.t |
|
227 | 227 | test-lfs-largefiles.t |
|
228 | test-lfs-pointer.py | |
|
228 | 229 | test-linerange.py |
|
229 | 230 | test-locate.t |
|
230 | 231 | test-lock-badness.t |
@@ -6,6 +6,10 b' import sys' | |||
|
6 | 6 | # make it runnable using python directly without run-tests.py |
|
7 | 7 | sys.path[0:0] = [os.path.join(os.path.dirname(__file__), '..')] |
|
8 | 8 | |
|
9 | # Import something from Mercurial, so the module loader gets initialized. | |
|
10 | from mercurial import pycompat | |
|
11 | del pycompat # unused for now | |
|
12 | ||
|
9 | 13 | from hgext.lfs import pointer |
|
10 | 14 | |
|
11 | 15 | def tryparse(text): |
@@ -14,28 +18,28 b' def tryparse(text):' | |||
|
14 | 18 | r = pointer.deserialize(text) |
|
15 | 19 | print('ok') |
|
16 | 20 | except Exception as ex: |
|
17 | print(ex) | |
|
21 | print((b'%s' % ex).decode('ascii')) | |
|
18 | 22 | if r: |
|
19 | 23 | text2 = r.serialize() |
|
20 | 24 | if text2 != text: |
|
21 | 25 | print('reconstructed text differs') |
|
22 | 26 | return r |
|
23 | 27 | |
|
24 | t = ('version https://git-lfs.github.com/spec/v1\n' | |
|
25 | 'oid sha256:4d7a214614ab2935c943f9e0ff69d22eadbb8f32b1' | |
|
26 | '258daaa5e2ca24d17e2393\n' | |
|
27 | 'size 12345\n' | |
|
28 | 'x-foo extra-information\n') | |
|
28 | t = (b'version https://git-lfs.github.com/spec/v1\n' | |
|
29 | b'oid sha256:4d7a214614ab2935c943f9e0ff69d22eadbb8f32b1' | |
|
30 | b'258daaa5e2ca24d17e2393\n' | |
|
31 | b'size 12345\n' | |
|
32 | b'x-foo extra-information\n') | |
|
29 | 33 | |
|
30 | tryparse('') | |
|
34 | tryparse(b'') | |
|
31 | 35 | tryparse(t) |
|
32 | tryparse(t.replace('git-lfs', 'unknown')) | |
|
33 | tryparse(t.replace('v1\n', 'v1\n\n')) | |
|
34 | tryparse(t.replace('sha256', 'ahs256')) | |
|
35 | tryparse(t.replace('sha256:', '')) | |
|
36 | tryparse(t.replace('12345', '0x12345')) | |
|
37 | tryparse(t.replace('extra-information', 'extra\0information')) | |
|
38 | tryparse(t.replace('extra-information', 'extra\ninformation')) | |
|
39 | tryparse(t.replace('x-foo', 'x_foo')) | |
|
40 | tryparse(t.replace('oid', 'blobid')) | |
|
41 | tryparse(t.replace('size', 'size-bytes').replace('oid', 'object-id')) | |
|
36 | tryparse(t.replace(b'git-lfs', b'unknown')) | |
|
37 | tryparse(t.replace(b'v1\n', b'v1\n\n')) | |
|
38 | tryparse(t.replace(b'sha256', b'ahs256')) | |
|
39 | tryparse(t.replace(b'sha256:', b'')) | |
|
40 | tryparse(t.replace(b'12345', b'0x12345')) | |
|
41 | tryparse(t.replace(b'extra-information', b'extra\0information')) | |
|
42 | tryparse(t.replace(b'extra-information', b'extra\ninformation')) | |
|
43 | tryparse(t.replace(b'x-foo', b'x_foo')) | |
|
44 | tryparse(t.replace(b'oid', b'blobid')) | |
|
45 | tryparse(t.replace(b'size', b'size-bytes').replace(b'oid', b'object-id')) |
General Comments 0
You need to be logged in to leave comments.
Login now