add tests

This commit is contained in:
2023-11-16 15:13:19 +01:00
parent b11f94a647
commit 47627ed330
26 changed files with 304 additions and 4 deletions
+25
View 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
View File
@@ -0,0 +1,3 @@
# This should be impossible
@import(tests/fixtures/cycle-b.md)
+3
View File
@@ -0,0 +1,3 @@
# This should be impossible
@import(tests/fixtures/cycle-a.md)
+1
View File
@@ -0,0 +1 @@
foo 'tests/fixtures/quote.txt'
+1
View File
@@ -0,0 +1 @@
$tests/fixtures/quote.txt$
+7
View File
@@ -0,0 +1,7 @@
Here is a typescript snippet
```ts
@import(tests/fixtures/sum.ts)
```
> @import(tests/fixtures/quote.txt)
+3
View File
@@ -0,0 +1,3 @@
# This needs to fail
@import(some/path/to/nirvana.md)
+5
View File
@@ -0,0 +1,5 @@
# Bubble sort in go
```go
@import(tests/fixtures/bubble-sort.go)[12-25]
```
+1
View File
@@ -0,0 +1 @@
This is some amazing quote
+3
View File
@@ -0,0 +1,3 @@
# I am gonna import different stuff
@import(tests/fixtures/rec-b.md)
+7
View File
@@ -0,0 +1,7 @@
## Here is a typescript snippet
> @import(tests/fixtures/rec-c.txt)
```ts
@import(tests/fixtures/sum.ts)
```
+1
View File
@@ -0,0 +1 @@
TypeScript is a strongly typed programming language that builds on JavaScript, giving you better tooling at any scale.
+5
View File
@@ -0,0 +1,5 @@
Here is a typescript snippet
```ts
@import(sum.ts)
```
+3
View File
@@ -0,0 +1,3 @@
# This should be impossible
@import(tests/fixtures/self-reference.md)
+11
View File
@@ -0,0 +1,11 @@
# Some title
- Some
- List
- Three
> Some note
| Column A | Column B | Column C |
| -------- | -------- | -------- |
| Some | `stuff` | |
+3
View File
@@ -0,0 +1,3 @@
export function sum(a: number, b: number): number {
return a + b
}
+5
View File
@@ -0,0 +1,5 @@
Here is a typescript snippet
```ts
@import(tests/fixtures/sum.ts)
```