-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for result validation; Error in usage example (#8)
* move menu test to seperate file, not included in runtest Menu tests don't work, since request() form REPL.TerminalMenus is called in a script. Also, stdin is type IOStream in the script and has no field buffer. In REPL stdin is Base.TTY. * Fix schema and records Adding meas_level and curc_id keys to the ExpResult schema.
- Loading branch information
Showing
7 changed files
with
386 additions
and
263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
using REPL.TerminalMenus | ||
const CR = "\r" | ||
const LF = "\n" | ||
const UP = "\eOA" | ||
const DOWN = "\eOB" | ||
const ALL = "a" | ||
const NONE = "n" | ||
const DONE = "d" | ||
const SIGINT = "\x03" | ||
const QUIT = "q" | ||
|
||
menu = IBMQClient.DeviceMenu(devices) | ||
print( | ||
stdin.buffer, | ||
DOWN, | ||
LF, | ||
CR, | ||
) | ||
|
||
choice = request("choose a device:", menu) | ||
@test choice == 2 | ||
readavailable(stdin.buffer) | ||
|
||
print( | ||
stdin.buffer, | ||
DOWN, | ||
DOWN, | ||
DOWN, | ||
LF, | ||
CR, | ||
) | ||
choice = request("choose a device:", menu) | ||
@test choice == 4 | ||
readavailable(stdin.buffer) | ||
|
||
print( | ||
stdin.buffer, | ||
DOWN, | ||
DOWN, | ||
DOWN, | ||
QUIT, | ||
) | ||
choice = request("choose a device:", menu) | ||
@test choice == -1 | ||
readavailable(stdin.buffer) | ||
|
||
@test_throws InterruptException begin | ||
print( | ||
stdin.buffer, | ||
DOWN, | ||
DOWN, | ||
DOWN, | ||
SIGINT, | ||
) | ||
request("choose a device:", menu) | ||
readavailable(stdin.buffer) | ||
end |
Oops, something went wrong.