Skip to content

Commit

Permalink
Merge pull request #259 from yast/mvidner-test
Browse files Browse the repository at this point in the history
Fix Jenkins build "Error opening terminal: unknown"
  • Loading branch information
mvidner committed Nov 3, 2020
2 parents 8ce9a23 + 855e1d3 commit 1d8aa2f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tests/builtins_regexps_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ def regexpsub(input, pattern, output)

describe ".regexptokenize" do
it "works as expected" do
expect(Yast::Builtins.regexptokenize("aaabbBb", "(.*[A-Z]).*")).to eq(["aaabbB"])
expect(Yast::Builtins.regexptokenize("aaabb7b", "(.*[0-9]).*")).to eq(["aaabb7"])
expect(Yast::Builtins.regexptokenize("aaabbb", "(.*ab)(.*)")).to eq(["aaab", "bb"])
expect(Yast::Builtins.regexptokenize("aaabbb", "(.*ba).*")).to eq([])
expect(Yast::Builtins.regexptokenize("aaabbb", "(.*ba).*(")).to eq(nil)

# the result must be UTF-8 string
expect(Yast::Builtins.regexptokenize("aaabbBb", "(.*[A-Z]).*").first.encoding).to eq(Encoding::UTF_8)
expect(Yast::Builtins.regexptokenize("aaabb7b", "(.*[0-9]).*").first.encoding).to eq(Encoding::UTF_8)
end
end
end
4 changes: 3 additions & 1 deletion tests/integration/run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ def cleanup
test = File.dirname(__FILE__) + "/std_streams_spec.rb"
cmd = "rspec #{test} >#{OUTPUT} 2>&1"

`tmux -c '#{cmd}; echo \$? > #{RESULT}'`
tmux_out = `TERM=screen tmux -c '#{cmd}; echo \$? > #{RESULT}'`
puts "Outside tmux output:"
puts tmux_out
if File.exist?(RESULT) && File.read(RESULT) == "0\n"
puts "Test succeeded."
cleanup
Expand Down
6 changes: 4 additions & 2 deletions tests/integration/std_streams_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
require_relative "../test_helper"
require "yast/ui_shortcuts"

Yast.import "UI"

def std_puts(message)
$stdout.puts "stdout: #{message}"
$stderr.puts "stderr: #{message}"
end

std_puts "tty before importing UI"
std_puts "TERM=#{ENV['TERM']}"
Yast.import "UI"

# Regression test for the fix of bnc#943757 implemented
# in libyui-ncurses 2.47.3
describe "streams redirection in libyui-ncurses" do
Expand Down

0 comments on commit 1d8aa2f

Please sign in to comment.