File: label_get_info.vader

package info (click to toggle)
vim-link-vim 2.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 524 kB
  • sloc: python: 66; makefile: 30
file content (82 lines) | stat: -rw-r--r-- 2,737 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
Given markdown (Last line contains label; cursor at top/bottom):
  # A consectetuer nunc justo ac nisl.

  Praesent semper magna. In eu justo. Nunc vitae risus nec
  sem scelerisque consequat. In hac habitasse platea dictumst. Nam posuere

  ## Links

  [2]: http://www.loremipsumdolorsitamet.com
  [3]: http://www.ipsumloremconsecteturadipiscing.com
  [4]: http://www.dolorsitametconsecteturadipiscingelit.com
  [5]: http://www.adipiscingelitipsumdolorsitamet.com
Execute:
  call cursor(1, 1)
  let actual = linkvim#x#label#get_info()
  AssertEqual 2, actual.first.id
  AssertEqual 8, actual.first.lnum
  AssertEqual 5, actual.last.id
  AssertEqual 11, actual.last.lnum

  call cursor('$', 99)
  let actual = linkvim#x#label#get_info()
  AssertEqual 2, actual.first.id
  AssertEqual 8, actual.first.lnum
  AssertEqual 5, actual.last.id
  AssertEqual 11, actual.last.lnum

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Given markdown (Last line does not contain label; cursor at top/bottom):
  # A consectetuer nunc justo ac nisl.
  
  Praesent semper magna. In eu justo. Nunc vitae risus nec
  sem scelerisque consequat. In hac habitasse platea dictumst. Nam posuere
  
  ## Links
  
  [2]: http://www.loremipsumdolorsitamet.com
  [3]: http://www.ipsumloremconsecteturadipiscing.com
  [4]: http://www.dolorsitametconsecteturadipiscingelit.com
  [5]: http://www.adipiscingelitipsumdolorsitamet.com
  
  Cum sociis natoque penatibus et magnis dis parturient montes,
  nascetur ridiculus mus.
Execute:
  call cursor(1, 1)
  let actual = linkvim#x#label#get_info()
  AssertEqual 2, actual.first.id
  AssertEqual 8, actual.first.lnum
  AssertEqual 5, actual.last.id
  AssertEqual 11, actual.last.lnum

  call cursor('$', 99)
  let actual = linkvim#x#label#get_info()
  AssertEqual 2, actual.first.id
  AssertEqual 8, actual.first.lnum
  AssertEqual 5, actual.last.id
  AssertEqual 11, actual.last.lnum

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Given markdown (No labels; cursor at top/bottom):
  # A consectetuer nunc justo ac nisl.
  
  Praesent semper magna. In eu justo. Nunc vitae risus nec
  sem scelerisque consequat. In hac habitasse platea dictumst. Nam posuere
Execute:
  call cursor(1, 1)
  let actual = linkvim#x#label#get_info()
  AssertEqual -1, actual.first.id
  AssertEqual -1, actual.first.lnum
  AssertEqual -1, actual.last.id
  AssertEqual -1, actual.last.lnum

  call cursor('$', 99)
  let actual = linkvim#x#label#get_info()
  AssertEqual -1, actual.first.id
  AssertEqual -1, actual.first.lnum
  AssertEqual -1, actual.last.id
  AssertEqual -1, actual.last.lnum

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~