Skip to content

Commit

Permalink
Added first test cases for init
Browse files Browse the repository at this point in the history
  • Loading branch information
pietercolpaert committed Feb 17, 2025
1 parent c48a5a8 commit d8cab23
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/Build-test-spec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build TREE discovery spec
on:
workflow_dispatch: {}
pull_request: {}
push:
branches: [master]
jobs:
main:
name: Build, Validate and Deploy
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: w3c/spec-prod@v2
with:
TOOLCHAIN: bikeshed

# Modify as appropriate
GH_PAGES_BRANCH: gh-pages

# if your doc isn’t in the root folder,
# or Bikeshed otherwise can’t find it:
SOURCE: 04-tests.bs

# output filename defaults to your input
# with .html extension instead,
# but if you want to customize it:
DESTINATION: tests.html
61 changes: 61 additions & 0 deletions 04-tests.bs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<pre class='metadata'>
Title: TREE client tests
Shortname: tests
Level: 1
Status: w3c/CG-DRAFT
Markup Shorthands: markdown yes
URL: https://w3id.org/tree/specification/tests
Repository: https://github.com/treecg/specification
Mailing List: public-treecg@w3.org
Mailing List Archives: https://lists.w3.org/Archives/Public/public-treecg/
Editor: Pieter Colpaert, https://pietercolpaert.be
Abstract:
A set of tests for testing compliance of clients to the TREE specification.
</pre>

# Tests # {#overview}

## 01. Initialization ## {#01}

This test is about a function `initialization(url)`. The function will return a the collection and the URL of the root node.

We’ll test this with various URLs containing different contents.

### 01.1 The URL to a rootnode without redirects ### {#01.1}

File url `test01.1.ttl`

```turtle
@prefix tree: <https://w3id.org/tree#> .
<Collection> tree:view <test01.1.ttl> .
```

Returns:
* Collection: <Collection>
* Root node: <test01.1.ttl>

### 01.2 The URL to a collection without redirects ### {#01.2}

File url `test01.2.ttl#collection`

```turtle
@prefix tree: <https://w3id.org/tree#> .
<test01.2.ttl#collection> tree:view <test01.2.ttl> .
```

Returns:
* Collection: <test01.2.ttl#collection>
* Root node: <test01.2.ttl>

### 01.3 The URL to a rootnode before redirects ### {#01.1}

File url `test01.3` should redirect to `test01.3.ttl`

```turtle
@prefix tree: <https://w3id.org/tree#> .
<Collection> tree:view <test01.3.ttl> .
```

Returns:
* Collection: <Collection>
* Root node: <test01.3.ttl>

0 comments on commit d8cab23

Please sign in to comment.