Skip to content
This repository was archived by the owner on Jan 20, 2025. It is now read-only.

Commit 65655bf

Browse files
Tests: added file descriptor to heredocs test for clarity and to test its functionality
1 parent fb2a5d9 commit 65655bf

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

parse_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func TestParseFile(t *testing.T) {
118118
}
119119

120120
func TestParseReaderHeredocs(t *testing.T) {
121-
dockerfile := `RUN <<EOF
121+
dockerfile := `RUN 3<<EOF
122122
source $HOME/.bashrc && echo $HOME
123123
echo "Hello" >> /hello
124124
echo "World!" >> /hello
@@ -137,7 +137,7 @@ EOF
137137
Heredocs: []Heredoc{
138138
Heredoc{
139139
Name: "EOF",
140-
FileDescriptor: 0,
140+
FileDescriptor: 3,
141141
Content: "source $HOME/.bashrc && echo $HOME\necho \"Hello\" >> /hello\necho \"World!\" >> /hello\n"},
142142
},
143143
},

tests/dockerfile_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def test_parse_file_success():
115115

116116
def test_heredoc_string_success():
117117
test_string = (
118-
'RUN <<EOF\n'
118+
'RUN 3<<EOF\n'
119119
'source $HOME/.bashrc && echo $HOME\n'
120120
'echo "Hello" >> /hello\n'
121121
'echo "World!" >> /hello\n'
@@ -137,7 +137,7 @@ def test_heredoc_string_success():
137137
content='source $HOME/.bashrc && echo $HOME\n'
138138
'echo "Hello" >> /hello\n'
139139
'echo "World!" >> /hello\n',
140-
file_descriptor=0,
140+
file_descriptor=3,
141141
),
142142
),
143143
),

0 commit comments

Comments
 (0)