forked from casbin/casbin.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.test.ts
37 lines (29 loc) · 1.54 KB
/
config.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { Config } from '../../src';
import { path2Content } from '../utils';
const config = Config.newConfig(path2Content('test/config/testini.ini'));
describe('multi-line test', () => {
it('should config.get("multi1::name") to equal r.sub==p.sub&&r.obj==p.obj', function () {
expect(config.get('multi1::name')).toEqual('r.sub==p.sub&&r.obj==p.obj');
});
it('should config.get("multi2::name") to equal r.sub==p.sub&&r.obj==p.obj', function () {
expect(config.get('multi2::name')).toEqual('r.sub==p.sub&&r.obj==p.obj');
});
it('should config.get("multi3::name") to equal r.sub==p.sub&&r.obj==p.obj', function () {
expect(config.get('multi3::name')).toEqual('r.sub==p.sub&&r.obj==p.obj');
});
it('should config.get("multi4::name") to equal r.sub==p.sub&&r.obj==p.obj', function () {
expect(config.get('multi4::name')).toEqual('');
});
it('should config.get("multi5::name") to equal r.sub==p.sub&&r.obj==p.obj', function () {
expect(config.get('multi5::name')).toEqual('r.sub==p.sub&&r.obj==p.obj');
});
it('should config.get("multi6::name") to equal r.sub==p.sub&&r.obj==p.obj&&r.tex==p.tex', function () {
expect(config.get('multi6::name')).toEqual('r.sub==p.sub&&r.obj==p.obj&&r.tex==p.tex');
});
it('should config.get("mysql::mysql.master.host") to equal 10.0.0.1', function () {
expect(config.get('mysql::mysql.master.host')).toEqual('10.0.0.1');
});
it('should config.get("mysql::mysql.master.user") to equal root', function () {
expect(config.get('mysql::mysql.master.user')).toEqual('root');
});
});