File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import * as assert from 'assert' ;
2+ import { cljParser } from '../src/cljParser' ;
3+
4+ suite ( 'cljParser' , ( ) => {
5+ let cases = [
6+ [ 'user' , '' ] ,
7+ [ 'foo' , '(ns foo)' ] ,
8+ [ 'foo' , '\n(ns foo)' ] ,
9+ [ 'foo' , '\t(ns foo)' ] ,
10+ [ 'foo' , '\t(ns\tfoo)' ] ,
11+ [ 'foo-bar' , '(ns foo-bar)' ] ,
12+ [ 'bar' , '(ns bar)' ] ,
13+ [ 'baz' , '(ns baz "docstring")' ] ,
14+ [ 'qux' , `(ns qux
15+ "docstring")` ] ,
16+ [ 'foo.bar' , '(ns foo.bar)' ] ,
17+ [ 'foo.bar-baz' , '(ns foo.bar-baz)' ] ,
18+ [ 'foo.bar' , `(ns foo.bar
19+ (:refer-clojure :exclude [ancestors printf])
20+ (:require (clojure.contrib sql combinatorics))
21+ (:use (my.lib this that))
22+ (:import (java.util Date Timer Random)
23+ (java.sql Connection Statement)))` ] ,
24+ [ 'bar' , '(in-ns \'bar)' ] ,
25+ ] ;
26+ for ( let [ want , input ] of cases ) {
27+ test ( `getNamespace("${ input } ") should be "${ want } "` , ( ) => {
28+ assert . equal ( cljParser . getNamespace ( input ) , want ) ;
29+ } ) ;
30+ }
31+ } ) ;
You can’t perform that action at this time.
0 commit comments