-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add function
Interactive.useSilently
`useSilently file` has the same effect as `use file`, but does not print to stdout. It is particularly suitable when a test (`.smli` file) wants to include a preamble but does not want to include that preamble's output in its own output. `ScriptTest` should verify that the included file generates the correct output (e.g. identical to the input, if it is an `.smli` file, or identical to the `.ref` for other file types) but it does not currently verify. Add scott dataset to `relational.smli` by including new file `scott.smli` using `useSilently`. After the include, there is a variable `scott` that has fields `emp`, `dept`, `bonus`, `salgrade`, like the JDBC data source, but stored on the heap, and in fact overshadowing the JDBC data source.
- Loading branch information
1 parent
37f49ed
commit 295d60f
Showing
9 changed files
with
147 additions
and
19 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
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
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,99 @@ | ||
(* | ||
* Licensed to Julian Hyde under one or more contributor license | ||
* agreements. See the NOTICE file distributed with this work | ||
* for additional information regarding copyright ownership. | ||
* Julian Hyde licenses this file to you under the Apache | ||
* License, Version 2.0 (the "License"); you may not use this | ||
* file except in compliance with the License. You may obtain a | ||
* copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
* either express or implied. See the License for the specific | ||
* language governing permissions and limitations under the | ||
* License. | ||
*) | ||
Sys.set ("printLength", 64); | ||
> val it = () : unit | ||
|
||
val scott = { | ||
bonus = [] : {comm:real, ename:string, job:string, sal:real} list, | ||
emp = [ | ||
{comm = 0.0, deptno = 20, empno = 7369, ename = "SMITH", hiredate = "1980-12-16", job = "CLERK", mgr = 7902, sal = 800.0}, | ||
{comm = 300.0, deptno = 30, empno = 7499, ename = "ALLEN", hiredate = "1981-02-19", job = "SALESMAN", mgr = 7698, sal = 1600.0}, | ||
{comm = 500.0, deptno = 30, empno = 7521, ename = "WARD", hiredate = "1981-02-21", job = "SALESMAN", mgr = 7698, sal = 1250.0}, | ||
{comm = 0.0, deptno = 20, empno = 7566, ename = "JONES", hiredate = "1981-02-03", job = "MANAGER", mgr = 7839, sal = 2975.0}, | ||
{comm = 1400.0, deptno = 30, empno = 7654, ename = "MARTIN", hiredate = "1981-09-27", job = "SALESMAN", mgr = 7698, sal = 1250.0}, | ||
{comm = 0.0, deptno = 30, empno = 7698, ename = "BLAKE", hiredate = "1981-01-04", job = "MANAGER", mgr = 7839, sal = 2850.0}, | ||
{comm = 0.0, deptno = 10, empno = 7782, ename = "CLARK", hiredate = "1981-06-08", job = "MANAGER", mgr = 7839, sal = 2450.0}, | ||
{comm = 0.0, deptno = 20, empno = 7788, ename = "SCOTT", hiredate = "1987-04-18", job = "ANALYST", mgr = 7566, sal = 3000.0}, | ||
{comm = 0.0, deptno = 10, empno = 7839, ename = "KING", hiredate = "1981-11-16", job = "PRESIDENT", mgr = 0, sal = 5000.0}, | ||
{comm = 0.0, deptno = 30, empno = 7844, ename = "TURNER", hiredate = "1981-09-07", job = "SALESMAN", mgr = 7698, sal = 1500.0}, | ||
{comm = 0.0, deptno = 20, empno = 7876, ename = "ADAMS", hiredate = "1987-05-22", job = "CLERK", mgr = 7788, sal = 1100.0}, | ||
{comm = 0.0, deptno = 30, empno = 7900, ename = "JAMES", hiredate = "1981-12-02", job = "CLERK", mgr = 7698, sal = 950.0}, | ||
{comm = 0.0, deptno = 20, empno = 7902, ename = "FORD", hiredate = "1981-12-02", job = "ANALYST", mgr = 7566, sal = 3000.0}, | ||
{comm = 0.0, deptno = 10, empno = 7934, ename = "MILLER", hiredate = "1982-01-22", job = "CLERK", mgr = 7782, sal = 1300.0}], | ||
dept = [ | ||
{deptno = 10, dname = "ACCOUNTING", loc = "NEW YORK"}, | ||
{deptno = 20, dname = "RESEARCH", loc = "DALLAS"}, | ||
{deptno = 30, dname = "SALES", loc = "CHICAGO"}, | ||
{deptno = 40, dname = "OPERATIONS", loc = "BOSTON"}], | ||
salgrade = [ | ||
{grade = 1, hisal = 1200.0, losal = 700.0}, | ||
{grade = 2, hisal = 1400.0, losal = 1201.0}, | ||
{grade = 3, hisal = 2000.0, losal = 1401.0}, | ||
{grade = 4, hisal = 3000.0, losal = 2001.0}, | ||
{grade = 5, hisal = 9999.0, losal = 3001.0}] | ||
}; | ||
> val scott = | ||
> {bonus=[], | ||
> dept= | ||
> [{deptno=10,dname="ACCOUNTING",loc="NEW YORK"}, | ||
> {deptno=20,dname="RESEARCH",loc="DALLAS"}, | ||
> {deptno=30,dname="SALES",loc="CHICAGO"}, | ||
> {deptno=40,dname="OPERATIONS",loc="BOSTON"}], | ||
> emp= | ||
> [ | ||
> {comm=0.0,deptno=20,empno=7369,ename="SMITH",hiredate="1980-12-16", | ||
> job="CLERK",mgr=7902,sal=800.0}, | ||
> {comm=300.0,deptno=30,empno=7499,ename="ALLEN",hiredate="1981-02-19", | ||
> job="SALESMAN",mgr=7698,sal=1600.0}, | ||
> {comm=500.0,deptno=30,empno=7521,ename="WARD",hiredate="1981-02-21", | ||
> job="SALESMAN",mgr=7698,sal=1250.0}, | ||
> {comm=0.0,deptno=20,empno=7566,ename="JONES",hiredate="1981-02-03", | ||
> job="MANAGER",mgr=7839,sal=2975.0}, | ||
> {comm=1400.0,deptno=30,empno=7654,ename="MARTIN",hiredate="1981-09-27", | ||
> job="SALESMAN",mgr=7698,sal=1250.0}, | ||
> {comm=0.0,deptno=30,empno=7698,ename="BLAKE",hiredate="1981-01-04", | ||
> job="MANAGER",mgr=7839,sal=2850.0}, | ||
> {comm=0.0,deptno=10,empno=7782,ename="CLARK",hiredate="1981-06-08", | ||
> job="MANAGER",mgr=7839,sal=2450.0}, | ||
> {comm=0.0,deptno=20,empno=7788,ename="SCOTT",hiredate="1987-04-18", | ||
> job="ANALYST",mgr=7566,sal=3000.0}, | ||
> {comm=0.0,deptno=10,empno=7839,ename="KING",hiredate="1981-11-16", | ||
> job="PRESIDENT",mgr=0,sal=5000.0}, | ||
> {comm=0.0,deptno=30,empno=7844,ename="TURNER",hiredate="1981-09-07", | ||
> job="SALESMAN",mgr=7698,sal=1500.0}, | ||
> {comm=0.0,deptno=20,empno=7876,ename="ADAMS",hiredate="1987-05-22", | ||
> job="CLERK",mgr=7788,sal=1100.0}, | ||
> {comm=0.0,deptno=30,empno=7900,ename="JAMES",hiredate="1981-12-02", | ||
> job="CLERK",mgr=7698,sal=950.0}, | ||
> {comm=0.0,deptno=20,empno=7902,ename="FORD",hiredate="1981-12-02", | ||
> job="ANALYST",mgr=7566,sal=3000.0}, | ||
> {comm=0.0,deptno=10,empno=7934,ename="MILLER",hiredate="1982-01-22", | ||
> job="CLERK",mgr=7782,sal=1300.0}], | ||
> salgrade= | ||
> [{grade=1,hisal=1200.0,losal=700.0},{grade=2,hisal=1400.0,losal=1201.0}, | ||
> {grade=3,hisal=2000.0,losal=1401.0},{grade=4,hisal=3000.0,losal=2001.0}, | ||
> {grade=5,hisal=9999.0,losal=3001.0}]} | ||
> : {bonus:{comm:real, ename:string, job:string, sal:real} list, | ||
> dept:{deptno:int, dname:string, loc:string} list, | ||
> emp: | ||
> {comm:real, deptno:int, empno:int, ename:string, hiredate:string, | ||
> job:string, mgr:int, sal:real} list, | ||
> salgrade:{grade:int, hisal:real, losal:real} list} | ||
|
||
(*) End scott.smli |