Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added precision argument to print and show functions #148

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed print tests
  • Loading branch information
jacobhuesman committed Aug 31, 2018
commit 1cb783f6d406ccd370d672f37e4aaf66abcdbe2f
57 changes: 45 additions & 12 deletions test/test_transferfunction.jl
Original file line number Diff line number Diff line change
@@ -76,19 +76,52 @@ tf(vecarray(1, 2, [0], [0]), vecarray(1, 2, [1], [1]), 0.005)
@test size(C_222[1,[]]) == (1,0)

# Printing
res = ("TransferFunction:\nInput 1 to Output 1\ns^2 + 2.0s + 3.0\n-----------"*
"------\ns^2 + 8.0s + 15.0\n\nInput 1 to Output 2\ns^2 + 2.0s + 3.0\n-"*
"----------------\ns^2 + 8.0s + 15.0\n\nInput 2 to Output 1\n s + "*
"2.0\n-----------------\ns^2 + 8.0s + 15.0\n\nInput 2 to Output 2\n "*
" s + 2.0\n-----------------\ns^2 + 8.0s + 15.0\n\nContinuous-time"*
" transfer function model")
res = ("TransferFunction:\n"*
"Input 1 to Output 1\n"*
"s^2 + 2*s + 3\n"*
"--------------\n"*
"s^2 + 8*s + 15\n"*
"\n"*
"Input 1 to Output 2\n"*
"s^2 + 2*s + 3\n"*
"--------------\n"*
"s^2 + 8*s + 15\n"*
"\n"*
"Input 2 to Output 1\n"*
" s + 2\n"*
"--------------\n"*
"s^2 + 8*s + 15\n"*
"\n"*
"Input 2 to Output 2\n"*
" s + 2\n"*
"--------------\n"*
"s^2 + 8*s + 15\n"*
"\n"*
"Continuous-time transfer function model")
@test sprint(show, C_222) == res
res = ("TransferFunction:\nInput 1 to Output 1\nz^2 + 2.0z + 3.0\n-----------"*
"------\nz^2 - 0.2z - 0.15\n\nInput 1 to Output 2\nz^2 + 2.0z + 3.0\n-"*
"----------------\nz^2 - 0.2z - 0.15\n\nInput 2 to Output 1\n z + "*
"2.0\n-----------------\nz^2 - 0.2z - 0.15\n\nInput 2 to Output 2\n "*
" z + 2.0\n-----------------\nz^2 - 0.2z - 0.15\n\nSample Time: 0.005 "*
"(seconds)\nDiscrete-time transfer function model")
res = ("TransferFunction:\n"*
"Input 1 to Output 1\n"*
" z^2 + 2*z + 3\n"*
"------------------\n"*
"z^2 - 0.2*z - 0.15\n"*
"\n"*
"Input 1 to Output 2\n"*
" z^2 + 2*z + 3\n"*
"------------------\n"*
"z^2 - 0.2*z - 0.15\n"*
"\n"*
"Input 2 to Output 1\n"*
" z + 2\n"*
"------------------\n"*
"z^2 - 0.2*z - 0.15\n"*
"\n"*
"Input 2 to Output 2\n"*
" z + 2\n"*
"------------------\n"*
"z^2 - 0.2*z - 0.15\n"*
"\n"*
"Sample Time: 0.005 (seconds)\n"*
"Discrete-time transfer function model")
@test sprint(show, D_222) == res

# Type stability Continuous-time