Skip to content

Commit

Permalink
Add default_path syntax tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kmturley committed Mar 31, 2024
1 parent cb7f9bc commit 21e71a7
Show file tree
Hide file tree
Showing 16 changed files with 642 additions and 0 deletions.
92 changes: 92 additions & 0 deletions test/syntax/default_path.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
"elements": [
{
"type": "element",
"name": "region",
"elements": [
{
"type": "element",
"name": "opcode",
"attributes": {
"name": "sample",
"value": "DefaultPath/SubPath1/sample1.wav"
}
}
]
},
{
"type": "element",
"name": "control",
"elements": [
{
"type": "element",
"name": "opcode",
"attributes": {
"name": "default_path",
"value": "DefaultPath\\SubPath2\\"
}
}
]
},
{
"type": "element",
"name": "region",
"elements": [
{
"type": "element",
"name": "opcode",
"attributes": {
"name": "sample",
"value": "sample2.wav"
}
}
]
},
{
"type": "element",
"name": "control",
"elements": [
{
"type": "element",
"name": "opcode",
"attributes": {
"name": "default_path",
"value": "DefaultPath/SubPath1/sample"
}
}
]
},
{
"type": "element",
"name": "region",
"elements": [
{
"type": "element",
"name": "opcode",
"attributes": {
"name": "sample",
"value": "1.wav"
}
}
]
},
{
"type": "element",
"name": "control"
},
{
"type": "element",
"name": "region",
"elements": [
{
"type": "element",
"name": "opcode",
"attributes": {
"name": "sample",
"value": "DefaultPath/SubPath2/sample2.wav"
}
}
]
}
]
}
10 changes: 10 additions & 0 deletions test/syntax/default_path.sfz
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<region> sample=DefaultPath/SubPath1/sample1.wav

<control> default_path=DefaultPath\SubPath2\
<region> sample=sample2.wav

<control> default_path=DefaultPath/SubPath1/sample
<region> sample=1.wav

<control> // New control headers reset the default path
<region> sample=DefaultPath/SubPath2/sample2.wav
20 changes: 20 additions & 0 deletions test/syntax/default_path.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0"?>
<region>
<opcode name="sample" value="DefaultPath/SubPath1/sample1.wav" />
</region>
<control>
<opcode name="default_path" value="DefaultPath\SubPath2\" />
</control>
<region>
<opcode name="sample" value="sample2.wav" />
</region>
<control>
<opcode name="default_path" value="DefaultPath/SubPath1/sample" />
</control>
<region>
<opcode name="sample" value="1.wav" />
</region>
<control />
<region>
<opcode name="sample" value="DefaultPath/SubPath2/sample2.wav" />
</region>
52 changes: 52 additions & 0 deletions test/syntax/default_path.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
elements:
- type: element
name: region
elements:
- type: element
name: opcode
attributes:
name: sample
value: DefaultPath/SubPath1/sample1.wav
- type: element
name: control
elements:
- type: element
name: opcode
attributes:
name: default_path
value: DefaultPath\SubPath2\
- type: element
name: region
elements:
- type: element
name: opcode
attributes:
name: sample
value: sample2.wav
- type: element
name: control
elements:
- type: element
name: opcode
attributes:
name: default_path
value: DefaultPath/SubPath1/sample
- type: element
name: region
elements:
- type: element
name: opcode
attributes:
name: sample
value: 1.wav
- type: element
name: control
- type: element
name: region
elements:
- type: element
name: opcode
attributes:
name: sample
value: DefaultPath/SubPath2/sample2.wav

32 changes: 32 additions & 0 deletions test/syntax/default_path_generator.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"elements": [
{
"type": "element",
"name": "control",
"elements": [
{
"type": "element",
"name": "opcode",
"attributes": {
"name": "default_path",
"value": "DefaultPath/SubPath1"
}
}
]
},
{
"type": "element",
"name": "region",
"elements": [
{
"type": "element",
"name": "opcode",
"attributes": {
"name": "sample",
"value": "*sine"
}
}
]
}
]
}
2 changes: 2 additions & 0 deletions test/syntax/default_path_generator.sfz
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<control> default_path=DefaultPath/SubPath1
<region> sample=*sine
7 changes: 7 additions & 0 deletions test/syntax/default_path_generator.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0"?>
<control>
<opcode name="default_path" value="DefaultPath/SubPath1" />
</control>
<region>
<opcode name="sample" value="*sine" />
</region>
18 changes: 18 additions & 0 deletions test/syntax/default_path_generator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
elements:
- type: element
name: control
elements:
- type: element
name: opcode
attributes:
name: default_path
value: DefaultPath/SubPath1
- type: element
name: region
elements:
- type: element
name: opcode
attributes:
name: sample
value: '*sine'

Loading

0 comments on commit 21e71a7

Please sign in to comment.