Some short programs in `examples` are related to specific libraries. Therefore to improve coupling and cohesion, these examples are moved into a subdirectory of their associated libs.
Basically, it means moving `examples/foo` into `lib/foo/examples`
Pull-Request: #1656
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
mkdir -p bin
../../bin/nitc -o bin/moles src/moles_linux.nit
-android: android-icons $(shell ../../bin/nitls -M src/moles_android.nit) assets/images/drawing.png
+bin/moles.apk: android-icons $(shell ../../bin/nitls -M src/moles_android.nit) assets/images/drawing.png
mkdir -p bin
../../bin/nitc -o bin/moles.apk src/moles_android.nit
+android: bin/moles.apk
+
../inkscape_tools/bin/svg_to_icons:
$(MAKE) -C ../inkscape_tools
mkdir -p res
../inkscape_tools/bin/svg_to_icons art/icon.svg --android --out res/
-android-install: android
+android-install: bin/moles.apk
adb install -rf bin/moles.apk
assets/images/drawing.png: art/drawing.svg ../../contrib/inkscape_tools/bin/svg_to_icons
mkdir -p assets/images
../inkscape_tools/bin/svg_to_png_and_nit --src src/ --scale 2.0 art/drawing.svg
-check-android:
- ./check-android.sh
+check-android: bin/moles.apk
+ ../../misc/jenkins/check_android.sh bin/moles.apk
clean:
rm -rf bin res
+++ /dev/null
-#!/bin/bash
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Licensed 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.
-
-set -x
-
-avd=android4.0
-sleep=20
-
-android list avd | grep $avd
-
-if [ $? -eq 1 ]; then
- echo no | android create avd -n $avd --snapshot -t android-15 --abi x86 || true
- sleep=120
-fi
-
-#-no-window
-emulator -avd android4.0 -no-window -qemu -m 512 -enable-kvm &
-
-sleep $sleep
-
-dev=`adb devices | grep emulator | sed "s/\(.*\)\s*device/\1/"`
-
-adb -s $dev install -r bin/moles.apk
-
-# Unlock screen
-adb -s $dev shell input keyevent 82
-
-adb -s $dev shell monkey -p org.nitlanguage.moles_android_debug \
- --monitor-native-crashes --throttle 5 --pct-touch 50 --pct-motion 50 1000
-
-adb -s $dev emu kill
--- /dev/null
+default: linux
+
+linux:
+ mkdir -p bin
+ ../../bin/nitc -o bin/simple src/simple_linux.nit
+
+android:
+ mkdir -p bin
+ ../../bin/nitc -o bin/complete.apk src/complete_simple_android.nit --semi-global
+ ../../bin/nitc -o bin/minimal.apk src/simple_android.nit --semi-global
+
+clean:
+ rm -rf bin
Categories:Nit
License:Apache2
Web Site:http://nitlanguage.org
-Source Code:http://nitlanguage.org/nit.git/tree/HEAD:/examples/mnit_simple
+Source Code:http://nitlanguage.org/nit.git/tree/HEAD:/contrib/mnit_test
Issue Tracker:https://github.com/nitlang/nit/issues
Summary:Simple Demo for MNit
Description:
-A useless application that shows various API usage of the MNit+Android framework.
+A useless application that test various API usage of the mnit framework on Android.
.
# See the License for the specific language governing permissions and
# limitations under the License.
+# Entrypoint of an app with all the mnit tests for Android
module complete_simple_android is
+ app_name "mnit Complete"
app_namespace "org.nitlanguage.test_all"
android_api_target 19
end
# Very simple application
module simple is
- app_name("mnit Simple example") # On Android, this name is hidden by the value in `res/values/strings.xml`
+ app_name "mnit Minimal"
app_version(0, 2, git_revision)
end
# limitations under the License.
module simple_android is
- android_manifest("""<uses-permission android:name="android.permission.VIBRATE" />""")
+ app_namespace "org.nitlanguage.test_minimal"
+ android_manifest """<uses-permission android:name="android.permission.VIBRATE" />"""
end
import mnit_android
redef class App
redef fun input( ie )
do
- if ie isa PointerEvent and ie.depressed then
+ if ie isa PointerEvent and ie.depressed then
test_java_ffi
end
return super
redef class App
redef fun input( ie )
do
- if ie isa PointerEvent and ie.depressed then
+ if ie isa PointerEvent and ie.depressed then
test_assets
test_resources
end
# Testing the resources manager
fun test_resources do
- assert resource_manager.string("string_test") == "string test"
+ # FIXME test deactivated to use app_name which is incompatible
+ # with a custom res/values/strings.xml
+ #assert resource_manager.string("string_test") == "string test"
+
assert resource_manager.boolean("test_bool") == true
assert resource_manager.dimension("test_dimen_1") == 25
assert resource_manager.dimension("test_dimen_2") == 150
redef class App
# Sound
var soundsp: Sound
+
# Music
var soundmp: Music
+
# Sound
var easy_soundsp = new Sound("testsound")
+
# Music
var easy_soundmp = new Music("xylofon")
- # testing from assets ?
+
+ # Read sounds from the assets folder?
var test_assets = false
- # testinf from resources ?
+
+ # Read sounds from the resources folder?
var test_ressources = true
- # testing the automatic way ?
+
+ # Test the automatic way with `PlayableAudio::load`?
var test_easy_sounds = false
redef fun on_create
assert bundle.is_empty
end
end
-
assert sp.float("wrong_float", 0.0) == 0.0
assert sp.int("an_int", 0) == 666
assert sp.int("a_second_int", 0) == 0
- assert sp.long("a_long", 0) == 6666666666
+
+ # FIXME getting long from Java on Android is broken
+ # The C FFI (underlying the Java FFI) version of Int is a `long` which is on 32 bits on Android.
+ #assert sp.long("a_long", 0) == 6666666666
+
assert sp.long("wrong_long", 0) == 0
assert sp.string("a_string", "ERROR!") == "A string"
assert sp.string("wrong_string", "ERROR!") == "ERROR!"
redef class App
redef fun input( ie )
do
- if ie isa PointerEvent and ie.depressed then
+ if ie isa PointerEvent and ie.depressed then
test_target_api
end
return super
import pnacl
intrude import toolcontext
intrude import loader
-intrude import standard::file
+intrude import core::file
# We redefine exit to start a new thread before killing the one that called exit.
redef fun exit(exit_value: Int)
import model
import cfg
import flow_analysis
-intrude import standard::stream
+intrude import core::stream
import cpp
in "C++" `{
# A stack of integer implemented by a simple linked list.
# Note that this is only a toy class since a real linked list will gain to use
-# generics and extends interfaces, like Collection, from the standard library.
+# generics and extends interfaces, like `Collection`, from the `core` library.
class IntStack
# The head node of the list.
# Null means that the stack is empty.
# limitations under the License.
# Entire game logic for the Dino game
-# Depends only on Nit standard library
+# Depends only on Nit `core` library
module game_logic
interface Turnable
+++ /dev/null
-default: linux
-
-linux:
- mkdir -p bin
- ../../bin/nitc -o bin/simple src/simple_linux.nit
-
-android:
- mkdir -p bin
- ../../bin/nitc -o bin/simple.apk src/complete_simple_android.nit
-
-clean:
- rm -rf bin
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
- <string name="app_name"> mnit Simple</string>
- <string name="nit_string">Test Resources</string>
- <string name="string_test">string test</string>
-</resources>
import java
import java::io
intrude import assets_and_resources
-import native_app_glue # FIXME update this module to use nit_activity
+import activities
import app::audio
in "Java" `{
# Sets the stream of the app to STREAM_MUSIC.
# STREAM_MUSIC is the default stream used by android apps.
- private fun manage_audio_stream import native_activity, native_app_glue in "Java" `{
+ private fun manage_audio_stream import native_activity in "Java" `{
App_native_activity(self).setVolumeControlStream(AudioManager.STREAM_MUSIC);
`}
return sound
end
- redef fun pause do
+ redef fun on_pause do
super
for s in sounds do s.pause
audio_manager.abandon_audio_focus
end
- redef fun init_window do
+ redef fun on_create do
super
audio_manager.request_audio_focus
manage_audio_stream
end
- redef fun resume do
+ redef fun on_resume do
super
audio_manager.request_audio_focus
for s in sounds do s.resume
# A class mapping `String` keys to various value types
class Bundle
- private var native_bundle: NativeBundle = new NativeBundle is lazy
+ private var native_bundle: NativeBundle = (new NativeBundle).new_global_ref is lazy
# Get a new `Bundle` wrapping `native_bundle`
init from(native_bundle: NativeBundle) do self.native_bundle = native_bundle
# Returns `null` if none or if it's the wrong value type
fun string(key: String): nullable String
do
- sys.jni_env.push_local_frame(1)
- var return_value = native_bundle.get_string(key.to_java_string).to_s
- sys.jni_env.pop_local_frame
+ sys.jni_env.push_local_frame(2)
- if return_value == "" then return null
+ var jstr = native_bundle.get_string(key.to_java_string)
+ var str = null
+ if not jstr.is_java_null then str = jstr.to_s
- return return_value
+ sys.jni_env.pop_local_frame
+
+ return str
end
# Retrieves the `Bool` value corresponding to the given key
# http://developer.android.com/guide/topics/ui/notifiers/notifications.html
module notification
-import standard
+import core
private import native_notification
# An Android notification, shown at the top of the screen
module audio
import app_base
-import standard::error
+import core::error
# Platform variations
# TODO: move on the platform once qualified names are understand in the condition
# and reallocations when concatenating `String` objects.
module buffered_ropes
-intrude import standard::text::ropes
+intrude import core::text::ropes
# Hidden buffer, used to simulate a `FlatBuffer` on a short string.
#
# Utilities and performant structure for the FFI with C
module c
-import standard
-intrude import standard::collection::array
+import core
+intrude import core::collection::array
# A thin wrapper around a `NativeCArray` adding length information
abstract class CArray[E]
import cocoa
-fun dialog in "ObjC" `{
+in "ObjC" `{
+ #import <AppKit/AppKit.h>
+`}
+
+private fun dialog in "ObjC" `{
NSAlert *alert = [[[NSAlert alloc] init] autorelease];
[alert setMessageText:@"Hello world!"];
[alert runModal];
_node = _set._first_item
end
end
-
#
# This file is free software, which comes along with NIT. This software is
# distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. You can modify it is you want, provided this header
# is kept unaltered, and a notification of the changes is added.
# You are allowed to redistribute it and sell it, alone or is a part of
var t = _head
while t != null do
l += 1
- t = t.next
+ t = t.next
end
- return l
+ return l
end
# O(n)
# Build an empty list.
init do end
-
+
# Build a list filled with the items of `coll`.
init from(coll: Collection[E]) do append(coll)
n = n.next
i -= 1
end
- return n
+ return n
end
# get the first node that contains `e` after 'after', null otherwise
#
# This file is free software, which comes along with NIT. This software is
# distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. You can modify it is you want, provided this header
# is kept unaltered, and a notification of the changes is added.
# You are allowed to redistribute it and sell it, alone or is a part of
# Standard classes and methods used by default by Nit programs and libraries.
# This module is implicitly imported by every module.
-module standard
+module core
import posix
-import environ
+import environ
import time
import file
import exec
#
# This file is free software, which comes along with NIT. This software is
# distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. You can modify it is you want, provided this header
# is kept unaltered, and a notification of the changes is added.
# You are allowed to redistribute it and sell it, alone or is a part of
# Removes the numeric head of `self` if present
#
- # intrude import standard::fixed_ints
+ # intrude import core::fixed_ints
# assert "0xFFEF".strip_numhead == "FFEF"
# assert "0o7364".strip_numhead == "7364"
# assert "0b01001".strip_numhead == "01001"
# Gets the numeric head of `self` if present
# Returns "" otherwise
#
- # intrude import standard::fixed_ints
+ # intrude import core::fixed_ints
# assert "0xFEFF".get_numhead == "0x"
# assert "0b01001".get_numhead == "0b"
# assert "0o872".get_numhead == "0o"
# Removes the numeric extension if present
#
- # intrude import standard::fixed_ints
+ # intrude import core::fixed_ints
# assert "0xFEFFu8".strip_numext == "0xFEFF"
# assert "0b01001u8".strip_numext == "0b01001"
# assert "0o872u8".strip_numext == "0o872"
# Gets the numeric extension (i/u 8/16/32) in `self` is present
# Returns "" otherwise
#
- # intrude import standard::fixed_ints
+ # intrude import core::fixed_ints
# assert "0xFEFFu8".get_numext == "u8"
# assert "0b01001u8".get_numext == "u8"
# assert "0o872u8".get_numext == "u8"
# It is recommanded to use the higher level API offered by the class `Regex`,
# but it can still be used for advanced purpose or in optimized code.
#
-# To use this class and other `private` entities of this module, use `intrude import standard::re`
+# To use this class and other `private` entities of this module, use `intrude import core::re`
private extern class NativeRegex `{ regex_t* `}
# Allocate a new `NativeRegex`, it must then be compiled using `regcomp` before calling `regexec`
new malloc `{ return malloc(sizeof(regex_t)); `}
# Binding of C libCurl which allow us to interact with network.
module native_curl is pkgconfig "libcurl"
-intrude import standard::file
-import standard
+intrude import core::file
+import core
in "C header" `{
#include <curl/curl.h>
# at callers of `HashCollection::gt_collide` and `HashCollection::st_collide`.
module hash_debug
-intrude import standard::collection::hash_collection
-import standard
+intrude import core::collection::hash_collection
+import core
redef class Sys
# Number of calls of `HashCollection::node_at_idx`
# var p = new HTMLTag("p")
# p.text("Hello World!")
# assert p.write_to_string == "<p>Hello World!</p>"
- # Text is escaped see: `standard::String::html_escape`
+ # Text is escaped see: `core::String::html_escape`
fun text(txt: String): HTMLTag do
children.clear
# p.add(new HTMLTag("br"))
# p.append("World!")
# assert p.write_to_string == "<p>Hello<br/>World!</p>"
- # Text is escaped see: standard::String::html_escape
+ # Text is escaped see: core::String::html_escape
fun append(txt: String): HTMLTag do
add(new HTMLRaw("", txt.html_escape))
return self
end
import c
-intrude import standard::text::flat
+intrude import core::text::flat
import serialization
private import json::serialization
# Provides the `HttpRequest` class and services to create it
module http_request
-import standard
+import core
# A request received over HTTP, is build by `HttpRequestParser`
class HttpRequest
# 'nacl_sdk/pepper_your_pepper_version/getting_started/your_project_folder'.
module pnacl is platform
-import standard
-intrude import standard::stream
+import core
+intrude import core::stream
in "C Header" `{
#include "ppapi/c/pp_errors.h"
# Exposes methods for debugging ropes when needed.
module ropes_debug
-import standard
-intrude import standard::text::ropes
+import core
+intrude import core::text::ropes
redef class Text
# Writes self as a dot file on the hard drive
module saxophonit
import sax
-intrude import standard::file
+intrude import core::file
private import reader_model
private import lexer
module engine_tools
import serialization
-intrude import standard::collection::hash_collection
+intrude import core::collection::hash_collection
# Maps instances to a value, uses `is_same_serialized` and `serialization_hash`.
class StrictHashMap[K, V]
module socket
private import socket_c
-intrude import standard::stream
+intrude import core::stream
# A general Socket, either TCP or UDP
abstract class Socket
module sqlite3
private import native_sqlite3
-import standard
+import core
# A connection to a Sqlite3 database
class Sqlite3DB
--- /dev/null
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# This file is free software, which comes along with NIT. This software is
+# distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. You can modify it is you want, provided this header
+# is kept unaltered, and a notification of the changes is added.
+# You are allowed to redistribute it and sell it, alone or is a part of
+# another product.
+
+# Old module implicitly imported by the old compiler.
+# Now it just import `core`
+module standard is
+ # Use `core` instead of `standard`.
+ deprecated
+end
+
+import core
import sha1
import base64
-intrude import standard::stream
-intrude import standard::bytes
+intrude import core::stream
+intrude import core::bytes
# Websocket compatible listener
#
--- /dev/null
+#!/bin/bash
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed 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.
+
+# Script to test Android apps using `adb monkey`
+
+# Show the emulator window?
+show=false
+
+# Name of an already running device, as shown by `adb devices`
+dev=none
+
+# Parse command line options
+stop=false
+while [ $stop = false ]; do
+ case $1 in
+ --show) show=true; shift;;
+ --dev) dev=$2; shift; shift;;
+ *) stop=true
+ esac
+done
+
+if [ $# = 0 ]; then
+ echo "Test an apk"
+ echo "Usage: check_android.sh [--show] [--dev android-device-name] file.apk [other_file.apk [...]]"
+ exit 1
+fi
+
+set -x
+
+# Create an AVD if none is specified
+kill_emu=false
+if [ $dev = none ]; then
+ kill_emu=true
+
+ # Name of the AVD
+ # TODO have alternatives AVD with different specs
+ avd=check_android_avd
+
+ # Port for the emulator
+ port=5600
+
+ dev=emulator-$port
+
+ # Time to wait for the emulator to be ready
+ to_sleep=20
+
+ # Does the AVD exists?
+ android list avd | grep $avd
+ if [ $? -eq 1 ]; then
+ # Create it
+ echo no | android create avd -n $avd --snapshot -t android-19 --abi x86 || true
+ to_sleep=120
+ fi
+
+ # Show the emulator window on request only
+ emu_opts=
+ if [ $show = false ]; then
+ emu_opts="-no-window"
+ fi
+
+ emulator -avd $avd -port $port -logcat app.nit $emu_opts &
+ # To use hardware optimization add: -qemu -m 512 -enable-kvm
+
+ sleep $to_sleep
+fi
+
+for apk in $@; do
+
+ # Target package name
+ pkg=`aapt dump badging $apk | grep package | sed -e "s/.*name='\([a-z._]*\)'.*/\1/"`
+
+ # Force reinstall
+ adb -s $dev uninstall $pkg
+ adb -s $dev install -r "$apk"
+
+ # Unlock screen
+ adb -s $dev shell input keyevent 82
+ adb -s $dev shell input keyevent 4
+
+ # Run monkey
+ tools_dir=`dirname $0`
+ $tools_dir/unitrun.sh "android-`basename $apk .apk`" \
+ adb -s $dev shell monkey -p $pkg \
+ --monitor-native-crashes --throttle 2 --pct-touch 50 --pct-motion 50 5000
+done
+
+if [ $kill_emu = true ]; then
+ # Kill emulator
+ adb -s $dev emu kill
+fi
redef fun make_results(nitx, results) do
var len = results.length
- # FIXME how to render the pager for one worded namespaces like "standard"?
+ # FIXME how to render the pager for one worded namespaces like "core"?
if len == 1 then
var page = results.first.as(PageMatch).page
var pager = new Pager
# underlying implementation and that the services are semantically correct.
module primitive_types
-intrude import standard::file
-intrude import standard::text::flat
+intrude import core::file
+intrude import core::text::flat
# Wrapper for `NativeFile`
class PrimitiveNativeFile
mmodule.set_visibility_for(sup, mvisibility)
end
if stdimport then
- var mod_name = "standard"
+ var mod_name = "core"
var sup = self.get_mmodule_by_name(nmodule, null, mod_name)
if sup == null then
nmodule.mmodule = null # invalidate the module
self.toolcontext.info("{mmodule} imports {mmodule.in_importation.direct_greaters.join(", ")}", 3)
- # Force standard to be public if imported
+ # Force `core` to be public if imported
for sup in mmodule.in_importation.greaters do
- if sup.name == "standard" then
+ if sup.name == "core" then
mmodule.set_visibility_for(sup, public_visibility)
end
end
end
-redef class MClass
- # is the class imported from standard lib?
- fun is_standard: Bool do
- return self.intro_mmodule.mgroup.mproject.name == "standard"
- end
-end
-
-redef class MModule
- # is the module imported from standard lib?
- fun is_standard: Bool do
- return self.mgroup.mproject.name == "standard"
- end
-end
-
# A Metric is used to collect data about things
#
# The concept is reified here for a better organization and documentation
redef var to_s: String is noinit
# The full-name of the class, then the full-name of each type arguments within brackets.
- # Example: `"standard::Map[standard::String, standard::List[standard::Int]]"`
+ # Example: `"core::Map[core::String, core::List[core::Int]]"`
redef var full_name is lazy do
var args = new Array[String]
for t in arguments do
"xcodebuild -target '{project_name}' " +
"-destination 'platform=iOS Simulator,name=iPhone' " +
"-configuration {if release then "Release" else "Debug"} " +
+ "ONLY_ACTIVE_ARCH=NO "+
"-sdk iphonesimulator build"]
toolcontext.exec_and_check(args, "iOS project error")
# usualy, only the original module must be imported in the unit test.
var o = mmodule
var g = o.mgroup
- if g != null and g.mproject.name == "standard" then
- # except for a unit test in a module of standard
- # in this case, the whole standard must be imported
+ if g != null and g.mproject.name == "core" then
+ # except for a unit test in a module of `core`
+ # in this case, the whole `core` must be imported
o = get_mmodule_by_name(nmodule, g, g.mproject.name).as(not null)
end
# See the License for the specific language governing permissions and
# limitations under the License.
-import standard::kernel
+import core::kernel
fun foo(i: Int): nullable Int do return i
fun bar(i: Int) do i.output
# See the License for the specific language governing permissions and
# limitations under the License.
-import standard::kernel
+import core::kernel
class A
fun foo do 1.output
# See the License for the specific language governing permissions and
# limitations under the License.
-import standard::kernel
+import core::kernel
redef class Int
fun next: nullable Int do if self < 20 then return self + 1 else return null
# See the License for the specific language governing permissions and
# limitations under the License.
-import standard::collection::array
+import core::collection::array
var a #1alt1#var a: Array[Object]
a = [1]#1alt2#
# See the License for the specific language governing permissions and
# limitations under the License.
-import standard::kernel
+import core::kernel
class O
fun foo: O do
# See the License for the specific language governing permissions and
# limitations under the License.
-import standard::kernel
+import core::kernel
interface A
# See the License for the specific language governing permissions and
# limitations under the License.
-import standard::kernel
+import core::kernel
fun foo(i: Int): nullable Int do return i
fun bar(i: Int) do i.output
# See the License for the specific language governing permissions and
# limitations under the License.
-import standard::kernel
+import core::kernel
var x
x = null
# See the License for the specific language governing permissions and
# limitations under the License.
-import standard::kernel
+import core::kernel
class A
fun foo(a, b: nullable Int, c, d: Int, e,f: nullable Int)
# See the License for the specific language governing permissions and
# limitations under the License.
-import standard::kernel
+import core::kernel
class A
var mandatory: Int
# limitations under the License.
import base_arg_default
-import standard::collection::array
+import core::collection::array
fun order(i: Int): Int do
'>'.output
# See the License for the specific language governing permissions and
# limitations under the License.
-import standard::kernel
+import core::kernel
abstract class A
var x: Int
# See the License for the specific language governing permissions and
# limitations under the License.
-import standard::kernel
+import core::kernel
interface A
var i: Int is abstract, autoinit
# See the License for the specific language governing permissions and
# limitations under the License.
-import standard::kernel
+import core::kernel
interface A
var i: Int is abstract
# See the License for the specific language governing permissions and
# limitations under the License.
-import standard::kernel
+import core::kernel
class A
var a: Object is
# See the License for the specific language governing permissions and
# limitations under the License.
-import standard::collection::array
+import core::collection::array
class A
type V: nullable Object
# See the License for the specific language governing permissions and
# limitations under the License.
-import standard::kernel
+import core::kernel
var b = 0b_
var x = 0x_
# See the License for the specific language governing permissions and
# limitations under the License.
-import standard::kernel
+import core::kernel
class A
var i: Int = 1
# See the License for the specific language governing permissions and
# limitations under the License.
-intrude import standard::collection::array
+intrude import core::collection::array
var a = new Array[Bool]
var cpt = 0
# See the License for the specific language governing permissions and
# limitations under the License.
-import standard::kernel
+import core::kernel
class A[E] #alt2# class A[E: Object]
type V: nullable Object #alt2# type V: Object
# See the License for the specific language governing permissions and
# limitations under the License.
-import standard::kernel
+import core::kernel
class A
fun +: A
# See the License for the specific language governing permissions and
# limitations under the License.
-import standard::kernel
+import core::kernel
redef class Int
# See the License for the specific language governing permissions and
# limitations under the License.
-import standard::kernel
+import core::kernel
assert 0b1001 == 0x09
assert 0o715 == 0x1CD
# See the License for the specific language governing permissions and
# limitations under the License.
-#alt1 import standard
-#alt1 import standard::text::ropes
+#alt1 import core
+#alt1 import core::text::ropes
var n = 4
if not args.is_empty then
# See the License for the specific language governing permissions and
# limitations under the License.
-import standard::kernel
+import core::kernel
class G[E: Object]
end
# See the License for the specific language governing permissions and
# limitations under the License.
-import standard::kernel
+import core::kernel
class G[E]
end
# See the License for the specific language governing permissions and
# limitations under the License.
-import standard
+import core
var p = new Process("ls", "-l")
p.wait
# Un fichier = un module. Les classes d'un module sont définies dans le fichier.
# Au début des fichiers, les modules à importer doivent être déclarés (via le
# mot clé "import"). Implicitement, tout module importe le module nommé
-# "standard" qui définit les classes usuelles.
+# "core" qui définit les classes usuelles.
# On va étudier une représentation d'un entrepôt de produits variés.
class Entrepot
# See the License for the specific language governing permissions and
# limitations under the License.
-#alt1 import standard
-#alt1 import standard::text::ropes
+#alt1 import core
+#alt1 import core::text::ropes
# A procedural program (without explicit class).
# It displays the value of a local variable.
# It exhibs ways to concatenate strings.
-#alt1 import standard
-#alt1 import standard::text::ropes
+#alt1 import core
+#alt1 import core::text::ropes
var a = 10
# First way: Multiple parameters.
---diagram package --private ./base_prot_sig2.nit -I ../lib/standard
---diagram package ./base_prot_sig2.nit -I ../lib/standard
---diagram class --private ./base_prot_sig2.nit -I ../lib/standard
---diagram class ./base_prot_sig2.nit -I ../lib/standard
+--diagram package --private ./base_prot_sig2.nit -I ../lib/core
+--diagram package ./base_prot_sig2.nit -I ../lib/core
+--diagram class --private ./base_prot_sig2.nit -I ../lib/core
+--diagram class ./base_prot_sig2.nit -I ../lib/core
-alt/base_arg_default_autoinit_alt1.nit:59,5--7: Error: expected at least 1 argument(s) for `init(mandatory: Int, optional: nullable Int)`; got 0. See introduction at `standard::Object::init`.
-alt/base_arg_default_autoinit_alt1.nit:68,5--7: Error: expected 2 argument(s) for `init(mandatory: Int, optional: nullable Int)`; got 3. See introduction at `standard::Object::init`.
-alt/base_arg_default_autoinit_alt1.nit:71,5--7: Error: expected 4 argument(s) for `init(mandatory: Int, optional: nullable Int, optional_b: nullable Int, mandatory_b: Int)`; got 1. See introduction at `standard::Object::init`.
-alt/base_arg_default_autoinit_alt1.nit:74,5--7: Error: expected 4 argument(s) for `init(mandatory: Int, optional: nullable Int, optional_b: nullable Int, mandatory_b: Int)`; got 2. See introduction at `standard::Object::init`.
-alt/base_arg_default_autoinit_alt1.nit:77,5--7: Error: expected 4 argument(s) for `init(mandatory: Int, optional: nullable Int, optional_b: nullable Int, mandatory_b: Int)`; got 3. See introduction at `standard::Object::init`.
-alt/base_arg_default_autoinit_alt1.nit:83,5--7: Error: expected 4 argument(s) for `init(mandatory: Int, optional: nullable Int, optional_b: nullable Int, mandatory_b: Int)`; got 5. See introduction at `standard::Object::init`.
-alt/base_arg_default_autoinit_alt1.nit:86,5--7: Error: expected 3 argument(s) for `init(optional_b: nullable Int, mandatory_b: Int, mandatory: Int)`; got 1. See introduction at `standard::Object::init`.
-alt/base_arg_default_autoinit_alt1.nit:89,5--7: Error: expected 3 argument(s) for `init(optional_b: nullable Int, mandatory_b: Int, mandatory: Int)`; got 2. See introduction at `standard::Object::init`.
-alt/base_arg_default_autoinit_alt1.nit:95,5--7: Error: expected 3 argument(s) for `init(optional_b: nullable Int, mandatory_b: Int, mandatory: Int)`; got 4. See introduction at `standard::Object::init`.
+alt/base_arg_default_autoinit_alt1.nit:59,5--7: Error: expected at least 1 argument(s) for `init(mandatory: Int, optional: nullable Int)`; got 0. See introduction at `core::Object::init`.
+alt/base_arg_default_autoinit_alt1.nit:68,5--7: Error: expected 2 argument(s) for `init(mandatory: Int, optional: nullable Int)`; got 3. See introduction at `core::Object::init`.
+alt/base_arg_default_autoinit_alt1.nit:71,5--7: Error: expected 4 argument(s) for `init(mandatory: Int, optional: nullable Int, optional_b: nullable Int, mandatory_b: Int)`; got 1. See introduction at `core::Object::init`.
+alt/base_arg_default_autoinit_alt1.nit:74,5--7: Error: expected 4 argument(s) for `init(mandatory: Int, optional: nullable Int, optional_b: nullable Int, mandatory_b: Int)`; got 2. See introduction at `core::Object::init`.
+alt/base_arg_default_autoinit_alt1.nit:77,5--7: Error: expected 4 argument(s) for `init(mandatory: Int, optional: nullable Int, optional_b: nullable Int, mandatory_b: Int)`; got 3. See introduction at `core::Object::init`.
+alt/base_arg_default_autoinit_alt1.nit:83,5--7: Error: expected 4 argument(s) for `init(mandatory: Int, optional: nullable Int, optional_b: nullable Int, mandatory_b: Int)`; got 5. See introduction at `core::Object::init`.
+alt/base_arg_default_autoinit_alt1.nit:86,5--7: Error: expected 3 argument(s) for `init(optional_b: nullable Int, mandatory_b: Int, mandatory: Int)`; got 1. See introduction at `core::Object::init`.
+alt/base_arg_default_autoinit_alt1.nit:89,5--7: Error: expected 3 argument(s) for `init(optional_b: nullable Int, mandatory_b: Int, mandatory: Int)`; got 2. See introduction at `core::Object::init`.
+alt/base_arg_default_autoinit_alt1.nit:95,5--7: Error: expected 3 argument(s) for `init(optional_b: nullable Int, mandatory_b: Int, mandatory: Int)`; got 4. See introduction at `core::Object::init`.
-alt/base_attr_annot_1alt1.nit:33,9--11: Error: expected 0 argument(s) for `init`; got 1. See introduction at `standard::Object::init`.
+alt/base_attr_annot_1alt1.nit:33,9--11: Error: expected 0 argument(s) for `init`; got 1. See introduction at `core::Object::init`.
-alt/base_attr_annot_alt1.nit:33,9--11: Error: expected 1 argument(s) for `init(a: Object)`; got 0. See introduction at `standard::Object::init`.
+alt/base_attr_annot_alt1.nit:33,9--11: Error: expected 1 argument(s) for `init(a: Object)`; got 0. See introduction at `core::Object::init`.
-alt/base_import_alt3.nit:1,8--21: Error: cannot find module `fail` from `project1`. Tried: ., ../lib/standard, ../lib/standard/collection, alt, ../lib, ../contrib.
+alt/base_import_alt3.nit:1,8--21: Error: cannot find module `fail` from `project1`. Tried: ., ../lib/core, ../lib/core/collection, alt, ../lib, ../contrib.
-alt/base_import_alt5.nit:1,8--25: Error: cannot find module `project2` from `project1`. Tried: ., ../lib/standard, ../lib/standard/collection, alt, ../lib, ../contrib.
+alt/base_import_alt5.nit:1,8--25: Error: cannot find module `project2` from `project1`. Tried: ., ../lib/core, ../lib/core/collection, alt, ../lib, ../contrib.
-alt/base_init_basic_alt5.nit:79,9--11: Error: expected 2 argument(s) for `init(c: Int, b: Int)`; got 1. See introduction at `standard::Object::init`.
+alt/base_init_basic_alt5.nit:79,9--11: Error: expected 2 argument(s) for `init(c: Int, b: Int)`; got 1. See introduction at `core::Object::init`.
-alt/base_init_noinit_alt4.nit:30,3--5: Error: expected 0 argument(s) for `init`; got 1. See introduction at `standard::Object::init`.
+alt/base_init_noinit_alt4.nit:30,3--5: Error: expected 0 argument(s) for `init`; got 1. See introduction at `core::Object::init`.
alt/base_module_conditional_alt1.nit:17,20--30: Syntax Error: `conditional` expects module identifiers as arguments.
alt/base_module_conditional_alt1.nit:18,32--36: Syntax Error: `conditional` expects module identifier as arguments.
-alt/base_module_conditional_alt1.nit:19,32--35: Error: cannot find module `fail` from `base_module_conditional_alt1`. Tried: ., ../lib/standard, ../lib/standard/collection, alt, ../lib, ../contrib.
-alt/base_module_conditional_alt1.nit:20,8--11: Error: cannot find module `fail` from `base_module_conditional_alt1`. Tried: ., ../lib/standard, ../lib/standard/collection, alt, ../lib, ../contrib.
+alt/base_module_conditional_alt1.nit:19,32--35: Error: cannot find module `fail` from `base_module_conditional_alt1`. Tried: ., ../lib/core, ../lib/core/collection, alt, ../lib, ../contrib.
+alt/base_module_conditional_alt1.nit:20,8--11: Error: cannot find module `fail` from `base_module_conditional_alt1`. Tried: ., ../lib/core, ../lib/core/collection, alt, ../lib, ../contrib.
-../lib/standard/kernel.nit:32,1--225,3: Error: `kernel#Object` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
-../lib/standard/kernel.nit:227,1--300,3: Error: `kernel#Sys` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
-../lib/standard/kernel.nit:313,1--371,3: Error: `kernel#Comparable` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
-../lib/standard/kernel.nit:373,1--410,3: Error: `kernel#Discrete` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
-../lib/standard/kernel.nit:412,1--429,3: Error: `kernel#Cloneable` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
-../lib/standard/kernel.nit:431,1--486,3: Error: `kernel#Numeric` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
-../lib/standard/kernel.nit:492,1--515,3: Error: `kernel#Bool` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
-../lib/standard/kernel.nit:517,1--599,3: Error: `kernel#Float` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
-../lib/standard/kernel.nit:601,1--697,3: Error: `kernel#Byte` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
-../lib/standard/kernel.nit:699,1--884,3: Error: `kernel#Int` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
-../lib/standard/kernel.nit:886,1--1039,3: Error: `kernel#Char` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
-../lib/standard/kernel.nit:1041,1--1048,3: Error: `kernel#Pointer` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
+../lib/core/kernel.nit:32,1--225,3: Error: `kernel#Object` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
+../lib/core/kernel.nit:227,1--300,3: Error: `kernel#Sys` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
+../lib/core/kernel.nit:313,1--371,3: Error: `kernel#Comparable` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
+../lib/core/kernel.nit:373,1--410,3: Error: `kernel#Discrete` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
+../lib/core/kernel.nit:412,1--429,3: Error: `kernel#Cloneable` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
+../lib/core/kernel.nit:431,1--486,3: Error: `kernel#Numeric` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
+../lib/core/kernel.nit:492,1--515,3: Error: `kernel#Bool` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
+../lib/core/kernel.nit:517,1--599,3: Error: `kernel#Float` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
+../lib/core/kernel.nit:601,1--697,3: Error: `kernel#Byte` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
+../lib/core/kernel.nit:699,1--884,3: Error: `kernel#Int` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
+../lib/core/kernel.nit:886,1--1039,3: Error: `kernel#Char` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
+../lib/core/kernel.nit:1041,1--1048,3: Error: `kernel#Pointer` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
-error_init_auto.nit:34,5--7: Error: expected 1 argument(s) for `init(x: Int)`; got 0. See introduction at `standard::Object::init`.
-error_init_auto.nit:36,5--7: Error: expected 1 argument(s) for `init(x: Int)`; got 2. See introduction at `standard::Object::init`.
-error_init_auto.nit:37,5--7: Error: expected 1 argument(s) for `init(x: Int)`; got 3. See introduction at `standard::Object::init`.
+error_init_auto.nit:34,5--7: Error: expected 1 argument(s) for `init(x: Int)`; got 0. See introduction at `core::Object::init`.
+error_init_auto.nit:36,5--7: Error: expected 1 argument(s) for `init(x: Int)`; got 2. See introduction at `core::Object::init`.
+error_init_auto.nit:37,5--7: Error: expected 1 argument(s) for `init(x: Int)`; got 3. See introduction at `core::Object::init`.
error_init_auto.nit:38,11--13: Error: method `foo` does not exists in `A`.
-alt/error_init_auto_alt1.nit:35,5--7: Error: expected 0 argument(s) for `init`; got 1. See introduction at `standard::Object::init`.
-alt/error_init_auto_alt1.nit:36,5--7: Error: expected 0 argument(s) for `init`; got 2. See introduction at `standard::Object::init`.
-alt/error_init_auto_alt1.nit:37,5--7: Error: expected 0 argument(s) for `init`; got 3. See introduction at `standard::Object::init`.
+alt/error_init_auto_alt1.nit:35,5--7: Error: expected 0 argument(s) for `init`; got 1. See introduction at `core::Object::init`.
+alt/error_init_auto_alt1.nit:36,5--7: Error: expected 0 argument(s) for `init`; got 2. See introduction at `core::Object::init`.
+alt/error_init_auto_alt1.nit:37,5--7: Error: expected 0 argument(s) for `init`; got 3. See introduction at `core::Object::init`.
alt/error_init_auto_alt1.nit:38,11--13: Error: method `foo` does not exists in `A`.
-alt/error_init_auto_alt2.nit:34,5--7: Error: expected 2 argument(s) for `init(x: Int, y: Int)`; got 0. See introduction at `standard::Object::init`.
-alt/error_init_auto_alt2.nit:35,5--7: Error: expected 2 argument(s) for `init(x: Int, y: Int)`; got 1. See introduction at `standard::Object::init`.
-alt/error_init_auto_alt2.nit:37,5--7: Error: expected 2 argument(s) for `init(x: Int, y: Int)`; got 3. See introduction at `standard::Object::init`.
+alt/error_init_auto_alt2.nit:34,5--7: Error: expected 2 argument(s) for `init(x: Int, y: Int)`; got 0. See introduction at `core::Object::init`.
+alt/error_init_auto_alt2.nit:35,5--7: Error: expected 2 argument(s) for `init(x: Int, y: Int)`; got 1. See introduction at `core::Object::init`.
+alt/error_init_auto_alt2.nit:37,5--7: Error: expected 2 argument(s) for `init(x: Int, y: Int)`; got 3. See introduction at `core::Object::init`.
alt/error_init_auto_alt2.nit:38,11--13: Error: method `foo` does not exists in `A`.
-alt/error_init_auto_alt4.nit:34,5--7: Error: expected 1 argument(s) for `init(x: Int)`; got 0. See introduction at `standard::Object::init`.
-alt/error_init_auto_alt4.nit:36,5--7: Error: expected 1 argument(s) for `init(x: Int)`; got 2. See introduction at `standard::Object::init`.
-alt/error_init_auto_alt4.nit:37,5--7: Error: expected 1 argument(s) for `init(x: Int)`; got 3. See introduction at `standard::Object::init`.
+alt/error_init_auto_alt4.nit:34,5--7: Error: expected 1 argument(s) for `init(x: Int)`; got 0. See introduction at `core::Object::init`.
+alt/error_init_auto_alt4.nit:36,5--7: Error: expected 1 argument(s) for `init(x: Int)`; got 2. See introduction at `core::Object::init`.
+alt/error_init_auto_alt4.nit:37,5--7: Error: expected 1 argument(s) for `init(x: Int)`; got 3. See introduction at `core::Object::init`.
-error_mod_unk.nit:17,8--11: Error: cannot find module `dfgd` from `error_mod_unk`. Tried: ., ../lib/standard, ../lib/standard/collection, alt, ../lib, ../contrib.
+error_mod_unk.nit:17,8--11: Error: cannot find module `dfgd` from `error_mod_unk`. Tried: ., ../lib/core, ../lib/core/collection, alt, ../lib, ../contrib.
-Runtime error: Cast failed. Expected `OTHER`, got `Float` (../lib/standard/kernel.nit:720)
+Runtime error: Cast failed. Expected `OTHER`, got `Float` (../lib/core/kernel.nit:720)
11
21
31
-Runtime error: Cast failed. Expected `OTHER`, got `Float` (../lib/standard/kernel.nit:720)
+Runtime error: Cast failed. Expected `OTHER`, got `Float` (../lib/core/kernel.nit:720)
11
21
31
-Runtime error: Cast failed. Expected `OTHER`, got `Float` (../lib/standard/kernel.nit:720)
+Runtime error: Cast failed. Expected `OTHER`, got `Float` (../lib/core/kernel.nit:720)
11
21
31
+++ /dev/null
-../lib/android/platform.nit:18,20--37: Error: target platform `android` unknown.
+++ /dev/null
-../lib/android/platform.nit:18,20--37: Error: target platform `android` unknown.
-Runtime error: Cast failed. Expected `OTHER`, got `Float` (../lib/standard/kernel.nit:542)
+Runtime error: Cast failed. Expected `OTHER`, got `Float` (../lib/core/kernel.nit:542)
11
21
31
-Runtime error: Cast failed. Expected `OTHER`, got `Float` (../lib/standard/kernel.nit:542)
+Runtime error: Cast failed. Expected `OTHER`, got `Float` (../lib/core/kernel.nit:542)
11
21
31
-Runtime error: Cast failed. Expected `OTHER`, got `Float` (../lib/standard/kernel.nit:542)
+Runtime error: Cast failed. Expected `OTHER`, got `Float` (../lib/core/kernel.nit:542)
11
21
31
# Module comment
module test_mod2 # second comment
-import standard::kernel
-#import standard::text
+import core::kernel
+#import core::text
import template # no need for string
-# import standard
+# import core
# limitations under the License.
import end
-intrude import standard::kernel
-private import standard::text
+intrude import core::kernel
+private import core::text
`{`}
# Module comment
module test_mod2 # second comment
-import standard::kernel
-#import standard::text
+import core::kernel
+#import core::text
import template # no need for string
-# import standard
\ No newline at end of file
+# import core
\ No newline at end of file
# limitations under the License.
import end
-intrude import standard::kernel
-private import standard::text
+intrude import core::kernel
+private import core::text
`{`}
TestSuites:
No test cases found
Class suites: 0; Test Cases: 0; Failures: 0
-<testsuites><testsuite package="test_nitunit2"><testcase classname="nitunit.test_nitunit2.standard::Sys" name="test_nitunit2::Sys::foo1"><system-err></system-err><system-out>if true then
+<testsuites><testsuite package="test_nitunit2"><testcase classname="nitunit.test_nitunit2.core::Sys" name="test_nitunit2::Sys::foo1"><system-err></system-err><system-out>if true then
assert true
end
-</system-out></testcase><testcase classname="nitunit.test_nitunit2.standard::Sys" name="test_nitunit2::Sys::bar2"><system-err></system-err><system-out>if true then
+</system-out></testcase><testcase classname="nitunit.test_nitunit2.core::Sys" name="test_nitunit2::Sys::bar2"><system-err></system-err><system-out>if true then
assert true
end
-</system-out></testcase><testcase classname="nitunit.test_nitunit2.standard::Sys" name="test_nitunit2::Sys::foo3"><system-err></system-err><system-out>var a = 1
+</system-out></testcase><testcase classname="nitunit.test_nitunit2.core::Sys" name="test_nitunit2::Sys::foo3"><system-err></system-err><system-out>var a = 1
assert a == 1
assert a == 1
</system-out></testcase></testsuite><testsuite></testsuite></testsuites>
\ No newline at end of file
TestSuites:
No test cases found
Class suites: 0; Test Cases: 0; Failures: 0
-<testsuites><testsuite package="test_doc2"><testcase classname="nitunit.test_doc2.standard::Sys" name="test_doc2::Sys::foo1"><system-err></system-err><system-out>assert true # tested
-</system-out></testcase><testcase classname="nitunit.test_doc2.standard::Sys" name="test_doc2::Sys::foo2"><system-err></system-err><system-out>assert true # tested
-</system-out></testcase><testcase classname="nitunit.test_doc2.standard::Sys" name="test_doc2::Sys::foo3"><system-err></system-err><system-out>assert true # tested
+<testsuites><testsuite package="test_doc2"><testcase classname="nitunit.test_doc2.core::Sys" name="test_doc2::Sys::foo1"><system-err></system-err><system-out>assert true # tested
+</system-out></testcase><testcase classname="nitunit.test_doc2.core::Sys" name="test_doc2::Sys::foo2"><system-err></system-err><system-out>assert true # tested
+</system-out></testcase><testcase classname="nitunit.test_doc2.core::Sys" name="test_doc2::Sys::foo3"><system-err></system-err><system-out>assert true # tested
</system-out></testcase></testsuite><testsuite></testsuite></testsuites>
\ No newline at end of file
TestSuites:
No test cases found
Class suites: 0; Test Cases: 0; Failures: 0
-<testsuites><testsuite package="test_doc3"><testcase classname="nitunit.test_doc3.standard::Sys" name="test_doc3::Sys::foo1"><failure message="test_doc3.nit:15,1--18,0: Invalid block of code. At 1,3--9: Syntax Error: unexpected identifier 'garbage'.."></failure></testcase><testcase classname="nitunit.test_doc3.standard::Sys" name="test_doc3::Sys::foo2"><failure message="test_doc3.nit:20,1--25,0: Invalid block of code. At 1,2--8: Syntax Error: unexpected identifier 'garbage'.."></failure></testcase><testcase classname="nitunit.test_doc3.standard::Sys" name="test_doc3::Sys::foo3"><failure message="test_doc3.nit:27,1--32,0: Invalid block of code. At 1,2--8: Syntax Error: unexpected identifier 'garbage'.."></failure></testcase></testsuite><testsuite></testsuite></testsuites>
\ No newline at end of file
+<testsuites><testsuite package="test_doc3"><testcase classname="nitunit.test_doc3.core::Sys" name="test_doc3::Sys::foo1"><failure message="test_doc3.nit:15,1--18,0: Invalid block of code. At 1,3--9: Syntax Error: unexpected identifier 'garbage'.."></failure></testcase><testcase classname="nitunit.test_doc3.core::Sys" name="test_doc3::Sys::foo2"><failure message="test_doc3.nit:20,1--25,0: Invalid block of code. At 1,2--8: Syntax Error: unexpected identifier 'garbage'.."></failure></testcase><testcase classname="nitunit.test_doc3.core::Sys" name="test_doc3::Sys::foo3"><failure message="test_doc3.nit:27,1--32,0: Invalid block of code. At 1,2--8: Syntax Error: unexpected identifier 'garbage'.."></failure></testcase></testsuite><testsuite></testsuite></testsuites>
\ No newline at end of file
+++ /dev/null
-../lib/mnit_linux/linux_app.nit:29,16--31: Redef Error: a virtual type cannot be refined.
-../lib/mnit_linux/linux_app.nit:30,16--29: Redef Error: a virtual type cannot be refined.
-Runtime error: Cast failed. Expected `E`, got `Bool` (../lib/standard/collection/array.nit:960)
+Runtime error: Cast failed. Expected `E`, got `Bool` (../lib/core/collection/array.nit:960)
NativeString
0x4e
Nit
-#alt1 import standard::text::ropes
-#alt1 import standard
+#alt1 import core::text::ropes
+#alt1 import core
var trimtest = " \t nono nono \n \t"
# See the License for the specific language governing permissions and
# limitations under the License.
-import standard
-intrude import standard::text::ropes
+import core
+intrude import core::text::ropes
var rp: String = new Concat("xxx", "yyy")
rp += "zzz"
# See the License for the specific language governing permissions and
# limitations under the License.
-import standard::kernel
+import core::kernel
in "C Header" `{
// C types of public Nit classes must be in the C header block
# Test callback to an extern constructor from extern code
-import standard::text
+import core::text
extern class IntPtr `{ int* `}
new (v: Int) `{
# See the License for the specific language governing permissions and
# limitations under the License.
-#alt1 import standard
+#alt1 import core
#alt1 import buffered_ropes
var st = "quick brown fox over the lazy dog"
end
end
-# call local::to_s and then standard::to_s
+# call local::to_s and then core::to_s
print 123.to_s
# call Int::foo and then Object::foo
# limitations under the License.
import end
-intrude import standard::kernel
-private import standard::text
+intrude import core::kernel
+private import core::text
`{`}
# Module comment
module test_mod2 # second comment
- import standard::kernel
-#import standard::text
+ import core::kernel
+#import core::text
import template # no need for string
-# import standard
+# import core
# See the License for the specific language governing permissions and
# limitations under the License.
-import standard
-intrude import standard::text::ropes
+import core
+intrude import core::text::ropes
# Force building a Rope
redef fun maxlen: Int do return once 2
# the buffer.
module test_ropes_buffer_add_overflow
-import standard
-intrude import standard::text::ropes
+import core
+intrude import core::text::ropes
var buffer = new RopeBuffer
# Checks if `RopeBuffer.clear` actually reset everything.
module test_ropes_buffer_clear
-import standard
+import core
var buffer = new RopeBuffer
module test_ropes_buffer_reverse
-import standard
+import core
redef fun maxlen do return 3
# Checks the immutability of the strings returned by `RopeBuffer.to_s`.
module test_ropes_buffer_to_s
-import standard
+import core
# Note: In this sort of test, never print the string more than once: the string
# itself may cache an flatten representation of itself when `print` calls `to_s`
# See the License for the specific language governing permissions and
# limitations under the License.
-#alt1 import standard
-#alt1 import standard::text::ropes
+#alt1 import core
+#alt1 import core::text::ropes
var s = "Bonjour !\n"
var r: Buffer = new FlatBuffer.with_capacity(50)
# See the License for the specific language governing permissions and
# limitations under the License.
-#alt2 import standard
+#alt2 import core
#alt2 import buffered_ropes
var str = "Woe to you, oh earth and sea for the Devil sends the beast with wrath because he knows the time is short. Let him who hath understanding reckon the number of the beast, for it is a human number, its number is Six Hundred and Sixty-Six."
# See the License for the specific language governing permissions and
# limitations under the License.
-#alt1 import standard::text::ropes
+#alt1 import core::text::ropes
var x: Buffer = new FlatBuffer.from("test")
#alt1 x = new RopeBuffer.from("test")
# See the License for the specific language governing permissions and
# limitations under the License.
-intrude import standard::text::flat
-import standard
+intrude import core::text::flat
+import core
var s = "𐏓".as(FlatString)
print s.items.char_at(0).ascii.to_hex
tmp=${ii/../AA}
if [ "x$tmp" = "x$ii" ]; then
- includes="-I . -I ../lib/standard -I ../lib/standard/collection -I alt"
+ includes="-I . -I ../lib/core -I ../lib/core/collection -I alt"
else
includes="-I alt"
fi