mirror of
https://github.com/cupcakearmy/markdown-it-import.git
synced 2025-09-05 17:30:39 +00:00
add tests
This commit is contained in:
25
tests/fixtures/bubble-sort.go
vendored
Normal file
25
tests/fixtures/bubble-sort.go
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
sample := []int{3, 4, 5, 2, 1}
|
||||
bubbleSort(sample)
|
||||
sample = []int{3, 4, 5, 2, 1, 7, 8, -1, -3}
|
||||
bubbleSort(sample)
|
||||
}
|
||||
|
||||
func bubbleSort(arr []int) {
|
||||
len := len(arr)
|
||||
for i := 0; i < len-1; i++ {
|
||||
for j := 0; j < len-i-1; j++ {
|
||||
if arr[j] > arr[j+1] {
|
||||
arr[j], arr[j+1] = arr[j+1], arr[j]
|
||||
}
|
||||
}
|
||||
}
|
||||
fmt.Println("\nAfter Bubble Sorting")
|
||||
for _, val := range arr {
|
||||
fmt.Println(val)
|
||||
}
|
||||
}
|
3
tests/fixtures/cycle-a.md
vendored
Normal file
3
tests/fixtures/cycle-a.md
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# This should be impossible
|
||||
|
||||
@import(tests/fixtures/cycle-b.md)
|
3
tests/fixtures/cycle-b.md
vendored
Normal file
3
tests/fixtures/cycle-b.md
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# This should be impossible
|
||||
|
||||
@import(tests/fixtures/cycle-a.md)
|
1
tests/fixtures/matcher-a.md
vendored
Normal file
1
tests/fixtures/matcher-a.md
vendored
Normal file
@@ -0,0 +1 @@
|
||||
foo 'tests/fixtures/quote.txt'
|
1
tests/fixtures/matcher-b.md
vendored
Normal file
1
tests/fixtures/matcher-b.md
vendored
Normal file
@@ -0,0 +1 @@
|
||||
$tests/fixtures/quote.txt$
|
7
tests/fixtures/multiple.md
vendored
Normal file
7
tests/fixtures/multiple.md
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
Here is a typescript snippet
|
||||
|
||||
```ts
|
||||
@import(tests/fixtures/sum.ts)
|
||||
```
|
||||
|
||||
> @import(tests/fixtures/quote.txt)
|
3
tests/fixtures/notFound.md
vendored
Normal file
3
tests/fixtures/notFound.md
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# This needs to fail
|
||||
|
||||
@import(some/path/to/nirvana.md)
|
5
tests/fixtures/partial.md
vendored
Normal file
5
tests/fixtures/partial.md
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
# Bubble sort in go
|
||||
|
||||
```go
|
||||
@import(tests/fixtures/bubble-sort.go)[12-25]
|
||||
```
|
1
tests/fixtures/quote.txt
vendored
Normal file
1
tests/fixtures/quote.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
This is some amazing quote
|
3
tests/fixtures/rec-a.md
vendored
Normal file
3
tests/fixtures/rec-a.md
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# I am gonna import different stuff
|
||||
|
||||
@import(tests/fixtures/rec-b.md)
|
7
tests/fixtures/rec-b.md
vendored
Normal file
7
tests/fixtures/rec-b.md
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
## Here is a typescript snippet
|
||||
|
||||
> @import(tests/fixtures/rec-c.txt)
|
||||
|
||||
```ts
|
||||
@import(tests/fixtures/sum.ts)
|
||||
```
|
1
tests/fixtures/rec-c.txt
vendored
Normal file
1
tests/fixtures/rec-c.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
TypeScript is a strongly typed programming language that builds on JavaScript, giving you better tooling at any scale.
|
5
tests/fixtures/relative.md
vendored
Normal file
5
tests/fixtures/relative.md
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
Here is a typescript snippet
|
||||
|
||||
```ts
|
||||
@import(sum.ts)
|
||||
```
|
3
tests/fixtures/self-reference.md
vendored
Normal file
3
tests/fixtures/self-reference.md
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# This should be impossible
|
||||
|
||||
@import(tests/fixtures/self-reference.md)
|
11
tests/fixtures/simple.md
vendored
Normal file
11
tests/fixtures/simple.md
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
# Some title
|
||||
|
||||
- Some
|
||||
- List
|
||||
- Three
|
||||
|
||||
> Some note
|
||||
|
||||
| Column A | Column B | Column C |
|
||||
| -------- | -------- | -------- |
|
||||
| Some | `stuff` | |
|
3
tests/fixtures/sum.ts
vendored
Normal file
3
tests/fixtures/sum.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export function sum(a: number, b: number): number {
|
||||
return a + b
|
||||
}
|
5
tests/fixtures/whole.md
vendored
Normal file
5
tests/fixtures/whole.md
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
Here is a typescript snippet
|
||||
|
||||
```ts
|
||||
@import(tests/fixtures/sum.ts)
|
||||
```
|
Reference in New Issue
Block a user