Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

issue-41.spec.js 8.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. const { default: getParser } = require('../../lib/parser/index.cjs');
  2. test('quoted name', () => {
  3. const parsed = getParser()(`
  4. /**
  5. * @section "Brand Colors" - Here you can find all the brand colors...
  6. */`);
  7. expect(parsed).toEqual([
  8. {
  9. description: '',
  10. tags: [
  11. {
  12. tag: 'section',
  13. name: 'Brand Colors',
  14. type: '',
  15. optional: false,
  16. description: '- Here you can find all the brand colors...',
  17. problems: [],
  18. source: [
  19. {
  20. number: 2,
  21. source:
  22. ' * @section "Brand Colors" - Here you can find all the brand colors...',
  23. tokens: {
  24. start: ' ',
  25. delimiter: '*',
  26. postDelimiter: ' ',
  27. tag: '@section',
  28. postTag: ' ',
  29. name: '"Brand Colors"',
  30. postName: ' ',
  31. type: '',
  32. postType: '',
  33. description: '- Here you can find all the brand colors...',
  34. end: '',
  35. lineEnd: '',
  36. },
  37. },
  38. {
  39. number: 3,
  40. source: ' */',
  41. tokens: {
  42. start: ' ',
  43. delimiter: '',
  44. postDelimiter: '',
  45. tag: '',
  46. postTag: '',
  47. name: '',
  48. postName: '',
  49. type: '',
  50. postType: '',
  51. description: '',
  52. end: '*/',
  53. lineEnd: '',
  54. },
  55. },
  56. ],
  57. },
  58. ],
  59. source: [
  60. {
  61. number: 1,
  62. source: ' /**',
  63. tokens: {
  64. start: ' ',
  65. delimiter: '/**',
  66. postDelimiter: '',
  67. tag: '',
  68. postTag: '',
  69. name: '',
  70. postName: '',
  71. type: '',
  72. postType: '',
  73. description: '',
  74. end: '',
  75. lineEnd: '',
  76. },
  77. },
  78. {
  79. number: 2,
  80. source:
  81. ' * @section "Brand Colors" - Here you can find all the brand colors...',
  82. tokens: {
  83. start: ' ',
  84. delimiter: '*',
  85. postDelimiter: ' ',
  86. tag: '@section',
  87. postTag: ' ',
  88. name: '"Brand Colors"',
  89. postName: ' ',
  90. type: '',
  91. postType: '',
  92. description: '- Here you can find all the brand colors...',
  93. end: '',
  94. lineEnd: '',
  95. },
  96. },
  97. {
  98. number: 3,
  99. source: ' */',
  100. tokens: {
  101. start: ' ',
  102. delimiter: '',
  103. postDelimiter: '',
  104. tag: '',
  105. postTag: '',
  106. name: '',
  107. postName: '',
  108. type: '',
  109. postType: '',
  110. description: '',
  111. end: '*/',
  112. lineEnd: '',
  113. },
  114. },
  115. ],
  116. problems: [],
  117. },
  118. ]);
  119. });
  120. test('optional name', () => {
  121. const parsed = getParser()(`
  122. /**
  123. * @section [Brand Colors] - Here you can find all the brand colors...
  124. */`);
  125. expect(parsed).toEqual([
  126. {
  127. description: '',
  128. tags: [
  129. {
  130. tag: 'section',
  131. name: 'Brand Colors',
  132. type: '',
  133. optional: true,
  134. description: '- Here you can find all the brand colors...',
  135. problems: [],
  136. source: [
  137. {
  138. number: 2,
  139. source:
  140. ' * @section [Brand Colors] - Here you can find all the brand colors...',
  141. tokens: {
  142. start: ' ',
  143. delimiter: '*',
  144. postDelimiter: ' ',
  145. tag: '@section',
  146. postTag: ' ',
  147. name: '[Brand Colors]',
  148. postName: ' ',
  149. type: '',
  150. postType: '',
  151. description: '- Here you can find all the brand colors...',
  152. end: '',
  153. lineEnd: '',
  154. },
  155. },
  156. {
  157. number: 3,
  158. source: ' */',
  159. tokens: {
  160. start: ' ',
  161. delimiter: '',
  162. postDelimiter: '',
  163. tag: '',
  164. postTag: '',
  165. name: '',
  166. postName: '',
  167. type: '',
  168. postType: '',
  169. description: '',
  170. end: '*/',
  171. lineEnd: '',
  172. },
  173. },
  174. ],
  175. },
  176. ],
  177. source: [
  178. {
  179. number: 1,
  180. source: ' /**',
  181. tokens: {
  182. start: ' ',
  183. delimiter: '/**',
  184. postDelimiter: '',
  185. tag: '',
  186. postTag: '',
  187. name: '',
  188. postName: '',
  189. type: '',
  190. postType: '',
  191. description: '',
  192. end: '',
  193. lineEnd: '',
  194. },
  195. },
  196. {
  197. number: 2,
  198. source:
  199. ' * @section [Brand Colors] - Here you can find all the brand colors...',
  200. tokens: {
  201. start: ' ',
  202. delimiter: '*',
  203. postDelimiter: ' ',
  204. tag: '@section',
  205. postTag: ' ',
  206. name: '[Brand Colors]',
  207. postName: ' ',
  208. type: '',
  209. postType: '',
  210. description: '- Here you can find all the brand colors...',
  211. end: '',
  212. lineEnd: '',
  213. },
  214. },
  215. {
  216. number: 3,
  217. source: ' */',
  218. tokens: {
  219. start: ' ',
  220. delimiter: '',
  221. postDelimiter: '',
  222. tag: '',
  223. postTag: '',
  224. name: '',
  225. postName: '',
  226. type: '',
  227. postType: '',
  228. description: '',
  229. end: '*/',
  230. lineEnd: '',
  231. },
  232. },
  233. ],
  234. problems: [],
  235. },
  236. ]);
  237. });
  238. test('inconsistent quotes', () => {
  239. const parsed = getParser()(`
  240. /**
  241. * @section "Brand Colors - Here you can find all the brand colors...
  242. */`);
  243. expect(parsed).toEqual([
  244. {
  245. description: '',
  246. tags: [
  247. {
  248. tag: 'section',
  249. name: '"Brand',
  250. type: '',
  251. optional: false,
  252. description: 'Colors - Here you can find all the brand colors...',
  253. problems: [],
  254. source: [
  255. {
  256. number: 2,
  257. source:
  258. ' * @section "Brand Colors - Here you can find all the brand colors...',
  259. tokens: {
  260. start: ' ',
  261. delimiter: '*',
  262. postDelimiter: ' ',
  263. tag: '@section',
  264. postTag: ' ',
  265. name: '"Brand',
  266. postName: ' ',
  267. type: '',
  268. postType: '',
  269. description:
  270. 'Colors - Here you can find all the brand colors...',
  271. end: '',
  272. lineEnd: '',
  273. },
  274. },
  275. {
  276. number: 3,
  277. source: ' */',
  278. tokens: {
  279. start: ' ',
  280. delimiter: '',
  281. postDelimiter: '',
  282. tag: '',
  283. postTag: '',
  284. name: '',
  285. postName: '',
  286. type: '',
  287. postType: '',
  288. description: '',
  289. end: '*/',
  290. lineEnd: '',
  291. },
  292. },
  293. ],
  294. },
  295. ],
  296. source: [
  297. {
  298. number: 1,
  299. source: ' /**',
  300. tokens: {
  301. start: ' ',
  302. delimiter: '/**',
  303. postDelimiter: '',
  304. tag: '',
  305. postTag: '',
  306. name: '',
  307. postName: '',
  308. type: '',
  309. postType: '',
  310. description: '',
  311. end: '',
  312. lineEnd: '',
  313. },
  314. },
  315. {
  316. number: 2,
  317. source:
  318. ' * @section "Brand Colors - Here you can find all the brand colors...',
  319. tokens: {
  320. start: ' ',
  321. delimiter: '*',
  322. postDelimiter: ' ',
  323. tag: '@section',
  324. postTag: ' ',
  325. name: '"Brand',
  326. postName: ' ',
  327. type: '',
  328. postType: '',
  329. description: 'Colors - Here you can find all the brand colors...',
  330. end: '',
  331. lineEnd: '',
  332. },
  333. },
  334. {
  335. number: 3,
  336. source: ' */',
  337. tokens: {
  338. start: ' ',
  339. delimiter: '',
  340. postDelimiter: '',
  341. tag: '',
  342. postTag: '',
  343. name: '',
  344. postName: '',
  345. type: '',
  346. postType: '',
  347. description: '',
  348. end: '*/',
  349. lineEnd: '',
  350. },
  351. },
  352. ],
  353. problems: [],
  354. },
  355. ]);
  356. });